diff options
author | raj <raj@FreeBSD.org> | 2012-03-20 13:08:57 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2012-03-20 13:08:57 +0000 |
commit | e87823cf6ee42b9d37c7af7ba277341a2fd2fac9 (patch) | |
tree | ba1cbbb3da1a81e3bf3066248d61d34a1f5568c7 /sys/boot/uboot | |
parent | b276eae62cc103a99108b3a6ca4d3c7403c48511 (diff) | |
download | FreeBSD-src-e87823cf6ee42b9d37c7af7ba277341a2fd2fac9.zip FreeBSD-src-e87823cf6ee42b9d37c7af7ba277341a2fd2fac9.tar.gz |
Improve device tree blob (DTB) handling in loader(8).
Enable using the statically embedded blob from the kernel, if present. The KLD
loaded DTB takes precedence, but they are both recognized and handled in the
same way.
Submitted by: Lukasz Wojcik
Obtained from: Semihalf
MFC after: 1 week
Diffstat (limited to 'sys/boot/uboot')
-rw-r--r-- | sys/boot/uboot/common/metadata.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/boot/uboot/common/metadata.c b/sys/boot/uboot/common/metadata.c index e346430..7b6e1fc 100644 --- a/sys/boot/uboot/common/metadata.c +++ b/sys/boot/uboot/common/metadata.c @@ -333,13 +333,12 @@ md_load(char *args, vm_offset_t *modulep) #if defined(LOADER_FDT_SUPPORT) /* Handle device tree blob */ - fdt_fixup(); - if ((bfp = file_findfile(NULL, "dtb")) == NULL && - (howto & RB_VERBOSE)) - printf("**WARNING** Booting with no DTB loaded!\n"); - - dtbp = bfp == NULL ? 0 : bfp->f_addr; - file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); + dtbp = fdt_fixup(); + if (dtbp != (vm_offset_t)NULL) + file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); + else + pager_output("WARNING! Trying to fire up the kernel, but no " + "device tree blob found!\n"); #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); |