bfin: Move gpio support for bf54x and bf60x into the generic driver folder.
PATCH 1/1 bfin: Move gpio support for bf54x and bf60x into the generic driver folder.
From: Sonic Zhang <[email protected]>
The gpio spec for bf54x and bf60x differ a lot from the old gpio driver for bf5xx. A lot of machine macros are used to accomodate both code in one gpio driver. This patch split the old gpio driver and move new gpio2 support to the generic gpio driver folder.
- To enable gpio2 driver, macro CONFIG_ADI_GPIO2 should be defined in the board's config header file.
- The gpio2 driver supports bf54x, bf60x and future ADI processors, while the older gpio driver supports bf50x, bf51x, bf52x, bf53x and bf561.
- All blackfin specific gpio function names are replaced by the generic gpio APIs.
--- arch/blackfin/cpu/Makefile | 2 +- arch/blackfin/cpu/gpio.c | 145 ++---------- arch/blackfin/include/asm/gpio.h | 62 +---- arch/blackfin/include/asm/portmux.h | 5 - drivers/gpio/Makefile | 1 + drivers/gpio/adi_gpio2.c | 440 +++++++++++++++++++++++++++++++++++ include/configs/bf548-ezkit.h | 2 + include/configs/bf609-ezkit.h | 2 + include/configs/bfin_adi_common.h | 4 +- 9 files changed, 479 insertions(+), 184 deletions(-) create mode 100644 drivers/gpio/adi_gpio2.c
arch/blackfin/cpu/Makefile +1 -1
@@ -18,7 +18,7 @@ CEXTRA := initcode.o SEXTRA := start.o SOBJS := interrupt.o cache.o COBJS-y += cpu.o -COBJS-y += gpio.o +COBJS-$(CONFIG_ADI_GPIO1) += gpio.o COBJS-y += interrupts.o COBJS-$(CONFIG_JTAG_CONSOLE) += jtag-console.o COBJS-y += os_log.o
arch/blackfin/cpu/gpio.c +20 -125
294 lines not on this page · raw message
arch/blackfin/include/asm/gpio.h +10 -52
94 lines not on this page · raw message
arch/blackfin/include/asm/portmux.h +0 -5
@@ -17,11 +17,6 @@#define P_MAYSHARE 0x2000#define P_DONTCARE 0x1000 -#ifndef CONFIG_BFIN_GPIO_TRACK -#define peripheral_request (per, label) peripheral_request(per) -#define peripheral_request_list (per, label) peripheral_request_list(per) -#endif -#ifndef __ASSEMBLY__int peripheral_request (unsigned short per,const char *label);
drivers/gpio/Makefile +1 -0
@@ -46,6 +46,7 @@ COBJS-$(CONFIG_OMAP_GPIO) += omap_gpio.o COBJS-$(CONFIG_DB8500_GPIO) += db8500_gpio.o COBJS-$(CONFIG_BCM2835_GPIO) += bcm2835_gpio.o COBJS-$(CONFIG_S3C2440_GPIO) += s3c2440_gpio.o +COBJS-$(CONFIG_ADI_GPIO2) += adi_gpio2.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
drivers/gpio/adi_gpio2.c new file +440 -0
440 lines not on this page · raw message
include/configs/bf548-ezkit.h +2 -0
@@ -182,6 +182,8 @@#define CONFIG_UART_CONSOLE 1#define CONFIG_BFIN_SPI_IMG_SIZE 0x50000 +#define CONFIG_ADI_GPIO2 +#undef CONFIG_VIDEO#ifdef CONFIG_VIDEO #define EASYLOGO_HEADER < asm/bfin_logo_230x230_gzip.h >
include/configs/bf609-ezkit.h +2 -0
@@ -149,6 +149,8 @@#define CONFIG_SYS_MEMTEST_END (CONFIG_STACKBASE - 20*1024*1024 + 4)#define CONFIG_BFIN_SOFT_SWITCH +#define CONFIG_ADI_GPIO2 +#if 0 #define CONFIG_UART_MEM 1024#undef CONFIG_UART_CONSOLE
include/configs/bfin_adi_common.h +3 -1
@@ -323,5 +323,7 @@# define CONFIG_WATCHDOG_TIMEOUT_MSECS 5000# endif #endif - +#ifndef CONFIG_ADI_GPIO2 +# define CONFIG_ADI_GPIO1 +#endif #endif
Signature · 1 line
1.7.0.4
PATCH 1/1 bfin: Move gpio support for bf54x and bf60x into the generic driver folder.
Quoted 11 lines · On Thursday 02 May 2013 01:55:25 Sonic Zhang wrote:
The gpio spec for bf54x and bf60x differ a lot from the old gpio driver for bf5xx. A lot of machine macros are used to accomodate both code in one gpio driver. This patch split the old gpio driver and move new gpio2 support to the generic gpio driver folder.
- To enable gpio2 driver, macro
CONFIG_ADI_GPIO2should be defined in the board's config header file.
- The gpio2 driver supports bf54x, bf60x and future ADI processors, while the older gpio driver supports bf50x, bf51x, bf52x, bf53x and bf561.
- All blackfin specific gpio function names are replaced by the generic gpio APIs.
the code in u-boot was written so as to make direct import from the kernel trivial. that way there is only one code base to maintain -- the kernel. last i looked, you hadn't split the drivers in the kernel, which means things are now diverging.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130502/887b1bb8/attachment.pgp>
PATCH 1/1 bfin: Move gpio support for bf54x and bf60x into the generic driver folder.
Hi Mike,
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · On Thursday 02 May 2013 01:55:25 Sonic Zhang wrote:
The gpio spec for bf54x and bf60x differ a lot from the old gpio driver for bf5xx. A lot of machine macros are used to accomodate both code in one gpio driver. This patch split the old gpio driver and move new gpio2 support to the generic gpio driver folder.
- To enable gpio2 driver, macro
CONFIG_ADI_GPIO2should be defined in the board's config header file.
- The gpio2 driver supports bf54x, bf60x and future ADI processors, while the older gpio driver supports bf50x, bf51x, bf52x, bf53x and bf561.
- All blackfin specific gpio function names are replaced by the generic gpio APIs.
Quoted 4 lines
the code in u-boot was written so as to make direct import from the kernel trivial. that way there is only one code base to maintain -- the kernel. last i looked, you hadn't split the drivers in the kernel, which means things are now diverging.
Don't worry. I will do it in Linux kernel soon after this is merged into u-boot.
Regards,
Sonic