From: Steven Miao Date: Wed, 23 Oct 2013 06:44:09 +0000 (+0800) Subject: blackfin: Move machine specific gpio_port_t structure back to blackfin arch folder. X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=cae4d0403c0863176f228d410d6a29b3f4b9d595;p=u-boot.git blackfin: Move machine specific gpio_port_t structure back to blackfin arch folder. The gpio register mappings are different among blackfin processors. Signed-off-by: Steven Miao Signed-off-by: Sonic Zhang --- diff --git a/arch/blackfin/cpu/Makefile b/arch/blackfin/cpu/Makefile index 1421cb2ca2..929fc8b7ce 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 f9aff4d894..5e9c68af85 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 58a6191107..376ec02b65 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 051073cee3..88cd65b87f 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)