diff mbox

[U-Boot,8/8,omap3,overo] Allow overo to boot with device tree

Message ID 1398813328-17365-9-git-send-email-ashcharles@gmail.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Ash Charles April 29, 2014, 11:15 p.m. UTC
Update the board configuration for Gumstix Overo. In particular,
add support for zImage and DTB files on boot.

Signed-off-by: Ash Charles <ashcharles@gmail.com>
---
 include/configs/omap3_overo.h | 57 ++++++++++++++++++++++++++++---------------
 1 file changed, 37 insertions(+), 20 deletions(-)

Comments

Tom Rini May 6, 2014, 6:14 p.m. UTC | #1
On Tue, Apr 29, 2014 at 04:15:28PM -0700, Ash Charles wrote:

> Update the board configuration for Gumstix Overo. In particular,
> add support for zImage and DTB files on boot.
> 
> Signed-off-by: Ash Charles <ashcharles@gmail.com>
[snip]
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"loadaddr=0x82000000\0" \
> +	"dtbaddr=0x81600000\0" \
> +	"dtbfile=overo.dtb\0" \

Please see DEFAULT_LINUX_BOOT_ENV and the related discussions.  If you
have less than 128MB DDR we can sort something out, but if you have
256MB it's really advised to use 0x88000000 for the DT (see
Documentation/arm/Booting in the kernel).
Ash Charles May 6, 2014, 11:56 p.m. UTC | #2
On Tue, May 6, 2014 at 11:14 AM, Tom Rini <trini@ti.com> wrote:
> Please see DEFAULT_LINUX_BOOT_ENV and the related discussions.  If you
> have less than 128MB DDR we can sort something out, but if you have
> 256MB it's really advised to use 0x88000000 for the DT (see
> Documentation/arm/Booting in the kernel).
Overo doesn't pull in the configuration from
include/configs/ti_armv7_common.h where DEFAULT_LINUX_BOOT_ENV is
defined.  Might a v2 using the settings defined by
DEFAULT_LINUX_BOOT_ENV in the overo config be acceptable?

--Ash
Tom Rini May 7, 2014, 12:40 p.m. UTC | #3
On Tue, May 06, 2014 at 04:56:08PM -0700, Ash Charles wrote:
> On Tue, May 6, 2014 at 11:14 AM, Tom Rini <trini@ti.com> wrote:
> > Please see DEFAULT_LINUX_BOOT_ENV and the related discussions.  If you
> > have less than 128MB DDR we can sort something out, but if you have
> > 256MB it's really advised to use 0x88000000 for the DT (see
> > Documentation/arm/Booting in the kernel).
> Overo doesn't pull in the configuration from
> include/configs/ti_armv7_common.h where DEFAULT_LINUX_BOOT_ENV is
> defined.  Might a v2 using the settings defined by
> DEFAULT_LINUX_BOOT_ENV in the overo config be acceptable?

I'd like to start by seeing if we can adopt the files (ti_omap3_common.h
which grabs ti_armv7_common.h).  The intention is to have the
really common parts there and the board specific elsewhere.  It's indeed
not quite perfect and we probably need to push a few things back up to
the board, even if they're repeated frequently.
Ash Charles May 7, 2014, 5:45 p.m. UTC | #4
On Wed, May 7, 2014 at 5:40 AM, Tom Rini <trini@ti.com> wrote:
> I'd like to start by seeing if we can adopt the files (ti_omap3_common.h
> which grabs ti_armv7_common.h).  The intention is to have the
> really common parts there and the board specific elsewhere.  It's indeed
> not quite perfect and we probably need to push a few things back up to
> the board, even if they're repeated frequently.
Thanks Tom.
As this is a rather distinct change, I'm sending an additional patch
that switches Overo to ti_omap3_common and DEFAULT_LINUX_BOOT_ENV
rather than amending the previous patch series.  I hope this is
appropriate and acceptable as I wasn't sure the policy on such patches
after the close date for the merge window.

