From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Kiryanov Date: Wed, 04 Jul 2012 13:33:37 +0300 Subject: [U-Boot] [PATCH V2 3/4] common lcd: simplify core functions In-Reply-To: <20120625072337.9CD3E202239@gemini.denx.de> References: <1340607844-8718-1-git-send-email-nikita@compulab.co.il> <1340607844-8718-4-git-send-email-nikita@compulab.co.il> <20120625072337.9CD3E202239@gemini.denx.de> Message-ID: <4FF41C01.2000805@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/25/2012 10:23 AM, Wolfgang Denk wrote: > Dear Nikita Kiryanov, > > In message <1340607844-8718-4-git-send-email-nikita@compulab.co.il> you wrote: >> Move highly platform dependant code into its own function to reduce the >> number of #ifdefs in the bigger functions >> >> Signed-off-by: Nikita Kiryanov >> Signed-off-by: Igor Grinberg >> --- >> common/lcd.c | 58 ++++++++++++++++++++++++++++------------------------------ >> 1 files changed, 28 insertions(+), 30 deletions(-) >> >> diff --git a/common/lcd.c b/common/lcd.c >> index 4a5c8d5..3c0f1b1 100644 >> --- a/common/lcd.c >> +++ b/common/lcd.c >> @@ -498,21 +498,35 @@ static int lcd_getbgcolor(void) >> /************************************************************************/ >> /* ** Chipset depending Bitmap / Logo stuff... */ >> /************************************************************************/ >> +static inline ushort *configuration_get_cmap(void) >> +{ >> +#if defined CONFIG_CPU_PXA >> + struct pxafb_info *fbi = &panel_info.pxa; >> + return (ushort *)fbi->palette; >> +#elif defined(CONFIG_MPC823) >> + volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; >> + volatile cpm8xx_t *cp = &(immr->im_cpm); >> + return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]); >> +#elif defined(CONFIG_ATMEL_LCD) >> + return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0)); >> +#else >> + return (ushort *)panel_info.cmap; >> +#endif >> +} > > Please fix and use I/O accessors instead of volatile pointers. > > Best regards, > > Wolfgang Denk > The goal of this patch set was to reduce #define complexity in common/lcd. Do you mind if I address the volatile pointers with a follow up patch? -- Nikita