From be634a96252f3691bea5128af69a51b846969608 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 9 Nov 2015 14:04:31 -0200 Subject: [PATCH] mx6sabre_common: Dynamically change the video output Use the 'hdmidetect' command in U-boot to load the appropriate video arguments. If HDMI is connected during boot then make HDMI as the primary framebuffer, otherwise let LVDS be the primary framebuffer. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador --- configs/mx6sabreauto_defconfig | 1 + configs/mx6sabresd_defconfig | 1 + include/configs/mx6sabre_common.h | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig index 236af953b5..1f02775e2a 100644 --- a/configs/mx6sabreauto_defconfig +++ b/configs/mx6sabreauto_defconfig @@ -9,6 +9,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y +CONFIG_CMD_HDMIDETECT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,SPL,MX6QDL" CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index d8e05cfe04..e0b5a34fb7 100644 --- a/configs/mx6sabresd_defconfig +++ b/configs/mx6sabresd_defconfig @@ -9,6 +9,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_VIDEO=y +CONFIG_CMD_HDMIDETECT=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6QDL" CONFIG_BOOTDELAY=3 # CONFIG_CONSOLE_MUX is not set diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index 729996281c..f997604c91 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -64,6 +64,13 @@ #define VIDEO_ARGS "${video_args}" #define VIDEO_ARGS_SCRIPT "run video_args_script; " +#define CONFIG_PREBOOT \ + "if hdmidet; then " \ + "setenv video_interfaces hdmi lvds; " \ + "else " \ + "setenv video_interfaces lvds hdmi; " \ + "fi;" + #define CONFIG_EXTRA_ENV_SETTINGS \ "script=boot.scr\0" \ "image=zImage\0" \ @@ -102,7 +109,6 @@ "video_args_lcd=setenv video_args $video_args " \ "video=mxcfb${fb}:dev=lcd,CLAA-WVGA,if=RGB666\0" \ "fb=0\0" \ - "video_interfaces=hdmi lvds lcd\0" \ "video_args_script=" \ "for v in ${video_interfaces}; do " \ "run video_args_${v}; " \ -- 2.40.1