From: Stefan E. <se...@us...> - 2001-10-15 15:02:43
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv12326 Modified Files: lcd.c Log Message: - lcd_controller_enable() separated to _setup() and _enable() - Debugging output - bugfixes in test pattern code Index: lcd.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/lcd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- lcd.c 2001/10/09 19:24:54 1.3 +++ lcd.c 2001/10/15 15:02:40 1.4 @@ -47,6 +47,12 @@ #define SET(reg,bit) ((reg) |= (1<<(bit))) #define CLR(reg,bit) ((reg) &= ~(1<<(bit))) +#define LCD_DEBUG 1 + +#define OUTHEX( val ) SerialOutputString( #val"=0x" ); \ + SerialOutputHex( val ); \ + SerialOutputByte( '\n' ); + /********************************************************************** * program globals */ @@ -56,6 +62,7 @@ */ u16 *lcd_palette = (u16*)(LCD_PALETTE_DMA_ADR); +u32 *lcd_vram = (u32*)(LCD_VIDEORAM_START); /********************************************************************** * Prototypes @@ -87,7 +94,7 @@ return 0; } -int WEAK_SYM lcd_controller_enable( void ) +int WEAK_SYM lcd_controller_setup( void ) { lcd_palette[0] &= 0xcfff; lcd_palette[0] |= 2<<16; // 8 bpp @@ -99,6 +106,11 @@ LCCR0 = LCD_LCCR0 & ~LCCR0_LEN; DBAR1 = (u32 *)LCD_PALETTE_DMA_ADR; DBAR2 = (u32 *)LCD_VIDEORAM_DMA_ADR; + return 0; +} + +int WEAK_SYM lcd_controller_enable( void ) +{ LCCR0 |= LCCR0_LEN; return 0; } @@ -154,6 +166,24 @@ int x,y; char c; +#if LCD_DEBUG + OUTHEX( LCD_LCCR0 ); + OUTHEX( LCD_LCCR1 ); + OUTHEX( LCD_LCCR2 ); + OUTHEX( LCD_LCCR3 ); + OUTHEX( LCD_BPP ); + OUTHEX( LCD_COLS ); + OUTHEX( LCD_ROWS ); + OUTHEX( LCD_PALETTE_ENTRIES ); + OUTHEX( LCD_PALETTE_SIZE ); + OUTHEX( LCD_RAM_BASE ); + OUTHEX( LCD_VIDEORAM_SIZE ); + OUTHEX( LCD_VIDEORAM_START ); + OUTHEX( LCD_VIDEORAM_END ); + OUTHEX( LCD_VIDEORAM_DMA_ADR ); + OUTHEX( LCD_PALETTE_DMA_ADR ); +#endif + SerialOutputString( "LCD: power up ..." ); ret = lcd_power_up(); if ( ret != 0 ) return ret; @@ -164,13 +194,16 @@ if ( ret != 0 ) return ret; SerialOutputString( "done\n" ); + SerialOutputString( "LCD: controller setup ..." ); + ret = lcd_controller_setup(); + if ( ret != 0 ) return ret; + SerialOutputString( "done\n" ); SerialOutputString( "LCD: palette setup ..." ); ret = lcd_palette_setup(); if ( ret != 0 ) return ret; SerialOutputString( "done\n" ); - SerialOutputString( "LCD: controller enable ..." ); ret = lcd_controller_enable(); if ( ret != 0 ) return ret; @@ -186,9 +219,14 @@ SerialOutputString( "LCD: vertical lines test pattern ..." ); for ( y=0; y<LCD_ROWS; y++ ) { for ( x=0; x<(LCD_COLS>>2); x++ ) { - MEM( LCD_VIDEORAM_START + (y*LCD_ROWS) + (x<<2) ) = 0xF0F0F0F0; + if ( x%2 == 0 ) { + lcd_vram[y*(LCD_COLS>>2) + x ] = 0xffffffff; + } else { + lcd_vram[y*(LCD_COLS>>2) + x ] = 0x00000000; + } } } + SerialOutputString( "done\n" ); SerialOutputString( "LCD: press any key to proceed\n" ); |