From patchwork Wed Oct 23 07:50:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 285537 X-Patchwork-Delegate: sonic.adi@gmail.com 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 5A4C62C020A for ; Wed, 23 Oct 2013 18:52:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AC5B44A193; Wed, 23 Oct 2013 09:52:15 +0200 (CEST) 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 QlaMi6QB-Dvr; Wed, 23 Oct 2013 09:52:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E14B14A18B; Wed, 23 Oct 2013 09:52:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE0EA4A18B for ; Wed, 23 Oct 2013 09:52:07 +0200 (CEST) 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 B2gjrSPjIpeR for ; Wed, 23 Oct 2013 09:52:01 +0200 (CEST) X-Greylist: delayed 909 seconds by postgrey-1.27 at theia; Wed, 23 Oct 2013 09:51:54 CEST 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 va3outboundpool.messaging.microsoft.com (va3ehsobe005.messaging.microsoft.com [216.32.180.31]) by theia.denx.de (Postfix) with ESMTPS id 7E4444A18A for ; Wed, 23 Oct 2013 09:51:54 +0200 (CEST) Received: from mail35-va3-R.bigfish.com (10.7.14.243) by VA3EHSOBE009.bigfish.com (10.7.40.29) with Microsoft SMTP Server id 14.1.225.22; Wed, 23 Oct 2013 07:36:42 +0000 Received: from mail35-va3 (localhost [127.0.0.1]) by mail35-va3-R.bigfish.com (Postfix) with ESMTP id 3ABAC3600D9; Wed, 23 Oct 2013 07:36:42 +0000 (UTC) X-Forefront-Antispam-Report: CIP:137.71.25.55; KIP:(null); UIP:(null); IPV:NLI; H:nwd2mta1.analog.com; RD:nwd2mail10.analog.com; EFVD:NLI X-SpamScore: 1 X-BigFish: VS1(zzzz1f42h1ee6h1ce5h1fdah201ch2073h1202h1fd0h1e76h1d1ah1cabh1d2ah1fc6hzz1de098h8275bh1de097hz31h87h2a8h839hd24he5bh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h13eah1441h14ddh1504h1537h15a8h162dh1631h1758h17eeh1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e23h1fe8h1ff5h129fi1155h) Received-SPF: softfail (mail35-va3: transitioning domain of gmail.com does not designate 137.71.25.55 as permitted sender) client-ip=137.71.25.55; envelope-from=sonic.adi@gmail.com; helo=nwd2mta1.analog.com ; 1.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail35-va3 (localhost.localdomain [127.0.0.1]) by mail35-va3 (MessageSwitch) id 1382513800913220_9520; Wed, 23 Oct 2013 07:36:40 +0000 (UTC) Received: from VA3EHSMHS006.bigfish.com (unknown [10.7.14.239]) by mail35-va3.bigfish.com (Postfix) with ESMTP id D0DA4120040; Wed, 23 Oct 2013 07:36:40 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by VA3EHSMHS006.bigfish.com (10.7.99.16) with Microsoft SMTP Server (TLS) id 14.16.227.3; Wed, 23 Oct 2013 07:36:40 +0000 Received: from NWD2HUBCAS6.ad.analog.com (nwd2hubcas6.ad.analog.com [10.64.72.159]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id r9N7a0aB020827 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 23 Oct 2013 00:36:00 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS6.ad.analog.com (10.64.72.159) with Microsoft SMTP Server id 14.3.158.1; Wed, 23 Oct 2013 03:35:19 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id r9N7ZHZI032662; Wed, 23 Oct 2013 03:35:18 -0400 Received: from nine.analog.com (unknown [10.99.22.80]) by linux.site (Postfix) with ESMTP id 4557E3AB38B2; Tue, 22 Oct 2013 18:13:40 -0600 (MDT) From: Sonic Zhang To: Date: Wed, 23 Oct 2013 15:50:50 +0800 Message-ID: <1382514650-5950-1-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.8.2.3 MIME-Version: 1.0 X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: Sonic Zhang , adi-buildroot-devel@lists.sourceforge.net, Steven Miao Subject: [U-Boot] [PATCH] blackfin: Move machine specific gpio_port_t structure back to blackfin arch folder. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Steven Miao The gpio register mappings are different among blackfin processors. Signed-off-by: Steven Miao Signed-off-by: Sonic Zhang --- arch/blackfin/cpu/Makefile | 2 +- arch/blackfin/cpu/gpio.c | 17 +++++++++++++++++ arch/blackfin/include/asm/gpio.h | 3 +++ drivers/gpio/adi_gpio2.c | 17 ----------------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/arch/blackfin/cpu/Makefile b/arch/blackfin/cpu/Makefile index 1421cb2..929fc8b 100644 --- a/arch/blackfin/cpu/Makefile +++ b/arch/blackfin/cpu/Makefile @@ -18,7 +18,7 @@ CEXTRA := initcode.o SEXTRA := start.o SOBJS := interrupt.o cache.o COBJS-y += cpu.o -COBJS-$(CONFIG_ADI_GPIO1) += gpio.o +COBJS-y += gpio.o COBJS-y += interrupts.o COBJS-$(CONFIG_JTAG_CONSOLE) += jtag-console.o COBJS-y += os_log.o diff --git a/arch/blackfin/cpu/gpio.c b/arch/blackfin/cpu/gpio.c index f9aff4d..5e9c68a 100644 --- a/arch/blackfin/cpu/gpio.c +++ b/arch/blackfin/cpu/gpio.c @@ -12,6 +12,7 @@ #include #include +#ifdef CONFIG_ADI_GPIO1 #if ANOMALY_05000311 || ANOMALY_05000323 enum { AWA_data = SYSCR, @@ -774,3 +775,19 @@ void gpio_labels(void) continue; } } +#else +struct gpio_port_t * const gpio_array[] = { + (struct gpio_port_t *)PORTA_FER, + (struct gpio_port_t *)PORTB_FER, + (struct gpio_port_t *)PORTC_FER, + (struct gpio_port_t *)PORTD_FER, + (struct gpio_port_t *)PORTE_FER, + (struct gpio_port_t *)PORTF_FER, + (struct gpio_port_t *)PORTG_FER, +#if defined(CONFIG_BF54x) + (struct gpio_port_t *)PORTH_FER, + (struct gpio_port_t *)PORTI_FER, + (struct gpio_port_t *)PORTJ_FER, +#endif +}; +#endif diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 58a6191..376ec02 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h @@ -8,6 +8,7 @@ #define __ARCH_BLACKFIN_GPIO_H__ #include +#include #define gpio_bank(x) ((x) >> 4) #define gpio_bit(x) (1<<((x) & 0xF)) @@ -141,6 +142,8 @@ struct gpio_port_t { unsigned short dummy16; unsigned short inen; }; +#else +extern struct gpio_port_t * const gpio_array[]; #endif #ifdef ADI_SPECIAL_GPIO_BANKS diff --git a/drivers/gpio/adi_gpio2.c b/drivers/gpio/adi_gpio2.c index 051073c..88cd65b 100644 --- a/drivers/gpio/adi_gpio2.c +++ b/drivers/gpio/adi_gpio2.c @@ -10,22 +10,6 @@ #include #include #include -#include - -static struct gpio_port_t * const gpio_array[] = { - (struct gpio_port_t *)PORTA_FER, - (struct gpio_port_t *)PORTB_FER, - (struct gpio_port_t *)PORTC_FER, - (struct gpio_port_t *)PORTD_FER, - (struct gpio_port_t *)PORTE_FER, - (struct gpio_port_t *)PORTF_FER, - (struct gpio_port_t *)PORTG_FER, -#if defined(CONFIG_BF54x) - (struct gpio_port_t *)PORTH_FER, - (struct gpio_port_t *)PORTI_FER, - (struct gpio_port_t *)PORTJ_FER, -#endif -}; #define RESOURCE_LABEL_SIZE 16 @@ -98,7 +82,6 @@ static void port_setup(unsigned gpio, unsigned short usage) else gpio_array[gpio_bank(gpio)]->port_fer_set = gpio_bit(gpio); #endif - SSYNC(); } inline void portmux_setup(unsigned short per)