Commit 269647dc authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu

Blackfin arch: convert BF5{18,27,48}_FAMILY to CONFIG_BF{51,52,54}x

convert BF5{18,27,48}_FAMILY to CONFIG_BF{51,52,54}x as the defines
are redundant in these cases
Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent ffc89627
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
* MODIFICATION HISTORY : * MODIFICATION HISTORY :
**************************************************************/ **************************************************************/
#ifndef BF548_FAMILY #ifndef CONFIG_BF54x
void set_gpio_dir(unsigned, unsigned short); void set_gpio_dir(unsigned, unsigned short);
void set_gpio_inen(unsigned, unsigned short); void set_gpio_inen(unsigned, unsigned short);
void set_gpio_polar(unsigned, unsigned short); void set_gpio_polar(unsigned, unsigned short);
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
/* /*
* BF51x/BF52x/BF537: 8 timers: * BF51x/BF52x/BF537: 8 timers:
*/ */
#if defined(CONFIG_BF51x) || defined(BF527_FAMILY) || defined(BF537_FAMILY) #if defined(CONFIG_BF51x) || defined(CONFIG_BF52x) || defined(BF537_FAMILY)
# define MAX_BLACKFIN_GPTIMERS 8 # define MAX_BLACKFIN_GPTIMERS 8
# define TIMER0_GROUP_REG TIMER_ENABLE # define TIMER0_GROUP_REG TIMER_ENABLE
#endif #endif
/* /*
* BF54x: 11 timers (BF542: 8 timers): * BF54x: 11 timers (BF542: 8 timers):
*/ */
#if defined(BF548_FAMILY) #if defined(CONFIG_BF54x)
# ifdef CONFIG_BF542 # ifdef CONFIG_BF542
# define MAX_BLACKFIN_GPTIMERS 8 # define MAX_BLACKFIN_GPTIMERS 8
# else # else
......
...@@ -69,7 +69,7 @@ enum { ...@@ -69,7 +69,7 @@ enum {
static struct gpio_port_t * const gpio_array[] = { static struct gpio_port_t * const gpio_array[] = {
#if defined(BF533_FAMILY) || defined(BF538_FAMILY) #if defined(BF533_FAMILY) || defined(BF538_FAMILY)
(struct gpio_port_t *) FIO_FLAG_D, (struct gpio_port_t *) FIO_FLAG_D,
#elif defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #elif defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
(struct gpio_port_t *) PORTFIO, (struct gpio_port_t *) PORTFIO,
(struct gpio_port_t *) PORTGIO, (struct gpio_port_t *) PORTGIO,
(struct gpio_port_t *) PORTHIO, (struct gpio_port_t *) PORTHIO,
...@@ -77,7 +77,7 @@ static struct gpio_port_t * const gpio_array[] = { ...@@ -77,7 +77,7 @@ static struct gpio_port_t * const gpio_array[] = {
(struct gpio_port_t *) FIO0_FLAG_D, (struct gpio_port_t *) FIO0_FLAG_D,
(struct gpio_port_t *) FIO1_FLAG_D, (struct gpio_port_t *) FIO1_FLAG_D,
(struct gpio_port_t *) FIO2_FLAG_D, (struct gpio_port_t *) FIO2_FLAG_D,
#elif defined(BF548_FAMILY) #elif defined(CONFIG_BF54x)
(struct gpio_port_t *)PORTA_FER, (struct gpio_port_t *)PORTA_FER,
(struct gpio_port_t *)PORTB_FER, (struct gpio_port_t *)PORTB_FER,
(struct gpio_port_t *)PORTC_FER, (struct gpio_port_t *)PORTC_FER,
...@@ -93,7 +93,7 @@ static struct gpio_port_t * const gpio_array[] = { ...@@ -93,7 +93,7 @@ static struct gpio_port_t * const gpio_array[] = {
#endif #endif
}; };
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
static unsigned short * const port_fer[] = { static unsigned short * const port_fer[] = {
(unsigned short *) PORTF_FER, (unsigned short *) PORTF_FER,
(unsigned short *) PORTG_FER, (unsigned short *) PORTG_FER,
...@@ -109,11 +109,11 @@ static unsigned short * const port_mux[] = { ...@@ -109,11 +109,11 @@ static unsigned short * const port_mux[] = {
static const static const
u8 pmux_offset[][16] = { u8 pmux_offset[][16] = {
# if defined(BF527_FAMILY) # if defined(CONFIG_BF52x)
{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */ { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
{ 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */ { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */ { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
# elif defined(BF518_FAMILY) # elif defined(CONFIG_BF51x)
{ 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */ { 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */
{ 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */ { 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */
{ 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */ { 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */
...@@ -139,7 +139,7 @@ static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM]; ...@@ -139,7 +139,7 @@ static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM];
inline int check_gpio(unsigned gpio) inline int check_gpio(unsigned gpio)
{ {
#if defined(BF548_FAMILY) #if defined(CONFIG_BF54x)
if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
|| gpio == GPIO_PH14 || gpio == GPIO_PH15 || gpio == GPIO_PH14 || gpio == GPIO_PH15
|| gpio == GPIO_PJ14 || gpio == GPIO_PJ15) || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
...@@ -187,13 +187,13 @@ static void port_setup(unsigned gpio, unsigned short usage) ...@@ -187,13 +187,13 @@ static void port_setup(unsigned gpio, unsigned short usage)
if (check_gpio(gpio)) if (check_gpio(gpio))
return; return;
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
if (usage == GPIO_USAGE) if (usage == GPIO_USAGE)
*port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
else else
*port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
SSYNC(); SSYNC();
#elif defined(BF548_FAMILY) #elif defined(CONFIG_BF54x)
if (usage == GPIO_USAGE) if (usage == GPIO_USAGE)
gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
else else
...@@ -273,7 +273,7 @@ static void portmux_setup(unsigned short per) ...@@ -273,7 +273,7 @@ static void portmux_setup(unsigned short per)
} }
} }
} }
#elif defined(BF548_FAMILY) #elif defined(CONFIG_BF54x)
inline void portmux_setup(unsigned short per) inline void portmux_setup(unsigned short per)
{ {
u32 pmux; u32 pmux;
...@@ -297,7 +297,7 @@ inline u16 get_portmux(unsigned short per) ...@@ -297,7 +297,7 @@ inline u16 get_portmux(unsigned short per)
return (pmux >> (2 * gpio_sub_n(ident)) & 0x3); return (pmux >> (2 * gpio_sub_n(ident)) & 0x3);
} }
#elif defined(BF527_FAMILY) || defined(BF518_FAMILY) #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
inline void portmux_setup(unsigned short per) inline void portmux_setup(unsigned short per)
{ {
u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per); u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per);
...@@ -322,7 +322,7 @@ static int __init bfin_gpio_init(void) ...@@ -322,7 +322,7 @@ static int __init bfin_gpio_init(void)
arch_initcall(bfin_gpio_init); arch_initcall(bfin_gpio_init);
#ifndef BF548_FAMILY #ifndef CONFIG_BF54x
/*********************************************************** /***********************************************************
* *
* FUNCTIONS: Blackfin General Purpose Ports Access Functions * FUNCTIONS: Blackfin General Purpose Ports Access Functions
...@@ -489,7 +489,7 @@ static const unsigned int sic_iwr_irqs[] = { ...@@ -489,7 +489,7 @@ static const unsigned int sic_iwr_irqs[] = {
IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX
#elif defined(BF538_FAMILY) #elif defined(BF538_FAMILY)
IRQ_PORTF_INTB IRQ_PORTF_INTB
#elif defined(BF527_FAMILY) || defined(BF518_FAMILY) #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB
#elif defined(BF561_FAMILY) #elif defined(BF561_FAMILY)
IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB
...@@ -586,7 +586,7 @@ u32 bfin_pm_standby_setup(void) ...@@ -586,7 +586,7 @@ u32 bfin_pm_standby_setup(void)
gpio_array[bank]->maskb = 0; gpio_array[bank]->maskb = 0;
if (mask) { if (mask) {
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
gpio_bank_saved[bank].fer = *port_fer[bank]; gpio_bank_saved[bank].fer = *port_fer[bank];
#endif #endif
gpio_bank_saved[bank].inen = gpio_array[bank]->inen; gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
...@@ -631,7 +631,7 @@ void bfin_pm_standby_restore(void) ...@@ -631,7 +631,7 @@ void bfin_pm_standby_restore(void)
bank = gpio_bank(i); bank = gpio_bank(i);
if (mask) { if (mask) {
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
*port_fer[bank] = gpio_bank_saved[bank].fer; *port_fer[bank] = gpio_bank_saved[bank].fer;
#endif #endif
gpio_array[bank]->inen = gpio_bank_saved[bank].inen; gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
...@@ -657,9 +657,9 @@ void bfin_gpio_pm_hibernate_suspend(void) ...@@ -657,9 +657,9 @@ void bfin_gpio_pm_hibernate_suspend(void)
for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
bank = gpio_bank(i); bank = gpio_bank(i);
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
gpio_bank_saved[bank].fer = *port_fer[bank]; gpio_bank_saved[bank].fer = *port_fer[bank];
#if defined(BF527_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
gpio_bank_saved[bank].mux = *port_mux[bank]; gpio_bank_saved[bank].mux = *port_mux[bank];
#else #else
if (bank == 0) if (bank == 0)
...@@ -685,8 +685,8 @@ void bfin_gpio_pm_hibernate_restore(void) ...@@ -685,8 +685,8 @@ void bfin_gpio_pm_hibernate_restore(void)
for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
bank = gpio_bank(i); bank = gpio_bank(i);
#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
#if defined(BF527_FAMILY) || defined(BF518_FAMILY) #if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
*port_mux[bank] = gpio_bank_saved[bank].mux; *port_mux[bank] = gpio_bank_saved[bank].mux;
#else #else
if (bank == 0) if (bank == 0)
...@@ -710,7 +710,7 @@ void bfin_gpio_pm_hibernate_restore(void) ...@@ -710,7 +710,7 @@ void bfin_gpio_pm_hibernate_restore(void)
#endif #endif
#else /* BF548_FAMILY */ #else /* CONFIG_BF54x */
#ifdef CONFIG_PM #ifdef CONFIG_PM
u32 bfin_pm_standby_setup(void) u32 bfin_pm_standby_setup(void)
...@@ -762,7 +762,7 @@ unsigned short get_gpio_dir(unsigned gpio) ...@@ -762,7 +762,7 @@ unsigned short get_gpio_dir(unsigned gpio)
} }
EXPORT_SYMBOL(get_gpio_dir); EXPORT_SYMBOL(get_gpio_dir);
#endif /* BF548_FAMILY */ #endif /* CONFIG_BF54x */
/*********************************************************** /***********************************************************
* *
...@@ -817,7 +817,7 @@ int peripheral_request(unsigned short per, const char *label) ...@@ -817,7 +817,7 @@ int peripheral_request(unsigned short per, const char *label)
* be requested and used by several drivers * be requested and used by several drivers
*/ */
#ifdef BF548_FAMILY #ifdef CONFIG_BF54x
if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) { if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) {
#else #else
if (!(per & P_MAYSHARE)) { if (!(per & P_MAYSHARE)) {
...@@ -964,7 +964,7 @@ int bfin_gpio_request(unsigned gpio, const char *label) ...@@ -964,7 +964,7 @@ int bfin_gpio_request(unsigned gpio, const char *label)
printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!" printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!"
" (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio); " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio);
} }
#ifndef BF548_FAMILY #ifndef CONFIG_BF54x
else { /* Reset POLAR setting when acquiring a gpio for the first time */ else { /* Reset POLAR setting when acquiring a gpio for the first time */
set_gpio_polar(gpio, 0); set_gpio_polar(gpio, 0);
} }
...@@ -1072,7 +1072,7 @@ void bfin_gpio_irq_free(unsigned gpio) ...@@ -1072,7 +1072,7 @@ void bfin_gpio_irq_free(unsigned gpio)
static inline void __bfin_gpio_direction_input(unsigned gpio) static inline void __bfin_gpio_direction_input(unsigned gpio)
{ {
#ifdef BF548_FAMILY #ifdef CONFIG_BF54x
gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio);
#else #else
gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
...@@ -1100,13 +1100,13 @@ EXPORT_SYMBOL(bfin_gpio_direction_input); ...@@ -1100,13 +1100,13 @@ EXPORT_SYMBOL(bfin_gpio_direction_input);
void bfin_gpio_irq_prepare(unsigned gpio) void bfin_gpio_irq_prepare(unsigned gpio)
{ {
#ifdef BF548_FAMILY #ifdef CONFIG_BF54x
unsigned long flags; unsigned long flags;
#endif #endif
port_setup(gpio, GPIO_USAGE); port_setup(gpio, GPIO_USAGE);
#ifdef BF548_FAMILY #ifdef CONFIG_BF54x
local_irq_save_hw(flags); local_irq_save_hw(flags);
__bfin_gpio_direction_input(gpio); __bfin_gpio_direction_input(gpio);
local_irq_restore_hw(flags); local_irq_restore_hw(flags);
...@@ -1135,7 +1135,7 @@ int bfin_gpio_direction_output(unsigned gpio, int value) ...@@ -1135,7 +1135,7 @@ int bfin_gpio_direction_output(unsigned gpio, int value)
gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
gpio_set_value(gpio, value); gpio_set_value(gpio, value);
#ifdef BF548_FAMILY #ifdef CONFIG_BF54x
gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio);
#else #else
gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio); gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
...@@ -1150,7 +1150,7 @@ EXPORT_SYMBOL(bfin_gpio_direction_output); ...@@ -1150,7 +1150,7 @@ EXPORT_SYMBOL(bfin_gpio_direction_output);
int bfin_gpio_get_value(unsigned gpio) int bfin_gpio_get_value(unsigned gpio)
{ {
#ifdef BF548_FAMILY #ifdef CONFIG_BF54x
return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio))); return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)));
#else #else
unsigned long flags; unsigned long flags;
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#ifndef _MACH_BLACKFIN_H_ #ifndef _MACH_BLACKFIN_H_
#define _MACH_BLACKFIN_H_ #define _MACH_BLACKFIN_H_
#define BF518_FAMILY
#include "bf518.h" #include "bf518.h"
#include "mem_map.h" #include "mem_map.h"
#include "defBF512.h" #include "defBF512.h"
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#ifndef _MACH_BLACKFIN_H_ #ifndef _MACH_BLACKFIN_H_
#define _MACH_BLACKFIN_H_ #define _MACH_BLACKFIN_H_
#define BF527_FAMILY
#include "bf527.h" #include "bf527.h"
#include "mem_map.h" #include "mem_map.h"
#include "defBF522.h" #include "defBF522.h"
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#ifndef _MACH_BLACKFIN_H_ #ifndef _MACH_BLACKFIN_H_
#define _MACH_BLACKFIN_H_ #define _MACH_BLACKFIN_H_
#define BF548_FAMILY
#include "bf548.h" #include "bf548.h"
#include "mem_map.h" #include "mem_map.h"
#include "anomaly.h" #include "anomaly.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment