[U-Boot-Users] [PATCH 20/26] Add ATMEL LCD driver
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Fri May 9 12:57:07 CEST 2008
> +
> +/* 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.
More information about the U-Boot
mailing list