omap: switch from uEnv.txt to generic distro booting
authorAndre Heider <a.heider@gmail.com>
Fri, 6 Sep 2019 20:53:23 +0000 (22:53 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Wed, 20 Nov 2019 09:46:19 +0000 (10:46 +0100)
Which makes supporting different boot devices easy.

Signed-off-by: Andre Heider <a.heider@gmail.com>
package/boot/uboot-omap/Makefile
package/boot/uboot-omap/files/boot.scr.txt [new file with mode: 0644]
package/boot/uboot-omap/files/uEnv-default.txt [deleted file]
target/linux/omap/image/Makefile

index b519d6fb80bea90f8941589e3c65bdde4f5b72c1..70c8af1dc4ea2c3c74748fef5afeaf31f2a39b1a 100644 (file)
@@ -19,7 +19,6 @@ include $(INCLUDE_DIR)/package.mk
 define U-Boot/Default
   BUILD_TARGET:=omap
   UBOOT_IMAGE:=u-boot.img MLO
-  UENV:=default
 endef
 
 define U-Boot/omap4_panda
@@ -51,7 +50,8 @@ define Build/InstallDev
                $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(device)/
        )
        $(foreach device,$(BUILD_DEVICES), \
-               $(CP) ./files/uEnv-$(UENV).txt $(STAGING_DIR_IMAGE)/$(device)/uEnv.txt
+               mkimage -C none -A arm -T script -d ./files/boot.scr.txt \
+                       $(STAGING_DIR_IMAGE)/$(device)/boot.scr
        )
 endef
 
diff --git a/package/boot/uboot-omap/files/boot.scr.txt b/package/boot/uboot-omap/files/boot.scr.txt
new file mode 100644 (file)
index 0000000..3e6b5c3
--- /dev/null
@@ -0,0 +1,5 @@
+setenv bootargs console=${console} root=/dev/mmcblk0p2 rootwait
+
+load mmc 0:1 ${loadaddr} /zImage \
+&& load mmc 0:1 ${fdtaddr} /dtbs/${fdtfile} \
+&& bootz ${loadaddr} - ${fdtaddr}
diff --git a/package/boot/uboot-omap/files/uEnv-default.txt b/package/boot/uboot-omap/files/uEnv-default.txt
deleted file mode 100644 (file)
index 8dc80e7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-bootpart=0:1
-bootdir=/
-bootfile=zImage
-fdtdir=/dtbs
-uenvcmd=run loadfdt; run loadimage; run uenvbootargs ; bootz ${loadaddr} - ${fdtaddr}
-loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}
-devtype=mmc
-uenvbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rootwait
index ce3ad9ddf0d36ffbf717592739aad1aa3bab19ec..106071a38ed8044f6947351d8fada69b91510d21 100644 (file)
@@ -19,7 +19,7 @@ define Build/omap-sdcard
 
        mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/MLO ::MLO
        mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/u-boot.img ::u-boot.img
-       mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/uEnv.txt ::uEnv.txt
+       mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/boot.scr ::boot.scr
        mmd -i $@.boot ::/dtbs
        mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::/dtbs/$(DEVICE_DTS).dtb
        mcopy -i $@.boot $(IMAGE_KERNEL) ::/zImage