···11# SPDX-License-Identifier: GPL-2.0+
2233-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_ARCH_TEGRA),yy)
33+ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_ARCH_TEGRA),yy)
44CONFIG_CPU_V7A=
55CONFIG_CPU_ARM720T=y
66endif
···24242525# On Tegra systems we must build SPL for the armv4 core on the device
2626# but otherwise we can use the value in CONFIG_SYS_ARM_ARCH
2727-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_ARCH_TEGRA),yy)
2727+ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_ARCH_TEGRA),yy)
2828arch-y += -D__LINUX_ARM_ARCH__=4
2929else
3030arch-y += -D__LINUX_ARM_ARCH__=$(CONFIG_SYS_ARM_ARCH)
···106106107107head-y := arch/arm/cpu/$(CPU)/start.o
108108109109-ifeq ($(CONFIG_SPL_BUILD),y)
109109+ifeq ($(CONFIG_XPL_BUILD),y)
110110ifeq ($(CONFIG_SYS_SOC)$(CONFIG_SPL_FRAMEWORK),"mxs")
111111head-y := arch/arm/cpu/arm926ejs/mxs/start.o
112112endif
+3-3
arch/arm/config.mk
···9999ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
100100# This file is parsed many times, so the string may get added multiple
101101# times. Also, the prefix needs to be different based on whether
102102-# CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
102102+# CONFIG_XPL_BUILD is defined or not. 'filter-out' the existing entry
103103# before adding the correct one.
104104PLATFORM_LIBS := arch/arm/lib/eabi_compat.o \
105105 $(filter-out arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
···126126endif
127127endif
128128129129-ifneq ($(CONFIG_SPL_BUILD),y)
129129+ifneq ($(CONFIG_XPL_BUILD),y)
130130# Check that only R_ARM_RELATIVE relocations are generated.
131131INPUTS-y += checkarmreloc
132132# The movt / movw can hardcode 16 bit parts of the addresses in the
···160160ifdef CONFIG_MACH_IMX
161161ifneq ($(CONFIG_IMX_CONFIG),"")
162162ifdef CONFIG_SPL
163163-ifndef CONFIG_SPL_BUILD
163163+ifndef CONFIG_XPL_BUILD
164164INPUTS-y += SPL
165165endif
166166else
···6565 * When booting from NAND - it has definitely been a reset, so, no need
6666 * to flush caches and disable the MMU
6767 */
6868-#ifndef CONFIG_SPL_BUILD
6868+#ifndef CONFIG_XPL_BUILD
6969 /*
7070 * flush v4 I/D caches
7171 */
···3232 *
3333 * we turn off caches etc ...
3434 */
3535-#ifndef CONFIG_SPL_BUILD
3535+#ifndef CONFIG_XPL_BUILD
3636 disable_interrupts();
3737#endif
3838
+2-2
arch/arm/cpu/armv7/lowlevel_init.S
···2626 /*
2727 * Setup a temporary stack. Global data is not available yet.
2828 */
2929-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
2929+#if defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_STACK)
3030 ldr sp, =CONFIG_SPL_STACK
3131#else
3232 ldr sp, =SYS_INIT_SP_ADDR
···3939 * Set up global data for boards that still need it. This will be
4040 * removed soon.
4141 */
4242-#ifdef CONFIG_SPL_BUILD
4242+#ifdef CONFIG_XPL_BUILD
4343 ldr r9, =gdata
4444#else
4545 sub sp, sp, #GD_SIZE
···10161016 * running however really wants to have dcache and the MMU active. Check that
10171017 * everything is sane and give the developer a hint if it isn't.
10181018 */
10191019-#ifndef CONFIG_SPL_BUILD
10191019+#ifndef CONFIG_XPL_BUILD
10201020#error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
10211021#endif
10221022
···33 * Copyright 2019 NXP
44 */
5566-#if defined(CONFIG_SPL_BUILD)
66+#if defined(CONFIG_XPL_BUILD)
77 /*
88 * We use absolute address not PC relative address to jump.
99 * When running SPL on iMX8, the A core starts at address 0, a alias to OCRAM 0x100000,
···1414int mxsmmc_initialize(struct bd_info *bis, int id, int (*wp)(int),
1515 int (*cd)(int));
16161717-#ifdef CONFIG_SPL_BUILD
1717+#ifdef CONFIG_XPL_BUILD
18181919#if defined(CONFIG_MX23)
2020#include <asm/arch/iomux-mx23.h>
+2-2
arch/arm/include/asm/arch-rk3066/boot0.h
···1010 * (containing the magic 'RK30'). This magic constant will be written into
1111 * the final image by the rkimage tool, but we need to reserve space for it here.
1212 */
1313-#ifdef CONFIG_SPL_BUILD
1313+#ifdef CONFIG_XPL_BUILD
1414 b 1f /* if overwritten, entry-address is at the next word */
15151:
1616#endif
···6868 pop {r1-r12, pc}
6969#endif
70707171-#if (defined(CONFIG_SPL_BUILD))
7171+#if (defined(CONFIG_XPL_BUILD))
7272/* U-Boot proper of armv7 does not need this */
7373 b reset
7474#endif
+3-3
arch/arm/include/asm/arch-rockchip/boot0.h
···1212 * To make life easier for everyone, we build the SPL binary with
1313 * space for this 4-byte header already included in the binary.
1414 */
1515-#ifdef CONFIG_SPL_BUILD
1515+#ifdef CONFIG_XPL_BUILD
1616 /*
1717 * We need to add 4 bytes of space for the 'RK33' at the
1818 * beginning of the executable. However, as we want to keep
···3939 .word 0
4040#endif
41414242-#if (defined(CONFIG_SPL_BUILD) || defined(CONFIG_ARM64))
4242+#if (defined(CONFIG_XPL_BUILD) || defined(CONFIG_ARM64))
4343 /* U-Boot proper of armv7 do not need this */
4444 b reset
4545#endif
···5454 ARM_VECTORS
5555#endif
56565757-#if !defined(CONFIG_TPL_BUILD) && defined(CONFIG_SPL_BUILD) && \
5757+#if !defined(CONFIG_TPL_BUILD) && defined(CONFIG_XPL_BUILD) && \
5858 (CONFIG_ROCKCHIP_SPL_RESERVE_IRAM > 0)
5959 .space CONFIG_ROCKCHIP_SPL_RESERVE_IRAM /* space for the ATF data */
6060#endif
···102102103103#if defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_NEEDS_SEPARATE_STACK)
104104 ldr r0, =(CONFIG_TPL_STACK)
105105-#elif defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
105105+#elif defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_STACK)
106106 ldr r0, =(CONFIG_SPL_STACK)
107107#else
108108 ldr r0, =(SYS_INIT_SP_ADDR)
···119119 bl debug_uart_init
120120#endif
121121122122-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_EARLY_BSS)
122122+#if defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_EARLY_BSS)
123123 CLEAR_BSS
124124#endif
125125126126 mov r0, #0
127127 bl board_init_f
128128129129-#if ! defined(CONFIG_SPL_BUILD)
129129+#if ! defined(CONFIG_XPL_BUILD)
130130131131/*
132132 * Set up intermediate environment (new sp and gd) and call
···171171172172 bl c_runtime_cpu_setup /* we still call old routine here */
173173#endif
174174-#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
174174+#if !defined(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
175175176176-#if !defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_EARLY_BSS)
176176+#if !defined(CONFIG_XPL_BUILD) || !defined(CONFIG_SPL_EARLY_BSS)
177177 CLEAR_BSS
178178#endif
179179180180-# ifdef CONFIG_SPL_BUILD
180180+# ifdef CONFIG_XPL_BUILD
181181 /* Use a DRAM stack for the rest of SPL, if requested */
182182 bl spl_relocate_stack_gd
183183 cmp r0, #0
···185185 movne r9, r0
186186# endif
187187188188-#if ! defined(CONFIG_SPL_BUILD)
188188+#if ! defined(CONFIG_XPL_BUILD)
189189 bl coloured_LED_init
190190 bl red_led_on
191191#endif
+5-5
arch/arm/lib/crt0_64.S
···7171 */
7272#if defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_NEEDS_SEPARATE_STACK)
7373 ldr x0, =(CONFIG_TPL_STACK)
7474-#elif defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
7474+#elif defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_STACK)
7575 ldr x0, =(CONFIG_SPL_STACK)
7676#elif defined(CONFIG_INIT_SP_RELATIVE)
7777#if CONFIG_POSITION_INDEPENDENT
···9999 mov x0, #0
100100 bl board_init_f
101101102102-#if !defined(CONFIG_SPL_BUILD)
102102+#if !defined(CONFIG_XPL_BUILD)
103103/*
104104 * Set up intermediate environment (new sp and gd) and call
105105 * relocate_code(addr_moni). Trick here is that we'll return
···139139 * Set up final (full) environment
140140 */
141141 bl c_runtime_cpu_setup /* still call old routine */
142142-#endif /* !CONFIG_SPL_BUILD */
143143-#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
144144-#if defined(CONFIG_SPL_BUILD)
142142+#endif /* !CONFIG_XPL_BUILD */
143143+#if !defined(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
144144+#if defined(CONFIG_XPL_BUILD)
145145 bl spl_relocate_stack_gd /* may return NULL */
146146 /* set up gd here, outside any C code, if new stack is returned */
147147 cmp x0, #0
+1-1
arch/arm/lib/eabi_compat.c
···1212int raise (int signum)
1313{
1414 /* Even if printf() is available, it's large. Punt it for SPL builds */
1515-#if !defined(CONFIG_SPL_BUILD)
1515+#if !defined(CONFIG_XPL_BUILD)
1616 printf("raise: Signal # %d caught\n", signum);
1717#endif
1818 return 0;
···126126 * via YMODEM. This is done to avoid disturbing the YMODEM serial
127127 * protocol transactions.
128128 */
129129- if (!(IS_ENABLED(CONFIG_SPL_BUILD) &&
129129+ if (!(IS_ENABLED(CONFIG_XPL_BUILD) &&
130130 IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) &&
131131 spl_boot_device() == BOOT_DEVICE_UART))
132132 printf("Authentication passed\n");
···134134 * via YMODEM. This is done to avoid disturbing the YMODEM serial
135135 * protocol transactions.
136136 */
137137- if (!(IS_ENABLED(CONFIG_SPL_BUILD) &&
137137+ if (!(IS_ENABLED(CONFIG_XPL_BUILD) &&
138138 IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) &&
139139 spl_boot_device() == BOOT_DEVICE_UART))
140140 printf("Authentication passed\n");
···16161717ENTRY(lowlevel_init)
18181919-#ifndef CONFIG_SPL_BUILD
1919+#ifndef CONFIG_XPL_BUILD
2020 /* Return to U-Boot via saved link register */
2121 mov pc, lr
2222#else
···3636/* SOC specific definations */
3737#define INTREG_BASE 0xd0000000
3838#define INTREG_BASE_ADDR_REG (INTREG_BASE + 0x20080)
3939-#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_ARMADA_3700)
3939+#if defined(CONFIG_XPL_BUILD) || defined(CONFIG_ARMADA_3700)
4040/*
4141 * The SPL U-Boot version still runs with the default
4242 * address for the internal registers, configured by
···2424#include <asm/omap_gpio.h>
2525#include <asm/emif.h>
26262727-#ifndef CONFIG_SPL_BUILD
2727+#ifndef CONFIG_XPL_BUILD
2828/*
2929 * printing to console doesn't work unless
3030 * this code is executed from SPL
+1-1
arch/arm/mach-omap2/config.mk
···5566include $(srctree)/arch/arm/mach-omap2/config_secure.mk
7788-ifdef CONFIG_SPL_BUILD
88+ifdef CONFIG_XPL_BUILD
99ifeq ($(CONFIG_TI_SECURE_DEVICE),y) # Refer to README.ti-secure for more info
1010# On DRA7xx/AM57xx:
1111#
···146146 * then set cs_cfg to the appropriate value then try and
147147 * setup CS1.
148148 */
149149-#ifdef CONFIG_SPL_BUILD
149149+#ifdef CONFIG_XPL_BUILD
150150 /* set/modify board-specific timings */
151151 get_board_mem_timings(&timings);
152152#endif
···166166167167 writel(ENADLL | DLLPHASE_90, &sdrc_base->dlla_ctrl);
168168 sdelay(0x20000);
169169-#ifdef CONFIG_SPL_BUILD
169169+#ifdef CONFIG_XPL_BUILD
170170 write_sdrc_timings(CS0, sdrc_actim_base0, &timings);
171171 make_cs1_contiguous();
172172 write_sdrc_timings(CS1, sdrc_actim_base1, &timings);
+1-1
arch/arm/mach-omap2/omap5/hwinit.c
···5050 writel(pad->val, base + pad->offset);
5151}
52525353-#ifdef CONFIG_SPL_BUILD
5353+#ifdef CONFIG_XPL_BUILD
5454/* LPDDR2 specific IO settings */
5555static void io_settings_lpddr2(void)
5656{
+1-1
arch/arm/mach-omap2/sec-common.c
···178178 * via YMODEM. This is done to avoid disturbing the YMODEM serial
179179 * protocol transactions.
180180 */
181181- if (!(IS_ENABLED(CONFIG_SPL_BUILD) &&
181181+ if (!(IS_ENABLED(CONFIG_XPL_BUILD) &&
182182 IS_ENABLED(CONFIG_SPL_YMODEM_SUPPORT) &&
183183 spl_boot_device() == BOOT_DEVICE_UART))
184184 printf("Authentication passed\n");
+1-1
arch/arm/mach-orion5x/cpu.c
···235235 /* Enable and invalidate L2 cache in write through mode */
236236 invalidate_l2_cache();
237237238238-#ifdef CONFIG_SPL_BUILD
238238+#ifdef CONFIG_XPL_BUILD
239239 orion5x_config_adr_windows();
240240#endif
241241
+2-2
arch/arm/mach-orion5x/lowlevel_init.S
···69697070lowlevel_init:
71717272-#ifdef CONFIG_SPL_BUILD
7272+#ifdef CONFIG_XPL_BUILD
73737474 /* Use 'r2 as the base for internal register accesses */
7575 ldr r2, =ORION5X_REGS_PHY_BASE
···280280 ldr r0, =0x7fff0001
281281 str r0, [r3, #0x504]
282282283283-#endif /* CONFIG_SPL_BUILD */
283283+#endif /* CONFIG_XPL_BUILD */
284284285285 /* Return to U-Boot via saved link register */
286286 mov pc, lr
···15151616obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
17171818-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
1818+ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
19192020# Always include boot_mode.o, as we bypass it (i.e. turn it off)
2121# inside of boot_mode.c when CONFIG_ROCKCHIP_BOOT_MODE_REG is 0. This way,
···5151obj-spl-$(CONFIG_TPL_BUILD) =
52525353# Now add SPL/TPL objects back into the main build
5454-obj-$(CONFIG_SPL_BUILD) += $(obj-spl-y)
5454+obj-$(CONFIG_XPL_BUILD) += $(obj-spl-y)
5555obj-$(CONFIG_TPL_BUILD) += $(obj-tpl-y)
+1-1
arch/arm/mach-rockchip/px30/px30.c
···244244 static struct px30_cru * const cru = (void *)CRU_BASE;
245245 u32 __maybe_unused val;
246246247247-#ifdef CONFIG_SPL_BUILD
247247+#ifdef CONFIG_XPL_BUILD
248248 /* We do some SoC one time setting here. */
249249 /* Disable the ddr secure region setting to make it non-secure */
250250 writel(0x0, DDR_FW_BASE + FW_DDR_CON);
···27272828void spl_board_init(void)
2929{
3030- if (!IS_ENABLED(CONFIG_SPL_BUILD))
3030+ if (!IS_ENABLED(CONFIG_XPL_BUILD))
3131 return;
32323333 if (IS_ENABLED(CONFIG_SPL_DM_MMC)) {
···62626363int arch_cpu_init(void)
6464{
6565-#ifdef CONFIG_SPL_BUILD
6565+#ifdef CONFIG_XPL_BUILD
6666 u32 reg;
67676868 /* We do some SoC one time setting here. */
+1-1
arch/arm/mach-rockchip/rk3368/rk3368.c
···9393}
9494#endif
95959696-#ifdef CONFIG_SPL_BUILD
9696+#ifdef CONFIG_XPL_BUILD
9797/*
9898 * The SPL (and also the full U-Boot stage on the RK3368) will run in
9999 * secure mode (i.e. EL3) and an ATF will eventually be booted before
···105105106106int arch_cpu_init(void)
107107{
108108-#ifdef CONFIG_SPL_BUILD
108108+#ifdef CONFIG_XPL_BUILD
109109 /*
110110 * When perform idle operation, corresponding clock can
111111 * be opened or gated automatically.
···6666 * since they are unsecure.
6767 * (Note: only secure-world can access this register)
6868 */
6969- if (IS_ENABLED(CONFIG_SPL_BUILD))
6969+ if (IS_ENABLED(CONFIG_XPL_BUILD))
7070 writel(0, FIREWALL_APB_BASE + FW_DDR_CON_REG);
71717272 return 0;
···214214/* weak function: STM32MP15x mach init for boot without TFA */
215215void stm32mp_cpu_init(void)
216216{
217217- if (IS_ENABLED(CONFIG_SPL_BUILD)) {
217217+ if (IS_ENABLED(CONFIG_XPL_BUILD)) {
218218 security_init();
219219 update_bootmode();
220220 }
221221222222 /* reset copro state in SPL, when used, or in U-Boot */
223223- if (!IS_ENABLED(CONFIG_SPL) || IS_ENABLED(CONFIG_SPL_BUILD)) {
223223+ if (!IS_ENABLED(CONFIG_SPL) || IS_ENABLED(CONFIG_XPL_BUILD)) {
224224 /* Reset Coprocessor state unless it wakes up from Standby power mode */
225225 if (!(readl(PWR_MCUCR) & PWR_MCUCR_SBF)) {
226226 writel(TAMP_COPRO_STATE_OFF, TAMP_COPRO_STATE);
···22#
33# (C) Copyright 2010,2011 Nvidia Corporation.
4455-obj-$(CONFIG_SPL_BUILD) += cpu.o
55+obj-$(CONFIG_XPL_BUILD) += cpu.o
66obj-$(CONFIG_$(SPL_)CMD_EBTUPDATE) += bct.o
7788# The AVP is ARMv4T architecture so we must use special compiler
···2727endif
28282929# Only test once
3030-ifneq ($(CONFIG_SPL_BUILD),y)
3030+ifneq ($(CONFIG_XPL_BUILD),y)
3131archprepare: checkgcc4
32323333# GCC 3.x is reported to have problems generating the type of relocation
···88obj-y := cache.o cpu.o state.o
99extra-y := start.o os.o
1010extra-$(CONFIG_SANDBOX_SDL) += sdl.o
1111-obj-$(CONFIG_SPL_BUILD) += spl.o
1111+obj-$(CONFIG_XPL_BUILD) += spl.o
1212obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
13131414# os.c is build in the system environment, so needs standard includes
+1-1
arch/sandbox/cpu/cpu.c
···165165166166void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
167167{
168168-#if defined(CONFIG_PCI) && !defined(CONFIG_SPL_BUILD)
168168+#if defined(CONFIG_PCI) && !defined(CONFIG_XPL_BUILD)
169169 unsigned long plen = len;
170170 void *ptr;
171171
···82828383static int last_stage_init(void)
8484{
8585- if (IS_ENABLED(CONFIG_SPL_BUILD))
8585+ if (IS_ENABLED(CONFIG_XPL_BUILD))
8686 return 0;
87878888 board_final_init();
+2-2
arch/x86/cpu/cpu.c
···185185#endif
186186187187#if !defined(CONFIG_SYS_COREBOOT) && !defined(CONFIG_EFI_STUB) && \
188188- !defined(CONFIG_SPL_BUILD)
188188+ !defined(CONFIG_XPL_BUILD)
189189/*
190190 * Implement a weak default function for boards that need to do some final init
191191 * before the system is ready.
···247247}
248248EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
249249250250-#endif /* !SYS_COREBOOT && !EFI_STUB && !SPL_BUILD */
250250+#endif /* !SYS_COREBOOT && !EFI_STUB && !XPL_BUILD */
251251252252static int x86_init_cpus(void)
253253{
···1818 * Our assembly routines do not work on in 64-bit mode and we don't do a lot of
1919 * copying in SPL, so code size is more important there.
2020 */
2121-#if defined(CONFIG_SPL_BUILD) || !IS_ENABLED(CONFIG_X86_32BIT_INIT)
2121+#if defined(CONFIG_XPL_BUILD) || !IS_ENABLED(CONFIG_X86_32BIT_INIT)
22222323#undef __HAVE_ARCH_MEMCPY
2424extern void *memcpy(void *, const void *, __kernel_size_t);