From 6493fa4c3da3299ecf5fcbdb10de967162f12856 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Fri, 3 Sep 2021 10:24:39 +0200 Subject: [PATCH] arm: use CONFIG_SUPPORT_PASSING_ATAGS Simplify the bootm and the spl code by using the new config CONFIG_SUPPORT_PASSING_ATAGS. Signed-off-by: Patrick Delaunay Reviewed-by: Tom Rini --- arch/arm/include/asm/bootm.h | 6 +----- arch/nds32/include/asm/bootm.h | 6 +----- arch/nds32/lib/bootm.c | 22 +++++----------------- cmd/spl.c | 6 +----- 4 files changed, 8 insertions(+), 32 deletions(-) diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h index 27f183b..439e43c 100644 --- a/arch/arm/include/asm/bootm.h +++ b/arch/arm/include/asm/bootm.h @@ -10,11 +10,7 @@ extern void udc_disconnect(void); -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ - defined(CONFIG_CMDLINE_TAG) || \ - defined(CONFIG_INITRD_TAG) || \ - defined(CONFIG_SERIAL_TAG) || \ - defined(CONFIG_REVISION_TAG) +#ifdef CONFIG_SUPPORT_PASSING_ATAGS # define BOOTM_ENABLE_TAGS 1 #else # define BOOTM_ENABLE_TAGS 0 diff --git a/arch/nds32/include/asm/bootm.h b/arch/nds32/include/asm/bootm.h index 804f858..c956fdd 100644 --- a/arch/nds32/include/asm/bootm.h +++ b/arch/nds32/include/asm/bootm.h @@ -12,11 +12,7 @@ extern void udc_disconnect(void); -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ - defined(CONFIG_CMDLINE_TAG) || \ - defined(CONFIG_INITRD_TAG) || \ - defined(CONFIG_SERIAL_TAG) || \ - defined(CONFIG_REVISION_TAG) +#ifdef CONFIG_SUPPORT_PASSING_ATAGS # define BOOTM_ENABLE_TAGS 1 #else # define BOOTM_ENABLE_TAGS 0 diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c index a7c8978..1c7f785 100644 --- a/arch/nds32/lib/bootm.c +++ b/arch/nds32/lib/bootm.c @@ -19,11 +19,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ - defined(CONFIG_CMDLINE_TAG) || \ - defined(CONFIG_INITRD_TAG) || \ - defined(CONFIG_SERIAL_TAG) || \ - defined(CONFIG_REVISION_TAG) +#ifdef CONFIG_SUPPORT_PASSING_ATAGS static void setup_start_tag(struct bd_info *bd); # ifdef CONFIG_SETUP_MEMORY_TAGS @@ -38,7 +34,7 @@ static void setup_initrd_tag(struct bd_info *bd, ulong initrd_start, static void setup_end_tag(struct bd_info *bd); static struct tag *params; -#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ +#endif /* CONFIG_SUPPORT_PASSING_ATAGS */ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { @@ -82,11 +78,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) } #endif } else if (BOOTM_ENABLE_TAGS) { -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ - defined(CONFIG_CMDLINE_TAG) || \ - defined(CONFIG_INITRD_TAG) || \ - defined(CONFIG_SERIAL_TAG) || \ - defined(CONFIG_REVISION_TAG) +#ifdef CONFIG_SUPPORT_PASSING_ATAGS setup_start_tag(bd); #ifdef CONFIG_SERIAL_TAG setup_serial_tag(¶ms); @@ -127,11 +119,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) return 1; } -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ - defined(CONFIG_CMDLINE_TAG) || \ - defined(CONFIG_INITRD_TAG) || \ - defined(CONFIG_SERIAL_TAG) || \ - defined(CONFIG_REVISION_TAG) +#ifdef CONFIG_SUPPORT_PASSING_ATAGS static void setup_start_tag(struct bd_info *bd) { params = (struct tag *)bd->bi_boot_params; @@ -244,7 +232,7 @@ static void setup_end_tag(struct bd_info *bd) params->hdr.size = 0; } -#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ +#endif /* CONFIG_SUPPORT_PASSING_ATAGS */ static ulong get_sp(void) { diff --git a/cmd/spl.c b/cmd/spl.c index 472703f..8a2ded7 100644 --- a/cmd/spl.c +++ b/cmd/spl.c @@ -32,11 +32,7 @@ static const char **subcmd_list[] = { NULL, }, [SPL_EXPORT_ATAGS] = (const char * []) { -#if defined(CONFIG_SETUP_MEMORY_TAGS) || \ - defined(CONFIG_CMDLINE_TAG) || \ - defined(CONFIG_INITRD_TAG) || \ - defined(CONFIG_SERIAL_TAG) || \ - defined(CONFIG_REVISION_TAG) +#ifdef CONFIG_SUPPORT_PASSING_ATAGS "start", "loados", #ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH -- 2.7.4