From patchwork Fri Feb 18 12:50:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinhard Meyer X-Patchwork-Id: 83585 X-Patchwork-Delegate: info@emk-elektronik.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id A05AFB70E3 for ; Fri, 18 Feb 2011 23:18:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CD0CE28089; Fri, 18 Feb 2011 13:17:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jh4NQvKc-txR; Fri, 18 Feb 2011 13:17:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B00B280B8; Fri, 18 Feb 2011 13:16:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2425280DE for ; Fri, 18 Feb 2011 13:16:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xK6J-BNZZJrR for ; Fri, 18 Feb 2011 13:16:34 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by theia.denx.de (Postfix) with ESMTP id 062A7280A4 for ; Fri, 18 Feb 2011 13:16:03 +0100 (CET) Received: from localhost.localdomain (p5B201A57.dip0.t-ipconnect.de [91.32.26.87]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LjLyR-1QMB2L3VwV-00dEu4; Fri, 18 Feb 2011 13:16:03 +0100 From: Reinhard Meyer To: u-boot@lists.denx.de Date: Fri, 18 Feb 2011 13:50:07 +0100 Message-Id: <1298033414-11481-10-git-send-email-u-boot@emk-elektronik.de> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1298033414-11481-9-git-send-email-u-boot@emk-elektronik.de> References: <1298033414-11481-1-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-2-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-3-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-4-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-5-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-6-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-7-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-8-git-send-email-u-boot@emk-elektronik.de> <1298033414-11481-9-git-send-email-u-boot@emk-elektronik.de> X-Provags-ID: V02:K0:p6gNAc1QZ6dMYOV87jZ3exIAFcF+NIGbYbaBhQts4Lu 7B81dIvRB/uuZMQjwGxwPstvDi6Te1VzeodfBg9y4N25UWyy2N xzAlRunmBHNcz9TocM/UdQWKq2kb3G6zmHOrnGoLueyEx1DUIE AGfQc0CyMXNtwIzQk7geD/9Lcmly2hNb+NLwq6tmVmXYSRR7s8 fVFTsyhXh3SFqKcflOXrp1nZvtSAsjGvGJ9J6LCKqM= Subject: [U-Boot] [PATCH 09/15] ATMEL: fix related common atmel driver files X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Reinhard Meyer --- drivers/mmc/gen_atmel_mci.c | 2 +- drivers/net/macb.c | 14 ++++++++------ drivers/serial/atmel_usart.c | 28 +++++++--------------------- drivers/spi/atmel_spi.c | 16 ++++++++-------- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index 2984d64..c28c469 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "atmel_mci.h" #ifndef CONFIG_SYS_MMC_CLK_OD diff --git a/drivers/net/macb.c b/drivers/net/macb.c index acb8d20..72ea1fc 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -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)); diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c index bfa1f3a..e326b2b 100644 --- a/drivers/serial/atmel_usart.c +++ b/drivers/serial/atmel_usart.c @@ -23,21 +23,7 @@ #include #include -#include - -#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 #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; } diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index d0de931..33e38b6 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -26,7 +26,7 @@ #include #include -#include +#include #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: