at91sam9/at91cap: move common serial initialisation to cpu
[oweals/u-boot.git] / board / atmel / at91sam9260ek / at91sam9260ek.c
index 913e3fb34c13e9df45adf3e6412f793d0f9b53e2..985daf7fb52936eb322cf11d0438335866edfa6a 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91sam9260_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
 #include <asm/arch/gpio.h>
@@ -43,33 +44,6 @@ DECLARE_GLOBAL_DATA_PTR;
  * Miscelaneous platform dependent initialisations
  */
 
-static void at91sam9260ek_serial_hw_init(void)
-{
-#ifdef CONFIG_USART0
-       at91_set_A_periph(AT91_PIN_PB4, 1);             /* TXD0 */
-       at91_set_A_periph(AT91_PIN_PB5, 0);             /* RXD0 */
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US0);
-#endif
-
-#ifdef CONFIG_USART1
-       at91_set_A_periph(AT91_PIN_PB6, 1);             /* TXD1 */
-       at91_set_A_periph(AT91_PIN_PB7, 0);             /* RXD1 */
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US1);
-#endif
-
-#ifdef CONFIG_USART2
-       at91_set_A_periph(AT91_PIN_PB8, 1);             /* TXD2 */
-       at91_set_A_periph(AT91_PIN_PB9, 0);             /* RXD2 */
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US2);
-#endif
-
-#ifdef CONFIG_USART3   /* DBGU */
-       at91_set_A_periph(AT91_PIN_PB14, 0);            /* DRXD */
-       at91_set_A_periph(AT91_PIN_PB15, 1);            /* DTXD */
-       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
-#endif
-}
-
 #ifdef CONFIG_CMD_NAND
 static void at91sam9260ek_nand_hw_init(void)
 {
@@ -92,9 +66,9 @@ static void at91sam9260ek_nand_hw_init(void)
        at91_sys_write(AT91_SMC_MODE(3),
                       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
                       AT91_SMC_EXNWMODE_DISABLE |
-#ifdef CFG_NAND_DBW_16
+#ifdef CONFIG_SYS_NAND_DBW_16
                       AT91_SMC_DBW_16 |
-#else /* CFG_NAND_DBW_8 */
+#else /* CONFIG_SYS_NAND_DBW_8 */
                       AT91_SMC_DBW_8 |
 #endif
                       AT91_SMC_TDF_(2));
@@ -217,7 +191,7 @@ int board_init(void)
        /* adress of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-       at91sam9260ek_serial_hw_init();
+       at91_serial_hw_init();
 #ifdef CONFIG_CMD_NAND
        at91sam9260ek_nand_hw_init();
 #endif
@@ -255,7 +229,7 @@ int board_eth_init(bd_t *bis)
 {
        int rc = 0;
 #ifdef CONFIG_MACB
-       rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
+       rc = macb_eth_initialize(0, (void *)AT91SAM9260_BASE_EMAC, 0x00);
 #endif
        return rc;
 }