Another newbie question: should I be basing submitted patches off
u-boot-ti/master (as I'm using TI chips) or u-boot/master?

--Ash
Stefan Herbrechtsmeier May 20, 2014, 5:34 p.m. UTC | #5
Am 30.04.2014 01:15, schrieb Ash Charles:
> Update the board configuration for Gumstix Overo. In particular,
> add support for zImage and DTB files on boot.
>
> Signed-off-by: Ash Charles <ashcharles@gmail.com>
> ---
>   include/configs/omap3_overo.h | 57 ++++++++++++++++++++++++++++---------------
>   1 file changed, 37 insertions(+), 20 deletions(-)
>
> diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
> index 1e4dfcf..71ec437 100644
> --- a/include/configs/omap3_overo.h
> +++ b/include/configs/omap3_overo.h
> @@ -193,16 +199,20 @@
>   		"omapdss.def_disp=${defaultdisplay} " \
>   		"root=${nandroot} " \
>   		"rootfstype=${nandrootfstype}\0" \
> -	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
> -	"bootscript=echo Running bootscript from mmc ...; " \
> +	"loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
> +	"bootscript=echo Running boot script from mmc ...; " \
>   		"source ${loadaddr}\0" \
> -	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
> -	"importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
> +	"loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
> +	"importbootenv=echo Importing environment from mmc ...; " \
>   		"env import -t ${loadaddr} ${filesize}\0" \
> -	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
> -	"mmcboot=echo Booting from mmc ...; " \
> +	"loaduimage=load mmc ${mmcdev} ${loadaddr} uImage\0" \
> +	"mmcboot=echo Booting from mmc...; " \
>   		"run mmcargs; " \
>   		"bootm ${loadaddr}\0" \
> +	"loadzimage=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}\0" \
> +	"loadfdt=load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \
> +	"mmcbootfdt=echo Booting with DT from mmc ...; " \
> +		"bootz ${loadaddr} - ${dtbaddr}\0" \
A run of mmcargs is missing.
Ash Charles May 21, 2014, 8:16 p.m. UTC | #6
On Tue, May 20, 2014 at 10:34 AM, Stefan Herbrechtsmeier
<stefan@herbrechtsmeier.net> wrote:
> A run of mmcargs is missing.
Totally correct---good catch.
I'll send a v2 for this series rebased on u-boot-ti/master and also
include this [1] patch.  Hopefully this is correct.

--Ash

[1] https://www.mail-archive.com/u-boot@lists.denx.de/msg137739.html
diff mbox

Patch

diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 1e4dfcf..71ec437 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -39,6 +39,7 @@ 
 #define CONFIG_REVISION_TAG
 
 #define CONFIG_OF_LIBFDT
+#define CONFIG_CMD_BOOTZ
 
 /*
  * Size of malloc() pool
@@ -92,7 +93,7 @@ 
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_EXT2		/* EXT2 Support			*/
 #define CONFIG_CMD_FAT		/* FAT support			*/
-#define CONFIG_CMD_JFFS2	/* JFFS2 Support		*/
+#define CONFIG_CMD_FS_GENERIC
 
 #define CONFIG_CMD_I2C		/* I2C serial bus support	*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
@@ -165,8 +166,13 @@ 
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x82000000\0" \
+	"dtbaddr=0x81600000\0" \
+	"dtbfile=overo.dtb\0" \
+	"bootdir=/boot\0" \
+	"bootfile=zImage\0" \
+	"usbtty=cdc_acm\0" \
 	"console=ttyO2,115200n8\0" \
-	"mpurate=500\0" \
+	"mpurate=auto\0" \
 	"optargs=\0" \
 	"vram=12M\0" \
 	"dvimode=1024x768MR-16@60\0" \
@@ -193,16 +199,20 @@ 
 		"omapdss.def_disp=${defaultdisplay} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
+	"loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+	"bootscript=echo Running boot script from mmc ...; " \
 		"source ${loadaddr}\0" \
-	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
-	"importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
+	"loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t ${loadaddr} ${filesize}\0" \
-	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
-	"mmcboot=echo Booting from mmc ...; " \
+	"loaduimage=load mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc...; " \
 		"run mmcargs; " \
 		"bootm ${loadaddr}\0" \
+	"loadzimage=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"loadfdt=load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \
+	"mmcbootfdt=echo Booting with DT from mmc ...; " \
+		"bootz ${loadaddr} - ${dtbaddr}\0" \
 	"nandboot=echo Booting from nand ...; " \
 		"run nandargs; " \
 		"nand read ${loadaddr} linux; " \
@@ -212,20 +222,27 @@ 
 	"mmc dev ${mmcdev}; if mmc rescan; then " \
 		"if run loadbootscript; then " \
 			"run bootscript; " \
-		"else " \
-			"if run loadbootenv; then " \
-				"run importbootenv; " \
-				"if test -n ${uenvcmd}; then " \
-					"echo Running uenvcmd ...;" \
-					"run uenvcmd;" \
+		"fi;" \
+		"if run loadbootenv; then " \
+			"echo Loaded environment from ${bootenv};" \
+			"run importbootenv;" \
+		"fi;" \
+		"if test -n $uenvcmd; then " \
+			"echo Running uenvcmd ...;" \
+			"run uenvcmd;" \
+		"fi;" \
+		"if run loaduimage; then " \
+			"run mmcboot;" \
+		"fi;" \
+		"if run loadzimage; then " \
+			"if test -n $dtbfile; then " \
+				"if run loadfdt; then " \
+					"run mmcbootfdt;" \
 				"fi;" \
 			"fi;" \
-			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"else run nandboot; " \
-			"fi; " \
-		"fi; " \
-	"else run nandboot; fi"
+		"fi;" \
+	"fi;" \
+	"run nandboot; " \
 
 #define CONFIG_AUTO_COMPLETE	1
 /*