From 3cccc93a2647c00f24f62d4f88919ee60433d0bf Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 1 Mar 2014 19:02:00 +0000 Subject: Prevent fdt data loaded from a file from overwriting the kernel environment, by having uboot_autoload() do the fdt setup (which may load a file) rather than waiting until we're actually in the process of launching the kernel. As part of making this happen... - Define LOADER_FDT_SUPPORT on the uboot/lib compile command line when MK_FDT is set. - Make fdt_setup_fdtb() public. - Declare public fdt_whatever() functions in a header instead of using scattered extern decls in .c files. --- sys/boot/uboot/lib/module.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/boot/uboot/lib/module.c') diff --git a/sys/boot/uboot/lib/module.c b/sys/boot/uboot/lib/module.c index f03d644..d9b3dc0 100644 --- a/sys/boot/uboot/lib/module.c +++ b/sys/boot/uboot/lib/module.c @@ -29,19 +29,23 @@ __FBSDID("$FreeBSD$"); /* * U-Boot-specific module functionality. - * - * XXX not much for now... - * */ #include #include #include "bootstrap.h" +#include "libuboot.h" int uboot_autoload(void) { +#if defined(LOADER_FDT_SUPPORT) + int err; + + if ((err = fdt_setup_fdtp()) != 0) + return (err); +#endif return(0); } -- cgit v1.1