Skip to content

Commit

Permalink
global: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Browse files Browse the repository at this point in the history
Complete this rename for all directories outside arch/ board/ drivers/
and include/

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
sjg20 authored and trini committed Oct 11, 2024
1 parent f38956a commit 1d6132e
Show file tree
Hide file tree
Showing 48 changed files with 78 additions and 78 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -1418,13 +1418,13 @@ Low Level (hardware related) configuration options:
This only takes effect if the memory commands are activated
globally (CONFIG_CMD_MEMORY).

- CONFIG_SPL_BUILD
- CONFIG_XPL_BUILD
Set when the currently running compilation is for an artifact
that will end up in one of the 'xPL' builds, i.e. SPL, TPL or
VPL. Code that needs phase-specific behaviour can check this,
or (where possible) use xpl_phase() instead.

Note that CONFIG_SPL_BUILD *is* always defined when either
Note that CONFIG_XPL_BUILD *is* always defined when either
of CONFIG_TPL_BUILD / CONFIG_VPL_BUILD is defined. This can be
counter-intuitive and should perhaps be changed.

Expand Down
2 changes: 1 addition & 1 deletion boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# (C) Copyright 2004-2006
# Wolfgang Denk, DENX Software Engineering, [email protected].

ifndef CONFIG_SPL_BUILD
ifndef CONFIG_XPL_BUILD

obj-$(CONFIG_BOOT_RETRY) += bootretry.o
obj-$(CONFIG_CMD_BOOTM) += bootm.o bootm_os.o
Expand Down
2 changes: 1 addition & 1 deletion boot/image-android-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion boot/image-android.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,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
Expand Down
2 changes: 1 addition & 1 deletion boot/image-fit-sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions cmd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# (C) Copyright 2004-2006
# Wolfgang Denk, DENX Software Engineering, [email protected].

ifndef CONFIG_SPL_BUILD
ifndef CONFIG_XPL_BUILD
# core command
obj-y += boot.o
obj-$(CONFIG_CMD_BOOTM) += bootm.o
Expand Down Expand Up @@ -247,7 +247,7 @@ obj-$(CONFIG_ARCH_MVEBU) += mvebu/
obj-$(CONFIG_ARCH_KEYSTONE) += ti/
obj-$(CONFIG_ARCH_K3) += ti/
obj-$(CONFIG_ARCH_OMAP2PLUS) += ti/
endif # !CONFIG_SPL_BUILD
endif # !CONFIG_XPL_BUILD

obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o

