]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
brppt1: Update environment to support new boot concept
authorBernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Thu, 25 Aug 2022 06:54:04 +0000 (08:54 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 15 Sep 2022 18:22:08 +0000 (14:22 -0400)
* Drop legacy /boot/PPTImage.md5 check
* Update device tree naming
* Update t30args#0 root cmd line property to support latest kernel
  versions (root=/dev/mmcblk0p2 for linux < 4 and
  root=/dev/mmcblk1p2 for linux >= 4)
* Add custom bootloader version string
* Destroy invalid dtb at ${dtbaddr} and configuration script at
  ${cfgaddr} to ensure proper boot in warm restart case.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
configs/brppt1_mmc_defconfig
include/configs/brppt1.h

index 6da6d58bfd25f1de98c4b63cb1c66afb09e4c72a..a45604de169e1752a30b3b07115b84dd9f575bb2 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SPL_SERIAL=y
 CONFIG_SPL=y
 CONFIG_ENV_OFFSET_REDUND=0x50000
 CONFIG_SYS_LOAD_ADDR=0x80000000
+CONFIG_LOCALVERSION="-2.0.0"
+# CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00
 # CONFIG_EXPERT is not set
@@ -26,7 +28,7 @@ CONFIG_BOOTDELAY=0
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run b_default"
 CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="mw ${dtbaddr} 0; run cfgscr; run brdefaultip"
+CONFIG_PREBOOT="mw ${cfgaddr} 0; mw ${dtbaddr} 0; run cfgscr; run brdefaultip"
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
index aaf3f8b4a5fbba906ac835a005d3283e2f56b260..2c5236aa58bbd14727a7a3620e6e3a7c719bcba7 100644 (file)
 
 #define MMC_TGTS \
 "t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
-       "b_mode=${b_mode} root=/dev/mmcblk0p2 rootfstype=ext4\0" \
+       "b_mode=${b_mode} root=${root_dev} rootfstype=ext4 rootwait\0" \
 "b_t30lgcy#0=" \
-       "load ${loaddev}:2 ${loadaddr} /boot/PPTImage.md5 && " \
        "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \
-       "load ${loaddev}:2 ${dtbaddr} /boot/am335x-ppt30.dtb || " \
-       "load ${loaddev}:1 ${dtbaddr} am335x-ppt30-legacy.dtb; "\
+       "run load_dtb && " \
        "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \
 "t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
        "b_mode=${b_mode}\0" \
 "b_t30lgcy#1=" \
        "load ${loaddev}:1 ${loadaddr} zImage && " \
-       "load ${loaddev}:1 ${dtbaddr} am335x-ppt30.dtb && " \
+       "load ${loaddev}:1 ${dtbaddr} am335x-brppt30.dtb && " \
        "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \
        "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \
 "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \
 "b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \
 "b_tgts_rcy=t30lgcy#1 usb0 net\0" \
 "b_tgts_pme=net usb0 mmc0 mmc1\0" \
-"loaddev=mmc 1\0"
+"loaddev=mmc 1\0" \
+"root_dev=/dev/mmcblk0p2\0" \
+"load_dtb=load ${loaddev}:2 ${dtbaddr} /boot/am335x-brppt30.dtb; " \
+        "if test $? -eq 0; then " \
+            "setenv root_dev /dev/mmcblk1p2; " \
+        "else; " \
+            "load ${loaddev}:1 ${dtbaddr} am335x-brppt30-legacy.dtb; " \
+        "fi;\0"
 
 #ifdef CONFIG_ENV_IS_IN_MMC
 #define MMCTGTS \
 MMC_TGTS \
+"cfgscr=mw ${cfgaddr} 0;" \
 " mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr};" \
 " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0"
 #else