diff options
Diffstat (limited to 'u-boot/board/goldelico/gta04b4/LQ050W1LC1B.c')
-rw-r--r-- | u-boot/board/goldelico/gta04b4/LQ050W1LC1B.c | 97 |
1 files changed, 69 insertions, 28 deletions
diff --git a/u-boot/board/goldelico/gta04b4/LQ050W1LC1B.c b/u-boot/board/goldelico/gta04b4/LQ050W1LC1B.c index f9802be..82752ce 100644 --- a/u-boot/board/goldelico/gta04b4/LQ050W1LC1B.c +++ b/u-boot/board/goldelico/gta04b4/LQ050W1LC1B.c @@ -1,4 +1,4 @@ -/* u-boot driver for the OrtusTech COM37H3M05DTC LCM +/* u-boot driver for the Sharp LQ050W1LC1B LCM * * Copyright (C) 2006-2007 by OpenMoko, Inc. * Author: Harald Welte <laforge@openmoko.org> @@ -30,41 +30,58 @@ #include <asm/mach-types.h> #include <twl4030.h> #include "../gta04/dssfb.h" -#include "../gta04/jbt6k74.h" // FIXME: change to display.h and make it more generic -#include "COM37H3M05DTC.h" +#include "../gta04/panel.h" +#include "LQ050W1LC1B.h" + +#define mdelay(n) ({ unsigned long msec = (n); while (msec--) udelay(1000); }) + +#ifndef CONFIG_GOLDELICO_EXPANDER_B4 + +#error only for B4 board + +#endif + +#ifdef CONFIG_OMAP3_GTA04 + +#define GPIO_POWER 12 /* McBSP5-CLKX GTA04 controls 5V power for the display */ +#define GPIO_BLSHUTDOWN 19 /* McBSP5-FSX controls Backlight SHUTDOWN (shutdown if high) */ +#define GPIO_SHUTDOWN 20 /* McBSP5-DX controls LVDS SHUTDOWN (shutdown if low) */ + +#elif CONFIG_OMAP3_BEAGLE + +#define GPIO_POWER 162 /* McBSP5-CLKX GTA04 controls 5V power for the display */ +#define GPIO_BLSHUTDOWN 161 /* McBSP5-FSX controls Backlight SHUTDOWN (shutdown if high) */ +#define GPIO_SHUTDOWN 158 /* McBSP5-DX controls LVDS SHUTDOWN (shutdown if low) */ -#ifdef CONFIG_OMAP3_BEAGLE_EXPANDER -#define GPIO_STBY 158 -#else -#define GPIO_STBY 20 #endif -// configure beagle board DSS for the COM37H3M05DTC +// configure beagle board DSS for the LQ050W1LC1B #define DVI_BACKGROUND_COLOR 0x00fadc29 // rgb(250, 220, 41) #define DSS1_FCLK 432000000 // see figure 15-65 -#define PIXEL_CLOCK 22400000 // approx. 22.4 MHz (will be divided from 432 MHz) +#define DSS1_FCLK3730 108000000 // compare table 3-34, figure 7-63 - but there are other factors +#define PIXEL_CLOCK 48336000 // approx. 48.336 MHz (will be divided from 432 MHz) // all values are min ratings -#define VDISP 640 // vertical active area -#define VFP 2 // vertical front porch -#define VS 1 // VSYNC pulse width (negative going) -#define VBP 3 // vertical back porch +#define VDISP 600 // vertical active area +#define VFP 7 // vertical front porch +#define VS 7 // VSYNC pulse width (negative going) +#define VBP 7 // vertical back porch #define VDS (VS+VBP) // vertical data start #define VBL (VS+VBP+VFP) // vertical blanking period #define VP (VDISP+VBL) // vertical cycle -#define HDISP 480 // horizontal active area -#define HFP 2 // horizontal front porch -#define HS 2 // HSYNC pulse width (negative going) -#define HBP 9 // horizontal back porch +#define HDISP 1024 // horizontal active area +#define HFP 96 // horizontal front porch +#define HS 96 // HSYNC pulse width (negative going) +#define HBP 96 // horizontal back porch #define HDS (HS+HBP) // horizontal data start #define HBL (HS+HBP+HFP) // horizontal blanking period #define HP (HDISP+HBL) // horizontal cycle -static const struct panel_config lcm_cfg = +static /*const*/ struct panel_config lcm_cfg = { .timing_h = ((HBP-1)<<20) | ((HFP-1)<<8) | ((HS-1)<<0), /* Horizantal timing */ .timing_v = ((VBP+0)<<20) | ((VFP+0)<<8) | ((VS-1)<<0), /* Vertical timing */ @@ -80,43 +97,64 @@ static const struct panel_config lcm_cfg = .panel_color = DVI_BACKGROUND_COLOR }; -int jbt_reg_init(void) +int panel_reg_init(void) { - omap_request_gpio(GPIO_STBY); - omap_set_gpio_direction(GPIO_STBY, 0); // output + omap_request_gpio(GPIO_SHUTDOWN); + omap_set_gpio_direction(GPIO_SHUTDOWN, 0); // output + omap_request_gpio(GPIO_POWER); + omap_set_gpio_direction(GPIO_POWER, 0); // output + omap_request_gpio(GPIO_BLSHUTDOWN); + omap_set_gpio_direction(GPIO_BLSHUTDOWN, 0); // output return 0; } -int jbt_check(void) +int panel_check(void) { return 0; } -const char *jbt_state(void) +const char *panel_state(void) { return "?"; } /* frontend function */ -int jbt6k74_enter_state(enum jbt_state new_state) +int panel_enter_state(enum panel_state new_state) { return 0; } -int jbt6k74_display_onoff(int on) +int panel_display_onoff(int on) { - omap_set_gpio_dataout(GPIO_STBY, on?1:0); // on = no STBY + if(on) + { + omap_set_gpio_dataout(GPIO_POWER, 1); + mdelay(10); + omap_set_gpio_dataout(GPIO_SHUTDOWN, 1); + mdelay(100); + omap_set_gpio_dataout(GPIO_BLSHUTDOWN, 0); + } + else + { + omap_set_gpio_dataout(GPIO_BLSHUTDOWN, 0); + mdelay(5); + omap_set_gpio_dataout(GPIO_SHUTDOWN, 1); + mdelay(10); + omap_set_gpio_dataout(GPIO_POWER, 1); + mdelay(200); + } return 0; } int board_video_init(GraphicDevice *pGD) { extern int get_board_revision(void); - printf("board_video_init() COM37H3M05DTC\n"); + printf("board_video_init() LQ050W1LC1B\n"); // FIXME: here we should pass down the GPIO(s) backlight_init(); // initialize backlight +#if defined (CONFIG_OMAP3_BEAGLE) #define REVISION_XM 0 if(get_board_revision() == REVISION_XM) { /* Set VAUX1 to 3.3V for GTA04E display board */ @@ -126,15 +164,18 @@ int board_video_init(GraphicDevice *pGD) TWL4030_PM_RECEIVER_DEV_GRP_P1); udelay(5000); } +#endif // FIXME: here we should init the TSC and pass down the GPIO numbers and resistance values - if(jbt_reg_init()) // initialize SPI + if(panel_reg_init()) // initialize SPI { printf("No LCM connected\n"); return 1; } + if (get_cpu_family() == CPU_OMAP36XX) + lcm_cfg.divisor = (0x0001<<16)|(DSS1_FCLK3730/PIXEL_CLOCK); /* get Pixel Clock divisor from dss1_fclk */ dssfb_init(&lcm_cfg); printf("did board_video_init()\n"); |