[U-Boot] [PATCH] Add support for Jade display controller

Tom Tom.Rix at windriver.com
Sat Jan 16 17:30:58 CET 2010


Matthias Weisser wrote:
> Signed-off-by: Matthias Weisser <matthias.weisser at graf-syteco.de>
> ---
>  drivers/video/Makefile      |    1 +
>  drivers/video/cfb_console.c |    2 +-
>  drivers/video/jadegdc.c     |  193 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 195 insertions(+), 1 deletions(-)
>  create mode 100644 drivers/video/jadegdc.c
> 
> diff --git a/drivers/video/Makefile b/drivers/video/Makefile
> index bb6b5a0..aadc149 100644
> --- a/drivers/video/Makefile
> +++ b/drivers/video/Makefile
> @@ -30,6 +30,7 @@ COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
>  COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
>  COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
>  COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o
> +COBJS-$(CONFIG_VIDEO_JADEGDC) += jadegdc.o
>  COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o
>  COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o
>  COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index c07a26e..506337b 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -321,7 +321,7 @@ void	console_cursor (int state);
>  #else
>  #define SWAP16(x)	 (x)
>  #define SWAP32(x)	 (x)
> -#if defined(VIDEO_FB_16BPP_WORD_SWAP)
> +#if defined(VIDEO_FB_16BPP_WORD_SWAP) || defined(CONFIG_VIDEO_JADEGDC)

Instead of adding CONFIG_VIDEO_JADEGDC, define VIDEO_FB_16BPP_WORD_SWAP
in your board config file or a more appropriate file.

>  #define SHORTSWAP32(x)	 ( ((x) >> 16) | ((x) << 16) )
>  #else
>  #define SHORTSWAP32(x)	 (x)
> diff --git a/drivers/video/jadegdc.c b/drivers/video/jadegdc.c
<snip>

> + * 4MB (at the end of system RAM)
> + */
> +#define VIDEO_MEM_SIZE		0x400000
> +
> +/*
> + * Graphic Device
> + */
> +GraphicDevice jadegdc;

It does not look like this global is accessed output of this function
It should be declared static.

> +
> +void *video_hw_init(void)
> +{
> +	GraphicDevice *pGD = &jadegdc;
> +	struct ctfb_res_modes var_mode[2];
> +	unsigned long *vid;
> +	unsigned long div;
> +	unsigned long dspBase[2];
> +	char *penv;
> +	int bpp;
> +	int i, j;
> +
> +	memset(pGD, 0, sizeof(GraphicDevice));
> +
> +	dspBase[0] = JADE_GDC_DISP0_PHYS_BASE;
> +	dspBase[1] = JADE_GDC_DISP1_PHYS_BASE;
> +
> +	pGD->gdfIndex = GDF_15BIT_555RGB;
> +	pGD->gdfBytesPP = 2;
> +
> +	pGD->memSize = VIDEO_MEM_SIZE;
> +	pGD->frameAdrs = PHYS_SDRAM + PHYS_SDRAM_SIZE - VIDEO_MEM_SIZE;
> +	vid = (unsigned long *)pGD->frameAdrs;
> +
> +	for (i = 0; i < 2; i++) {
> +		char varName[32];
> +		u32 dcm1, dcm2, dcm3;
> +		u16 htp, hdp, hdb, hsp, vtr, vsp, vdp;
> +		u8 hsw, vsw;
> +		u32 l2m, l2em, l2oa0, l2da0, l2oa1, l2da1;
> +		u16 l2dx, l2dy, l2wx, l2wy, l2ww, l2wh;
> +
> +		sprintf(varName, "gs_dsp_%d_param", i);
> +
> +		penv = getenv(varName);
> +		if (penv == NULL) {
> +			penv = getenv("videomode");
> +			if ((i == 1) || (penv == NULL))
> +				continue;

This check for (i == 1) should be moved before the getenv

> +		}
> +
> +		bpp = 0;

<snip>
> +	}
> +
> +	return pGD;
> +}
> +
> +/*
> + * Set a RGB color in the LUT
> + */
> +void video_set_lut(unsigned int index, unsigned char r,
> +			unsigned char g, unsigned char b)
> +{

If leaving this a noop is intentional, add a comment.

Tom



More information about the U-Boot mailing list