at91sam9260ek: move board id setup to config header
authorAndreas Bießmann <andreas.devel@googlemail.com>
Fri, 10 May 2013 05:05:30 +0000 (05:05 +0000)
committerAndreas Bießmann <andreas.devel@googlemail.com>
Sun, 12 May 2013 14:49:14 +0000 (16:49 +0200)
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
board/atmel/at91sam9260ek/at91sam9260ek.c
include/configs/at91sam9260ek.h

index 1e7b33e39c1e63b8cc7ee48d8ea92bd1e2f05292..8d3fc75cd9f7a7a0934ff22ca51242b2b66c7010 100644 (file)
@@ -167,18 +167,6 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-#ifdef CONFIG_AT91SAM9G20EK_2MMC
-       /* arch number of AT91SAM9G20EK_2MMC-Board */
-       gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK_2MMC;
-#else
-#ifdef CONFIG_AT91SAM9G20EK
-       /* arch number of AT91SAM9G20EK-Board */
-       gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK;
-#else
-       /* arch number of AT91SAM9260EK-Board */
-       gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9260EK;
-#endif
-#endif
        /* adress of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
index 7846d0b94fa2532eea1fbd49665e47c7e36094cc..43289446b1fd7377c9fe6ac651108fefdcfad19a 100644 (file)
        (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
 #endif
 
+/*
+ * The (arm)linux board id set by generic code depending on configured board
+ * (see boards.cfg for different boards)
+ */
+#ifdef CONFIG_AT91SAM9G20
+       /* the sam9g20 variants have two different board ids */
+# ifdef CONFIG_AT91SAM9G20EK_2MMC
+       /* we may be setup for the 2MMC variant of at91sam9g20ek */
+#  define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
+# else
+       /* or the normal at91sam9g20ek */
+#  define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
+# endif
+#else
+       /* otherwise default to good old at91sam9260ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
+#endif
+
 /* DataFlash */
 #ifndef CONFIG_AT91SAM9G20EK_2MMC
 #define CONFIG_ATMEL_DATAFLASH_SPI