[meta-arm,1/2] arm-bsp/u-boot: fix autoboot issue on juno platform

Submitted by Diego Sueiro on Nov. 6, 2020, 2:18 p.m. | Patch ID: 178125

Details

Message ID 80b1626dd2d1f10caf155a533b858c0ef5a663ba.1604672207.git.diego.sueiro@arm.com
State New
Headers show

Commit Message

Diego Sueiro Nov. 6, 2020, 2:18 p.m.
From: Damodar Santhapuri <damodar.santhapuri@arm.com>


this commit fixes memory corruption of uEnv.txt's DRAM memory at
${loadaddr} , by giving enough memory to kernel Image.

Change-Id: I0243b121f1e56b06b8d2f2a21420c594598fad31
Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>

---
 .../u-boot-2020.07/juno/u-boot_vexpress_uenv.patch | 63 ++++++++++++++++++----
 1 file changed, 53 insertions(+), 10 deletions(-)

-- 
2.7.4
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1339): https://lists.yoctoproject.org/g/meta-arm/message/1339
Mute This Topic: https://lists.yoctoproject.org/mt/78074209/1003190
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [mhalstead@linuxfoundation.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch
index c68c173..68433ed 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch
@@ -1,16 +1,39 @@ 
+From 5372743bab931e0f31e37c3767077abd504eca2b Mon Sep 17 00:00:00 2001
+From: Damodar Santhapuri <damodar.santhapuri@arm.com>
+Date: Thu, 5 Nov 2020 22:40:48 +0530
+Subject: [PATCH] arm: juno: add custom bootcmd to autoboot from uEnv.txt file
+
+enable autoboot support with custom bootcmd loads uEnv.txt
+from NOR to DRAM and import.
+
+Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>
+Upstream-Status: Pending
+---
+ include/configs/vexpress_aemv8a.h | 40 ++++++++++++++++++++++++++-----
+ 1 file changed, 34 insertions(+), 6 deletions(-)
+
 diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
-index 09cdd3dab5..7d6d231bd9 100644
+index 09cdd3dab5..9c9f8dfd16 100644
 --- a/include/configs/vexpress_aemv8a.h
 +++ b/include/configs/vexpress_aemv8a.h
-@@ -136,6 +136,32 @@
+@@ -131,11 +131,39 @@
+ 				"kernel_name=norkern\0"	\
+ 				"kernel_alt_name=Image\0"	\
+ 				"kernel_addr_r=0x80080000\0" \
+-				"ramdisk_name=ramdisk.img\0"	\
+-				"ramdisk_addr_r=0x88000000\0"	\
++				"initrd_name=ramdisk.img\0"	\
++				"initrd_addr_r=0x88000000\0"	\
  				"fdtfile=board.dtb\0" \
  				"fdt_alt_name=juno\0" \
  				"fdt_addr_r=0x80000000\0" \
-+                               "bootenvfile=uEnv.txt\0" \
-+                               "bootcmd=run envboot\0" \
-+                               "envboot=if run loadbootenv; then echo Loading env from ${bootenvfile}; run importbootenv; else run default_bootcmd; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd;fi;\0" \
++				"fdt_high=0xffffffffffffffff\0" \
++				"initrd_high=0xffffffffffffffff\0" \
++                                "bootenvfile=uEnv.txt\0" \
++                                "bootcmd=run envboot\0" \
++                                "envboot=if run loadbootenv; then echo Loading env from ${bootenvfile}; run importbootenv; else run default_bootcmd; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd;fi;\0" \
 +                                "importbootenv=echo Importing environment from memory, size ${filesize}; env import -t ${loadaddr} ${filesize}\0" \
-+                                "loadaddr=0x82000000\0" \
++                                "loadaddr=0x84000000\0" \
 +                                "filesize=0x4000\0" \
 +                                "loadbootenv=mw.l ${loadaddr} 0 0x1000; afs load ${bootenvfile} ${loadaddr}\0" \
 +                                "default_bootcmd=echo running default boot command; afs load ${kernel_name} ${kernel_addr_r} ; " \
@@ -26,12 +49,32 @@  index 09cdd3dab5..7d6d231bd9 100644
 +		                                "  afs load ${fdt_alt_name} ${fdt_addr_r}; "\
 +		                                "fi ; "\
 +                                                "fdt addr ${fdt_addr_r}; fdt resize; " \
-+		                                "if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\
++		                                "if afs load  ${initrd_name} ${initrd_addr_r} ; "\
 +		                                "then "\
-+		                                "  setenv ramdisk_param ${ramdisk_addr_r}; "\
-+		                                "  else setenv ramdisk_param -; "\
++		                                "  setenv initrd_param ${initrd_addr_r}; "\
++		                                "  else setenv initrd_param -; "\
 +		                                "fi ; " \
-+		                                "booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}\0"
++		                                "booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}\0"
  
  /* Copy the kernel and FDT to DRAM memory and boot */
  #define CONFIG_BOOTCOMMAND	"afs load ${kernel_name} ${kernel_addr_r} ;"\
