From c74a26a7d23e28f8c50f7a41a1a57c41fd94891a 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 --- include/configs/mx6sabre_common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index d922de4de3..ced58bc6b0 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -72,6 +72,13 @@ #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" \ "image=zImage\0" \ @@ -110,7 +117,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}; " \ @@ -241,6 +247,7 @@ #define CONFIG_IPUV3_CLK 264000000 #endif #define CONFIG_IMX_HDMI +#define CONFIG_CMD_HDMIDETECT #define CONFIG_IMX_VIDEO_SKIP #ifndef CONFIG_SPL -- 2.40.1