From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 9 May 2008 12:57:07 +0200 Subject: [U-Boot-Users] [PATCH 20/26] Add ATMEL LCD driver In-Reply-To: <1210279954-28692-21-git-send-email-stelian@popies.net> References: <1210279954-28692-20-git-send-email-stelian@popies.net> <1210279954-28692-21-git-send-email-stelian@popies.net> Message-ID: <20080509105707.GH19728@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > + > +/* configurable parameters */ > +#define ATMEL_LCDC_CVAL_DEFAULT 0xc8 > +#define ATMEL_LCDC_DMA_BURST_LEN 8 > + > +#if defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91CAP9) > +#define ATMEL_LCDC_FIFO_SIZE 2048 > +#else > +#define ATMEL_LCDC_FIFO_SIZE 512 > +#endif > + > +#define lcdc_readl(mmio, reg) __raw_readl((mmio)+(reg)) > +#define lcdc_writel(mmio, reg, val) __raw_writel((val), (mmio)+(reg)) > + > +void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue) ^ Please choose one coding style please > +{ > +#if defined(CONFIG_ATMEL_LCD_BGR555) > + lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno), > + (red >> 3) | ((green & 0xf8) << 2) | ((blue & 0xf8) << 7)); > +#else > + lcdc_writel(panel_info.mmio, ATMEL_LCDC_LUT(regno), > + (blue >> 3) | ((green & 0xfc) << 3) | ((red & 0xf8) << 8)); > +#endif > +} > + > +void lcd_ctrl_init(void *lcdbase) > +{ > + unsigned long value; > + > + > + /* Set framebuffer DMA base address and pixel offset */ > + lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMABADDR1, (u_long)lcdbase); > + > + lcdc_writel(panel_info.mmio, ATMEL_LCDC_DMACON, ATMEL_LCDC_DMAEN); > + lcdc_writel(panel_info.mmio, ATMEL_LCDC_PWRCON, > + (1 << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR); > +} > + > +ulong calc_fbsize (void) ^ Please choose one coding style please > +{ > + return ((panel_info.vl_col * panel_info.vl_row * > + NBITS(panel_info.vl_bpix)) / 8) + PAGE_SIZE; > +} Best Regards, J.