From d6d0c0e0e832086cee3c673749d49d1bffd025c6 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 | 15 ++++++++------- include/configs/mx6sabresd.h | 3 --- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig index 06835f203a..892480bdd8 100644 --- a/configs/mx6sabreauto_defconfig +++ b/configs/mx6sabreauto_defconfig @@ -14,6 +14,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y CONFIG_SPL_LIBDISK_SUPPORT=y +CONFIG_CMD_HDMIDETECT=y CONFIG_NXP_BOARD_REVISION=y CONFIG_SPL_TEXT_BASE=0x00908000 CONFIG_FIT=y diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index f218408832..7d55b52129 100644 --- a/configs/mx6sabresd_defconfig +++ b/configs/mx6sabresd_defconfig @@ -15,6 +15,7 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_TEXT_BASE=0x00908000 +CONFIG_CMD_HDMIDETECT=y CONFIG_FIT=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index 5b8cf435cd..b8c26a1f6f 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -40,13 +40,15 @@ #define EMMC_ENV "" #endif -#ifndef VIDEO_ARGS -#define VIDEO_ARGS "" -#endif +#define VIDEO_ARGS "${video_args}" +#define VIDEO_ARGS_SCRIPT "run video_args_script; " -#ifndef VIDEO_ARGS_SCRIPT -#define VIDEO_ARGS_SCRIPT "" -#endif +#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" \ @@ -87,7 +89,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}; " \ diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h index e9aec99703..ec1537541a 100644 --- a/include/configs/mx6sabresd.h +++ b/include/configs/mx6sabresd.h @@ -16,9 +16,6 @@ #define CONFIG_MXC_UART_BASE UART1_BASE #define CONSOLE_DEV "ttymxc0" -#define VIDEO_ARGS "${video_args}" -#define VIDEO_ARGS_SCRIPT "run video_args_script; " - #include "mx6sabre_common.h" /* Falcon Mode */