diff options
author | Steve Markgraf <steve@steve-m.de> | 2012-02-12 21:54:37 +0100 |
---|---|---|
committer | Steve Markgraf <steve@steve-m.de> | 2012-02-12 21:54:37 +0100 |
commit | 05e9b142c38321b45a23d6495d1a92b9cbae326b (patch) | |
tree | ade803cf25f58ac7443196085055d7cc05da444c /src/target/firmware/board | |
parent | 90ab06ce5c1259f0ff91a4ff9ef5b2d0050234cd (diff) |
firmware/fb: add framebuffer driver for the Pirelli DP-L10 display
This commit adds a combined driver for the Sunplus SPCA-552E
Multimedia Controller and the Samsung S6B33B1X LCD controller.
I have to thank Stephan Meier, who helped me to reverse-engineer
this beast during 28c3.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Diffstat (limited to 'src/target/firmware/board')
-rw-r--r-- | src/target/firmware/board/pirelli_dpl10/init.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/target/firmware/board/pirelli_dpl10/init.c b/src/target/firmware/board/pirelli_dpl10/init.c index 3f3145e1..ef184033 100644 --- a/src/target/firmware/board/pirelli_dpl10/init.c +++ b/src/target/firmware/board/pirelli_dpl10/init.c @@ -1,7 +1,7 @@ /* Initialization for the Pirelli DP-L10 */ /* (C) 2010 by Harald Welte <laforge@gnumonks.org> - * (C) 2011 by Steve Markgraf <steve@steve-m.de> + * (C) 2011-12 by Steve Markgraf <steve@steve-m.de> * * All Rights Reserved * @@ -49,7 +49,9 @@ #include <fb/framebuffer.h> #define ARMIO_LATCH_OUT 0xfffe4802 +#define IO_CNTL_REG 0xfffe4804 #define ASIC_CONF_REG 0xfffef008 +#define IO_CONF_REG 0xfffef00a static void board_io_init(void) { @@ -60,17 +62,36 @@ static void board_io_init(void) reg |= ((1 << 12) | (1 << 7)); /* SCL / SDA */ /* TWL3025: Set SPI+RIF RX clock to rising edge */ reg |= (1 << 13) | (1 << 14); + reg &= ~(1 << 1); writew(reg, ASIC_CONF_REG); + + /* enable IO functionality */ + reg = readw(IO_CONF_REG); + reg |= (1 << 9) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0); + writew(reg, IO_CONF_REG); + + /* set IO directions */ + reg = readw(IO_CNTL_REG); + reg &= ~((1 << 7) | (1 << 4) | (1 << 1)); + writew(reg, IO_CNTL_REG); + + /* reset display controller, disable bypass mode, set nCS4 to display */ + reg = readw(ARMIO_LATCH_OUT); + reg &= ~(1 << 4); + writew(reg, ARMIO_LATCH_OUT); + reg &= ~(1 << 7); + reg |= (1 << 4) | (1 << 1); + writew(reg, ARMIO_LATCH_OUT); } void board_init(void) { /* Configure the memory interface */ - calypso_mem_cfg(CALYPSO_nCS0, 3, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_nCS1, 3, CALYPSO_MEM_16bit, 1); + calypso_mem_cfg(CALYPSO_nCS0, 4, CALYPSO_MEM_16bit, 1); + calypso_mem_cfg(CALYPSO_nCS1, 4, CALYPSO_MEM_16bit, 1); calypso_mem_cfg(CALYPSO_nCS2, 5, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_nCS3, 5, CALYPSO_MEM_16bit, 1); - calypso_mem_cfg(CALYPSO_CS4, 0, CALYPSO_MEM_8bit, 1); + calypso_mem_cfg(CALYPSO_nCS3, 4, CALYPSO_MEM_16bit, 1); + calypso_mem_cfg(CALYPSO_CS4, 7, CALYPSO_MEM_16bit, 1); calypso_mem_cfg(CALYPSO_nCS6, 0, CALYPSO_MEM_32bit, 1); calypso_mem_cfg(CALYPSO_nCS7, 0, CALYPSO_MEM_32bit, 0); @@ -111,10 +132,11 @@ void board_init(void) /* Initialize system timers (uses hwtimer 2) */ timer_init(); - /* Initialize LCD driver (uses I2C) and backlight */ - fb_init(); + /* Initialize LCD driver and backlight (0 is max, 255 min brightness) */ bl_mode_pwl(1); - bl_level(0); + bl_level(50); + + fb_init(); /* Initialize keypad driver */ keypad_init(1); |