Expand Down
12 changes: 6 additions & 6 deletions cmd/nvedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/
#define MAX_ENV_SIZE (1 << 20) /* 1 MiB */

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
/*
* Command interface: print one or all environment variables
*
Expand Down Expand Up @@ -182,9 +182,9 @@ static int do_env_grep(struct cmd_tbl *cmdtp, int flag,
return 0;
}
#endif
#endif /* CONFIG_SPL_BUILD */
#endif /* CONFIG_XPL_BUILD */

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
static int do_env_set(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
Expand Down Expand Up @@ -503,9 +503,9 @@ static int do_env_select(struct cmd_tbl *cmdtp, int flag, int argc,
}
#endif

#endif /* CONFIG_SPL_BUILD */
#endif /* CONFIG_XPL_BUILD */

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
static int do_env_default(struct cmd_tbl *cmdtp, int flag,
int argc, char *const argv[])
{
Expand Down Expand Up @@ -1289,4 +1289,4 @@ U_BOOT_CMD_COMPLETE(
var_complete
);
#endif
#endif /* CONFIG_SPL_BUILD */
#endif /* CONFIG_XPL_BUILD */
8 changes: 4 additions & 4 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Wolfgang Denk, DENX Software Engineering, [email protected].

# core
ifndef CONFIG_SPL_BUILD
ifndef CONFIG_XPL_BUILD
obj-y += init/
obj-y += main.o
obj-y += exports.o
Expand Down Expand Up @@ -42,12 +42,12 @@ obj-$(CONFIG_MENU) += menu.o
obj-$(CONFIG_UPDATE_COMMON) += update.o
obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o

endif # !CONFIG_SPL_BUILD
endif # !CONFIG_XPL_BUILD

obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o
obj-$(CONFIG_$(SPL_TPL_)BLOBLIST) += bloblist.o

ifdef CONFIG_SPL_BUILD
ifdef CONFIG_XPL_BUILD
ifdef CONFIG_SPL_DFU
obj-$(CONFIG_DFU_OVER_USB) += dfu.o
endif
Expand All @@ -58,7 +58,7 @@ obj-$(CONFIG_SPL_USB_STORAGE) += usb_storage.o
obj-$(CONFIG_SPL_MUSB_NEW) += usb.o
obj-$(CONFIG_SPL_SPLASH_SCREEN) += splash.o
obj-$(CONFIG_SPL_SPLASH_SOURCE) += splash_source.o
endif # CONFIG_SPL_BUILD
endif # CONFIG_XPL_BUILD

#others
obj-$(CONFIG_DDR_SPD) += ddr_spd.o
Expand Down
2 changes: 1 addition & 1 deletion common/cli_readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static char *delete_char (char *buffer, char *p, int *colp, int *np, int plen)
#define getcmd_getch() getchar()
#define getcmd_cbeep() getcmd_putch('\a')

#ifdef CONFIG_SPL_BUILD
#ifdef CONFIG_XPL_BUILD
#define HIST_MAX 3
#define HIST_SIZE 32
#else
Expand Down
2 changes: 1 addition & 1 deletion common/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int console_setfile(int file, struct stdio_dev * dev)
/* Assign the new device (leaving the existing one started) */
stdio_devices[file] = dev;

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
/*
* Update monitor functions
* (to use the console stuff by other applications)
Expand Down
2 changes: 1 addition & 1 deletion common/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ int hash_block(const char *algo_name, const void *data, unsigned int len,
return 0;
}

#if !defined(CONFIG_SPL_BUILD) && (defined(CONFIG_CMD_HASH) || \
#if !defined(CONFIG_XPL_BUILD) && (defined(CONFIG_CMD_HASH) || \
defined(CONFIG_CMD_SHA1SUM) || defined(CONFIG_CMD_CRC32)) || \
defined(CONFIG_CMD_MD5SUM)
/**
Expand Down
2 changes: 1 addition & 1 deletion common/spl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Based on common/Makefile.
#

ifdef CONFIG_SPL_BUILD
ifdef CONFIG_XPL_BUILD
obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
obj-$(CONFIG_$(SPL_TPL_)BOOTROM_SUPPORT) += spl_bootrom.o
obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += spl_fit.o
Expand Down
2 changes: 1 addition & 1 deletion common/splash_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int splash_init_virtio(void)
}
}

#if defined(CONFIG_CMD_UBIFS) && !defined(CONFIG_SPL_BUILD)
#if defined(CONFIG_CMD_UBIFS) && !defined(CONFIG_XPL_BUILD)
static int splash_mount_ubifs(struct splash_location *location)
{
int res;
Expand Down
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VENDOR :=

ARCH := $(CONFIG_SYS_ARCH:"%"=%)
CPU := $(CONFIG_SYS_CPU:"%"=%)
ifdef CONFIG_SPL_BUILD
ifdef CONFIG_XPL_BUILD
ifdef CONFIG_ARCH_TEGRA
CPU := arm720t
endif
Expand Down
2 changes: 1 addition & 1 deletion disk/part.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
}
#endif

#if IS_ENABLED(CONFIG_CMD_UBIFS) && !IS_ENABLED(CONFIG_SPL_BUILD)
#if IS_ENABLED(CONFIG_CMD_UBIFS) && !IS_ENABLED(CONFIG_XPL_BUILD)
/*
* Special-case ubi, ubi goes through a mtd, rather than through
* a regular block device.
Expand Down
2 changes: 1 addition & 1 deletion disk/part_dos.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int test_block_type(unsigned char *buffer)

static int part_test_dos(struct blk_desc *desc)
{
#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr,
DIV_ROUND_UP(desc->blksz, sizeof(legacy_mbr)));

Expand Down
4 changes: 2 additions & 2 deletions doc/develop/distro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ TO BE UPDATED:

In your board configuration file, include the following::

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
#include <config_distro_bootcmd.h>
#endif

Expand Down Expand Up @@ -316,7 +316,7 @@ that it supports the correct set of possible boot device types. To provide this
configuration, simply define macro BOOT_TARGET_DEVICES prior to including
<config_distro_bootcmd.h>. For example::

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 1) \
func(MMC, mmc, 0) \
Expand Down
2 changes: 1 addition & 1 deletion doc/develop/qconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Available options
Look for moved config options in spl/include/autoconf.mk instead of
include/autoconf.mk. This is useful for moving options for SPL build
because SPL related options (mostly prefixed with CONFIG_SPL\_) are
sometimes blocked by CONFIG_SPL_BUILD ifdef conditionals.
sometimes blocked by CONFIG_XPL_BUILD ifdef conditionals.

-j, --jobs
Specify the number of threads to run simultaneously. If not specified,
Expand Down
2 changes: 1 addition & 1 deletion doc/develop/tests_sandbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Whatever sandbox build is used, which tests are present is determined by which
source files are built. For sandbox_spl, the of_platdata tests are built
because of the build rule in test/dm/Makefile::

ifeq ($(CONFIG_SPL_BUILD),y)
ifeq ($(CONFIG_XPL_BUILD),y)
obj-$(CONFIG_SPL_OF_PLATDATA) += of_platdata.o
else
...other tests for non-spl
Expand Down
2 changes: 1 addition & 1 deletion dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ PHONY += arch-dtbs
arch-dtbs:
$(Q)$(MAKE) $(build)=$(dt_dir) dtbs

ifeq ($(CONFIG_SPL_BUILD),y)
ifeq ($(CONFIG_XPL_BUILD),y)
obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
# support "out-of-tree" build for dtb-spl
$(obj)/dt-spl.dtb.o: $(obj)/dt-spl.dtb.S FORCE
Expand Down
2 changes: 1 addition & 1 deletion env/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += env.o
obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += attr.o
obj-$(CONFIG_$(SPL_TPL_)ENV_SUPPORT) += flags.o

ifndef CONFIG_SPL_BUILD
ifndef CONFIG_XPL_BUILD
obj-y += callback.o
obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
obj-$(CONFIG_ENV_IS_IN_EEPROM) += embedded.o
Expand Down
4 changes: 2 additions & 2 deletions env/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int env_do_env_set(int flag, int argc, char *const argv[], int env_flag)

debug("Initial value for argc=%d\n", argc);

#if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_CMD_NVEDIT_EFI)
#if !IS_ENABLED(CONFIG_XPL_BUILD) && IS_ENABLED(CONFIG_CMD_NVEDIT_EFI)
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'e')
return do_env_set_efi(NULL, flag, --argc, ++argv);
#endif
Expand Down Expand Up @@ -551,7 +551,7 @@ int env_export(env_t *env_out)
void env_relocate(void)
{
if (gd->env_valid == ENV_INVALID) {
#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_SPL_BUILD)
#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_XPL_BUILD)
/* Environment not changable */
env_set_default(NULL, 0);
#else
Expand Down
4 changes: 2 additions & 2 deletions env/fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <asm/global_data.h>
#include <linux/stddef.h>

#ifdef CONFIG_SPL_BUILD
#ifdef CONFIG_XPL_BUILD
/* TODO([email protected]): Figure out why this is needed */
# if !defined(CONFIG_TARGET_AM335X_EVM) || defined(CONFIG_SPL_OS_BOOT)
# define LOADENV
Expand Down Expand Up @@ -129,7 +129,7 @@ static int env_fat_load(void)
if (!strcmp(ifname, "mmc"))
mmc_initialize(NULL);
#endif
#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
#if defined(CONFIG_AHCI) || defined(CONFIG_SCSI)
if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "scsi"))
scsi_scan(true);
Expand Down
6 changes: 3 additions & 3 deletions env/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

