summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2019-11-27 20:02:00 +0530
committerAmit Pundir <amit.pundir@linaro.org>2019-11-27 23:06:03 +0530
commit4c88555ac266663f2243529a1481ed8a15fe139d (patch)
treec3d47a18c0b42877207a9a5e32f135f2735d2348
parent5b7f1237b6b4797af6564bb3687be779d3128c08 (diff)
QcomModulePkg: BootLib: skip dtbo image loading
Skip loading dtb overlay image from dtbo partition because there isn't any. In case of missing dtbo image, DTBImgCheckAndAppendDT assumes that we are booting with appended dtb (Image.gz-dtb) format and fail to load dtb from boot.img (boot image header v2 format). So we fix that by loading dtb from boot.img explicitly in case of missing DTBO image. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--QcomModulePkg/Library/BootLib/BootLinux.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/QcomModulePkg/Library/BootLib/BootLinux.c b/QcomModulePkg/Library/BootLib/BootLinux.c
index dda9aa04e1..61feed46d9 100644
--- a/QcomModulePkg/Library/BootLib/BootLinux.c
+++ b/QcomModulePkg/Library/BootLib/BootLinux.c
@@ -480,7 +480,26 @@ DTBImgCheckAndAppendDT (BootInfo *Info, BootParamlist *BootParamlistPtr)
SingleDtHdr, fdt_totalsize (SingleDtHdr));
} else {
DEBUG ((EFI_D_ERROR, "Error: Device Tree blob not found\n"));
- return EFI_NOT_FOUND;
+
+ /* Get the Soc specific dtb in case of boot image header v2
+ * with dtb.img at an offset and missing DTBO partition */
+ SocDtb = GetSocDtb (ImageBuffer,
+ DtbSize,
+ BootParamlistPtr->DtbOffset,
+ (VOID *)BootParamlistPtr->DeviceTreeLoadAddr);
+ if (!SocDtb) {
+ DEBUG ((EFI_D_ERROR,
+ "Error: Appended Soc Device Tree blob not found\n"));
+ return EFI_NOT_FOUND;
+ }
+
+ Status = ApplyOverlay (BootParamlistPtr,
+ SocDtb,
+ DtsList);
+ if (Status != EFI_SUCCESS) {
+ DEBUG ((EFI_D_ERROR, "Error: Dtb overlay failed\n"));
+ return Status;
+ }
}
}
} else {