summaryrefslogtreecommitdiff
path: root/boot/image-fdt.c
diff options
context:
space:
mode:
authorSughosh Ganu <[email protected]>2025-03-17 14:04:02 +0530
committerIlias Apalodimas <[email protected]>2025-03-26 13:28:08 +0200
commit61e0a20aecf4af6cdc223bd8cd1bd82fe5e3d9f6 (patch)
tree941665a95d85cfed88c16851dc464fd7c9d3e816 /boot/image-fdt.c
parent54c39bf104017e3a0b30fdff6104141b719af9ef (diff)
blkmap: pass information on ISO image to the OS
The EFI HTTP boot puts the ISO installer image at some location in memory. Information about this image has to be passed on to the OS kernel, which is done by adding a persistent memory(pmem) node to the devicetree(DT) that is passed to the OS. The OS kernel then gets information about the presence of this ISO image and proceeds with the installation. In U-Boot, this ISO image gets mounted as a memory mapped blkmap device slice, with the 'preserve' attribute. Add a helper function which iterates through all such slices, and invokes a callback. The callback adds the pmem node to the DT and removes the corresponding memory region from the EFI memory map. Invoke this helper function as part of the DT fixup which happens before booting the OS. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Tobias Waldekranz <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'boot/image-fdt.c')
-rw-r--r--boot/image-fdt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index 9d1598b1a93..8f718ad29f6 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -11,6 +11,7 @@
#include <command.h>
#include <fdt_support.h>
#include <fdtdec.h>
+#include <efi.h>
#include <env.h>
#include <errno.h>
#include <image.h>
@@ -649,6 +650,12 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob, bool lmb)
if (!ft_verify_fdt(blob))
goto err;
+ if (CONFIG_IS_ENABLED(BLKMAP) && CONFIG_IS_ENABLED(EFI_LOADER)) {
+ fdt_ret = fdt_efi_pmem_setup(blob);
+ if (fdt_ret)
+ goto err;
+ }
+
/* after here we are using a livetree */
if (!of_live_active() && CONFIG_IS_ENABLED(EVENT)) {
struct event_ft_fixup fixup;