cpu9260/9G20: fix board support
authorEric Benard <eric@eukrea.com>
Mon, 6 Jun 2011 22:48:28 +0000 (22:48 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 21 Jun 2011 20:26:22 +0000 (22:26 +0200)
Signed-off-by: Eric BĂ©nard <eric@eukrea.com>
MAKEALL
Makefile
board/eukrea/cpu9260/cpu9260.c
board/eukrea/cpu9260/led.c
include/configs/cpu9260.h

diff --git a/MAKEALL b/MAKEALL
index d592374049960a802f2adac10f075f6ac6715110..13dde6fca651db9d2fa8e0912a37fa7556f5d28e 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -455,8 +455,6 @@ LIST_at91="$(boards_by_soc at91)\
        at91sam9m10g45ek        \
        at91sam9rlek            \
        CPUAT91                 \
-       CPU9260                 \
-       CPU9G20                 \
        pm9g45                  \
        SBC35_A9G20             \
        TNY_A9260               \
index 61ce415d666eaa0866529c54aec02b49bb6521d8..1619c47ecc9a40426f12a95aaa3c7d5dc22c4752 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -820,14 +820,6 @@ at91sam9rlek_config        :       unconfig
        fi;
        @$(MKCONFIG) -n $@ -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
 
-CPU9G20_128M_config \
-CPU9G20_config \
-CPU9260_128M_config \
-CPU9260_config :       unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
-       @$(MKCONFIG) -n $@ -a cpu9260 arm arm926ejs cpu9260 eukrea at91
-
 at91sam9m10g45ek_nandflash_config \
 at91sam9m10g45ek_dataflash_config \
 at91sam9m10g45ek_dataflash_cs0_config \
index 9ec48a0d21cbcac105d034be345cf50dfdc1fe52..0959c5cdb93dc8dc3f73ca9522fbef3d94ee1cbe 100644 (file)
@@ -4,7 +4,7 @@
  * Lead Tech Design <www.leadtechdesign.com>
  * Ilko Iliev <www.ronetix.at>
  *
- * (C) Copyright 2009
+ * (C) Copyright 2009-2011
  * Eric Benard <eric@eukrea.com>
  *
  * See file CREDITS for list of people who contributed to this
  */
 
 #include <common.h>
-#include <asm/sizes.h>
+#include <asm/io.h>
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
+#include <asm/arch/at91_matrix.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
-#include <asm/arch/at91_matrix.h>
 #include <asm/arch/at91_pio.h>
 #include <asm/arch/clk.h>
-#include <asm/arch/io.h>
 #include <asm/arch/hardware.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
@@ -54,9 +53,9 @@ DECLARE_GLOBAL_DATA_PTR;
 static void cpu9260_nand_hw_init(void)
 {
        unsigned long csa;
-       at91_smc_t *smc = (at91_smc_t *) AT91_SMC_BASE;
-       at91_matrix_t *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
-       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+       at91_smc_t *smc = (at91_smc_t *) ATMEL_BASE_SMC;
+       at91_matrix_t *matrix = (at91_matrix_t *) ATMEL_BASE_MATRIX;
+       at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
        /* Enable CS3 */
        csa = readl(&matrix->csa) | AT91_MATRIX_CSA_EBI_CS3A;
@@ -93,7 +92,7 @@ static void cpu9260_nand_hw_init(void)
                &smc->cs[3].mode);
 #endif
 
-       writel(1 << AT91SAM9260_ID_PIOC, &pmc->pcer);
+       writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
 
        /* Configure RDY/BSY */
        at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
@@ -107,11 +106,11 @@ static void cpu9260_nand_hw_init(void)
 static void cpu9260_macb_hw_init(void)
 {
        unsigned long rstcmr;
-       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
-       at91_rstc_t *rstc = (at91_rstc_t *) AT91_RSTC_BASE;
+       at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
+       at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC;
 
        /* Enable clock */
-       writel(1 << AT91SAM9260_ID_EMAC, &pmc->pcer);
+       writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
 
        at91_set_pio_pullup(AT91_PIO_PORTA, 17, 1);
 
@@ -136,14 +135,14 @@ static void cpu9260_macb_hw_init(void)
 
 int board_early_init_f(void)
 {
-       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+       at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
-       writel((1 << AT91SAM9260_ID_PIOA) |
-               (1 << AT91SAM9260_ID_PIOC) |
-               (1 << AT91SAM9260_ID_PIOB),
+       writel((1 << ATMEL_ID_PIOA) |
+               (1 << ATMEL_ID_PIOB) |
+               (1 << ATMEL_ID_PIOC),
                &pmc->pcer);
 
-       at91_serial_hw_init();
+       at91_seriald_hw_init();
 
        return 0;
 }
@@ -184,7 +183,7 @@ int board_eth_init(bd_t *bis)
 {
        int rc = 0;
 #ifdef CONFIG_MACB
-       rc = macb_eth_initialize(0, (void *)AT91_EMAC_BASE, 0);
+       rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC0, 0);
 #endif
        return rc;
 }
index d0906bc894d1f84bc25d5fc555308a78838ad670..8d865eb87070c7bb9f108ac15b92d88d36eb7221 100644 (file)
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/io.h>
+#include <asm/io.h>
 
 static unsigned int saved_state[4] = {STATUS_LED_OFF, STATUS_LED_OFF,
                STATUS_LED_OFF, STATUS_LED_OFF};
 
 void coloured_LED_init(void)
 {
-       at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
+       at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
 
        /* Enable clock */
-       writel(1 << AT91SAM9260_ID_PIOC, &pmc->pcer);
+       writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
 
        at91_set_pio_output(CONFIG_RED_LED, 1);
        at91_set_pio_output(CONFIG_GREEN_LED, 1);
index a8ada2d418ba0246c28f303fc70beb55fc777c3e..ba9f797d6e7942ff22287968fb0f031902259194 100644 (file)
@@ -37,8 +37,7 @@
 
 #define CONFIG_SYS_AT91_MAIN_CLOCK     18432000
 #define CONFIG_SYS_HZ          1000
-
-#define CONFIG_ARM926EJS
+#define CONFIG_SYS_AT91_SLOW_CLOCK     32768
 
 #if defined(CONFIG_CPU9G20)
 #define CONFIG_AT91SAM9G20
@@ -48,6 +47,8 @@
 #error "Unknown board"
 #endif
 
+#include <asm/arch/hardware.h>
+
 #define CONFIG_AT91FAMILY
 #define CONFIG_ARCH_CPU_INIT
 #undef CONFIG_USE_IRQ
 #define CONFIG_AT91SAM9_WATCHDOG
 #define CONFIG_AT91_GPIO
 #define CONFIG_ATMEL_USART
-#undef CONFIG_USART0
-#undef CONFIG_USART1
-#undef CONFIG_USART2
-#define CONFIG_USART3
+#define CONFIG_USART_BASE      ATMEL_BASE_DBGU
+#define CONFIG_USART_ID                ATMEL_ID_SYS
 
 #define CONFIG_BOOTDELAY       3