2022-03-08 01:07:36 +00:00
|
|
|
# Uses the following env. vars:
|
|
|
|
# devtype e.g. mmc/scsi etc
|
|
|
|
# devnum The device number of the given type
|
|
|
|
# bootpart The partition containing the boot files
|
|
|
|
# board_rev Librem 5 board revision
|
2020-01-14 03:55:23 +00:00
|
|
|
|
2022-03-08 01:07:36 +00:00
|
|
|
|
|
|
|
# Default to devtype=mmc, devnum=0, bootpart=1 if they are unset in the
|
|
|
|
# environment. For supporting older u-boot where these may not be configured.
|
|
|
|
if itest.s "x" == "x$devtype" ; then
|
|
|
|
devtype="mmc"
|
|
|
|
fi
|
|
|
|
if itest.s "x" == "x$devnum" ; then
|
|
|
|
devnum=0
|
|
|
|
fi
|
|
|
|
if itest.s "x" == "x$bootpart" ; then
|
|
|
|
bootpart=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
setenv bootargs init=/init.sh rw console=ttymxc0,115200 cma=256M PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE
|
2020-09-07 23:32:48 +00:00
|
|
|
|
|
|
|
# select the correct dtb based on device revision
|
2021-02-03 06:48:01 +00:00
|
|
|
# default to "-r2" if board_rev isn't set, since it'll boot on any librem5
|
|
|
|
# revision
|
|
|
|
dtb_file=imx8mq-librem5-r2.dtb
|
|
|
|
if itest.s "x3" == "x$board_rev" ; then
|
2020-09-07 23:32:48 +00:00
|
|
|
dtb_file=imx8mq-librem5-r3.dtb
|
2021-01-08 18:46:24 +00:00
|
|
|
elif itest.s "x4" == "x$board_rev" ; then
|
|
|
|
dtb_file=imx8mq-librem5-r4.dtb
|
2020-09-07 23:32:48 +00:00
|
|
|
fi
|
|
|
|
|
2020-01-14 03:55:23 +00:00
|
|
|
echo Loading DTB
|
2022-03-08 01:07:36 +00:00
|
|
|
ext2load $devtype ${devnum}:${bootpart} ${fdt_addr_r} ${dtb_file}
|
2020-01-14 03:55:23 +00:00
|
|
|
|
|
|
|
echo Loading Initramfs
|
2022-03-08 01:07:36 +00:00
|
|
|
ext2load $devtype ${devnum}:${bootpart} ${ramdisk_addr_r} initramfs
|
2020-01-14 03:55:23 +00:00
|
|
|
|
|
|
|
echo Loading Kernel
|
2022-03-08 01:07:36 +00:00
|
|
|
ext2load $devtype ${devnum}:${bootpart} ${kernel_addr_r} vmlinuz
|
2020-01-14 03:55:23 +00:00
|
|
|
|
|
|
|
echo Resizing FDT
|
|
|
|
fdt addr ${fdt_addr_r}
|
|
|
|
fdt resize
|
|
|
|
|
2022-03-08 01:07:36 +00:00
|
|
|
# For debug
|
|
|
|
printenv
|
|
|
|
|
2020-01-14 03:55:23 +00:00
|
|
|
echo Booting kernel
|
|
|
|
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
|