summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/Makefile58
-rw-r--r--common/spl/spl.c61
-rw-r--r--common/spl/spl_fit.c2
-rw-r--r--common/spl/spl_legacy.c2
4 files changed, 61 insertions, 62 deletions
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 137b18428bd..75123eb666b 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -6,36 +6,36 @@
# Based on common/Makefile.
#
-ifdef CONFIG_SPL_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
-obj-$(CONFIG_$(SPL_TPL_)BLK_FS) += spl_blk_fs.o
-obj-$(CONFIG_$(SPL_TPL_)LEGACY_IMAGE_FORMAT) += spl_legacy.o
-obj-$(CONFIG_$(SPL_TPL_)NOR_SUPPORT) += spl_nor.o
-obj-$(CONFIG_$(SPL_TPL_)XIP_SUPPORT) += spl_xip.o
-obj-$(CONFIG_$(SPL_TPL_)YMODEM_SUPPORT) += spl_ymodem.o
+ifdef CONFIG_XPL_BUILD
+obj-$(CONFIG_$(PHASE_)FRAMEWORK) += spl.o
+obj-$(CONFIG_$(PHASE_)BOOTROM_SUPPORT) += spl_bootrom.o
+obj-$(CONFIG_$(PHASE_)LOAD_FIT) += spl_fit.o
+obj-$(CONFIG_$(PHASE_)BLK_FS) += spl_blk_fs.o
+obj-$(CONFIG_$(PHASE_)LEGACY_IMAGE_FORMAT) += spl_legacy.o
+obj-$(CONFIG_$(PHASE_)NOR_SUPPORT) += spl_nor.o
+obj-$(CONFIG_$(PHASE_)XIP_SUPPORT) += spl_xip.o
+obj-$(CONFIG_$(PHASE_)YMODEM_SUPPORT) += spl_ymodem.o
ifndef CONFIG_SPL_UBI
-obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += spl_nand.o
-obj-$(CONFIG_$(SPL_TPL_)ONENAND_SUPPORT) += spl_onenand.o
+obj-$(CONFIG_$(PHASE_)NAND_SUPPORT) += spl_nand.o
+obj-$(CONFIG_$(PHASE_)ONENAND_SUPPORT) += spl_onenand.o
endif
-obj-$(CONFIG_$(SPL_TPL_)UBI) += spl_ubi.o
-obj-$(CONFIG_$(SPL_TPL_)NET) += spl_net.o
-obj-$(CONFIG_$(SPL_TPL_)MMC) += spl_mmc.o
-obj-$(CONFIG_$(SPL_TPL_)ATF) += spl_atf.o
-obj-$(CONFIG_$(SPL_TPL_)OPTEE_IMAGE) += spl_optee.o
-obj-$(CONFIG_$(SPL_TPL_)OPENSBI) += spl_opensbi.o
-obj-$(CONFIG_$(SPL_TPL_)USB_STORAGE) += spl_usb.o
-obj-$(CONFIG_$(SPL_TPL_)FS_FAT) += spl_fat.o
-obj-$(CONFIG_$(SPL_TPL_)FS_EXT4) += spl_ext.o
-obj-$(CONFIG_$(SPL_TPL_)LOAD_IMX_CONTAINER) += spl_imx_container.o
-obj-$(CONFIG_$(SPL_TPL_)SATA) += spl_sata.o
-obj-$(CONFIG_$(SPL_TPL_)NVME) += spl_nvme.o
-obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += spl_semihosting.o
-obj-$(CONFIG_$(SPL_TPL_)DFU) += spl_dfu.o
-obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o
-obj-$(CONFIG_$(SPL_TPL_)RAM_SUPPORT) += spl_ram.o
-obj-$(CONFIG_$(SPL_TPL_)USB_SDP_SUPPORT) += spl_sdp.o
+obj-$(CONFIG_$(PHASE_)UBI) += spl_ubi.o
+obj-$(CONFIG_$(PHASE_)NET) += spl_net.o
+obj-$(CONFIG_$(PHASE_)MMC) += spl_mmc.o
+obj-$(CONFIG_$(PHASE_)ATF) += spl_atf.o
+obj-$(CONFIG_$(PHASE_)OPTEE_IMAGE) += spl_optee.o
+obj-$(CONFIG_$(PHASE_)OPENSBI) += spl_opensbi.o
+obj-$(CONFIG_$(PHASE_)USB_STORAGE) += spl_usb.o
+obj-$(CONFIG_$(PHASE_)FS_FAT) += spl_fat.o
+obj-$(CONFIG_$(PHASE_)FS_EXT4) += spl_ext.o
+obj-$(CONFIG_$(PHASE_)LOAD_IMX_CONTAINER) += spl_imx_container.o
+obj-$(CONFIG_$(PHASE_)SATA) += spl_sata.o
+obj-$(CONFIG_$(PHASE_)NVME) += spl_nvme.o
+obj-$(CONFIG_$(PHASE_)SEMIHOSTING) += spl_semihosting.o
+obj-$(CONFIG_$(PHASE_)DFU) += spl_dfu.o
+obj-$(CONFIG_$(PHASE_)SPI_LOAD) += spl_spi.o
+obj-$(CONFIG_$(PHASE_)RAM_SUPPORT) += spl_ram.o
+obj-$(CONFIG_$(PHASE_)USB_SDP_SUPPORT) += spl_sdp.o
endif
-obj-$(CONFIG_$(SPL_TPL_)UPL) += spl_upl.o
+obj-$(CONFIG_$(PHASE_)UPL) += spl_upl.o
diff --git a/common/spl/spl.c b/common/spl/spl.c
index c13b2b8f714..94657d00591 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -97,9 +97,9 @@ __weak int dram_init_banksize(void)
#if CONFIG_IS_ENABLED(OS_BOOT)
__weak int spl_start_uboot(void)
{
- puts(SPL_TPL_PROMPT
+ puts(PHASE_PROMPT
"Please implement spl_start_uboot() for your board\n");
- puts(SPL_TPL_PROMPT "Direct Linux boot not active!\n");
+ puts(PHASE_PROMPT "Direct Linux boot not active!\n");
return 1;
}
@@ -140,13 +140,13 @@ void spl_fixup_fdt(void *fdt_blob)
/* fixup the memory dt node */
err = fdt_shrink_to_minimum(fdt_blob, 0);
if (err == 0) {
- printf(SPL_TPL_PROMPT "fdt_shrink_to_minimum err - %d\n", err);
+ printf(PHASE_PROMPT "fdt_shrink_to_minimum err - %d\n", err);
return;
}
err = arch_fixup_fdt(fdt_blob);
if (err) {
- printf(SPL_TPL_PROMPT "arch_fixup_fdt err - %d\n", err);
+ printf(PHASE_PROMPT "arch_fixup_fdt err - %d\n", err);
return;
}
#endif
@@ -176,10 +176,10 @@ ulong spl_get_image_pos(void)
return BINMAN_SYM_MISSING;
#ifdef CONFIG_VPL
- if (spl_next_phase() == PHASE_VPL)
+ if (xpl_next_phase() == PHASE_VPL)
return binman_sym(ulong, u_boot_vpl_any, image_pos);
#endif
- return spl_next_phase() == PHASE_SPL ?
+ return xpl_next_phase() == PHASE_SPL ?
binman_sym(ulong, u_boot_spl_any, image_pos) :
binman_sym(ulong, u_boot_any, image_pos);
}
@@ -190,10 +190,10 @@ ulong spl_get_image_size(void)
return BINMAN_SYM_MISSING;
#ifdef CONFIG_VPL
- if (spl_next_phase() == PHASE_VPL)
+ if (xpl_next_phase() == PHASE_VPL)
return binman_sym(ulong, u_boot_vpl_any, size);
#endif
- return spl_next_phase() == PHASE_SPL ?
+ return xpl_next_phase() == PHASE_SPL ?
binman_sym(ulong, u_boot_spl_any, size) :
binman_sym(ulong, u_boot_any, size);
}
@@ -201,10 +201,10 @@ ulong spl_get_image_size(void)
ulong spl_get_image_text_base(void)
{
#ifdef CONFIG_VPL
- if (spl_next_phase() == PHASE_VPL)
+ if (xpl_next_phase() == PHASE_VPL)
return CONFIG_VPL_TEXT_BASE;
#endif
- return spl_next_phase() == PHASE_SPL ? CONFIG_SPL_TEXT_BASE :
+ return xpl_next_phase() == PHASE_SPL ? CONFIG_SPL_TEXT_BASE :
CONFIG_TEXT_BASE;
}
@@ -330,7 +330,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
spl_image->load_addr = start;
spl_image->entry_point = start;
spl_image->size = size;
- debug(SPL_TPL_PROMPT
+ debug(PHASE_PROMPT
"payload Image, load addr: 0x%lx size: %d\n",
spl_image->load_addr, spl_image->size);
return 0;
@@ -344,7 +344,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
spl_image->load_addr = CONFIG_SYS_LOAD_ADDR;
spl_image->entry_point = CONFIG_SYS_LOAD_ADDR;
spl_image->size = end - start;
- debug(SPL_TPL_PROMPT
+ debug(PHASE_PROMPT
"payload zImage, load addr: 0x%lx size: %d\n",
spl_image->load_addr, spl_image->size);
return 0;
@@ -423,7 +423,7 @@ static int write_spl_handoff(void)
ret = handoff_arch_save(ho);
if (ret)
return ret;
- debug(SPL_TPL_PROMPT "Wrote SPL handoff\n");
+ debug(PHASE_PROMPT "Wrote SPL handoff\n");
return 0;
}
@@ -441,7 +441,7 @@ static inline int write_spl_handoff(void) { return 0; }
*/
static enum bootstage_id get_bootstage_id(bool start)
{
- enum u_boot_phase phase = spl_phase();
+ enum xpl_phase_t phase = xpl_phase();
if (IS_ENABLED(CONFIG_TPL_BUILD) && phase == PHASE_TPL)
return start ? BOOTSTAGE_ID_START_TPL : BOOTSTAGE_ID_END_TPL;
@@ -464,19 +464,18 @@ static int spl_common_init(bool setup_malloc)
gd->malloc_ptr = 0;
}
#endif
- ret = bootstage_init(u_boot_first_phase());
+ ret = bootstage_init(xpl_is_first_phase());
if (ret) {
debug("%s: Failed to set up bootstage: ret=%d\n", __func__,
ret);
return ret;
}
- if (!u_boot_first_phase()) {
+ if (!xpl_is_first_phase()) {
ret = bootstage_unstash_default();
if (ret)
log_debug("Failed to unstash bootstage: ret=%d\n", ret);
}
- bootstage_mark_name(get_bootstage_id(true),
- spl_phase_name(spl_phase()));
+ bootstage_mark_name(get_bootstage_id(true), xpl_name(xpl_phase()));
#if CONFIG_IS_ENABLED(LOG)
ret = log_init();
if (ret) {
@@ -493,7 +492,7 @@ static int spl_common_init(bool setup_malloc)
}
if (CONFIG_IS_ENABLED(DM)) {
bootstage_start(BOOTSTAGE_ID_ACCUM_DM_SPL,
- spl_phase() == PHASE_TPL ? "dm tpl" : "dm_spl");
+ xpl_phase() == PHASE_TPL ? "dm tpl" : "dm_spl");
/* With CONFIG_SPL_OF_PLATDATA, bring in all devices */
ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA));
bootstage_accum(BOOTSTAGE_ID_ACCUM_DM_SPL);
@@ -624,11 +623,11 @@ static int boot_from_devices(struct spl_image_info *spl_image,
printf("Trying to boot from %s\n",
spl_loader_name(loader));
else if (CONFIG_IS_ENABLED(SHOW_ERRORS)) {
- printf(SPL_TPL_PROMPT
+ printf(PHASE_PROMPT
"Unsupported Boot Device %d\n",
bootdev);
} else {
- puts(SPL_TPL_PROMPT
+ puts(PHASE_PROMPT
"Unsupported Boot Device!\n");
}
}
@@ -674,7 +673,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
struct spl_image_info spl_image;
int ret, os;
- debug(">>" SPL_TPL_PROMPT "board_init_r()\n");
+ debug(">>" PHASE_PROMPT "board_init_r()\n");
spl_set_bd();
@@ -694,7 +693,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
if (ret) {
debug("%s: Failed to set up bloblist: ret=%d\n",
__func__, ret);
- puts(SPL_TPL_PROMPT "Cannot set up bloblist\n");
+ puts(PHASE_PROMPT "Cannot set up bloblist\n");
hang();
}
}
@@ -703,7 +702,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
ret = setup_spl_handoff();
if (ret) {
- puts(SPL_TPL_PROMPT "Cannot set up SPL handoff\n");
+ puts(PHASE_PROMPT "Cannot set up SPL handoff\n");
hang();
}
}
@@ -724,7 +723,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
if (CONFIG_IS_ENABLED(PCI) && !(gd->flags & GD_FLG_DM_DEAD)) {
ret = pci_init();
if (ret)
- puts(SPL_TPL_PROMPT "Cannot initialize PCI\n");
+ puts(PHASE_PROMPT "Cannot initialize PCI\n");
/* Don't fail. We still can try other boot methods. */
}
@@ -751,10 +750,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
ARRAY_SIZE(spl_boot_list));
if (ret) {
if (CONFIG_IS_ENABLED(SHOW_ERRORS))
- printf(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n",
+ printf(PHASE_PROMPT "failed to boot from all boot devices (err=%d)\n",
ret);
else
- puts(SPL_TPL_PROMPT "failed to boot from all boot devices\n");
+ puts(PHASE_PROMPT "failed to boot from all boot devices\n");
hang();
}
@@ -762,7 +761,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
os = spl_image.os;
if (os == IH_OS_U_BOOT) {
- debug("Jumping to %s...\n", spl_phase_name(spl_next_phase()));
+ debug("Jumping to %s...\n", xpl_name(xpl_next_phase()));
} else if (CONFIG_IS_ENABLED(ATF) && os == IH_OS_ARM_TRUSTED_FIRMWARE) {
debug("Jumping to U-Boot via ARM Trusted Firmware\n");
spl_fixup_fdt(spl_image_fdt_addr(&spl_image));
@@ -808,13 +807,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
if (CONFIG_IS_ENABLED(HANDOFF)) {
ret = write_spl_handoff();
if (ret)
- printf(SPL_TPL_PROMPT
+ printf(PHASE_PROMPT
"SPL hand-off write failed (err=%d)\n", ret);
}
if (CONFIG_IS_ENABLED(UPL_OUT) && (gd->flags & GD_FLG_UPL)) {
ret = spl_write_upl_handoff(&spl_image);
if (ret) {
- printf(SPL_TPL_PROMPT
+ printf(PHASE_PROMPT
"UPL hand-off write failed (err=%d)\n", ret);
hang();
}
@@ -844,7 +843,7 @@ void preloader_console_init(void)
gd->flags |= GD_FLG_HAVE_CONSOLE;
#if CONFIG_IS_ENABLED(BANNER_PRINT)
- puts("\nU-Boot " SPL_TPL_NAME " " PLAIN_VERSION " (" U_BOOT_DATE " - "
+ puts("\nU-Boot " PHASE_NAME " " PLAIN_VERSION " (" U_BOOT_DATE " - "
U_BOOT_TIME " " U_BOOT_TZ ")\n");
#endif
#ifdef CONFIG_SPL_DISPLAY_PRINT
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 1ad5a69d807..3160f573bfb 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -904,7 +904,7 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
spl_image->os = IH_OS_INVALID;
spl_image->name = genimg_get_os_name(spl_image->os);
- debug(SPL_TPL_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n",
+ debug(PHASE_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n",
spl_image->name, spl_image->load_addr, spl_image->size);
#ifdef CONFIG_SPL_FIT_SIGNATURE
diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index a77893455f2..9252b3a3de0 100644
--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -71,7 +71,7 @@ int spl_parse_legacy_header(struct spl_image_info *spl_image,
spl_image->os = image_get_os(header);
spl_image->name = image_get_name(header);
- debug(SPL_TPL_PROMPT
+ debug(PHASE_PROMPT
"payload image: %32s load addr: 0x%lx size: %d\n",
spl_image->name, spl_image->load_addr, spl_image->size);