+@@ -151,12 +179,12 @@
+ 				"  afs load ${fdt_alt_name} ${fdt_addr_r}; "\
+ 				"fi ; "\
+ 				"fdt addr ${fdt_addr_r}; fdt resize; " \
+-				"if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\
++				"if afs load  ${initrd_name} ${initrd_addr_r} ; "\
+ 				"then "\
+-				"  setenv ramdisk_param ${ramdisk_addr_r}; "\
+-				"  else setenv ramdisk_param -; "\
++				"  setenv initrd_param ${initrd_addr_r}; "\
++				"  else setenv initrd_param -; "\
+ 				"fi ; " \
+-				"booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}"
++				"booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}"
+ 
+ 
+ #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
+-- 
+2.17.1
+

Comments

Jon Mason Nov. 9, 2020, 8:39 p.m.
On Fri, Nov 06, 2020 at 02:18:58PM +0000, Diego Sueiro wrote:
> From: Damodar Santhapuri <damodar.santhapuri@arm.com>

> 

> this commit fixes memory corruption of uEnv.txt's DRAM memory at

> ${loadaddr} , by giving enough memory to kernel Image.

> 

> Change-Id: I0243b121f1e56b06b8d2f2a21420c594598fad31

> Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>


Patches pushed to master.

Thanks,
Jon

> ---

>  .../u-boot-2020.07/juno/u-boot_vexpress_uenv.patch | 63 ++++++++++++++++++----

>  1 file changed, 53 insertions(+), 10 deletions(-)

> 

> diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch

> index c68c173..68433ed 100644

> --- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch

> +++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2020.07/juno/u-boot_vexpress_uenv.patch

> @@ -1,16 +1,39 @@

> +From 5372743bab931e0f31e37c3767077abd504eca2b Mon Sep 17 00:00:00 2001

> +From: Damodar Santhapuri <damodar.santhapuri@arm.com>

> +Date: Thu, 5 Nov 2020 22:40:48 +0530

> +Subject: [PATCH] arm: juno: add custom bootcmd to autoboot from uEnv.txt file

> +

> +enable autoboot support with custom bootcmd loads uEnv.txt

> +from NOR to DRAM and import.

> +

> +Signed-off-by: Damodar Santhapuri <damodar.santhapuri@arm.com>

> +Upstream-Status: Pending

> +---

> + include/configs/vexpress_aemv8a.h | 40 ++++++++++++++++++++++++++-----

> + 1 file changed, 34 insertions(+), 6 deletions(-)

> +

>  diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h

> -index 09cdd3dab5..7d6d231bd9 100644

> +index 09cdd3dab5..9c9f8dfd16 100644

>  --- a/include/configs/vexpress_aemv8a.h

>  +++ b/include/configs/vexpress_aemv8a.h

> -@@ -136,6 +136,32 @@

> +@@ -131,11 +131,39 @@

> + 				"kernel_name=norkern\0"	\

> + 				"kernel_alt_name=Image\0"	\

