diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fsl_diu_fb.c | 51 | ||||
-rw-r--r-- | drivers/video/mb862xx.c | 34 | ||||
-rw-r--r-- | drivers/video/mb86r0xgdc.c | 3 |
3 files changed, 65 insertions, 23 deletions
diff --git a/drivers/video/fsl_diu_fb.c b/drivers/video/fsl_diu_fb.c index 0709849..e1d6c26 100644 --- a/drivers/video/fsl_diu_fb.c +++ b/drivers/video/fsl_diu_fb.c @@ -78,13 +78,9 @@ struct fb_videomode { unsigned int flag; }; -#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */ -#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */ -#define FB_VMODE_NONINTERLACED 0 /* non interlaced */ - /* This setting is used for the ifm pdm360ng with PRIMEVIEW PM070WL3 */ -static struct fb_videomode fsl_diu_mode_800 = { - .name = "800x600-60", +static struct fb_videomode fsl_diu_mode_800_480 = { + .name = "800x480-60", .refresh = 60, .xres = 800, .yres = 480, @@ -99,13 +95,30 @@ static struct fb_videomode fsl_diu_mode_800 = { .vmode = FB_VMODE_NONINTERLACED }; +/* For the SHARP LQ084S3LG01, used on the P1022DS board */ +static struct fb_videomode fsl_diu_mode_800_600 = { + .name = "800x600-60", + .refresh = 60, + .xres = 800, + .yres = 600, + .pixclock = 25000, + .left_margin = 88, + .right_margin = 40, + .upper_margin = 23, + .lower_margin = 1, + .hsync_len = 128, + .vsync_len = 4, + .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .vmode = FB_VMODE_NONINTERLACED +}; + /* * These parameters give default parameters * for video output 1024x768, * FIXME - change timing to proper amounts * hsync 31.5kHz, vsync 60Hz */ -static struct fb_videomode fsl_diu_mode_1024 = { +static struct fb_videomode fsl_diu_mode_1024_768 = { .name = "1024x768-60", .refresh = 60, .xres = 1024, @@ -121,7 +134,7 @@ static struct fb_videomode fsl_diu_mode_1024 = { .vmode = FB_VMODE_NONINTERLACED }; -static struct fb_videomode fsl_diu_mode_1280 = { +static struct fb_videomode fsl_diu_mode_1280_1024 = { .name = "1280x1024-60", .refresh = 60, .xres = 1280, @@ -263,7 +276,7 @@ static struct diu_ad *allocate_fb(unsigned int xres, unsigned int yres, return ad; } -int fsl_diu_init(int xres, u32 pixel_format, int gamma_fix) +int fsl_diu_init(u16 xres, u16 yres, u32 pixel_format, int gamma_fix) { struct fb_videomode *fsl_diu_mode_db; struct diu_ad *ad; @@ -274,15 +287,23 @@ int fsl_diu_init(int xres, u32 pixel_format, int gamma_fix) struct diu_addr gamma; struct diu_addr cursor; - switch (xres) { - case 800: - fsl_diu_mode_db = &fsl_diu_mode_800; +/* Convert the X,Y resolution pair into a single number */ +#define RESOLUTION(x, y) (((u32)(x) << 16) | (y)) + + switch (RESOLUTION(xres, yres)) { + case RESOLUTION(800, 480): + fsl_diu_mode_db = &fsl_diu_mode_800_480; break; - case 1280: - fsl_diu_mode_db = &fsl_diu_mode_1280; + case RESOLUTION(800, 600): + fsl_diu_mode_db = &fsl_diu_mode_800_600; + case RESOLUTION(1024, 768): + fsl_diu_mode_db = &fsl_diu_mode_1024_768; + case RESOLUTION(1280, 1024): + fsl_diu_mode_db = &fsl_diu_mode_1280_1024; break; default: - fsl_diu_mode_db = &fsl_diu_mode_1024; + printf("DIU: Unsupported resolution %ux%u\n", xres, yres); + return -1; } /* The AD struct for the dummy framebuffer and the FB itself */ diff --git a/drivers/video/mb862xx.c b/drivers/video/mb862xx.c index edf34aa..1a4ba82 100644 --- a/drivers/video/mb862xx.c +++ b/drivers/video/mb862xx.c @@ -189,13 +189,22 @@ static void de_init (void) } #if defined(CONFIG_VIDEO_CORALP) +/* use CCF and MMR parameters for Coral-P Eval. Board as default */ +#ifndef CONFIG_SYS_MB862xx_CCF +#define CONFIG_SYS_MB862xx_CCF 0x00090000 +#endif +#ifndef CONFIG_SYS_MB862xx_MMR +#define CONFIG_SYS_MB862xx_MMR 0x11d7fa13 +#endif + unsigned int pci_video_init (void) { GraphicDevice *dev = &mb862xx; pci_dev_t devbusfn; + u16 device; if ((devbusfn = pci_find_devices (supported, 0)) < 0) { - puts ("PCI video controller not found!\n"); + puts("controller not present\n"); return 0; } @@ -212,10 +221,25 @@ unsigned int pci_video_init (void) dev->pciBase = dev->frameAdrs; - /* Setup clocks and memory mode for Coral-P Eval. Board */ - HOST_WR_REG (GC_CCF, 0x00090000); + puts("Coral-"); + + pci_read_config_word(devbusfn, PCI_DEVICE_ID, &device); + switch (device) { + case PCI_DEVICE_ID_CORAL_P: + puts("P\n"); + break; + case PCI_DEVICE_ID_CORAL_PA: + puts("PA\n"); + break; + default: + puts("Unknown\n"); + return 0; + } + + /* Setup clocks and memory mode for Coral-P(A) */ + HOST_WR_REG(GC_CCF, CONFIG_SYS_MB862xx_CCF); udelay (200); - HOST_WR_REG (GC_MMR, 0x11d7fa13); + HOST_WR_REG(GC_MMR, CONFIG_SYS_MB862xx_MMR); udelay (100); return dev->frameAdrs; } @@ -235,8 +259,6 @@ unsigned int card_init (void) if (!pci_video_init ()) return 0; - puts ("CoralP\n"); - tmp = 0; videomode = 0x310; /* get video mode via environment */ diff --git a/drivers/video/mb86r0xgdc.c b/drivers/video/mb86r0xgdc.c index 3bdc1db..5425c9d 100644 --- a/drivers/video/mb86r0xgdc.c +++ b/drivers/video/mb86r0xgdc.c @@ -77,8 +77,7 @@ static void dsp_init(struct mb86r0x_gdc_dsp *dsp, char *modestr, } /* Fill memory with white */ - for (i = 0; i < var_mode.xres * var_mode.yres / 2; i++) - *videomem++ = 0xFFFFFFFF; + memset(videomem, 0xFF, var_mode.xres * var_mode.yres * 2); mb86r0x.winSizeX = var_mode.xres; mb86r0x.winSizeY = var_mode.yres; |