Skip to contentSkip to conversation

u-boot-fslc: mx6sabresd: Enable HDMI video in bootargs

PATCH In review Nikolay Dimitrov 4 participants 24 messages May 31, 2015 – Jul 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 u-boot-fslc: mx6sabresd: Enable HDMI video in bootargs

---
 ...-mx6sabresd-Enable-HDMI-video-in-bootargs.patch |   60 ++++++++++++++++++++
 recipes-bsp/u-boot/u-boot-fslc_2015.04.bb          |    2 +
 2 files changed, 62 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch
recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch new file +60 -0
new file mode 100644
index 0000000..bce93d2
@@ -0,0 +1,60 @@
+From 36b480be4cbe134adb91097b4a1d0b0750553cc4 Mon Sep 17 00:00:00 2001
+From: Nikolay Dimitrov <[email protected]>
+Date: Fri, 22 May 2015 22:15:06 +0300
+Subject: [PATCH] mx6sabresd: Enable HDMI video in bootargs
+
+Upstream-Status: Inappropriate [FSL kernel specific]
+
+Link: http://lists.denx.de/pipermail/u-boot/2015-May/215014.html
+
+Signed-off-by: Nikolay Dimitrov <[email protected]>
+---
+ include/configs/mx6sabre_common.h |    7 ++++++-
+ include/configs/mx6sabresd.h      |    6 ++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
+index b72522b..86745ac 100644
+--- a/include/configs/mx6sabre_common.h
++++ b/include/configs/mx6sabre_common.h
+@@ -121,6 +121,10 @@
+ #define EMMC_ENV ""
+ #endif
+ 
++#ifndef VIDEO_ARGS
++#define VIDEO_ARGS ""
++#endif
++
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ 	"script=boot.scr\0" \
+ 	"image=zImage\0" \
+@@ -149,7 +153,8 @@
+ 		"fi\0" \
+ 	EMMC_ENV	  \
+ 	"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 ...; " \
+diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
+index dab2fd2..1bd4912 100644
+--- a/include/configs/mx6sabresd.h
++++ b/include/configs/mx6sabresd.h
+@@ -31,6 +31,12 @@
+ 
+ #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
+ 
++#define VIDEO_ARGS	"video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \
++				"video=mxcfb1:off " \
++				"video=mxcfb2:off " \
++				"video=mxcfb3:off " \
++				"fbmem=28M"
++
+ #include "mx6sabre_common.h"
+ 
+ #define CONFIG_SYS_FSL_USDHC_NUM	3
+-- 
+1.7.10.4
+
recipes-bsp/u-boot/u-boot-fslc_2015.04.bb +2 -0
index 726d442..e5cec59 100644
@@ -4,3 +4,5 @@ PV = "v2015.04+git${SRCPV}"
 
 SRCREV = "b16ec2de8ddd3ce3bca7566e045dc085755550f6"
 SRCBRANCH = "patches-2015.04"
+
+SRC_URI += "file://0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch"
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 1 line · Nikolay Dimitrov

I agree with the patch but please send it to be applied in the U-Boot FSLC fork and not in the recipe. This makes it easier to rebase and maintain against new releases of U-Boot and simplifies the recipe. Once I apply it we can bump the revision :)

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#2 lore raw

Hi Otavio,

Quoted 7 lines · Otavio Salvador
Quoted 1 line · Nikolay Dimitrov

I agree with the patch but please send it to be applied in the U-Boot FSLC fork and not in the recipe. This makes it easier to rebase and maintain against new releases of U-Boot and simplifies the recipe. Once I apply it we can bump the revision :)

OK, will do, after I understand and address Fabio's concerns.

Regards,
Nikolay

#3 lore raw
In reply to Nikolay Dimitrov
Quoted 1 line · Nikolay Dimitrov

++#define VIDEO_ARGS "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \

What if the user wants to use LVDS as fb0?

