diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2017-12-29 18:08:30 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2017-12-29 18:08:30 +0000 |
commit | 06d6750e0d9647298da760c0e69d9479ac207c14 (patch) | |
tree | 6b4615377066cf437597fb0ca15f0a49f1aabef2 /stand/efi/fdt | |
parent | 5c515efc888261ad3de45493ef10ba959db67f56 (diff) | |
download | src-06d6750e0d9647298da760c0e69d9479ac207c14.tar.gz src-06d6750e0d9647298da760c0e69d9479ac207c14.zip |
stand/fdt: Consistently apply fdt_overlays
Overlays were previously not applied when U-Boot provides FDT or EFI
provides FDT, only when we load FDT from /boot/dtb given name from U-Boot.
Make all three paths lead to loading fdt_overlays and applying them, so that
fdt_overlays can be expected to Just Work.
Reviewed by: gonzo, imp, manu
Differential Revision: https://reviews.freebsd.org/D13664
Notes
Notes:
svn path=/head/; revision=327350
Diffstat (limited to 'stand/efi/fdt')
-rw-r--r-- | stand/efi/fdt/efi_fdt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/stand/efi/fdt/efi_fdt.c b/stand/efi/fdt/efi_fdt.c index d6757689c896..5fcb6ad1588b 100644 --- a/stand/efi/fdt/efi_fdt.c +++ b/stand/efi/fdt/efi_fdt.c @@ -44,19 +44,27 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; + const char *s; hdr = efi_get_table(&fdtdtb); - if (hdr != NULL) { - if (fdt_load_dtb_addr(hdr) == 0) { - printf("Using DTB provided by EFI at %p.\n", hdr); - return (0); - } + if (hdr == NULL) + return (1); + if (fdt_load_dtb_addr(hdr) != 0) + return (1); + printf("Using DTB provided by EFI at %p.\n", hdr); + + s = getenv("fdt_overlays"); + if (s != NULL && *s != '\0') { + printf("Loading DTB overlays: '%s'\n", s); + fdt_load_dtb_overlays(s); } - return (1); + return (0); } void fdt_platform_fixups(void) { + + fdt_apply_overlays(); } |