diff options
author | Tom Rini <trini@konsulko.com> | 2024-10-11 12:23:25 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-10-11 12:23:25 -0600 |
commit | 47e544f576699ca4630e20448db6a05178960697 (patch) | |
tree | f31951120512ac41f145dc0fcf6b0bbdfe5b9c01 /boot | |
parent | 5d899fc58c44fe5623e31524da2205d8597a53d1 (diff) | |
parent | 0220a68c25cbfdfa495927f83abf0b1d4ebd823b (diff) | |
download | u-boot-master.zip u-boot-master.tar.gz u-boot-master.tar.bz2 |
Simon Glass <sjg@chromium.org> says:
When the SPL build-phase was first created it was designed to solve a
particular problem (the need to init SDRAM so that U-Boot proper could
be loaded). It has since expanded to become an important part of U-Boot,
with three phases now present: TPL, VPL and SPL
Due to this history, the term 'SPL' is used to mean both a particular
phase (the one before U-Boot proper) and all the non-proper phases.
This has become confusing.
For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL'
phases, not just SPL. So code which can only be compiled for actual SPL,
for example, must use something like this:
#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
In Makefiles we have similar issues. SPL_ has been used as a variable
which expands to either SPL_ or nothing, to chose between options like
CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable
was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was
updated to support 'VPL_' as well.
This series starts a change in terminology and usage to resolve the
above issues:
- The word 'xPL' is used instead of 'SPL' to mean a non-proper build
- A new CONFIG_XPL_BUILD define indicates that the current build is an
'xPL' build
- The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now
defined for TPL and VPL phases
- The existing SPL_ Makefile variable is renamed to SPL_
- The existing SPL_TPL Makefile variable is renamed to PHASE_
It should be noted that xpl_phase() can generally be used instead of
the above CONFIGs without a code-space or run-time penalty.
This series does not attempt to convert all of U-Boot to use this new
terminology but it makes a start. In particular, renaming spl.h and
common/spl seems like a bridge too far at this point.
The series is fully bisectable. It has also been checked to ensure there
are no code-size changes on any commit.
Diffstat (limited to 'boot')
-rw-r--r-- | boot/Makefile | 86 | ||||
-rw-r--r-- | boot/fdt_simplefb.c | 2 | ||||
-rw-r--r-- | boot/image-android-dt.c | 2 | ||||
-rw-r--r-- | boot/image-android.c | 2 | ||||
-rw-r--r-- | boot/image-fit-sig.c | 2 | ||||
-rw-r--r-- | boot/vbe_simple_fw.c | 4 |
6 files changed, 48 insertions, 50 deletions
diff --git a/boot/Makefile b/boot/Makefile index f4675d6..b24f806 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -3,7 +3,7 @@ # (C) Copyright 2004-2006 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. -ifndef CONFIG_SPL_BUILD +ifndef CONFIG_XPL_BUILD obj-$(CONFIG_BOOT_RETRY) += bootretry.o obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o @@ -19,56 +19,54 @@ obj-y += image.o image-board.o obj-$(CONFIG_ANDROID_AB) += android_ab.o obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o image-android-dt.o -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootdev-uclass.o -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow.o -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootmeth-uclass.o -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o - -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD_PROG) += prog_boot.o - -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX) += bootmeth_extlinux.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EXTLINUX_PXE) += bootmeth_pxe.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFILOADER) += bootmeth_efi.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_CROS) += bootm.o bootm_os.o bootmeth_cros.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_QFW) += bootmeth_qfw.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o -obj-$(CONFIG_$(SPL_TPL_)CEDIT) += cedit.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFI_BOOTMGR) += bootmeth_efi_mgr.o -ifdef CONFIG_$(SPL_TPL_)BOOTSTD_FULL -obj-$(CONFIG_$(SPL_TPL_)EXPO) += bootflow_menu.o -obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow_menu.o +obj-$(CONFIG_$(PHASE_)BOOTSTD) += bootdev-uclass.o +obj-$(CONFIG_$(PHASE_)BOOTSTD) += bootflow.o +obj-$(CONFIG_$(PHASE_)BOOTSTD) += bootmeth-uclass.o +obj-$(CONFIG_$(PHASE_)BOOTSTD) += bootstd-uclass.o + +obj-$(CONFIG_$(PHASE_)BOOTSTD_PROG) += prog_boot.o + +obj-$(CONFIG_$(PHASE_)BOOTMETH_EXTLINUX) += bootmeth_extlinux.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_EXTLINUX_PXE) += bootmeth_pxe.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_EFILOADER) += bootmeth_efi.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_CROS) += bootm.o bootm_os.o bootmeth_cros.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_QFW) += bootmeth_qfw.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_SCRIPT) += bootmeth_script.o +obj-$(CONFIG_$(PHASE_)CEDIT) += cedit.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_EFI_BOOTMGR) += bootmeth_efi_mgr.o +ifdef CONFIG_$(PHASE_)BOOTSTD_FULL +obj-$(CONFIG_$(PHASE_)EXPO) += bootflow_menu.o +obj-$(CONFIG_$(PHASE_)BOOTSTD) += bootflow_menu.o endif -obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o -obj-$(CONFIG_$(SPL_TPL_)FDT_SIMPLEFB) += fdt_simplefb.o +obj-$(CONFIG_$(PHASE_)OF_LIBFDT) += fdt_support.o +obj-$(CONFIG_$(PHASE_)FDT_SIMPLEFB) += fdt_simplefb.o -obj-$(CONFIG_$(SPL_TPL_)UPL) += upl_common.o -obj-$(CONFIG_$(SPL_TPL_)UPL_READ) += upl_read.o -obj-$(CONFIG_$(SPL_TPL_)UPL_WRITE) += upl_write.o +obj-$(CONFIG_$(PHASE_)UPL) += upl_common.o +obj-$(CONFIG_$(PHASE_)UPL_READ) += upl_read.o +obj-$(CONFIG_$(PHASE_)UPL_WRITE) += upl_write.o -obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o -obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += fdt_region.o -obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o -obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o -obj-$(CONFIG_$(SPL_TPL_)IMAGE_PRE_LOAD) += image-pre-load.o -obj-$(CONFIG_$(SPL_TPL_)IMAGE_SIGN_INFO) += image-sig.o -obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-fit-sig.o -obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o +obj-$(CONFIG_$(PHASE_)OF_LIBFDT) += image-fdt.o +obj-$(CONFIG_$(PHASE_)FIT_SIGNATURE) += fdt_region.o +obj-$(CONFIG_$(PHASE_)FIT) += image-fit.o +obj-$(CONFIG_$(XPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o +obj-$(CONFIG_$(PHASE_)IMAGE_PRE_LOAD) += image-pre-load.o +obj-$(CONFIG_$(PHASE_)IMAGE_SIGN_INFO) += image-sig.o +obj-$(CONFIG_$(PHASE_)FIT_SIGNATURE) += image-fit-sig.o +obj-$(CONFIG_$(PHASE_)FIT_CIPHER) += image-cipher.o obj-$(CONFIG_CMD_ADTIMG) += image-android-dt.o -ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o -endif +obj-$(CONFIG_$(PHASE_)LOAD_FIT) += common_fit.o -obj-$(CONFIG_$(SPL_TPL_)EXPO) += expo.o scene.o expo_build.o -obj-$(CONFIG_$(SPL_TPL_)EXPO) += scene_menu.o scene_textline.o +obj-$(CONFIG_$(PHASE_)EXPO) += expo.o scene.o expo_build.o +obj-$(CONFIG_$(PHASE_)EXPO) += scene_menu.o scene_textline.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE) += vbe.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_REQUEST) += vbe_request.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE) += vbe_simple.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_FW) += vbe_simple_fw.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_OS) += vbe_simple_os.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_VBE) += vbe.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_VBE_REQUEST) += vbe_request.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_VBE_SIMPLE) += vbe_simple.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_VBE_SIMPLE_FW) += vbe_simple_fw.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_VBE_SIMPLE_OS) += vbe_simple_os.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_ANDROID) += bootmeth_android.o +obj-$(CONFIG_$(PHASE_)BOOTMETH_ANDROID) += bootmeth_android.o diff --git a/boot/fdt_simplefb.c b/boot/fdt_simplefb.c index 5341554..71b833e 100644 --- a/boot/fdt_simplefb.c +++ b/boot/fdt_simplefb.c @@ -27,7 +27,7 @@ static int fdt_simplefb_configure_node(void *blob, int off) struct udevice *dev; int ret; - if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && spl_phase() > PHASE_SPL) { + if (IS_ENABLED(CONFIG_SPL_VIDEO_HANDOFF) && xpl_phase() > PHASE_SPL) { struct video_handoff *ho; ho = bloblist_find(BLOBLISTT_U_BOOT_VIDEO, sizeof(*ho)); diff --git a/boot/image-android-dt.c b/boot/image-android-dt.c index 3b25018..653835c 100644 --- a/boot/image-android-dt.c +++ b/boot/image-android-dt.c @@ -72,7 +72,7 @@ bool android_dt_get_fdt_by_index(ulong hdr_addr, u32 index, ulong *addr, return true; } -#if !defined(CONFIG_SPL_BUILD) +#if !defined(CONFIG_XPL_BUILD) static void android_dt_print_fdt_info(const struct fdt_header *fdt) { u32 fdt_size; diff --git a/boot/image-android.c b/boot/image-android.c index 8934491..e74dd49 100644 --- a/boot/image-android.c +++ b/boot/image-android.c @@ -656,7 +656,7 @@ bool android_image_get_dtb_by_index(ulong hdr_addr, ulong vendor_boot_img, return false; } -#if !defined(CONFIG_SPL_BUILD) +#if !defined(CONFIG_XPL_BUILD) /** * android_print_contents - prints out the contents of the Android format image * @hdr: pointer to the Android format image header diff --git a/boot/image-fit-sig.c b/boot/image-fit-sig.c index fe328df..35873b1 100644 --- a/boot/image-fit-sig.c +++ b/boot/image-fit-sig.c @@ -48,7 +48,7 @@ struct image_region *fit_region_make_list(const void *fit, * Use malloc() except in SPL (to save code size). In SPL the caller * must allocate the array. */ - if (!IS_ENABLED(CONFIG_SPL_BUILD) && !region) + if (!IS_ENABLED(CONFIG_XPL_BUILD) && !region) region = calloc(sizeof(*region), count); if (!region) return NULL; diff --git a/boot/vbe_simple_fw.c b/boot/vbe_simple_fw.c index 4d6da94..da9701f 100644 --- a/boot/vbe_simple_fw.c +++ b/boot/vbe_simple_fw.c @@ -157,7 +157,7 @@ static int simple_load_from_image(struct spl_image_info *spl_image, struct vbe_handoff *handoff; int ret; - if (spl_phase() != PHASE_VPL && spl_phase() != PHASE_SPL) + if (xpl_phase() != PHASE_VPL && xpl_phase() != PHASE_SPL) return -ENOENT; ret = bloblist_ensure_size(BLOBLISTT_VBE, sizeof(struct vbe_handoff), @@ -197,7 +197,7 @@ static int simple_load_from_image(struct spl_image_info *spl_image, bootflow_free(&bflow); /* Record that VBE was used in this phase */ - handoff->phases |= 1 << spl_phase(); + handoff->phases |= 1 << xpl_phase(); return 0; } |