]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ATMEL: fix related common atmel driver files
authorReinhard Meyer <u-boot@emk-elektronik.de>
Wed, 3 Nov 2010 15:32:56 +0000 (16:32 +0100)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Wed, 18 May 2011 05:56:51 +0000 (07:56 +0200)
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
drivers/mmc/gen_atmel_mci.c
drivers/net/macb.c
drivers/serial/atmel_usart.c
drivers/spi/atmel_spi.c

index 6577925b8ecc558e91b160acc571c6b2690d9c2d..f346b244be124e0502a9ec172584f4fccee78c2b 100644 (file)
@@ -33,7 +33,7 @@
 #include <asm/errno.h>
 #include <asm/byteorder.h>
 #include <asm/arch/clk.h>
-#include <asm/arch/memory-map.h>
+#include <asm/arch/hardware.h>
 #include "atmel_mci.h"
 
 #ifndef CONFIG_SYS_MMC_CLK_OD
index acb8d20b136090b37bfca69d5c4e234cada00652..72ea1fc11d6ac04d2f6108060b3aba9c9eaafa88 100644 (file)
@@ -469,17 +469,19 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 
        /* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
-    defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
-       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
+#if    defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+       defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
+       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
+       defined(CONFIG_AT91SAM9XE)
        macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
 #else
        macb_writel(macb, USRIO, 0);
 #endif
 #else
-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
-    defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
-       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
+#if    defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+       defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
+       defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
+       defined(CONFIG_AT91SAM9XE)
        macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
        macb_writel(macb, USRIO, MACB_BIT(MII));
index bfa1f3a8d52c690a16c0950331443daf6d52c903..e326b2bcff9867985d94720b4fbc2a8033568d88 100644 (file)
 
 #include <asm/io.h>
 #include <asm/arch/clk.h>
-#include <asm/arch/memory-map.h>
-
-#if defined(CONFIG_USART0)
-# define USART_ID      0
-# define USART_BASE    USART0_BASE
-#elif defined(CONFIG_USART1)
-# define USART_ID      1
-# define USART_BASE    USART1_BASE
-#elif defined(CONFIG_USART2)
-# define USART_ID      2
-# define USART_BASE    USART2_BASE
-#elif defined(CONFIG_USART3)
-# define USART_ID      3
-# define USART_BASE    USART3_BASE
-#endif
+#include <asm/arch/hardware.h>
 
 #include "atmel_usart.h"
 
@@ -45,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void serial_setbrg(void)
 {
-       atmel_usart3_t *usart = (atmel_usart3_t*)USART_BASE;
+       atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
        unsigned long divisor;
        unsigned long usart_hz;
 
@@ -54,14 +40,14 @@ void serial_setbrg(void)
         * Baud Rate = --------------
         *                16 * CD
         */
-       usart_hz = get_usart_clk_rate(USART_ID);
+       usart_hz = get_usart_clk_rate(CONFIG_USART_ID);
        divisor = (usart_hz / 16 + gd->baudrate / 2) / gd->baudrate;
        writel(USART3_BF(CD, divisor), &usart->brgr);
 }
 
 int serial_init(void)
 {
-       atmel_usart3_t *usart = (atmel_usart3_t*)USART_BASE;
+       atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 
        writel(USART3_BIT(RSTRX) | USART3_BIT(RSTTX), &usart->cr);
 
@@ -80,7 +66,7 @@ int serial_init(void)
 
 void serial_putc(char c)
 {
-       atmel_usart3_t *usart = (atmel_usart3_t*)USART_BASE;
+       atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 
        if (c == '\n')
                serial_putc('\r');
@@ -97,7 +83,7 @@ void serial_puts(const char *s)
 
 int serial_getc(void)
 {
-       atmel_usart3_t *usart = (atmel_usart3_t*)USART_BASE;
+       atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
 
        while (!(readl(&usart->csr) & USART3_BIT(RXRDY)))
                 WATCHDOG_RESET();
@@ -106,6 +92,6 @@ int serial_getc(void)
 
 int serial_tstc(void)
 {
-       atmel_usart3_t *usart = (atmel_usart3_t*)USART_BASE;
+       atmel_usart3_t *usart = (atmel_usart3_t *)CONFIG_USART_BASE;
        return (readl(&usart->csr) & USART3_BIT(RXRDY)) != 0;
 }
index d0de9319684650989e987c3f0bb037035c0d6715..33e38b61b72501a8d5935741e8894d923b2cb797 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/io.h>
 
 #include <asm/arch/clk.h>
-#include <asm/arch/memory-map.h>
+#include <asm/arch/hardware.h>
 
 #include "atmel_spi.h"
 
@@ -48,21 +48,21 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 
        switch (bus) {
        case 0:
-               regs = (void *)SPI0_BASE;
+               regs = (void *)ATMEL_BASE_SPI0;
                break;
-#ifdef SPI1_BASE
+#ifdef ATMEL_BASE_SPI1
        case 1:
-               regs = (void *)SPI1_BASE;
+               regs = (void *)ATMEL_BASE_SPI1;
                break;
 #endif
-#ifdef SPI2_BASE
+#ifdef ATMEL_BASE_SPI2
        case 2:
-               regs = (void *)SPI2_BASE;
+               regs = (void *)ATMEL_BASE_SPI2;
                break;
 #endif
-#ifdef SPI3_BASE
+#ifdef ATMEL_BASE_SPI3
        case 3:
-               regs = (void *)SPI3_BASE;
+               regs = (void *)ATMEL_BASE_SPI3;
                break;
 #endif
        default: