From 39a9b033ceeca65b45917094cc9099a610f0185e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 26 Jan 2025 11:43:27 -0700 Subject: vbe: Tidy up a few comments Join the comment block for the fit_image_load() call back to where it should be. Also fix a debug statement. Signed-off-by: Simon Glass --- boot/vbe_common.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'boot/vbe_common.c') diff --git a/boot/vbe_common.c b/boot/vbe_common.c index 0d51fe762c3..009bbcd3e76 100644 --- a/boot/vbe_common.c +++ b/boot/vbe_common.c @@ -202,14 +202,6 @@ int vbe_read_fit(struct udevice *blk, ulong area_offset, ulong area_size, phase = IS_ENABLED(CONFIG_TPL_BUILD) ? IH_PHASE_NONE : IS_ENABLED(CONFIG_VPL_BUILD) ? IH_PHASE_SPL : IH_PHASE_U_BOOT; - /* - * Load the image from the FIT. We ignore any load-address information - * so in practice this simply locates the image in the external-data - * region and returns its address and size. Since we only loaded the FIT - * itself, only a part of the image will be present, at best. - */ - fit_uname = NULL; - fit_uname_config = NULL; log_debug("loading FIT\n"); if (xpl_phase() == PHASE_SPL && !IS_ENABLED(CONFIG_SANDBOX)) { @@ -220,11 +212,19 @@ int vbe_read_fit(struct udevice *blk, ulong area_offset, ulong area_size, log_debug("doing SPL from %s blksz %lx log2blksz %x area_offset %lx + fdt_size %lx\n", blk->name, desc->blksz, desc->log2blksz, area_offset, ALIGN(size, 4)); ret = spl_load_simple_fit(image, &info, area_offset, buf); - log_debug("spl_load_abrec_fit() ret=%d\n", ret); + log_debug("spl_load_simple_fit() ret=%d\n", ret); return ret; } + /* + * Load the image from the FIT. We ignore any load-address information + * so in practice this simply locates the image in the external-data + * region and returns its address and size. Since we only loaded the FIT + * itself, only a part of the image will be present, at best. + */ + fit_uname = NULL; + fit_uname_config = NULL; ret = fit_image_load(&images, addr, &fit_uname, &fit_uname_config, IH_ARCH_DEFAULT, image_ph(phase, IH_TYPE_FIRMWARE), BOOTSTAGE_ID_FIT_SPL_START, FIT_LOAD_IGNORED, -- cgit v1.2.3 From f4415f2a375c6dab4b8b20a40d4c7ec15f1e951e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 26 Jan 2025 11:43:28 -0700 Subject: vbe: Allow VBE to disable adding loadables to the FDT When VBE operates within VPL it does not want the FDT to be changed. Provide a way to disable this feature. Move the FIT_IMAGE_TINY condition out of spl_fit_record_loadable() so that both conditions are together. This makes the code easier to understand. Replace the existing fit_loaded member, which is no-longer used. Signed-off-by: Simon Glass --- boot/vbe_common.c | 1 + 1 file changed, 1 insertion(+) (limited to 'boot/vbe_common.c') diff --git a/boot/vbe_common.c b/boot/vbe_common.c index 009bbcd3e76..801ab9da045 100644 --- a/boot/vbe_common.c +++ b/boot/vbe_common.c @@ -208,6 +208,7 @@ int vbe_read_fit(struct udevice *blk, ulong area_offset, ulong area_size, struct spl_load_info info; spl_load_init(&info, h_vbe_load_read, desc, desc->blksz); + xpl_set_fdt_update(&info, false); xpl_set_phase(&info, IH_PHASE_U_BOOT); log_debug("doing SPL from %s blksz %lx log2blksz %x area_offset %lx + fdt_size %lx\n", blk->name, desc->blksz, desc->log2blksz, area_offset, ALIGN(size, 4)); -- cgit v1.2.3 From f1eb367d76c9b28053b3adcb6bdeb865c6eda5fd Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 26 Jan 2025 11:43:29 -0700 Subject: vbe: Add an implementation of VBE-ABrec So far only VBE-simple is implemented in U-Boot. This supports a single image which can be updated in situ. It is often necessary to support two images (A and B) so that the board is not bricked if the update is interrupted or is bad. In some cases, a non-updatable recovery image is desirable, so that the board can be returned to a known-good state in the event of a serious failure. Introduce ABrec which provides these features. It supports three independent images and the logic to select the desired one on boot. While we are here, fix a debug message to indicate the function it called. Provide a maintainers entry for VBE. Note that fwupdated only supports VBE-simple so far, but supports for ABrec will appear in time. Signed-off-by: Simon Glass --- boot/vbe_common.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'boot/vbe_common.c') diff --git a/boot/vbe_common.c b/boot/vbe_common.c index 801ab9da045..a86986d86e9 100644 --- a/boot/vbe_common.c +++ b/boot/vbe_common.c @@ -374,3 +374,8 @@ int vbe_read_fit(struct udevice *blk, ulong area_offset, ulong area_size, return 0; } + +ofnode vbe_get_node(void) +{ + return ofnode_path("/bootstd/firmware0"); +} -- cgit v1.2.3