Not sure if we should really hardcode this kernel command line.

Regards,

Fabio Estevam

#4 lore raw

Hi Fabio,

Quoted 7 lines · Fabio Estevam
Quoted 1 line · Nikolay Dimitrov

++#define VIDEO_ARGS "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \

What if the user wants to use LVDS as fb0?

Not sure if we should really hardcode this kernel command line.

Well, the user has some options:

1. editenv mmcargs
2. edit the patch and rebuild

The only reason of proposing it this way is that I haven't found a better way to do it.

Regards,
Nikolay

PS: Actually, there's a slightly better way - adding support for extlinux boot configuration, and if you guys are interested I can send a patch so you can kick my arse about it too :D.

#5 lore raw
Quoted 11 lines · Nikolay Dimitrov

Hi Fabio,

Quoted 7 lines · Fabio Estevam
Quoted 1 line · Nikolay Dimitrov

++#define VIDEO_ARGS "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \

What if the user wants to use LVDS as fb0?

Not sure if we should really hardcode this kernel command line.

Quoted 7 lines

Well, the user has some options:

1. editenv mmcargs
2. edit the patch and rebuild

The only reason of proposing it this way is that I haven't found a better way to do it.

If you make this a proper U-Boot [enviroment] variable then it's easy to override - no compiling necessary :-)

Quoted 3 lines

PS: Actually, there's a slightly better way - adding support for extlinux boot configuration, and if you guys are interested I can send a patch so you can kick my arse about it too :D.

It might be nice to know how this can work in any case.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#6 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 7 lines · Fabio Estevam
Quoted 1 line · Nikolay Dimitrov

++#define VIDEO_ARGS "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \

What if the user wants to use LVDS as fb0?

Not sure if we should really hardcode this kernel command line.

What do you think about this:

video_args_hdmi=setenv video_args $video_args video=mxcfb${fbid}:dev=hdmi,1280x720M@60,if=RGB24\0 video_args_lvds=setenv video_args $video_args video=mxcfb${fbid}:dev=ldb,LDB-XGA,if=RGB666\0 video_args_lcd=setenv video_args $video_args video=mxcfb${fbid}:dev=lcd,CLAA-WVGA,if=RGB666\0 fb=0\0
video_interfaces=hdmi lvds lcd\0

config_video=for v in ${video_interfaces}; do \
    run video_args_${v}; \
    setexpr fb $fb + 1; \

done\0

mmcargs=setenv bootargs console=${console},${baudrate} \
    root=${mmcroot} \
    ${video_args}\0
...
mmcboot=echo Booting from mmc ...; \
    run config_video; \
    run mmcargs; \
    ...

Now video interfaces can be selected and reordered at will just by editing video_interfaces env-var.

Regards,
Nikolay

#7 lore raw

Hi guys,

Quoted 39 lines · Nikolay Dimitrov

Hi Fabio,

Quoted 8 lines · Fabio Estevam
Quoted 1 line · Nikolay Dimitrov

++#define VIDEO_ARGS "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \

What if the user wants to use LVDS as fb0?

Not sure if we should really hardcode this kernel command line.

What do you think about this:

video_args_hdmi=setenv video_args $video_args video=mxcfb${fbid}:dev=hdmi,1280x720M@60,if=RGB24\0 video_args_lvds=setenv video_args $video_args video=mxcfb${fbid}:dev=ldb,LDB-XGA,if=RGB666\0 video_args_lcd=setenv video_args $video_args video=mxcfb${fbid}:dev=lcd,CLAA-WVGA,if=RGB666\0 fb=0\0
video_interfaces=hdmi lvds lcd\0

config_video=for v in ${video_interfaces}; do \
     run video_args_${v}; \
     setexpr fb $fb + 1; \

done\0

mmcargs=setenv bootargs console=${console},${baudrate} \
     root=${mmcroot} \
     ${video_args}\0
