# HG changeset patch # User Paul Boddie # Date 1433717791 -7200 # Node ID 811c730bc541e961184c176c08ed65e549ab8539 # Parent e4d91d0f36b4f8055425708e880bd2df305848bc Finally get something to appear on the screen. diff -r e4d91d0f36b4 -r 811c730bc541 include/jz4740.h --- a/include/jz4740.h Mon Jun 08 00:35:35 2015 +0200 +++ b/include/jz4740.h Mon Jun 08 00:56:31 2015 +0200 @@ -2740,8 +2740,8 @@ /* LCD_D0~LCD_D7, SLCD_RS, SLCD_CS */ #define __gpio_as_slcd_8bit() \ do { \ - REG_GPIO_PXFUNS(2) = 0x001800ff; \ - REG_GPIO_PXSELC(2) = 0x001800ff; \ + REG_GPIO_PXFUNS(2) = 0x001c00ff; \ + REG_GPIO_PXSELC(2) = 0x001c00ff; \ } while (0) /* LCD_D0~LCD_D7, SLCD_RS, SLCD_CS */ diff -r e4d91d0f36b4 -r 811c730bc541 stage2/lcd.c --- a/stage2/lcd.c Mon Jun 08 00:35:35 2015 +0200 +++ b/stage2/lcd.c Mon Jun 08 00:56:31 2015 +0200 @@ -41,29 +41,17 @@ return addr; } -#define N_BLK_VERT 2 -#define N_BLK_HOR 3 - -static int test_colors[N_BLK_HOR * N_BLK_VERT] = { - 0x00ff0000, 0x0000ff00, 0x00ffff00, - 0x000000ff, 0x00ff00ff, 0x0000ffff, -}; - static void test_pattern(void *lcd_base) { unsigned short v_max = panel_info.vl_row; unsigned short h_max = panel_info.vl_col; - unsigned short v_step = (v_max + N_BLK_VERT - 1) / N_BLK_VERT; - unsigned short h_step = (h_max + N_BLK_HOR - 1) / N_BLK_HOR; unsigned short v, h; - unsigned char *pix = (unsigned char *)lcd_base; + u32 *pix = (u32 *)lcd_base; - /* WARNING: Code silently assumes 8bit/pixel */ - for (v = 0; v < v_max; ++v) { - unsigned char iy = v / v_step; - for (h = 0; h < h_max; ++h) { - unsigned char ix = N_BLK_HOR * iy + h / h_step; - *pix++ = test_colors[ix]; + /* WARNING: Code silently assumes 32 bit/pixel */ + for (v = 0; v < v_max; v += 1) { + for (h = 0; h < h_max; h += 1) { + *pix++ = 0x0000ff00; } } } diff -r e4d91d0f36b4 -r 811c730bc541 stage2/nanonote_gpm940b0.c --- a/stage2/nanonote_gpm940b0.c Mon Jun 08 00:35:35 2015 +0200 +++ b/stage2/nanonote_gpm940b0.c Mon Jun 08 00:56:31 2015 +0200 @@ -22,7 +22,8 @@ /* virt_to_phys() from u-boot/arch/mips/include/asm/addrspace.h via u-boot/arch/mips/include/asm/io.h */ -#define virt_to_phys(n) (((int) n) & 0x1fffffff) +/* #define virt_to_phys(n) (((int) n) & 0x1fffffff) */ +#define virt_to_phys(n) ((int) n) #include "jz4740.h" #include "nanonote_gpm940b0.h"