From 83828d5fe33350e3a91222f2d25fad61faa78efa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 14 May 2014 15:31:38 -0600 Subject: [PATCH] Misc changes while testing the SAM4E-EK LCD (still does not work) --- configs/sam4e-ek/README.txt | 20 ++++++++++++++++---- configs/sam4e-ek/src/sam4e-ek.h | 5 ----- configs/sam4e-ek/src/sam_ili9325.c | 12 ++++++------ configs/shenzhou/src/up_ili93xx.c | 2 +- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/configs/sam4e-ek/README.txt b/configs/sam4e-ek/README.txt index 3abf854a77..44fec94e45 100644 --- a/configs/sam4e-ek/README.txt +++ b/configs/sam4e-ek/README.txt @@ -957,6 +957,11 @@ ILI9325-Based LCD 39 NC ---- ----- --------- -------------------------------- + Jumpers + ------- + + Make sure the JP8 is closed. This connects PD18 as the LCD CS. + Backlight --------- @@ -992,7 +997,10 @@ ILI9325-Based LCD driver is the most recent. STATUS: - 2014-3-27: Not implemented. + 2014-05-14: Fully implemented. There is still a bug in in the LCD + communications. The LCD ID is read as 0x0000 instead of 0x9325. + + The LCD backlight appears to be functional. SAM4E-EK-specific Configuration Options ======================================= @@ -1381,8 +1389,6 @@ Configurations CONFIG_DEBUG_VERBOSE=y : Enable verbose debug output CONFIG_DEBUG_INPUT=y : Enable debug output from input devices - STATUS: Verified 2014-05-14 - 11. This configuration can be re-configured to test the on-board LCD module. @@ -1427,13 +1433,19 @@ Configurations CONFIG_EXAMPLES_NXLINES_BPP=16 STATUS: - 2014-3-24: DMA is not currently functional and without DMA, there + 2014-30-24: DMA is not currently functional and without DMA, there may not be reliable data transfers at high speeds due to data overrun problems. The current HSMCI driver supports DMA via the DMAC. However, the data sheet only discusses PDC-based HSMCI DMA (although there is a DMA channel interface definition for HSMCI). So this is effort is dead-in-the-water for now. + 2014-05-14: The touchscreen interface was successfully verified. + 2014-05-14: The LCD interface is fully implemented. However, + there is still a bug in in the LCD communications. The + LCD ID is read as 0x0000 instead of 0x9325. + + The LCD backlight appears to be functional. usbnsh: diff --git a/configs/sam4e-ek/src/sam4e-ek.h b/configs/sam4e-ek/src/sam4e-ek.h index 2630bf9480..fb52b39216 100644 --- a/configs/sam4e-ek/src/sam4e-ek.h +++ b/configs/sam4e-ek/src/sam4e-ek.h @@ -133,11 +133,6 @@ # undef HAVE_USBMONITOR #endif -/* External Memory Usage ************************************************************/ -/* LCD on CS2 */ - -#define LCD_BASE SAM_EXTCS2_BASE - /* SAM4E-EK GPIO Pin Definitions ****************************************************/ /* LCD: diff --git a/configs/sam4e-ek/src/sam_ili9325.c b/configs/sam4e-ek/src/sam_ili9325.c index 1cdd55b94e..fa4743b6b0 100644 --- a/configs/sam4e-ek/src/sam_ili9325.c +++ b/configs/sam4e-ek/src/sam_ili9325.c @@ -250,11 +250,11 @@ /* SAM4E-EK LCD Hardware Definitions **************************************************/ /* LCD /CS is CE4, Bank 3 of NOR/SRAM Bank 1~4 */ -#define SAM_LCD_BASE ((uintptr_t)(0x60000000 | 0x01000000)) +#define SAM_LCD_BASE ((uintptr_t)SAM_EXTCS1_BASE) #define LCD_INDEX (*(volatile uint8_t *)(SAM_LCD_BASE)) #define LCD_DATA (*(volatile uint8_t *)(SAM_LCD_BASE + 2)) -/* LCD SMC hip select number to be set */ +/* LCD SMC chip select number to be set */ #define SAM_LCD_CS 1 @@ -380,7 +380,7 @@ static const uint32_t g_lcdpin[] = GPIO_LCD_BKL /* Backlight control */ }; -#define LCP_NPINS (sizeof(g_lcdpin) / sizeof(uint32_t)) +#define LCD_NPINS (sizeof(g_lcdpin) / sizeof(uint32_t)) /* This is working memory allocated by the LCD driver for each LCD device * and for each color plane. This memory will hold one raster line of data. @@ -941,7 +941,7 @@ static inline void sam_gpio_initialize(void) /* Configure all LCD pins pins (backlight is initially off) */ - for (i = 0; i < LCP_NPINS; i++) + for (i = 0; i < LCD_NPINS; i++) { sam_configgpio(g_lcdpin[i]); } @@ -1282,7 +1282,7 @@ static inline int sam_lcd_initialize(void) { uint16_t id; - /* Check LCD ID */ + /* Check the LCD ID */ id = sam_read_reg(ILI9325_DEVICE_CODE_REG); lcdvdbg("LCD ID: %04x\n", id); @@ -1291,7 +1291,7 @@ static inline int sam_lcd_initialize(void) if (id != ILI9325_DEVICE_CODE) { - lcddbg("ERROR: Unsupported LCD type: %04x\n", id); + lcddbg("ERROR: Unsupported LCD: %04x\n", id); return -ENODEV; } diff --git a/configs/shenzhou/src/up_ili93xx.c b/configs/shenzhou/src/up_ili93xx.c index 19ab2c014c..7467c0d1dc 100644 --- a/configs/shenzhou/src/up_ili93xx.c +++ b/configs/shenzhou/src/up_ili93xx.c @@ -1880,7 +1880,7 @@ int up_lcdinitialize(void) lcdvdbg("Initializing\n"); - /* Configure GPIO pins. The inialial state of priv->output is false, so + /* Configure GPIO pins. The initial state of priv->output is false, so * we need to configure pins for output initially. */