...
mmcboot=echo Booting from mmc ...; \
     run config_video; \
     run mmcargs; \
     ...
Quoted 2 lines

Now video interfaces can be selected and reordered at will just by editing video_interfaces env-var.

I've cleaned-up the code and sent a pull-request for you to review:

https://github.com/Freescale/u-boot-fslc/pull/8

Regards,
Nikolay

#9 lore raw

Hi Fabio,

We're looking for your input on the following question - do you think that my patch should cover also sabreauto board, in order to avoid the VIDEO_ARGS define "hack"?

If you prefer such approach, it would be great if you can test the patch on the actual board and confirm that it works, as I don't have access to such board.

FYI - here's the Github discussion for my pull request:

https://github.com/Freescale/u-boot-fslc/pull/8

Thanks in advance for looking into this.

Kind regards,
Nikolay

#10 lore raw

Hi Fabio,

Quoted 10 lines · Nikolay Dimitrov

Hi Fabio,

We're looking for your input on the following question - do you think that my patch should cover also sabreauto board, in order to avoid the VIDEO_ARGS define "hack"?

If you prefer such approach, it would be great if you can test the patch on the actual board and confirm that it works, as I don't have access to such board.

Quoted 5 lines

FYI - here's the Github discussion for my pull request:

https://github.com/Freescale/u-boot-fslc/pull/8

Thanks in advance for looking into this.

Can you please take a look at this and tell me your opinion?

Thanks and regards,
Nikolay

#11 lore raw
In reply to Nikolay Dimitrov

Hi Nikolay,

Sorry for the delay.

Quoted 5 lines · Nikolay Dimitrov

++#ifndef VIDEO_ARGS
++#define VIDEO_ARGS ""
++#endif
++
+ #define CONFIG_EXTRA_ENV_SETTINGS \

recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch line 37

Quoted 9 lines
recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch new file +9 -0
+       "script=boot.scr\0" \
+       "image=zImage\0" \
+@@ -149,7 +153,8 @@
+               "fi\0" \
+       EMMC_ENV          \
+       "mmcargs=setenv bootargs console=${console},${baudrate} " \
+-              "root=${mmcroot}\0" \
++              "root=${mmcroot} " \
++              VIDEO_ARGS "\0" \

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

Quoted 8 lines
recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch new file +8 -0
+       "loadbootscript=" \
+               "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+       "bootscript=echo Running bootscript from mmc ...; " \
+diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
+index dab2fd2..1bd4912 100644
+--- a/include/configs/mx6sabresd.h
++++ b/include/configs/mx6sabresd.h
+@@ -31,6 +31,12 @@

recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch line 55

Quoted 10 lines
recipes-bsp/u-boot/u-boot-fslc/0001-mx6sabresd-Enable-HDMI-video-in-bootargs.patch new file +10 -0
+
+ #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
+
++#define VIDEO_ARGS    "video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24 " \
++                              "video=mxcfb1:off " \
++                              "video=mxcfb2:off " \
++                              "video=mxcfb3:off " \
++                              "fbmem=28M"
++
+ #include "mx6sabre_common.h"

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

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.

Regards,

Fabio Estevam

#12 lore raw

Hi Fabio,

Quoted 3 lines · Fabio Estevam

Hi Nikolay,

Sorry for the delay.

Np, I'm sorry for poking you.

Quoted 1 line

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.

Quoted 1 line

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 <[email protected]>
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.

---
 include/configs/mx6sabre_common.h |   25 ++++++++++++++++++++++++-
 include/configs/mx6sabresd.h      |    3 +++
 2 files changed, 27 insertions(+), 1 deletion(-)
include/configs/mx6sabre_common.h +24 -1
index b72522b..a8746a4 100644
@@ -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@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 " \
include/configs/mx6sabresd.h +3 -0
index fe71321..9835510 100644
@@ -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
Signature · 1 line
1.7.10.4
Quoted 3 lines

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

#13 lore raw

Hi Nikolay,

Quoted 2 lines · Nikolay Dimitrov

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:

No objections from me.

Regards,

Fabio Estevam

#14 lore raw

Hi Fabio,

Quoted 4 lines · Fabio Estevam

Hi Nikolay,

On Thu, Jun 11, 2015 at 11:16 AM, Nikolay Dimitrov <[email protected]> wrote:

Quoted 8 lines
Quoted 2 lines

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:

No objections from me.

Regards,

Fabio Estevam

Thanks!

Regards,
Nikolay

#15 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 8 lines · Fabio Estevam

Hi Nikolay,

Quoted 2 lines · Nikolay Dimitrov

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:

No objections from me.

Errm... still, would you recommend to apply the patch as it is only for sabresd, or I should change it so it can also work for sabreauto (which I can't test here)?

Regards,
Nikolay

#16 lore raw
Quoted 3 lines · Nikolay Dimitrov

Errm... still, would you recommend to apply the patch as it is only for sabresd, or I should change it so it can also work for sabreauto (which I can't test here)?

I also can't test it on sabreauto at the moment, so the current approach (sabresd only) is fine.

Regards,

Fabio Estevam

#17 lore raw

That's great, thanks!

Quoted 15 lines · Fabio Estevam
Quoted 3 lines · Nikolay Dimitrov

Errm... still, would you recommend to apply the patch as it is only for sabresd, or I should change it so it can also work for sabreauto (which I can't test here)?

I also can't test it on sabreauto at the moment, so the current approach (sabresd only) is fine.

Regards,

Fabio Estevam

#18 lore raw

Hi Otavio,

I don't want to be (too) annoying, but just to kindly remind you - do you plan to bump u-boot-fslc to 5d9ffd2?

Thanks in advance. Regards,
Nikolay

#19 lore raw
Quoted 2 lines · Nikolay Dimitrov

I don't want to be (too) annoying, but just to kindly remind you - do you plan to bump u-boot-fslc to 5d9ffd2?

Queued for merging.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#20 lore raw

Hello,

Can you rebase this and resend? it didn't apply.

Quoted 10 lines · Otavio Salvador
Quoted 2 lines · Nikolay Dimitrov

I don't want to be (too) annoying, but just to kindly remind you - do you plan to bump u-boot-fslc to 5d9ffd2?

Queued for merging.

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#21 lore raw

Hi Otavio,

Quoted 3 lines · Otavio Salvador

Hello,

Can you rebase this and resend? it didn't apply.

The patch you're trying to merge from patchwork was rejected by you on 1.June, when you recommended me to add it to u-boot-fslc instead, and you promised to bump the u-boot-fslc revision.

The new SRCREV should be 5d9ffd2.

Quoted 6 lines · Otavio Salvador
Quoted 4 lines · Nikolay Dimitrov
Quoted 2 lines

I don't want to be (too) annoying, but just to kindly remind you - do you plan to bump u-boot-fslc to 5d9ffd2?

Quoted 6 lines
Quoted 6 lines

Queued for merging.

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750

Regards,
Nikolay

#22 lore raw
Quoted 8 lines · Nikolay Dimitrov
Quoted 1 line · Otavio Salvador

Can you rebase this and resend? it didn't apply.

The patch you're trying to merge from patchwork was rejected by you on 1.June, when you recommended me to add it to u-boot-fslc instead, and you promised to bump the u-boot-fslc revision.

The new SRCREV should be 5d9ffd2.

Mind to cook a u-boot-fslc bump patch? otherwise I do it on Monday.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#23 lore raw
Quoted 3 lines · Otavio Salvador
Quoted 1 line

The new SRCREV should be 5d9ffd2.

Mind to cook a u-boot-fslc bump patch? otherwise I do it on Monday.

I have sent a patch for this.

Regards,

Fabio Estevam