spl: Make use of CONFIG_IS_ENABLED(OS_BOOT) in SPL/TPL common code paths
When building a system that has both TPL and SPL_OS_BOOT, code which tests for CONFIG_SPL_OS_BOOT will be built and enabled in TPL, which is not correct. While there is no CONFIG_TPL_OS_BOOT symbol at this time (and likely will not ever be) we can use CONFIG_IS_ENABLED(OS_BOOT) in these common paths to ensure we only compile these parts in the SPL case. Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -50,7 +50,7 @@ void __weak board_init_f(ulong dummy)
|
|||||||
* This function jumps to an image with argument. Normally an FDT or ATAGS
|
* This function jumps to an image with argument. Normally an FDT or ATAGS
|
||||||
* image.
|
* image.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
#ifdef CONFIG_ARM64
|
#ifdef CONFIG_ARM64
|
||||||
void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
|
void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ __weak int dram_init_banksize(void)
|
|||||||
* 0 to not start u-boot
|
* 0 to not start u-boot
|
||||||
* positive if u-boot should start
|
* positive if u-boot should start
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
__weak int spl_start_uboot(void)
|
__weak int spl_start_uboot(void)
|
||||||
{
|
{
|
||||||
puts(SPL_TPL_PROMPT
|
puts(SPL_TPL_PROMPT
|
||||||
@@ -353,7 +353,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
|
|||||||
panic("** no mkimage signature but raw image not supported");
|
panic("** no mkimage signature but raw image not supported");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
ulong start, end;
|
ulong start, end;
|
||||||
|
|
||||||
if (!bootz_setup((ulong)header, &start, &end)) {
|
if (!bootz_setup((ulong)header, &start, &end)) {
|
||||||
@@ -797,7 +797,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
|
|||||||
spl_invoke_opensbi(&spl_image);
|
spl_invoke_opensbi(&spl_image);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
case IH_OS_LINUX:
|
case IH_OS_LINUX:
|
||||||
debug("Jumping to Linux\n");
|
debug("Jumping to Linux\n");
|
||||||
#if defined(CONFIG_SYS_SPL_ARGS_ADDR)
|
#if defined(CONFIG_SYS_SPL_ARGS_ADDR)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ end:
|
|||||||
return err < 0;
|
return err < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
int spl_load_image_ext_os(struct spl_image_info *spl_image,
|
int spl_load_image_ext_os(struct spl_image_info *spl_image,
|
||||||
struct blk_desc *block_dev, int partition)
|
struct blk_desc *block_dev, int partition)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ end:
|
|||||||
return (err <= 0);
|
return (err <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
int spl_load_image_fat_os(struct spl_image_info *spl_image,
|
int spl_load_image_fat_os(struct spl_image_info *spl_image,
|
||||||
struct blk_desc *block_dev, int partition)
|
struct blk_desc *block_dev, int partition)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
|
static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
|
||||||
struct mmc *mmc)
|
struct mmc *mmc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
|
|||||||
|
|
||||||
header = spl_get_load_buffer(0, sizeof(*header));
|
header = spl_get_load_buffer(0, sizeof(*header));
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (!spl_start_uboot()) {
|
if (!spl_start_uboot()) {
|
||||||
/*
|
/*
|
||||||
* load parameter image
|
* load parameter image
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ static int spl_nor_load_image(struct spl_image_info *spl_image,
|
|||||||
*/
|
*/
|
||||||
spl_image->flags |= SPL_COPY_PAYLOAD_ONLY;
|
spl_image->flags |= SPL_COPY_PAYLOAD_ONLY;
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (!spl_start_uboot()) {
|
if (!spl_start_uboot()) {
|
||||||
/*
|
/*
|
||||||
* Load Linux from its location in NOR flash to its defined
|
* Load Linux from its location in NOR flash to its defined
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (spl_start_uboot() ||
|
if (spl_start_uboot() ||
|
||||||
spl_load_image_fat_os(spl_image, stor_dev,
|
spl_load_image_fat_os(spl_image, stor_dev,
|
||||||
CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
|
CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <asm/global_data.h>
|
#include <asm/global_data.h>
|
||||||
#include <dm/ofnode.h>
|
#include <dm/ofnode.h>
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
/*
|
/*
|
||||||
* Load the kernel, check for a valid header we can parse, and if found load
|
* Load the kernel, check for a valid header we can parse, and if found load
|
||||||
* the kernel and then device tree.
|
* the kernel and then device tree.
|
||||||
@@ -107,7 +107,7 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
|
|||||||
payload_offs);
|
payload_offs);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (spl_start_uboot() || spi_load_image_os(spl_image, flash, header))
|
if (spl_start_uboot() || spi_load_image_os(spl_image, flash, header))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ int spl_ubi_load_image(struct spl_image_info *spl_image,
|
|||||||
info.leb_start = CONFIG_SPL_UBI_LEB_START;
|
info.leb_start = CONFIG_SPL_UBI_LEB_START;
|
||||||
info.peb_count = CONFIG_SPL_UBI_MAX_PEBS - info.peb_offset;
|
info.peb_count = CONFIG_SPL_UBI_MAX_PEBS - info.peb_offset;
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (!spl_start_uboot()) {
|
if (!spl_start_uboot()) {
|
||||||
volumes[0].vol_id = CONFIG_SPL_UBI_LOAD_KERNEL_ID;
|
volumes[0].vol_id = CONFIG_SPL_UBI_LOAD_KERNEL_ID;
|
||||||
volumes[0].load_addr = (void *)CONFIG_SYS_LOAD_ADDR;
|
volumes[0].load_addr = (void *)CONFIG_SYS_LOAD_ADDR;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ int spl_usb_load(struct spl_image_info *spl_image,
|
|||||||
|
|
||||||
debug("boot mode - FAT\n");
|
debug("boot mode - FAT\n");
|
||||||
|
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (spl_start_uboot() ||
|
if (spl_start_uboot() ||
|
||||||
spl_load_image_fat_os(spl_image, stor_dev, partition))
|
spl_load_image_fat_os(spl_image, stor_dev, partition))
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
static int spl_xip(struct spl_image_info *spl_image,
|
static int spl_xip(struct spl_image_info *spl_image,
|
||||||
struct spl_boot_device *bootdev)
|
struct spl_boot_device *bootdev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SPL_OS_BOOT
|
#if CONFIG_IS_ENABLED(OS_BOOT)
|
||||||
if (!spl_start_uboot()) {
|
if (!spl_start_uboot()) {
|
||||||
spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
|
spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
|
||||||
spl_image->name = "Linux";
|
spl_image->name = "Linux";
|
||||||
|
|||||||
Reference in New Issue
Block a user