diff mbox

[U-Boot,V2] arm: novena: Switch novena to config_distro_bootcmd

Message ID 1447191829-7997-1-git-send-email-marex@denx.de
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Marek Vasut Nov. 10, 2015, 9:43 p.m. UTC
From: Vagrant Cascadian <vagrant@aikidev.net>

Switch Novena to distro bootcmd, so it can be used with debian easily.

Signed-off-by: Vagrant Cascadian <vagrant@aikidev.net>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Sean Cross <xobs@kosagi.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 include/configs/novena.h | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

V2: Drop the duplicate kernel_addr_r setting

Comments

Vagrant Cascadian Nov. 23, 2015, 8:02 p.m. UTC | #1
On 2015-11-10, Marek Vasut wrote:
> Switch Novena to distro bootcmd, so it can be used with debian easily.

> diff --git a/include/configs/novena.h b/include/configs/novena.h
> index 718989f..3bb406d 100644
> --- a/include/configs/novena.h
> +++ b/include/configs/novena.h
> @@ -58,7 +59,7 @@
>  /* Booting Linux */
>  #define CONFIG_BOOTFILE			"fitImage"
>  #define CONFIG_BOOTARGS			"console=ttymxc1,115200 "
> -#define CONFIG_BOOTCOMMAND		"run net_nfs"
> +#define CONFIG_BOOTCOMMAND		"run distro_bootcmd ; run net_nfs"
>  #define CONFIG_HOSTNAME			novena
>  
>  /* Physical Memory Map */
...
> @@ -199,6 +201,10 @@
>  	"rootdev=/dev/mmcblk0p2\0"					\
>  	"netdev=eth0\0"							\
>  	"kernel_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> +	"pxefile_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> +	"scriptaddr="__stringify(CONFIG_LOADADDR)"\0"			\
> +	"ramdisk_addr_r=0x28000000\0"		   			\
> +	"fdt_addr_r=0x10000000\0"					\
>  	"addcons="							\
>  		"setenv bootargs ${bootargs} "				\
>  		"console=${consdev},${baudrate}\0"			\

"fdtfile=imx6q-novena.dtb" should be added above, maybe after fdt_addr_r.

The use of CONFIG_BOOTARGS and "run addcons" appear to be redundant, or
at least overlapping. Other boards simply set "console=ttymxc0,115200"
or appropriate, which would be a bit simpler.


live well,
  vagrant
Vagrant Cascadian Nov. 24, 2015, 1:13 a.m. UTC | #2
On 2015-11-10, Marek Vasut wrote:
> Switch Novena to distro bootcmd, so it can be used with debian easily.
...
> diff --git a/include/configs/novena.h b/include/configs/novena.h
> index 718989f..3bb406d 100644
> --- a/include/configs/novena.h
> +++ b/include/configs/novena.h
> @@ -199,6 +201,10 @@
>  	"rootdev=/dev/mmcblk0p2\0"					\
>  	"netdev=eth0\0"							\
>  	"kernel_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> +	"pxefile_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> +	"scriptaddr="__stringify(CONFIG_LOADADDR)"\0"			\
> +	"ramdisk_addr_r=0x28000000\0"		   			\
> +	"fdt_addr_r=0x10000000\0"					\
>  	"addcons="							\
>  		"setenv bootargs ${bootargs} "				\
>  		"console=${consdev},${baudrate}\0"			\

Apparently, 0x10000000 doesn't work for fdt_addr_r, changing it to:

        "fdt_addr_r=0x11200000"

Worked for me.


live well,
  vagrant
Marek Vasut Nov. 24, 2015, 11:31 p.m. UTC | #3
On Monday, November 23, 2015 at 09:02:36 PM, Vagrant Cascadian wrote:
> On 2015-11-10, Marek Vasut wrote:
> > Switch Novena to distro bootcmd, so it can be used with debian easily.
> > 
> > diff --git a/include/configs/novena.h b/include/configs/novena.h
> > index 718989f..3bb406d 100644
> > --- a/include/configs/novena.h
> > +++ b/include/configs/novena.h
> > @@ -58,7 +59,7 @@
> > 
> >  /* Booting Linux */
> >  #define CONFIG_BOOTFILE			"fitImage"
> >  #define CONFIG_BOOTARGS			"console=ttymxc1,115200 "
> > 
> > -#define CONFIG_BOOTCOMMAND		"run net_nfs"
> > +#define CONFIG_BOOTCOMMAND		"run distro_bootcmd ; run 
net_nfs"
> > 
> >  #define CONFIG_HOSTNAME			novena
> >  
> >  /* Physical Memory Map */
> 
> ...
> 
> > @@ -199,6 +201,10 @@
> > 
> >  	"rootdev=/dev/mmcblk0p2\0"					\
> >  	"netdev=eth0\0"							\
> >  	"kernel_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> > 
> > +	"pxefile_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> > +	"scriptaddr="__stringify(CONFIG_LOADADDR)"\0"			\
> > +	"ramdisk_addr_r=0x28000000\0"		   			\
> > +	"fdt_addr_r=0x10000000\0"					\
> > 
> >  	"addcons="							\
> >  	
> >  		"setenv bootargs ${bootargs} "				\
> >  		"console=${consdev},${baudrate}\0"			\
> 
> "fdtfile=imx6q-novena.dtb" should be added above, maybe after fdt_addr_r.

