From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Tue, 28 Aug 2012 10:11:36 +0200 Subject: [U-Boot] [PATCH v1 8/8] OMAP3: mt_ventoux: added video support In-Reply-To: <1346140007-9563-8-git-send-email-sbabic@denx.de> References: <1346140007-9563-1-git-send-email-sbabic@denx.de> <1346140007-9563-8-git-send-email-sbabic@denx.de> Message-ID: <503C7D38.1070205@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Stefano, On 28.08.2012 09:46, Stefano Babic wrote: > Signed-off-by: Stefano Babic > --- > board/teejet/mt_ventoux/mt_ventoux.c | 91 ++++++++++++++++++++++++++++++++++ > board/teejet/mt_ventoux/mt_ventoux.h | 2 +- > include/configs/mt_ventoux.h | 16 ++++++ > 3 files changed, 108 insertions(+), 1 deletion(-) > > diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c > index 814e72f..a2bda4b 100644 > --- a/board/teejet/mt_ventoux/mt_ventoux.c > +++ b/board/teejet/mt_ventoux/mt_ventoux.c > @@ -21,13 +21,17 @@ > > #include > #include > +#include > #include > +#include > #include > #include > #include > #include > #include > #include > +#include > +#include > #include > #include > #include > @@ -53,6 +57,50 @@ DECLARE_GLOBAL_DATA_PTR; > #define FPGA_INIT 119 > #define FPGA_DONE 154 > > +#define LCD_PWR 138 > +#define LCD_PON_PIN 139 > + > +#if defined(CONFIG_VIDEO)&& !defined(CONFIG_SPL_BUILD) > +static struct { > + u32 xres; > + u32 yres; > +} panel_resolution[] = { > + { 480, 272 }, > + { 800, 480 } > +}; > + > +static struct panel_config lcd_cfg[] = { > + { > + .timing_h = ((4 /* hpb */ - 1)<< 20) | > + ((8 /*hfp */- 1)<< 8) | > + (41 /* hsw */ - 1), /* Horizontal timing */ Could we use here a define, something like this: #define PANEL_TIMING_H(bp, fp, sw) (((bp - 1) << 20) | ((fp - 1) << 8) | (sw - 1)) .panel_config = { .timing_h = PANEL_TIMING_H(4, 8, 41), > + .timing_v = (2 /*vbp */<< 24) | ^^ Is this correct? In the manual I see for the timing H and V settings the same bitpositions! > + (4 /* vfp */<< 8) | > + (10 - 1), /* Vertical timing */ #define PANEL_TIMING_V(bp, fp, sw) (((bp) << 20) | ((fp) << 8) | (sw - 1)) and here too ? > + .pol_freq = 0x00000000, /* Pol Freq */ > + .divisor = 0x0001000d, /* 33Mhz Pixel Clock */ > + .panel_type = 0x01, /* TFT */ > + .data_lines = 0x03, /* 24 Bit RGB */ > + .load_mode = 0x02, /* Frame Mode */ > + .panel_color = 0, > + }, > + { > + .timing_h = ((20 /* hpb */ - 1)<< 20) | > + ((192 /*hfp */- 1)<< 8) | > + (4 /* hsw */ - 1), /* Horizontal timing */ and here ... > + .timing_v = (2 /*vbp */<< 24) | > + (20 /* vfp */<< 8) | > + (10 /* vsw */ - 1), /* Vertical timing */ and here. > + .pol_freq = 0x00004000, /* Pol Freq */ > + .divisor = 0x0001000E, /* 36Mhz Pixel Clock */ > + .panel_type = 0x01, /* TFT */ > + .data_lines = 0x03, /* 24 Bit RGB */ > + .load_mode = 0x02, /* Frame Mode */ > + .panel_color = 0, > + } > +}; > +#endif [...] bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany