Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"

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.
This commit is contained in:
Tom Rini
2024-10-11 12:23:25 -06:00
906 changed files with 2270 additions and 2237 deletions

View File

@@ -147,7 +147,7 @@ static int coral_get_str(struct udevice *dev, int id, size_t size, char *val)
{
int ret;
if (IS_ENABLED(CONFIG_SPL_BUILD))
if (IS_ENABLED(CONFIG_XPL_BUILD))
return -ENOSYS;
switch (id) {

View File

@@ -7,7 +7,7 @@
#include <init.h>
#include <asm/arch-rockchip/clock.h>
#ifdef CONFIG_SPL_BUILD
#ifdef CONFIG_XPL_BUILD
/* provided to defeat compiler optimisation in board_init_f() */
void gru_dummy_function(int i)
{
@@ -33,7 +33,7 @@ int board_early_init_f(void)
}
#endif
#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
int board_early_init_r(void)
{
struct udevice *clk;

View File

@@ -5,7 +5,7 @@
obj-y += imx8mq_phanbell.o
ifdef CONFIG_SPL_BUILD
ifdef CONFIG_XPL_BUILD
obj-y += spl.o
obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing_1g.o
endif

View File

@@ -19,7 +19,7 @@
* There is a U-Boot driver for this but it may need to add support for the
* 'voltage-table' property.
*/
#ifndef CONFIG_SPL_BUILD
#ifndef CONFIG_XPL_BUILD
#if !CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
static int veyron_init(void)
{