Added, thanks.

> The use of CONFIG_BOOTARGS and "run addcons" appear to be redundant, or
> at least overlapping. Other boards simply set "console=ttymxc0,115200"
> or appropriate, which would be a bit simpler.

Should be ttymxc1. The idea is that addcons let's you configure console using
the consdev and baudrate (which specifies the UART baudrate in u-boot too),
so if you change the baudrate in U-Boot, it is automatically updated in Linux
too.

Best regards,
Marek Vasut
Marek Vasut Nov. 24, 2015, 11:31 p.m. UTC | #4
On Tuesday, November 24, 2015 at 02:13:14 AM, Vagrant Cascadian wrote:
> On 2015-11-10, Marek Vasut wrote:
> > Switch Novena to distro bootcmd, so it can be used with debian easily.
> 
> ...
> 
> > diff --git a/include/configs/novena.h b/include/configs/novena.h
> > index 718989f..3bb406d 100644
> > --- a/include/configs/novena.h
> > +++ b/include/configs/novena.h
> > @@ -199,6 +201,10 @@
> > 
> >  	"rootdev=/dev/mmcblk0p2\0"					\
> >  	"netdev=eth0\0"							\
> >  	"kernel_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> > 
> > +	"pxefile_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
> > +	"scriptaddr="__stringify(CONFIG_LOADADDR)"\0"			\
> > +	"ramdisk_addr_r=0x28000000\0"		   			\
> > +	"fdt_addr_r=0x10000000\0"					\
> > 
> >  	"addcons="							\
> >  	
> >  		"setenv bootargs ${bootargs} "				\
> >  		"console=${consdev},${baudrate}\0"			\
> 
> Apparently, 0x10000000 doesn't work for fdt_addr_r, changing it to:
> 
>         "fdt_addr_r=0x11200000"
> 
> Worked for me.

Makes sense, thanks :)

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/include/configs/novena.h b/include/configs/novena.h
index 718989f..3bb406d 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -16,6 +16,7 @@ 
 #define CONFIG_FIT
 #define CONFIG_KEYBOARD
 
+#include <config_distro_defaults.h>
 #include "mx6_common.h"
 
 /* U-Boot Commands */
@@ -58,7 +59,7 @@ 
 /* Booting Linux */
 #define CONFIG_BOOTFILE			"fitImage"
 #define CONFIG_BOOTARGS			"console=ttymxc1,115200 "
-#define CONFIG_BOOTCOMMAND		"run net_nfs"
+#define CONFIG_BOOTCOMMAND		"run distro_bootcmd ; run net_nfs"
 #define CONFIG_HOSTNAME			novena
 
 /* Physical Memory Map */
@@ -190,6 +191,7 @@ 
 #endif
 
 /* Extra U-Boot environment. */
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	"fdt_high=0xffffffff\0"						\
 	"initrd_high=0xffffffff\0"					\
@@ -199,6 +201,10 @@ 
 	"rootdev=/dev/mmcblk0p2\0"					\
 	"netdev=eth0\0"							\
 	"kernel_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
+	"pxefile_addr_r="__stringify(CONFIG_LOADADDR)"\0"		\
+	"scriptaddr="__stringify(CONFIG_LOADADDR)"\0"			\
+	"ramdisk_addr_r=0x28000000\0"		   			\
+	"fdt_addr_r=0x10000000\0"					\
 	"addcons="							\
 		"setenv bootargs ${bootargs} "				\
 		"console=${consdev},${baudrate}\0"			\
@@ -242,5 +248,19 @@ 
 		"fatwrite mmc 0:1 ${loadaddr} u-boot.img ${filesize} ; "\
 		"fi ; "							\
 		"fi\0"							\
+	BOOTENV
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(USB, usb, 0) \
+	func(SATA, sata, 0) \
+	func(PXE, pxe, na) \
+	func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
+#else
+#define CONFIG_EXTRA_ENV_SETTINGS
+#endif /* CONFIG_SPL_BUILD */
 
 #endif				/* __CONFIG_H */