[meta-freescale] [meta-fsl-arm][PATCH] u-boot-fslc: mx6sabresd: Enable HDMI video in bootargs

Nikolay Dimitrov picmaster at mail.bg
Thu Jun 11 07:16:20 PDT 2015


Hi Fabio,

On 06/11/2015 03:47 PM, Fabio Estevam wrote:
> Hi Nikolay,
>
> Sorry for the delay.

Np, I'm sorry for poking you.

> This only affects mmc boot, but what if people boot from NFS?

For sure I realize that there are lots of possible permutations, but I
would prefer someone who really needs this functionality to test and
propose a patch for it, which patch extends the current solution. I
just don't have the resources to implement all the possible variants,
but I will always welcome if you send such a patch.

> To be honest I don't know what is the best way to handle this.

Same here, but this my 4th attempt to provide a better solution
(mainline u-boot, yocto master, 2 patch attempts to u-boot-fslc), and
I'm starting to run out of ideas :D.

Actually the code in your email is from my old patch you rejected.
Here's the actual code from the Github u-boot-fslc pull-request:



 From 1dd053085a7c7dbe7b40aa81b29c35f9de7ef001 Mon Sep 17 00:00:00 2001
From: Nikolay Dimitrov <picmaster at mail.bg>
Date: Tue, 2 Jun 2015 18:44:17 +0300
Subject: [PATCH] mx6sabresd: Enable video interfaces in bootargs

Generate kernel video bootargs for sabresd, based on a list of needed video
interfaces ("video_interfaces" U-Boot env-var). The order of initialization
and video settings can be fully customized.

Signed-off-by: Nikolay Dimitrov <picmaster at mail.bg>
---
  include/configs/mx6sabre_common.h |   25 ++++++++++++++++++++++++-
  include/configs/mx6sabresd.h      |    3 +++
  2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/include/configs/mx6sabre_common.h 
b/include/configs/mx6sabre_common.h
index b72522b..a8746a4 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -121,6 +121,14 @@
  #define EMMC_ENV ""
  #endif

+#ifndef VIDEO_ARGS
+#define VIDEO_ARGS ""
+#endif
+
+#ifndef VIDEO_ARGS_SCRIPT
+#define VIDEO_ARGS_SCRIPT ""
+#endif
+
  #define CONFIG_EXTRA_ENV_SETTINGS \
  	"script=boot.scr\0" \
  	"image=zImage\0" \
@@ -148,8 +156,22 @@
  			"fi; "	\
  		"fi\0" \
  	EMMC_ENV	  \
+	"video_args_hdmi=setenv video_args $video_args " \
+		"video=mxcfb${fb}:dev=hdmi,1280x720M at 60,if=RGB24\0" \
+	"video_args_lvds=setenv video_args $video_args " \
+		"video=mxcfb${fb}:dev=ldb,LDB-XGA,if=RGB666\0" \
+	"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}; " \
+			"setexpr fb $fb + 1; " \
+		"done\0" \
  	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=${mmcroot}\0" \
+		"root=${mmcroot} " \
+		VIDEO_ARGS "\0" \
  	"loadbootscript=" \
  		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  	"bootscript=echo Running bootscript from mmc ...; " \
@@ -157,6 +179,7 @@
  	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
  	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
  	"mmcboot=echo Booting from mmc ...; " \
+		VIDEO_ARGS_SCRIPT \
  		"run mmcargs; " \
  		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  			"if run loadfdt; then " \
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index fe71321..9835510 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -31,6 +31,9 @@

  #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */

+#define VIDEO_ARGS        "${video_args}"
+#define VIDEO_ARGS_SCRIPT "run video_args_script; "
+
  #include "mx6sabre_common.h"

  #define CONFIG_SYS_FSL_USDHC_NUM	3
-- 
1.7.10.4



 > We could also use the 'hdmidet' command in U-boot and set HDMI as
 > video argument if a HDMI is connected, but then there is also the
 > issue that the FSL kernel hangs with HDMI enabled in U-boot.

That's correct. I don't think that hdmidet can work without U-Boot HDMI
support, so I would propose the dumb idea of just disabling the U-Boot
HDMI support and have things working in Linux.

Regards,
Nikolay


More information about the meta-freescale mailing list