DECLARE_GLOBAL_DATA_PTR;

#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
# if defined(CONFIG_CMD_SAVEENV) && defined(CONFIG_CMD_FLASH)
# include <flash.h>
# define CMD_SAVEENV
Expand All @@ -35,11 +35,11 @@ DECLARE_GLOBAL_DATA_PTR;
#if (!defined(CONFIG_MICROBLAZE) && !defined(CONFIG_ARCH_ZYNQ) && \
!defined(CONFIG_TARGET_MCCMON6) && !defined(CONFIG_TARGET_X600) && \
!defined(CONFIG_TARGET_EDMINIV2)) || \
!defined(CONFIG_SPL_BUILD)
!defined(CONFIG_XPL_BUILD)
#define LOADENV
#endif

#if !defined(CONFIG_TARGET_X600) || !defined(CONFIG_SPL_BUILD)
#if !defined(CONFIG_TARGET_X600) || !defined(CONFIG_XPL_BUILD)
#define INITENV
#endif

Expand Down
6 changes: 3 additions & 3 deletions env/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
mmc_set_env_part_restore(mmc);
}

#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_SPL_BUILD)
#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_XPL_BUILD)
static inline int write_env(struct mmc *mmc, unsigned long size,
unsigned long offset, const void *buffer)
{
Expand Down Expand Up @@ -368,7 +368,7 @@ static int env_mmc_erase(void)
fini_mmc_for_env(mmc);
return ret;
}
#endif /* CONFIG_CMD_SAVEENV && !CONFIG_SPL_BUILD */
#endif /* CONFIG_CMD_SAVEENV && !CONFIG_XPL_BUILD */

