aboutsummaryrefslogtreecommitdiff
path: root/board/phytec
diff options
context:
space:
mode:
authorBenjamin Hahn <B.Hahn@phytec.de>2024-07-16 22:11:27 -0700
committerTom Rini <trini@konsulko.com>2024-07-22 13:47:57 -0600
commit0ff9141fb88ee57fa3d994cdee48b32c173d4297 (patch)
tree19d500743b820012bc475ba7e61d32c0f1ba11a6 /board/phytec
parent26b2d2c0f271c4b9a5cd4f32be280fca2bec452c (diff)
downloadu-boot-0ff9141fb88ee57fa3d994cdee48b32c173d4297.zip
u-boot-0ff9141fb88ee57fa3d994cdee48b32c173d4297.tar.gz
u-boot-0ff9141fb88ee57fa3d994cdee48b32c173d4297.tar.bz2
phycore-imx8mp: Add overlay and bootenv.txt support
Add support for loading bootenv.txt as well as loading and applying overlays during boot from mmc and net. ${no_bootenv}: Prevent loading external bootenv.txt environment. Use ${overlays} variable directly from u-boot environment. ${no_overlay}: Do not load overlays defined in ${overlays} variable. Overlays loaded over the extension command are still being applied. Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de> Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Reviewed-by: Teresa Remmet <t.remmet@phytec.de> Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Diffstat (limited to 'board/phytec')
-rw-r--r--board/phytec/phycore_imx8mp/phycore_imx8mp.env15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/phytec/phycore_imx8mp/phycore_imx8mp.env b/board/phytec/phycore_imx8mp/phycore_imx8mp.env
index 7f6c5fd..4ed5dc7 100644
--- a/board/phytec/phycore_imx8mp/phycore_imx8mp.env
+++ b/board/phytec/phycore_imx8mp/phycore_imx8mp.env
@@ -1,4 +1,5 @@
#include <env/phytec/rauc.env>
+#include <env/phytec/overlays.env>
bootcmd=
if test ${dofastboot} = 1; then
@@ -16,6 +17,8 @@ bootcmd=
fi;
fi;
console=ttymxc0,115200
+bootenv_addr=0x49100000
+fdto_addr=0x49000000
dofastboot=0
emmc_dev=2
fastboot_raw_partition_all=0 4194304
@@ -32,8 +35,14 @@ mmcargs=
mmcautodetect=yes
mmcboot=
echo Booting from mmc ...;
+ if test ${no_bootenv} = 0; then
+ if run mmc_load_bootenv; then
+ env import -t ${bootenv_addr} ${filesize};
+ fi;
+ fi;
run mmcargs;
if run loadfdt; then
+ run mmc_apply_overlays;
booti ${loadaddr} - ${fdt_addr};
else
echo WARN: Cannot load the DT;
@@ -51,9 +60,15 @@ netboot=
else
setenv get_cmd tftp;
fi;
+ if test ${no_bootenv} = 0; then
+ if run net_load_bootenv; then
+ env import -t ${bootenv_addr} ${filesize};
+ fi;
+ fi;
${get_cmd} ${loadaddr} ${image};
run netargs;
if ${get_cmd} ${fdt_addr} ${fdt_file}; then
+ run net_apply_overlays;
booti ${loadaddr} - ${fdt_addr};
else
echo WARN: Cannot load the DT;