> + 				"kernel_addr_r=0x80080000\0" \

> +-				"ramdisk_name=ramdisk.img\0"	\

> +-				"ramdisk_addr_r=0x88000000\0"	\

> ++				"initrd_name=ramdisk.img\0"	\

> ++				"initrd_addr_r=0x88000000\0"	\

>   				"fdtfile=board.dtb\0" \

>   				"fdt_alt_name=juno\0" \

>   				"fdt_addr_r=0x80000000\0" \

> -+                               "bootenvfile=uEnv.txt\0" \

> -+                               "bootcmd=run envboot\0" \

> -+                               "envboot=if run loadbootenv; then echo Loading env from ${bootenvfile}; run importbootenv; else run default_bootcmd; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd;fi;\0" \

> ++				"fdt_high=0xffffffffffffffff\0" \

> ++				"initrd_high=0xffffffffffffffff\0" \

> ++                                "bootenvfile=uEnv.txt\0" \

> ++                                "bootcmd=run envboot\0" \

> ++                                "envboot=if run loadbootenv; then echo Loading env from ${bootenvfile}; run importbootenv; else run default_bootcmd; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd;fi;\0" \

>  +                                "importbootenv=echo Importing environment from memory, size ${filesize}; env import -t ${loadaddr} ${filesize}\0" \

> -+                                "loadaddr=0x82000000\0" \

> ++                                "loadaddr=0x84000000\0" \

>  +                                "filesize=0x4000\0" \

>  +                                "loadbootenv=mw.l ${loadaddr} 0 0x1000; afs load ${bootenvfile} ${loadaddr}\0" \

>  +                                "default_bootcmd=echo running default boot command; afs load ${kernel_name} ${kernel_addr_r} ; " \

> @@ -26,12 +49,32 @@ index 09cdd3dab5..7d6d231bd9 100644

>  +		                                "  afs load ${fdt_alt_name} ${fdt_addr_r}; "\

>  +		                                "fi ; "\

>  +                                                "fdt addr ${fdt_addr_r}; fdt resize; " \

> -+		                                "if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\

> ++		                                "if afs load  ${initrd_name} ${initrd_addr_r} ; "\

>  +		                                "then "\

> -+		                                "  setenv ramdisk_param ${ramdisk_addr_r}; "\

> -+		                                "  else setenv ramdisk_param -; "\

> ++		                                "  setenv initrd_param ${initrd_addr_r}; "\

> ++		                                "  else setenv initrd_param -; "\

>  +		                                "fi ; " \

> -+		                                "booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}\0"

> ++		                                "booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}\0"

>   

>   /* Copy the kernel and FDT to DRAM memory and boot */

>   #define CONFIG_BOOTCOMMAND	"afs load ${kernel_name} ${kernel_addr_r} ;"\

> +@@ -151,12 +179,12 @@

> + 				"  afs load ${fdt_alt_name} ${fdt_addr_r}; "\

> + 				"fi ; "\

> + 				"fdt addr ${fdt_addr_r}; fdt resize; " \

> +-				"if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\

> ++				"if afs load  ${initrd_name} ${initrd_addr_r} ; "\

> + 				"then "\

> +-				"  setenv ramdisk_param ${ramdisk_addr_r}; "\

> +-				"  else setenv ramdisk_param -; "\

> ++				"  setenv initrd_param ${initrd_addr_r}; "\

> ++				"  else setenv initrd_param -; "\

> + 				"fi ; " \

> +-				"booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}"

> ++				"booti ${kernel_addr_r} ${initrd_param} ${fdt_addr_r}"

> + 

> + 

> + #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP

> +-- 

> +2.17.1

> +

> -- 

> 2.7.4

> 


> 

> 

>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1348): https://lists.yoctoproject.org/g/meta-arm/message/1348
Mute This Topic: https://lists.yoctoproject.org/mt/78074209/1003190
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub [mhalstead@linuxfoundation.org]
-=-=-=-=-=-=-=-=-=-=-=-