summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-10-26 04:13:08 +0000
committerian <ian@FreeBSD.org>2014-10-26 04:13:08 +0000
commit46597f7cad834d35c04eb6d45243cc030b5e31b6 (patch)
tree3581e1e6e8069c932968e599a988d3988f0174c6 /sys/boot
parent449c80cb11cd101e956e86fe1e30508e2d07d09e (diff)
downloadFreeBSD-src-46597f7cad834d35c04eb6d45243cc030b5e31b6.zip
FreeBSD-src-46597f7cad834d35c04eb6d45243cc030b5e31b6.tar.gz
MFC r273298:
The U-Boot README says fdt_addr_r is the right env var for fdt data loaded into ram, but vendors also use fdtaddr and fdt_addr. Check the recommended variable first and fall back to the others.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/fdt/fdt_loader_cmd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/boot/fdt/fdt_loader_cmd.c b/sys/boot/fdt/fdt_loader_cmd.c
index b54a6b4..2014597 100644
--- a/sys/boot/fdt/fdt_loader_cmd.c
+++ b/sys/boot/fdt/fdt_loader_cmd.c
@@ -310,10 +310,13 @@ fdt_setup_fdtp()
/*
* If the U-boot environment contains a variable giving the address of a
- * valid blob in memory, use it. Board vendors use both fdtaddr and
- * fdt_addr names.
+ * valid blob in memory, use it. The U-boot README says the right
+ * variable for fdt data loaded into ram is fdt_addr_r, so try that
+ * first. Board vendors also use both fdtaddr and fdt_addr names.
*/
- s = ub_env_get("fdtaddr");
+ s = ub_env_get("fdt_addr_r");
+ if (s == NULL)
+ s = ub_env_get("fdtaddr");
if (s == NULL)
s = ub_env_get("fdt_addr");
if (s != NULL && *s != '\0') {
OpenPOWER on IntegriCloud