static inline int read_env(struct mmc *mmc, unsigned long size,
unsigned long offset, const void *buffer)
Expand Down Expand Up @@ -498,7 +498,7 @@ U_BOOT_ENV_LOCATION(mmc) = {
.location = ENVL_MMC,
ENV_NAME("MMC")
.load = env_mmc_load,
#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_SPL_BUILD)
#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_XPL_BUILD)
.save = env_save_ptr(env_mmc_save),
.erase = ENV_ERASE_PTR(env_mmc_erase)
#endif
Expand Down
8 changes: 4 additions & 4 deletions env/nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include <u-boot/crc.h>

#if defined(CONFIG_CMD_SAVEENV) && defined(CONFIG_CMD_NAND) && \
!defined(CONFIG_SPL_BUILD)
!defined(CONFIG_XPL_BUILD)
#define CMD_SAVEENV
#elif defined(CONFIG_ENV_OFFSET_REDUND) && !defined(CONFIG_SPL_BUILD)
#elif defined(CONFIG_ENV_OFFSET_REDUND) && !defined(CONFIG_XPL_BUILD)
#error CONFIG_ENV_OFFSET_REDUND must have CONFIG_CMD_SAVEENV & CONFIG_CMD_NAND
#endif

Expand Down Expand Up @@ -224,7 +224,7 @@ static int env_nand_save(void)
}
#endif /* CMD_SAVEENV */

#if defined(CONFIG_SPL_BUILD)
#if defined(CONFIG_XPL_BUILD)
static int readenv(size_t offset, u_char *buf)
{
return nand_spl_load_image(offset, CONFIG_ENV_SIZE, buf);
Expand Down Expand Up @@ -265,7 +265,7 @@ static int readenv(size_t offset, u_char *buf)

return 0;
}
#endif /* #if defined(CONFIG_SPL_BUILD) */
#endif /* #if defined(CONFIG_XPL_BUILD) */

#ifdef CONFIG_ENV_OFFSET_OOB
int get_nand_env_oob(struct mtd_info *mtd, unsigned long *result)
Expand Down
2 changes: 1 addition & 1 deletion env/nowhere.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int env_nowhere_load(void)
* searches default_environment array in that case.
* For U-Boot proper, import the default environment to allow reload.
*/
if (!IS_ENABLED(CONFIG_SPL_BUILD))
if (!IS_ENABLED(CONFIG_XPL_BUILD))
env_set_default(NULL, 0);

gd->env_valid = ENV_INVALID;
Expand Down
Loading

0 comments on commit 1d6132e

Please sign in to comment.