[v4 powerpc: use 'video-mode' environment variable to configure DIU
Subsystems (2)
PATCH 1/1 [v4 powerpc: use 'video-mode' environment variable to configure DIU
Use the 'video-mode' environment variable (for Freescale chips that have a DIU display controller) to designate the full video configuration. Previously, the DIU driver used the 'monitor' variable, and it was used only to determine the output video port.
The old definition of the "monitor" environment variable only determines which video port to use for output. This variable was set to a number (0, 1, or sometimes 2) to specify a DVI, LVDS, or Dual-LVDS port. The resolution was hard-coded into board-specific code. The Linux command-line arguments needed to be hard-coded to the proper video definition string.
--- README | 11 +- board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c | 73 +-- board/freescale/p1022ds/diu.c | 27 +- drivers/video/Makefile | 2 +- drivers/video/fsl_diu_fb.c | 938 +++++++++++-------------- include/configs/MPC8610HPCD.h | 10 +- include/configs/P1022DS.h | 6 +- include/fsl_diu_fb.h | 91 +-- 8 files changed, 514 insertions(+), 644 deletions(-)
rewrite drivers/video/fsl_diu_fb.c (63%)
rewrite include/fsl_diu_fb.h (62%)
README +4 -7
@@ -1088,13 +1088,10 @@ The following options need to be configured: CONFIG_VIDEO_LOGO CONFIG_VIDEO_BMP_LOGO - The DIU driver will look for the 'monitor' environment variable, - and if defined, enable the DIU as a console during boot. This - variable should be set to one of these values: - - '0' Output video to the DVI connector - '1' Output video to the LVDS connector - '2' Output video to the Dual-Link LVDS connector + The DIU driver will look for the 'video-mode' environment + variable, and if defined, enable the DIU as a console during + boot. See the documentation file README.video for a + description of this variable. - Keyboard Support: CONFIG_KEYBOARD
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c +31 -42
93 lines not on this page · raw message
board/freescale/p1022ds/diu.c +15 -12
@@ -12,6 +12,7 @@#include <common.h> #include <command.h> +#include <linux/ctype.h> #include <asm/io.h> #include <stdio_dev.h> #include <video_fb.h>
@@ -81,10 +82,10 @@ void diu_set_pixel_clock(unsigned int pixclock)out_be32 (&gur->clkdvdr, temp |0x80000000 | ((pixval &0x1F ) <<16 )); } -int platform_diu_init (unsigned int *xres,unsigned int *yres) +int platform_diu_init (unsigned int xres,unsigned int yres,const char *port) {ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); -char *monitor_port; +const char *name;u32 pixel_format;u8 temp;
@@ -100,21 +101,23 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres) temp =in_8 (&pixis->brdcfg1); - monitor_port =getenv ("monitor" ); -if (!strncmp (monitor_port,"1" ,1 )) {/* 1 - Single link LVDS */ - *xres =1024 ; - *yres =768 ; -/* Enable the DFP port, disable the DVI and the backlight */ - temp &= ~(PX_BRDCFG1_DVIEN |PX_BRDCFG1_BACKLIGHT ); - temp |=PX_BRDCFG1_DFPEN ; +if (strncmp (port,"lvds" ,4 ) ==0 ) { +/* Single link LVDS */ + temp &= ~PX_BRDCFG1_DVIEN ; +/* +* LVDS also needs backlight enabled, otherwise the display +* will be blank. +*/ + temp |= (PX_BRDCFG1_DFPEN |PX_BRDCFG1_BACKLIGHT ); + name ="Single-Link LVDS" ; }else {/* DVI */ - *xres =1280 ; - *yres =1024 ;/* Enable the DVI port, disable the DFP and the backlight */ temp &= ~(PX_BRDCFG1_DFPEN |PX_BRDCFG1_BACKLIGHT ); temp |=PX_BRDCFG1_DVIEN ; + name ="DVI" ; } +printf ("DIU: Switching to %s monitor @ %ux%u\n" , name, xres, yres);out_8 (&pixis->brdcfg1, temp);/*
@@ -136,7 +139,7 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres)clrsetbits_be32 (&gur->pmuxcr,PMUXCR_ELBCDIU_MASK ,PMUXCR_ELBCDIU_DIU ); pmuxcr =in_be32 (&gur->pmuxcr); -return fsl_diu_init (*xres, pixel_format,0 ); +return fsl_diu_init (xres, pixel_format,0 ); }/*
drivers/video/Makefile +1 -1
@@ -28,7 +28,7 @@ LIB := $(obj)libvideo.o COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o -COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o +COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o COBJS-$(CONFIG_S6E63D6) += s6e63d6.o COBJS-$(CONFIG_VIDEO_AMBA) += amba.o COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
drivers/video/fsl_diu_fb.c +425 -513
938 lines not on this page · raw message
include/configs/MPC8610HPCD.h +4 -6
@@ -1,5 +1,5 @@/* -* Copyright 2007, 2010 Freescale Semiconductor, Inc. +* Copyright 2007-2011 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
@@ -23,6 +23,8 @@/* video */ +#define CONFIG_FSL_DIU_FB +#ifdef CONFIG_FSL_DIU_FB #define CONFIG_SYS_DIU_ADDR (CONFIG_SYS_CCSRBAR + 0x2c000)#define CONFIG_VIDEO
@@ -625,8 +627,6 @@"diuregs=md e002c000 1d\0" \"dium=mw e002c01c\0" \"diuerr=md e002c014 1\0" \ -"othbootargs=diufb=15M video=fslfb:1280x1024-32 at 60,monitor=0 debug\0" \ -"monitor=0-DVI\0" \"pmregs=md e00e1000 2b\0" \"lawregs=md e0000c08 4b\0" \"lbcregs=md e0005000 36\0" \
@@ -646,9 +646,7 @@"ramdiskfile=8610hpcd/ramdisk.uboot\0" \"fdtaddr=c00000\0" \"fdtfile=8610hpcd/mpc8610_hpcd.dtb\0" \ -"bdev=sda3\0" \ -"othbootargs=diufb=15M video=fslfb:1280x1024-32@60,monitor=0\0" \ - "monitor=0-DVI\0" + "bdev=sda3\0"#endif #define CONFIG_NFSBOOTCOMMAND \
include/configs/P1022DS.h +3 -3
@@ -202,6 +202,8 @@#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "/* Video */ +#define CONFIG_FSL_DIU_FB +#ifdef CONFIG_FSL_DIU_FB #define CONFIG_SYS_DIU_ADDR (CONFIG_SYS_CCSRBAR + 0x10000)#define CONFIG_VIDEO
@@ -490,9 +492,7 @@"bdev=sda3\0" \"diuregs=md e002c000 1d\0" \"dium=mw e002c01c\0" \ -"diuerr=md e002c014 1\0" \ -"othbootargs=diufb=15M video=fslfb:1280x1024-32 at 60,monitor=0 tty0\0" \ -"monitor=0-DVI\0" +"diuerr=md e002c014 1\0" #define CONFIG_HDBOOT \"setenv bootargs root=/dev/$bdev rw " \
include/fsl_diu_fb.h +31 -60
91 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v5 1/1 powerpc: use 'video-mode' environment variable to configure DIU
From: Timur Tabi <[email protected]>
Use the 'video-mode' environment variable (for Freescale chips that have a DIU display controller) to designate the full video configuration. Previously, the DIU driver used the 'monitor' variable, and it was used only to determine the output video port.
The old definition of the "monitor" environment variable only determines which video port to use for output. This variable was set to a number (0, 1, or sometimes 2) to specify a DVI, LVDS, or Dual-LVDS port. The resolution was hard-coded into board-specific code. The Linux command-line arguments needed to be hard-coded to the proper video definition string.
---
Hi Timur,
please test recent changes on MPC8610HPCD and P1022DS. Thanks!
v5:
- rebased to apply on current top of tree
- fixed subject
- fixed checkpatch error
- fixed DIU support for mpc5121
- added cursor area init as without it we see dirty cursor rectangle on the display (when testing on mpc5121)
README | 11 +- arch/powerpc/cpu/mpc512x/diu.c | 16 +- board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c | 73 ++-- board/freescale/p1022ds/diu.c | 27 +- drivers/video/Makefile | 2 +- drivers/video/fsl_diu_fb.c | 530 +++++++++++-------------- include/configs/MPC8610HPCD.h | 10 +- include/configs/P1022DS.h | 8 +- include/configs/pdm360ng.h | 2 - include/fsl_diu_fb.h | 43 +-- 10 files changed, 294 insertions(+), 428 deletions(-)
README +4 -7
@@ -1096,13 +1096,10 @@ The following options need to be configured: CONFIG_VIDEO_LOGO CONFIG_VIDEO_BMP_LOGO - The DIU driver will look for the 'monitor' environment variable, - and if defined, enable the DIU as a console during boot. This - variable should be set to one of these values: - - '0' Output video to the DVI connector - '1' Output video to the LVDS connector - '2' Output video to the Dual-Link LVDS connector + The DIU driver will look for the 'video-mode' environment + variable, and if defined, enable the DIU as a console during + boot. See the documentation file README.video for a + description of this variable. - Keyboard Support: CONFIG_KEYBOARD
arch/powerpc/cpu/mpc512x/diu.c +3 -13
@@ -51,20 +51,10 @@ void diu_set_pixel_clock(unsigned int pixclock)debug ("DIU: Modified value of CLKDVDR = 0x%08x\n" ,in_be32 (clkdvdr)); } -int platform_diu_init (unsigned int *xres,unsigned int *yres) +int platform_diu_init (unsigned int xres,unsigned int yres,const char *port) { -unsigned int pixel_format; - -#if defined(CONFIG_VIDEO_XRES ) & defined(CONFIG_VIDEO_YRES ) - *xres =CONFIG_VIDEO_XRES ; - *yres =CONFIG_VIDEO_YRES ; -#else - *xres =1024 ; - *yres =768 ; -#endif - pixel_format =0x88883316 ; +unsigned int pixel_format =0x88883316 ;debug ("mpc5121_diu_init\n" ); - -return fsl_diu_init (*xres, pixel_format,0 ); +return fsl_diu_init (xres, pixel_format,0 ); }
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c +31 -42
93 lines not on this page · raw message
board/freescale/p1022ds/diu.c +15 -12
@@ -12,6 +12,7 @@#include <common.h> #include <command.h> +#include <linux/ctype.h> #include <asm/io.h> #include <stdio_dev.h> #include <video_fb.h>
@@ -81,10 +82,10 @@ void diu_set_pixel_clock(unsigned int pixclock)out_be32 (&gur->clkdvdr, temp |0x80000000 | ((pixval &0x1F ) <<16 )); } -int platform_diu_init (unsigned int *xres,unsigned int *yres) +int platform_diu_init (unsigned int xres,unsigned int yres,const char *port) {ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); -char *monitor_port; +const char *name;u32 pixel_format;u8 temp;
@@ -100,21 +101,23 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres) temp =in_8 (&pixis->brdcfg1); - monitor_port =getenv ("monitor" ); -if (!strncmp (monitor_port,"1" ,1 )) {/* 1 - Single link LVDS */ - *xres =1024 ; - *yres =768 ; -/* Enable the DFP port, disable the DVI and the backlight */ - temp &= ~(PX_BRDCFG1_DVIEN |PX_BRDCFG1_BACKLIGHT ); - temp |=PX_BRDCFG1_DFPEN ; +if (strncmp (port,"lvds" ,4 ) ==0 ) { +/* Single link LVDS */ + temp &= ~PX_BRDCFG1_DVIEN ; +/* +* LVDS also needs backlight enabled, otherwise the display +* will be blank. +*/ + temp |= (PX_BRDCFG1_DFPEN |PX_BRDCFG1_BACKLIGHT ); + name ="Single-Link LVDS" ; }else {/* DVI */ - *xres =1280 ; - *yres =1024 ;/* Enable the DVI port, disable the DFP and the backlight */ temp &= ~(PX_BRDCFG1_DFPEN |PX_BRDCFG1_BACKLIGHT ); temp |=PX_BRDCFG1_DVIEN ; + name ="DVI" ; } +printf ("DIU: Switching to %s monitor @ %ux%u\n" , name, xres, yres);out_8 (&pixis->brdcfg1, temp);/*
@@ -136,7 +139,7 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres)clrsetbits_be32 (&gur->pmuxcr,PMUXCR_ELBCDIU_MASK ,PMUXCR_ELBCDIU_DIU ); pmuxcr =in_be32 (&gur->pmuxcr); -return fsl_diu_init (*xres, pixel_format,0 ); +return fsl_diu_init (xres, pixel_format,0 ); }/*
drivers/video/Makefile +1 -1
@@ -28,7 +28,7 @@ LIB := $(obj)libvideo.o COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o -COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o +COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o COBJS-$(CONFIG_S6E63D6) += s6e63d6.o COBJS-$(CONFIG_VIDEO_AMBA) += amba.o COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
drivers/video/fsl_diu_fb.c +225 -305
646 lines not on this page · raw message
include/configs/MPC8610HPCD.h +4 -6
@@ -1,5 +1,5 @@/* -* Copyright 2007, 2010 Freescale Semiconductor, Inc. +* Copyright 2007-2011 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
@@ -23,6 +23,8 @@/* video */ +#define CONFIG_FSL_DIU_FB +#ifdef CONFIG_FSL_DIU_FB #define CONFIG_SYS_DIU_ADDR (CONFIG_SYS_CCSRBAR + 0x2c000)#define CONFIG_VIDEO
@@ -625,8 +627,6 @@"diuregs=md e002c000 1d\0" \"dium=mw e002c01c\0" \"diuerr=md e002c014 1\0" \ -"othbootargs=diufb=15M video=fslfb:1280x1024-32 at 60,monitor=0 debug\0" \ -"monitor=0-DVI\0" \"pmregs=md e00e1000 2b\0" \"lawregs=md e0000c08 4b\0" \"lbcregs=md e0005000 36\0" \
@@ -646,9 +646,7 @@"ramdiskfile=8610hpcd/ramdisk.uboot\0" \"fdtaddr=c00000\0" \"fdtfile=8610hpcd/mpc8610_hpcd.dtb\0" \ -"bdev=sda3\0" \ -"othbootargs=diufb=15M video=fslfb:1280x1024-32 at 60,monitor=0\0" \ - "monitor=0-DVI\0" + "bdev=sda3\0"#endif #define CONFIG_NFSBOOTCOMMAND \
include/configs/P1022DS.h +4 -4
@@ -202,6 +202,8 @@#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "/* Video */ +#define CONFIG_FSL_DIU_FB +#ifdef CONFIG_FSL_DIU_FB #define CONFIG_SYS_DIU_ADDR (CONFIG_SYS_CCSRBAR + 0x10000)#define CONFIG_VIDEO
@@ -219,7 +221,7 @@#undef CONFIG_SYS_FLASH_EMPTY_INFO#endif -#ifndef CONFIG_DIU +#ifndef CONFIG_FSL_DIU_FB #define CONFIG_ATI #endif
@@ -507,9 +509,7 @@"diuregs=md e002c000 1d\0" \"dium=mw e002c01c\0" \"diuerr=md e002c014 1\0" \ -"othbootargs=diufb=15M video=fslfb:1280x1024-32 at 60,monitor=0 tty0\0" \ -"hwconfig=esdhc;audclk:12\0" \ -"monitor=0-DVI\0" +"hwconfig=esdhc;audclk:12\0" #define CONFIG_HDBOOT \"setenv bootargs root=/dev/$bdev rw " \
include/configs/pdm360ng.h +0 -2
@@ -64,8 +64,6 @@#define CONFIG_SPLASH_SCREEN #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_RLE8 -#define CONFIG_VIDEO_XRES 800 -#define CONFIG_VIDEO_YRES 480#endif #define CONFIG_SYS_MPC512X_CLKIN 33333333/* in Hz */
include/fsl_diu_fb.h +7 -36
51 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v5 1/1 powerpc: use 'video-mode' environment variable to configure DIU
Quoted 1 line · Anatolij Gustschin
please test recent changes on MPC8610HPCD and P1022DS. Thanks!
This patch works on the 8610 and 1022.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH v5 1/1 powerpc: use 'video-mode' environment variable to configure DIU
In reply to Anatolij GustschinQuoted 16 lines · On Thu, 28 Apr 2011 10:48:47 +0200 Anatolij Gustschin <[email protected]> wrote:
From: Timur Tabi <[email protected]>
Use the 'video-mode' environment variable (for Freescale chips that have a DIU display controller) to designate the full video configuration. Previously, the DIU driver used the 'monitor' variable, and it was used only to determine the output video port.
The old definition of the "monitor" environment variable only determines which video port to use for output. This variable was set to a number (0, 1, or sometimes 2) to specify a DVI, LVDS, or Dual-LVDS port. The resolution was hard-coded into board-specific code. The Linux command-line arguments needed to be hard-coded to the proper video definition string.
Signed-off-by Timur Tabi <[email protected]>Signed-off-by Anatolij Gustschin <[email protected]>---
...
Quoted 11 lines
README | 11 +- arch/powerpc/cpu/mpc512x/diu.c | 16 +- board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c | 73 ++-- board/freescale/p1022ds/diu.c | 27 +- drivers/video/Makefile | 2 +- drivers/video/fsl_diu_fb.c | 530 +++++++++++-------------- include/configs/MPC8610HPCD.h | 10 +- include/configs/P1022DS.h | 8 +- include/configs/pdm360ng.h | 2 - include/fsl_diu_fb.h | 43 +-- 10 files changed, 294 insertions(+), 428 deletions(-)
applied to u-boot-video/master.
Anatolij