aboutsummaryrefslogtreecommitdiff
path: root/stand/fdt
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-04-11 13:26:28 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-04-11 13:26:28 +0000
commit2a1e52f347ff179183abb5e2a143f36c8e9feb42 (patch)
tree72210511a7b41c86dea6425d517890b01cf5d0ff /stand/fdt
parentcf973b4420f8b55ae80e0fcd0408d666356d20dd (diff)
downloadsrc-2a1e52f347ff179183abb5e2a143f36c8e9feb42.tar.gz
src-2a1e52f347ff179183abb5e2a143f36c8e9feb42.zip
stand: refactor overlay loading a little bit
It was pointed out that manually loading a .dtb to be used rather than relying on platform-specific method for loading .dtb will result in overlays not being applied. This was true because overlay loading was hacked into fdt_platform_load_dtb, rather than done in a way more independent from how the .dtb is loaded. Instead, push overlay loading (for now) out into an fdt_platform_load_overlays. This method easily allows ubldr to pull in any fdt_overlays specified in the ub env, and omits overlay-checking on platforms where they're not tested and/or not desired (e.g. powerpc). If we eventually stop caring about fdt_overlays from ubenv (if we ever cared), this method should get chopped out in favor of just calling fdt_load_dtb_overlays() directly. Reported by: Manuel Stühn (freebsdnewbie freenet de)
Notes
Notes: svn path=/head/; revision=346132
Diffstat (limited to 'stand/fdt')
-rw-r--r--stand/fdt/fdt_loader_cmd.c6
-rw-r--r--stand/fdt/fdt_platform.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/stand/fdt/fdt_loader_cmd.c b/stand/fdt/fdt_loader_cmd.c
index 38ac9876774a..87b587275bc2 100644
--- a/stand/fdt/fdt_loader_cmd.c
+++ b/stand/fdt/fdt_loader_cmd.c
@@ -522,6 +522,7 @@ fdt_setup_fdtp()
if (fdt_load_dtb(bfp->f_addr) == 0) {
printf("Using DTB from loaded file '%s'.\n",
bfp->f_name);
+ fdt_platform_load_overlays();
return (0);
}
}
@@ -531,12 +532,15 @@ fdt_setup_fdtp()
if (fdt_load_dtb_addr(fdt_to_load) == 0) {
printf("Using DTB from memory address %p.\n",
fdt_to_load);
+ fdt_platform_load_overlays();
return (0);
}
}
- if (fdt_platform_load_dtb() == 0)
+ if (fdt_platform_load_dtb() == 0) {
+ fdt_platform_load_overlays();
return (0);
+ }
/* If there is a dtb compiled into the kernel, use it. */
if ((va = fdt_find_static_dtb()) != 0) {
diff --git a/stand/fdt/fdt_platform.h b/stand/fdt/fdt_platform.h
index 8930340053c4..0528dd0f033e 100644
--- a/stand/fdt/fdt_platform.h
+++ b/stand/fdt/fdt_platform.h
@@ -51,6 +51,7 @@ int fdt_setup_fdtp(void);
/* The platform library needs to implement these functions */
int fdt_platform_load_dtb(void);
+void fdt_platform_load_overlays(void);
void fdt_platform_fixups(void);
#endif /* FDT_PLATFORM_H */