mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-15 19:34:49 +00:00
7dff6a8c89
This patch adds sysupgrade, uboot-env and networking support for Methode uDPU device. Device features 4 partitions: ----------------------------------------- | boot | recovery | rootfs | misc | | (ext4) | (ext4) | (fsf2) | (f2fs) | _________________________________________ Idea was to use f2fs only but the u-boot currently lacks support so first 2 partition are ext4 to be u-boot readable, and this was a reason why custom build and sysupgrade sections were required. On the sysupgrade, boot and rootfs partitions are updated, firmare image and user configuration is saved on the misc partition and if the upgrade was successfull, recovery partition will be updated on after the reboot from preinit script. If the sysupgrade fails for any reason, device will fallback to recovery initramfs image. Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
# Bootscript for Methode uDPU device
|
|
# Device and variables may vary between different revisions
|
|
# of device, so we need to make sure everything is set correctly.
|
|
|
|
# Set the LED's correctly
|
|
gpio clear 12; gpio clear 40; gpio clear 45;
|
|
|
|
# Find eMMC device,
|
|
if mmc dev 0; then
|
|
setenv mmcdev 0
|
|
setenv rootdev 'root=/dev/mmcblk0p3'
|
|
elif mmc dev 1; then
|
|
setenv mmcdev 1
|
|
setenv rootdev 'root=/dev/mmcblk1p3'
|
|
fi
|
|
|
|
# Set the variables if necessary
|
|
if test ${kernel_addr_r}; then
|
|
setenv kernel_addr_r 0x5000000
|
|
fi
|
|
|
|
if test ${fdt_add_r}; then
|
|
setenv fdt_addr_r 0x4f00000
|
|
fi
|
|
|
|
setenv console 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000'
|
|
setenv bootargs ${console} $rootdev rw rootwait
|
|
|
|
load mmc ${mmcdev}:1 ${fdt_addr_r} @DTB@.dtb
|
|
load mmc ${mmcdev}:1 ${kernel_addr_r} Image
|
|
|
|
booti ${kernel_addr_r} - ${fdt_addr_r}
|
|
|
|
# If the boot command fails, fallback to recovery image
|
|
echo '-- Boot failed, falling back to the recovery image --'
|
|
setenv bootargs $console
|
|
load mmc ${mmcdev}:2 ${kernel_addr_r} recovery.itb
|
|
bootm ${kernel_addr_r}
|