]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
image: push default arch values to arch headers
authorMike Frysinger <vapier@gentoo.org>
Mon, 3 Oct 2011 14:50:33 +0000 (14:50 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 5 Oct 2011 20:22:15 +0000 (22:22 +0200)
This pushes the ugly duplicated arch ifdef lists we maintain in various
image related files out to the arch headers themselves.

Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Tested-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 files changed:
arch/arm/include/asm/u-boot.h
arch/avr32/include/asm/u-boot.h
arch/blackfin/include/asm/u-boot.h
arch/m68k/include/asm/u-boot.h
arch/microblaze/include/asm/u-boot.h
arch/mips/include/asm/u-boot.h
arch/nios2/include/asm/u-boot.h
arch/powerpc/include/asm/u-boot.h
arch/sh/include/asm/u-boot.h
arch/sparc/include/asm/u-boot.h
arch/x86/include/asm/u-boot.h
common/cmd_bootm.c
include/image.h

index ed333270942d7dd824ca62e88346d955047a46c2..f30b9fc96f0be9a1d6328bd6206cc3cf988b4c84 100644 (file)
@@ -48,4 +48,7 @@ typedef struct bd_info {
     }                  bi_dram[CONFIG_NR_DRAM_BANKS];
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_ARM
+
 #endif /* _U_BOOT_H_ */
index 8acd0561a8b77d3a45b38f808e3e5a15ff81be46..ff1ed23db91673d8e03be133eb81fdc0a7a81b6b 100644 (file)
@@ -40,4 +40,7 @@ typedef struct bd_info {
 #define bi_memstart bi_dram[0].start
 #define bi_memsize bi_dram[0].size
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_AVR32
+
 #endif /* __ASM_U_BOOT_H__ */
index a6e6cf0f5422ea4c3ae6d38bdae140e5642eca96..9712fc00eecaa7856a15e55168d34a14237d2c50 100644 (file)
@@ -45,4 +45,7 @@ typedef struct bd_info {
        unsigned long bi_sclk;
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_BLACKFIN
+
 #endif /* _U_BOOT_H_ */
index a0f2983750f453d30b503e9b3d27e5289a445a0c..0a48bbdbe6dfd2741461091a511b59db27d07349 100644 (file)
@@ -64,4 +64,7 @@ typedef struct bd_info {
 
 #endif                         /* __ASSEMBLY__ */
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_M68K
+
 #endif                         /* __U_BOOT_H__ */
index 543a6b177707256321ebf241f48ba36eae2d789e..21c72d5940835fe0f603c741198f31623817b948 100644 (file)
@@ -44,5 +44,7 @@ typedef struct bd_info {
        unsigned long   bi_baudrate;    /* Console Baudrate */
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_MICROBLAZE
 
 #endif /* _U_BOOT_H_ */
index e839ca18ef24b9139d061a3fdb28331f4eff7e3d..edb87bb066710b458b663fa52788b9ee10a86a9b 100644 (file)
@@ -43,4 +43,7 @@ typedef struct bd_info {
        unsigned long   bi_flashoffset; /* reserved area for startup monitor */
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_MIPS
+
 #endif /* _U_BOOT_H_ */
index ec844d040180bf981bc6f32be31cff1713efbfbe..f7c70ff0c149126c4fef7d8533b476b9332203f4 100644 (file)
@@ -43,5 +43,7 @@ typedef struct bd_info {
        unsigned long   bi_baudrate;    /* Console Baudrate */
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_NIOS2
 
 #endif /* __ASM_NIOS2_U_BOOT_H_ */
index 721692a3851509436eba6f217670ed8cd688486e..b2fa2b574b940c5b321fc83e2db6603df5bb936f 100644 (file)
@@ -143,4 +143,8 @@ typedef struct bd_info {
 } bd_t;
 
 #endif /* __ASSEMBLY__ */
+
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_PPC
+
 #endif /* __U_BOOT_H__ */
index 27d43b93474806f889faca993b974dd04b6a5596..45745129a0dbf87db255a7f8a58358b75ced4ae7 100644 (file)
@@ -38,4 +38,7 @@ typedef struct bd_info {
        unsigned long   bi_boot_params; /* where this board expects params */
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_SH
+
 #endif
index 209873ffec86825be36dd95cfd8756d820d6688b..1d94087aab7b4fc511450f819e3b7d51056c9b5b 100644 (file)
@@ -59,4 +59,8 @@ typedef struct bd_info {
 } bd_t;
 
 #endif                         /* __ASSEMBLY__ */
+
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_SPARC
+
 #endif                         /* __U_BOOT_H__ */
index a43b3aadedd2801f1f1f67e17ce7de4f7f8a3c90..26450ebc44d5994792dd206042abf015184e5ff5 100644 (file)
@@ -58,4 +58,7 @@ typedef struct bd_info {
        }bi_dram[CONFIG_NR_DRAM_BANKS];
 } bd_t;
 
+/* For image.h:image_check_target_arch() */
+#define IH_ARCH_DEFAULT IH_ARCH_I386
+
 #endif /* _U_BOOT_H_ */
index 8909ee703d32db806ba677196788af623cde2bf4..c2e8038ee87d7a6e968ecb69c8845af39b5991a4 100644 (file)
@@ -165,31 +165,7 @@ void __arch_preboot_os(void)
 }
 void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));
 
-#if defined(__ARM__)
-  #define IH_INITRD_ARCH IH_ARCH_ARM
-#elif defined(__avr32__)
-  #define IH_INITRD_ARCH IH_ARCH_AVR32
-#elif defined(__bfin__)
-  #define IH_INITRD_ARCH IH_ARCH_BLACKFIN
-#elif defined(__I386__)
-  #define IH_INITRD_ARCH IH_ARCH_I386
-#elif defined(__M68K__)
-  #define IH_INITRD_ARCH IH_ARCH_M68K
-#elif defined(__microblaze__)
-  #define IH_INITRD_ARCH IH_ARCH_MICROBLAZE
-#elif defined(__mips__)
-  #define IH_INITRD_ARCH IH_ARCH_MIPS
-#elif defined(__nios2__)
-  #define IH_INITRD_ARCH IH_ARCH_NIOS2
-#elif defined(__PPC__)
-  #define IH_INITRD_ARCH IH_ARCH_PPC
-#elif defined(__sh__)
-  #define IH_INITRD_ARCH IH_ARCH_SH
-#elif defined(__sparc__)
-  #define IH_INITRD_ARCH IH_ARCH_SPARC
-#else
-# error Unknown CPU type
-#endif
+#define IH_INITRD_ARCH IH_ARCH_DEFAULT
 
 static void bootm_start_lmb(void)
 {
index 352e4a042b8b7b383c96cddbbb08fe2c869fd8e2..cca1cc533c586e21c2a82f22d316092e084abafd 100644 (file)
@@ -484,34 +484,10 @@ void image_print_contents (const void *hdr);
 #ifndef USE_HOSTCC
 static inline int image_check_target_arch (const image_header_t *hdr)
 {
-#if defined(__ARM__)
-       if (!image_check_arch (hdr, IH_ARCH_ARM))
-#elif defined(__avr32__)
-       if (!image_check_arch (hdr, IH_ARCH_AVR32))
-#elif defined(__bfin__)
-       if (!image_check_arch (hdr, IH_ARCH_BLACKFIN))
-#elif defined(__I386__)
-       if (!image_check_arch (hdr, IH_ARCH_I386))
-#elif defined(__M68K__)
-       if (!image_check_arch (hdr, IH_ARCH_M68K))
-#elif defined(__microblaze__)
-       if (!image_check_arch (hdr, IH_ARCH_MICROBLAZE))
-#elif defined(__mips__)
-       if (!image_check_arch (hdr, IH_ARCH_MIPS))
-#elif defined(__nios2__)
-       if (!image_check_arch (hdr, IH_ARCH_NIOS2))
-#elif defined(__PPC__)
-       if (!image_check_arch (hdr, IH_ARCH_PPC))
-#elif defined(__sh__)
-       if (!image_check_arch (hdr, IH_ARCH_SH))
-#elif defined(__sparc__)
-       if (!image_check_arch (hdr, IH_ARCH_SPARC))
-#else
-# error Unknown CPU type
+#ifndef IH_ARCH_DEFAULT
+# error "please define IH_ARCH_DEFAULT in your arch asm/u-boot.h"
 #endif
-               return 0;
-
-       return 1;
+       return image_check_arch(hdr, IH_ARCH_DEFAULT);
 }
 #endif /* USE_HOSTCC */
 
@@ -636,34 +612,7 @@ void fit_conf_print (const void *fit, int noffset, const char *p);
 #ifndef USE_HOSTCC
 static inline int fit_image_check_target_arch (const void *fdt, int node)
 {
-#if defined(__ARM__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_ARM))
-#elif defined(__avr32__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_AVR32))
-#elif defined(__bfin__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_BLACKFIN))
-#elif defined(__I386__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_I386))
-#elif defined(__M68K__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_M68K))
-#elif defined(__microblaze__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_MICROBLAZE))
-#elif defined(__mips__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_MIPS))
-#elif defined(__nios2__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_NIOS2))
-#elif defined(__PPC__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_PPC))
-#elif defined(__sh__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_SH))
-#elif defined(__sparc__)
-       if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC))
-#else
-# error Unknown CPU type
-#endif
-               return 0;
-
-       return 1;
+       return !fit_image_check_arch(fdt, node, IH_ARCH_DEFAULT);
 }
 #endif /* USE_HOSTCC */