m68knommu: simplify ColdFire GPIO init code
cover m68knommu: simplify ColdFire GPIO init code
The GPIO init code for the ColdFire cores is a set of very large tables, one for each ColdFire SoC type. Each SoC type has very different GPIO pin arrangements, so one for each is unavoidable. But there is fundamentaly two types of setup/access that we are trying to support.
With some pre-processor macro magic we can reduce the tables significantly, making them easier to read, easier to get correct, and easier to maintain.
The following patches implement a set of simplifying changes. What do others think? Overall we remove close to 2000 lines of code, and the end tables are much easier to read and get correct.
Looking for feedback...
Regards
Greg
a/arch/m68k/platform/5206/gpio.c | 27 - a/arch/m68k/platform/520x/gpio.c | 34 - a/arch/m68k/platform/523x/gpio.c | 40 -- a/arch/m68k/platform/5249/gpio.c | 28 - a/arch/m68k/platform/5272/gpio.c | 29 - a/arch/m68k/platform/527x/gpio.c | 61 --- a/arch/m68k/platform/528x/gpio.c | 49 -- a/arch/m68k/platform/5307/gpio.c | 27 - a/arch/m68k/platform/532x/gpio.c | 43 -- a/arch/m68k/platform/5407/gpio.c | 27 - arch/m68k/include/asm/mcfgpio.h | 3 arch/m68k/platform/5206/gpio.c | 12 arch/m68k/platform/520x/gpio.c | 12 arch/m68k/platform/523x/gpio.c | 12 arch/m68k/platform/5249/gpio.c | 12 arch/m68k/platform/5272/gpio.c | 12 arch/m68k/platform/527x/gpio.c | 12 arch/m68k/platform/528x/gpio.c | 12 arch/m68k/platform/5307/gpio.c | 12 arch/m68k/platform/532x/gpio.c | 12 arch/m68k/platform/5407/gpio.c | 12 b/arch/m68k/include/asm/m528xsim.h | 179 ++++------ b/arch/m68k/include/asm/mcfgpio.h | 41 ++ b/arch/m68k/platform/5206/Makefile | 2 b/arch/m68k/platform/5206/config.c | 9 b/arch/m68k/platform/5206/gpio.c | 16 b/arch/m68k/platform/520x/Makefile | 2 b/arch/m68k/platform/520x/config.c | 16 b/arch/m68k/platform/520x/gpio.c | 149 -------- b/arch/m68k/platform/523x/Makefile | 2 b/arch/m68k/platform/523x/config.c | 22 + b/arch/m68k/platform/523x/gpio.c | 264 --------------- b/arch/m68k/platform/5249/Makefile | 2 b/arch/m68k/platform/5249/config.c | 10 b/arch/m68k/platform/5249/gpio.c | 33 - b/arch/m68k/platform/5272/Makefile | 2 b/arch/m68k/platform/5272/config.c | 11 b/arch/m68k/platform/5272/gpio.c | 50 -- b/arch/m68k/platform/527x/Makefile | 2 b/arch/m68k/platform/527x/config.c | 43 ++ b/arch/m68k/platform/527x/gpio.c | 604 +---------------------------------- b/arch/m68k/platform/528x/Makefile | 2 b/arch/m68k/platform/528x/config.c | 31 + b/arch/m68k/platform/528x/gpio.c | 427 +----------------------- b/arch/m68k/platform/5307/Makefile | 2 b/arch/m68k/platform/5307/config.c | 9 b/arch/m68k/platform/5307/gpio.c | 16 b/arch/m68k/platform/532x/Makefile | 2 b/arch/m68k/platform/532x/config.c | 25 + b/arch/m68k/platform/532x/gpio.c | 320 ------------------ b/arch/m68k/platform/5407/Makefile | 2 b/arch/m68k/platform/5407/config.c | 9 b/arch/m68k/platform/5407/gpio.c | 16 b/arch/m68k/platform/coldfire/gpio.c | 4 54 files changed, 445 insertions(+), 2367 deletions(-)
PATCH 1/22 m68knommu: introduce macros to simplify ColdFire GPIO table initialization
From: Greg Ungerer <[email protected]>
We have very large tables in the ColdFire CPU GPIO setup code that essentially boil down to 2 distinct types of GPIO pin initiaization. Using 2 macros we can reduce these large tables to at most a dozen lines of setup code, and in quite a few cases a single table entry.
Introduce these 2 macros into the existing mcfgpio.h header.
--- arch/m68k/include/asm/mcfgpio.h | 41 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-)
arch/m68k/include/asm/mcfgpio.h +41 -0
@@ -37,4 +37,45 @@ void mcf_gpio_set_value_fast(struct gpio_chip *, unsigned, int);int mcf_gpio_request (struct gpio_chip *,unsigned );void mcf_gpio_free (struct gpio_chip *,unsigned ); +/* +* Define macros to ease the pain of setting up the gpio tables. +*/ +#define MCFGPS (mlabel, mbase, mngpio, mpddr, mpodr, mppdr) \ + { \ + .gpio_chip = { \ + .label = #mlabel, \ + .request = mcf_gpio_request, \ + .free = mcf_gpio_free, \ + .direction_input = mcf_gpio_direction_input, \ + .direction_output = mcf_gpio_direction_output,\ + .get = mcf_gpio_get_value, \ + .set = mcf_gpio_set_value, \ + .base = mbase, \ + .ngpio = mngpio, \ + }, \ + .pddr = (void __iomem *) mpddr, \ + .podr = (void __iomem *) mpodr, \ + .ppdr = (void __iomem *) mppdr, \ + } + +#define MCFGPF (mlabel, mbase, mngpio) \ + { \ + .gpio_chip = { \ + .label = #mlabel, \ + .request = mcf_gpio_request, \ + .free = mcf_gpio_free, \ + .direction_input = mcf_gpio_direction_input, \ + .direction_output = mcf_gpio_direction_output,\ + .get = mcf_gpio_get_value, \ + .set = mcf_gpio_set_value_fast, \ + .base = mbase, \ + .ngpio = mngpio, \ + }, \ + .pddr = (void __iomem *) MCFGPIO_PDDR_##mlabel, \ + .podr = (void __iomem *) MCFGPIO_PODR_##mlabel, \ + .ppdr = (void __iomem *) MCFGPIO_PPDSDR_##mlabel, \ + .setr = (void __iomem *) MCFGPIO_PPDSDR_##mlabel, \ + .clrr = (void __iomem *) MCFGPIO_PCLRR_##mlabel, \ + } +#endif
Signature · 1 line
1.7.0.4
PATCH 2/22 m68knommu: switch to GPIO init macros in ColdFire 5206 init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/5206/gpio.c | 16 +--------------- 1 files changed, 1 insertions(+), 15 deletions(-)
arch/m68k/platform/5206/gpio.c +1 -15
@@ -21,21 +21,7 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PP" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFSIM_PADDR , - .podr = (void __iomem *)MCFSIM_PADAT , - .ppdr = (void __iomem *)MCFSIM_PADAT , - }, +MCFGPS (PP ,0 ,8 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 3/22 m68knommu: switch to GPIO init macros in ColdFire 520x init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/520x/gpio.c | 149 ++------------------------------------- 1 files changed, 8 insertions(+), 141 deletions(-)
arch/m68k/platform/520x/gpio.c +8 -141
@@ -21,147 +21,14 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PIRQ" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFEPORT_EPDDR , - .podr = (void __iomem *)MCFEPORT_EPDR , - .ppdr = (void __iomem *)MCFEPORT_EPPDR , - }, - { - .gpio_chip = { - .label ="CS" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =9 , - .ngpio =3 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_CS , - .podr = (void __iomem *)MCFGPIO_PODR_CS , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_CS , - .setr = (void __iomem *)MCFGPIO_PPDSDR_CS , - .clrr = (void __iomem *)MCFGPIO_PCLRR_CS , - }, - { - .gpio_chip = { - .label ="FECI2C" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =16 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECI2C , - .podr = (void __iomem *)MCFGPIO_PODR_FECI2C , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECI2C , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECI2C , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECI2C , - }, - { - .gpio_chip = { - .label ="QSPI" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =24 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_QSPI , - .podr = (void __iomem *)MCFGPIO_PODR_QSPI , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_QSPI , - .setr = (void __iomem *)MCFGPIO_PPDSDR_QSPI , - .clrr = (void __iomem *)MCFGPIO_PCLRR_QSPI , - }, - { - .gpio_chip = { - .label ="TIMER" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =32 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_TIMER , - .podr = (void __iomem *)MCFGPIO_PODR_TIMER , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_TIMER , - .setr = (void __iomem *)MCFGPIO_PPDSDR_TIMER , - .clrr = (void __iomem *)MCFGPIO_PCLRR_TIMER , - }, - { - .gpio_chip = { - .label ="UART" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =40 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_UART , - .podr = (void __iomem *)MCFGPIO_PODR_UART , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_UART , - .setr = (void __iomem *)MCFGPIO_PPDSDR_UART , - .clrr = (void __iomem *)MCFGPIO_PCLRR_UART , - }, - { - .gpio_chip = { - .label ="FECH" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =48 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECH , - .podr = (void __iomem *)MCFGPIO_PODR_FECH , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECH , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECH , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECH , - }, - { - .gpio_chip = { - .label ="FECL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =56 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECL , - .podr = (void __iomem *)MCFGPIO_PODR_FECL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECL , - }, +MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (CS ,9 ,3 ), +MCFGPF (FECI2C ,16 ,4 ), +MCFGPF (QSPI ,24 ,4 ), +MCFGPF (TIMER ,32 ,4 ), +MCFGPF (UART ,40 ,8 ), +MCFGPF (FECH ,48 ,8 ), +MCFGPF (FECL ,56 ,8 ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 4/22 m68knommu: switch to GPIO init macros in ColdFire 523x init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/523x/gpio.c | 264 ++------------------------------------- 1 files changed, 14 insertions(+), 250 deletions(-)
arch/m68k/platform/523x/gpio.c +14 -250
@@ -21,256 +21,20 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PIRQ" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .base =1 , - .ngpio =7 , - }, - .pddr = (void __iomem *)MCFEPORT_EPDDR , - .podr = (void __iomem *)MCFEPORT_EPDR , - .ppdr = (void __iomem *)MCFEPORT_EPPDR , - }, - { - .gpio_chip = { - .label ="ADDR" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =13 , - .ngpio =3 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_ADDR , - .podr = (void __iomem *)MCFGPIO_PODR_ADDR , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_ADDR , - .setr = (void __iomem *)MCFGPIO_PPDSDR_ADDR , - .clrr = (void __iomem *)MCFGPIO_PCLRR_ADDR , - }, - { - .gpio_chip = { - .label ="DATAH" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =16 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_DATAH , - .podr = (void __iomem *)MCFGPIO_PODR_DATAH , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_DATAH , - .setr = (void __iomem *)MCFGPIO_PPDSDR_DATAH , - .clrr = (void __iomem *)MCFGPIO_PCLRR_DATAH , - }, - { - .gpio_chip = { - .label ="DATAL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =24 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_DATAL , - .podr = (void __iomem *)MCFGPIO_PODR_DATAL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_DATAL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_DATAL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_DATAL , - }, - { - .gpio_chip = { - .label ="BUSCTL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =32 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_BUSCTL , - .podr = (void __iomem *)MCFGPIO_PODR_BUSCTL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_BUSCTL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_BUSCTL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_BUSCTL , - }, - { - .gpio_chip = { - .label ="BS" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =40 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_BS , - .podr = (void __iomem *)MCFGPIO_PODR_BS , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_BS , - .setr = (void __iomem *)MCFGPIO_PPDSDR_BS , - .clrr = (void __iomem *)MCFGPIO_PCLRR_BS , - }, - { - .gpio_chip = { - .label ="CS" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =49 , - .ngpio =7 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_CS , - .podr = (void __iomem *)MCFGPIO_PODR_CS , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_CS , - .setr = (void __iomem *)MCFGPIO_PPDSDR_CS , - .clrr = (void __iomem *)MCFGPIO_PCLRR_CS , - }, - { - .gpio_chip = { - .label ="SDRAM" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =56 , - .ngpio =6 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_SDRAM , - .podr = (void __iomem *)MCFGPIO_PODR_SDRAM , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_SDRAM , - .setr = (void __iomem *)MCFGPIO_PPDSDR_SDRAM , - .clrr = (void __iomem *)MCFGPIO_PCLRR_SDRAM , - }, - { - .gpio_chip = { - .label ="FECI2C" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =64 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECI2C , - .podr = (void __iomem *)MCFGPIO_PODR_FECI2C , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECI2C , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECI2C , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECI2C , - }, - { - .gpio_chip = { - .label ="UARTH" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =72 , - .ngpio =2 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_UARTH , - .podr = (void __iomem *)MCFGPIO_PODR_UARTH , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_UARTH , - .setr = (void __iomem *)MCFGPIO_PPDSDR_UARTH , - .clrr = (void __iomem *)MCFGPIO_PCLRR_UARTH , - }, - { - .gpio_chip = { - .label ="UARTL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =80 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_UARTL , - .podr = (void __iomem *)MCFGPIO_PODR_UARTL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_UARTL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_UARTL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_UARTL , - }, - { - .gpio_chip = { - .label ="QSPI" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =88 , - .ngpio =5 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_QSPI , - .podr = (void __iomem *)MCFGPIO_PODR_QSPI , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_QSPI , - .setr = (void __iomem *)MCFGPIO_PPDSDR_QSPI , - .clrr = (void __iomem *)MCFGPIO_PCLRR_QSPI , - }, - { - .gpio_chip = { - .label ="TIMER" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =96 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_TIMER , - .podr = (void __iomem *)MCFGPIO_PODR_TIMER , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_TIMER , - .setr = (void __iomem *)MCFGPIO_PPDSDR_TIMER , - .clrr = (void __iomem *)MCFGPIO_PCLRR_TIMER , - }, - { - .gpio_chip = { - .label ="ETPU" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =104 , - .ngpio =3 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_ETPU , - .podr = (void __iomem *)MCFGPIO_PODR_ETPU , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_ETPU , - .setr = (void __iomem *)MCFGPIO_PPDSDR_ETPU , - .clrr = (void __iomem *)MCFGPIO_PCLRR_ETPU , - }, +MCFGPS (PIRQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (ADDR ,13 ,3 ), +MCFGPF (DATAH ,16 ,8 ), +MCFGPF (DATAL ,24 ,8 ), +MCFGPF (BUSCTL ,32 ,8 ), +MCFGPF (BS ,40 ,4 ), +MCFGPF (CS ,49 ,7 ), +MCFGPF (SDRAM ,56 ,6 ), +MCFGPF (FECI2C ,64 ,4 ), +MCFGPF (UARTH ,72 ,2 ), +MCFGPF (UARTL ,80 ,8 ), +MCFGPF (QSPI ,88 ,5 ), +MCFGPF (TIMER ,96 ,8 ), +MCFGPF (ETPU ,104 ,3 ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 5/22 m68knommu: switch to GPIO init macros in ColdFire 5249 init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/5249/gpio.c | 33 ++------------------------------- 1 files changed, 2 insertions(+), 31 deletions(-)
arch/m68k/platform/5249/gpio.c +2 -31
@@ -21,37 +21,8 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="GPIO0" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =32 , - }, - .pddr = (void __iomem *)MCFSIM2_GPIOENABLE , - .podr = (void __iomem *)MCFSIM2_GPIOWRITE , - .ppdr = (void __iomem *)MCFSIM2_GPIOREAD , - }, - { - .gpio_chip = { - .label ="GPIO1" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .base =32 , - .ngpio =32 , - }, - .pddr = (void __iomem *)MCFSIM2_GPIO1ENABLE , - .podr = (void __iomem *)MCFSIM2_GPIO1WRITE , - .ppdr = (void __iomem *)MCFSIM2_GPIO1READ , - }, +MCFGPS (GPIO0 ,0 ,32 ,MCFSIM2_GPIOENABLE ,MCFSIM2_GPIOWRITE ,MCFSIM2_GPIOREAD ), +MCFGPS (GPIO1 ,32 ,32 ,MCFSIM2_GPIO1ENABLE ,MCFSIM2_GPIO1WRITE ,MCFSIM2_GPIO1READ ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 6/22 m68knommu: switch to GPIO init macros in ColdFire 5272 init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/5272/gpio.c | 50 ++------------------------------------- 1 files changed, 3 insertions(+), 47 deletions(-)
arch/m68k/platform/5272/gpio.c +3 -47
@@ -21,53 +21,9 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PA" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =16 , - }, - .pddr = (void __iomem *)MCFSIM_PADDR , - .podr = (void __iomem *)MCFSIM_PADAT , - .ppdr = (void __iomem *)MCFSIM_PADAT , - }, - { - .gpio_chip = { - .label ="PB" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .base =16 , - .ngpio =16 , - }, - .pddr = (void __iomem *)MCFSIM_PBDDR , - .podr = (void __iomem *)MCFSIM_PBDAT , - .ppdr = (void __iomem *)MCFSIM_PBDAT , - }, - { - .gpio_chip = { - .label ="PC" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .base =32 , - .ngpio =16 , - }, - .pddr = (void __iomem *)MCFSIM_PCDDR , - .podr = (void __iomem *)MCFSIM_PCDAT , - .ppdr = (void __iomem *)MCFSIM_PCDAT , - }, +MCFGPS (PA ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), +MCFGPS (PB ,16 ,16 ,MCFSIM_PBDDR ,MCFSIM_PBDAT ,MCFSIM_PBDAT ), +MCFGPS (Pc,32 ,16 ,MCFSIM_PCDDR ,MCFSIM_PCDAT ,MCFSIM_PCDAT ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 7/22 m68knommu: switch to GPIO init macros in ColdFire 527x init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/527x/gpio.c | 604 +++------------------------------------- 1 files changed, 32 insertions(+), 572 deletions(-)
arch/m68k/platform/527x/gpio.c +32 -572
@@ -22,579 +22,39 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {#if defined(CONFIG_M5271 ) - { - .gpio_chip = { - .label = "PIRQ", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .base = 1, - .ngpio = 7, - }, - .pddr = (void __iomem *) MCFEPORT_EPDDR, - .podr = (void __iomem *) MCFEPORT_EPDR, - .ppdr = (void __iomem *) MCFEPORT_EPPDR, - }, - { - .gpio_chip = { - .label = "ADDR", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 13, - .ngpio = 3, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_ADDR, - .podr = (void __iomem *) MCFGPIO_PODR_ADDR, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_ADDR, - .setr = (void __iomem *) MCFGPIO_PPDSDR_ADDR, - .clrr = (void __iomem *) MCFGPIO_PCLRR_ADDR, - }, - { - .gpio_chip = { - .label = "DATAH", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 16, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_DATAH, - .podr = (void __iomem *) MCFGPIO_PODR_DATAH, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_DATAH, - .setr = (void __iomem *) MCFGPIO_PPDSDR_DATAH, - .clrr = (void __iomem *) MCFGPIO_PCLRR_DATAH, - }, - { - .gpio_chip = { - .label = "DATAL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 24, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_DATAL, - .podr = (void __iomem *) MCFGPIO_PODR_DATAL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_DATAL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_DATAL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_DATAL, - }, - { - .gpio_chip = { - .label = "BUSCTL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 32, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_BUSCTL, - .podr = (void __iomem *) MCFGPIO_PODR_BUSCTL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_BUSCTL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_BUSCTL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_BUSCTL, - }, - { - .gpio_chip = { - .label = "BS", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 40, - .ngpio = 4, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_BS, - .podr = (void __iomem *) MCFGPIO_PODR_BS, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_BS, - .setr = (void __iomem *) MCFGPIO_PPDSDR_BS, - .clrr = (void __iomem *) MCFGPIO_PCLRR_BS, - }, - { - .gpio_chip = { - .label = "CS", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 49, - .ngpio = 7, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_CS, - .podr = (void __iomem *) MCFGPIO_PODR_CS, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_CS, - .setr = (void __iomem *) MCFGPIO_PPDSDR_CS, - .clrr = (void __iomem *) MCFGPIO_PCLRR_CS, - }, - { - .gpio_chip = { - .label = "SDRAM", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 56, - .ngpio = 6, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_SDRAM, - .podr = (void __iomem *) MCFGPIO_PODR_SDRAM, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_SDRAM, - .setr = (void __iomem *) MCFGPIO_PPDSDR_SDRAM, - .clrr = (void __iomem *) MCFGPIO_PCLRR_SDRAM, - }, - { - .gpio_chip = { - .label = "FECI2C", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 64, - .ngpio = 4, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_FECI2C, - .podr = (void __iomem *) MCFGPIO_PODR_FECI2C, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_FECI2C, - .setr = (void __iomem *) MCFGPIO_PPDSDR_FECI2C, - .clrr = (void __iomem *) MCFGPIO_PCLRR_FECI2C, - }, - { - .gpio_chip = { - .label = "UARTH", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 72, - .ngpio = 2, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_UARTH, - .podr = (void __iomem *) MCFGPIO_PODR_UARTH, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_UARTH, - .setr = (void __iomem *) MCFGPIO_PPDSDR_UARTH, - .clrr = (void __iomem *) MCFGPIO_PCLRR_UARTH, - }, - { - .gpio_chip = { - .label = "UARTL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 80, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_UARTL, - .podr = (void __iomem *) MCFGPIO_PODR_UARTL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_UARTL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_UARTL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_UARTL, - }, - { - .gpio_chip = { - .label = "QSPI", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 88, - .ngpio = 5, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_QSPI, - .podr = (void __iomem *) MCFGPIO_PODR_QSPI, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_QSPI, - .setr = (void __iomem *) MCFGPIO_PPDSDR_QSPI, - .clrr = (void __iomem *) MCFGPIO_PCLRR_QSPI, - }, - { - .gpio_chip = { - .label = "TIMER", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 96, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_TIMER, - .podr = (void __iomem *) MCFGPIO_PODR_TIMER, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_TIMER, - .setr = (void __iomem *) MCFGPIO_PPDSDR_TIMER, - .clrr = (void __iomem *) MCFGPIO_PCLRR_TIMER, - }, + MCFGPS(PIRQ, 1, 7, MCFEPORT_EPDDR, MCFEPORT_EPDR, MCFEPORT_EPPDR), + MCFGPF(ADDR, 13, 3), + MCFGPF(DATAH, 16, 8), + MCFGPF(DATAL, 24, 8), + MCFGPF(BUSCTL, 32, 8), + MCFGPF(BS, 40, 4), + MCFGPF(CS, 49, 7), + MCFGPF(SDRAM, 56, 6), + MCFGPF(FECI2C, 64, 4), + MCFGPF(UARTH, 72, 2), + MCFGPF(UARTL, 80, 8), + MCFGPF(QSPI, 88, 5), + MCFGPF(TIMER, 96, 8), #elif defined(CONFIG_M5275) - { - .gpio_chip = { - .label = "PIRQ", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .base = 1, - .ngpio = 7, - }, - .pddr = (void __iomem *) MCFEPORT_EPDDR, - .podr = (void __iomem *) MCFEPORT_EPDR, - .ppdr = (void __iomem *) MCFEPORT_EPPDR, - }, - { - .gpio_chip = { - .label = "BUSCTL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 8, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_BUSCTL, - .podr = (void __iomem *) MCFGPIO_PODR_BUSCTL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_BUSCTL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_BUSCTL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_BUSCTL, - }, - { - .gpio_chip = { - .label = "ADDR", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 21, - .ngpio = 3, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_ADDR, - .podr = (void __iomem *) MCFGPIO_PODR_ADDR, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_ADDR, - .setr = (void __iomem *) MCFGPIO_PPDSDR_ADDR, - .clrr = (void __iomem *) MCFGPIO_PCLRR_ADDR, - }, - { - .gpio_chip = { - .label = "CS", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 25, - .ngpio = 7, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_CS, - .podr = (void __iomem *) MCFGPIO_PODR_CS, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_CS, - .setr = (void __iomem *) MCFGPIO_PPDSDR_CS, - .clrr = (void __iomem *) MCFGPIO_PCLRR_CS, - }, - { - .gpio_chip = { - .label = "FEC0H", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 32, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_FEC0H, - .podr = (void __iomem *) MCFGPIO_PODR_FEC0H, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_FEC0H, - .setr = (void __iomem *) MCFGPIO_PPDSDR_FEC0H, - .clrr = (void __iomem *) MCFGPIO_PCLRR_FEC0H, - }, - { - .gpio_chip = { - .label = "FEC0L", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 40, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_FEC0L, - .podr = (void __iomem *) MCFGPIO_PODR_FEC0L, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_FEC0L, - .setr = (void __iomem *) MCFGPIO_PPDSDR_FEC0L, - .clrr = (void __iomem *) MCFGPIO_PCLRR_FEC0L, - }, - { - .gpio_chip = { - .label = "FECI2C", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 48, - .ngpio = 6, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_FECI2C, - .podr = (void __iomem *) MCFGPIO_PODR_FECI2C, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_FECI2C, - .setr = (void __iomem *) MCFGPIO_PPDSDR_FECI2C, - .clrr = (void __iomem *) MCFGPIO_PCLRR_FECI2C, - }, - { - .gpio_chip = { - .label = "QSPI", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 56, - .ngpio = 7, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_QSPI, - .podr = (void __iomem *) MCFGPIO_PODR_QSPI, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_QSPI, - .setr = (void __iomem *) MCFGPIO_PPDSDR_QSPI, - .clrr = (void __iomem *) MCFGPIO_PCLRR_QSPI, - }, - { - .gpio_chip = { - .label = "SDRAM", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 64, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_SDRAM, - .podr = (void __iomem *) MCFGPIO_PODR_SDRAM, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_SDRAM, - .setr = (void __iomem *) MCFGPIO_PPDSDR_SDRAM, - .clrr = (void __iomem *) MCFGPIO_PCLRR_SDRAM, - }, - { - .gpio_chip = { - .label = "TIMERH", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 72, - .ngpio = 4, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_TIMERH, - .podr = (void __iomem *) MCFGPIO_PODR_TIMERH, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_TIMERH, - .setr = (void __iomem *) MCFGPIO_PPDSDR_TIMERH, - .clrr = (void __iomem *) MCFGPIO_PCLRR_TIMERH, - }, - { - .gpio_chip = { - .label = "TIMERL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 80, - .ngpio = 4, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_TIMERL, - .podr = (void __iomem *) MCFGPIO_PODR_TIMERL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_TIMERL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_TIMERL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_TIMERL, - }, - { - .gpio_chip = { - .label = "UARTL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 88, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_UARTL, - .podr = (void __iomem *) MCFGPIO_PODR_UARTL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_UARTL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_UARTL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_UARTL, - }, - { - .gpio_chip = { - .label = "FEC1H", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 96, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_FEC1H, - .podr = (void __iomem *) MCFGPIO_PODR_FEC1H, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_FEC1H, - .setr = (void __iomem *) MCFGPIO_PPDSDR_FEC1H, - .clrr = (void __iomem *) MCFGPIO_PCLRR_FEC1H, - }, - { - .gpio_chip = { - .label = "FEC1L", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 104, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_FEC1L, - .podr = (void __iomem *) MCFGPIO_PODR_FEC1L, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_FEC1L, - .setr = (void __iomem *) MCFGPIO_PPDSDR_FEC1L, - .clrr = (void __iomem *) MCFGPIO_PCLRR_FEC1L, - }, - { - .gpio_chip = { - .label = "BS", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 114, - .ngpio = 2, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_BS, - .podr = (void __iomem *) MCFGPIO_PODR_BS, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_BS, - .setr = (void __iomem *) MCFGPIO_PPDSDR_BS, - .clrr = (void __iomem *) MCFGPIO_PCLRR_BS, - }, - { - .gpio_chip = { - .label = "IRQ", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 121, - .ngpio = 7, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_IRQ, - .podr = (void __iomem *) MCFGPIO_PODR_IRQ, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_IRQ, - .setr = (void __iomem *) MCFGPIO_PPDSDR_IRQ, - .clrr = (void __iomem *) MCFGPIO_PCLRR_IRQ, - }, - { - .gpio_chip = { - .label = "USBH", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 128, - .ngpio = 1, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_USBH, - .podr = (void __iomem *) MCFGPIO_PODR_USBH, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_USBH, - .setr = (void __iomem *) MCFGPIO_PPDSDR_USBH, - .clrr = (void __iomem *) MCFGPIO_PCLRR_USBH, - }, - { - .gpio_chip = { - .label = "USBL", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 136, - .ngpio = 8, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_USBL, - .podr = (void __iomem *) MCFGPIO_PODR_USBL, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_USBL, - .setr = (void __iomem *) MCFGPIO_PPDSDR_USBL, - .clrr = (void __iomem *) MCFGPIO_PCLRR_USBL, - }, - { - .gpio_chip = { - .label = "UARTH", - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base = 144, - .ngpio = 4, - }, - .pddr = (void __iomem *) MCFGPIO_PDDR_UARTH, - .podr = (void __iomem *) MCFGPIO_PODR_UARTH, - .ppdr = (void __iomem *) MCFGPIO_PPDSDR_UARTH, - .setr = (void __iomem *) MCFGPIO_PPDSDR_UARTH, - .clrr = (void __iomem *) MCFGPIO_PCLRR_UARTH, - }, +MCFGPS (PIRQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (BUSCTL ,8 ,8 ), +MCFGPF (ADDR ,21 ,3 ), +MCFGPF (CS ,25 ,7 ), +MCFGPF (FEC0H ,32 ,8 ), +MCFGPF (FEC0L ,40 ,8 ), +MCFGPF (FECI2C ,48 ,6 ), +MCFGPF (QSPI ,56 ,7 ), +MCFGPF (SDRAM ,64 ,8 ), +MCFGPF (TIMERH ,72 ,4 ), +MCFGPF (TIMERL ,80 ,4 ), +MCFGPF (UARTL ,88 ,8 ), +MCFGPF (FEC1H ,96 ,8 ), +MCFGPF (FEC1L ,104 ,8 ), +MCFGPF (BS ,114 ,2 ), +MCFGPF (IRQ ,121 ,7 ), +MCFGPF (USBH ,128 ,1 ), +MCFGPF (USBL ,136 ,8 ), + MCFGPF(UARTH, 144, 4), #endif };
Signature · 1 line
1.7.0.4
PATCH 8/22 m68knommu: switch to GPIO init macros in ColdFire 528x init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
We also need to rename some of the GPIO registers to be consistent with all other ColdFire parts (we can't use the new GPIO macros otherwise).
--- arch/m68k/include/asm/m528xsim.h | 179 +++++++--------- arch/m68k/platform/528x/gpio.c | 427 ++------------------------------------ 2 files changed, 103 insertions(+), 503 deletions(-)
arch/m68k/include/asm/m528xsim.h +80 -99
@@ -97,100 +97,81 @@/* * GPIO registers */ -#define MCFGPIO_PORTA (MCF_IPSBAR + 0x00100000) -#define MCFGPIO_PORTB (MCF_IPSBAR + 0x00100001) -#define MCFGPIO_PORTC (MCF_IPSBAR + 0x00100002) -#define MCFGPIO_PORTD (MCF_IPSBAR + 0x00100003) -#define MCFGPIO_PORTE (MCF_IPSBAR + 0x00100004) -#define MCFGPIO_PORTF (MCF_IPSBAR + 0x00100005) -#define MCFGPIO_PORTG (MCF_IPSBAR + 0x00100006) -#define MCFGPIO_PORTH (MCF_IPSBAR + 0x00100007) -#define MCFGPIO_PORTJ (MCF_IPSBAR + 0x00100008) -#define MCFGPIO_PORTDD (MCF_IPSBAR + 0x00100009) -#define MCFGPIO_PORTEH (MCF_IPSBAR + 0x0010000A) -#define MCFGPIO_PORTEL (MCF_IPSBAR + 0x0010000B) -#define MCFGPIO_PORTAS (MCF_IPSBAR + 0x0010000C) -#define MCFGPIO_PORTQS (MCF_IPSBAR + 0x0010000D) -#define MCFGPIO_PORTSD (MCF_IPSBAR + 0x0010000E) -#define MCFGPIO_PORTTC (MCF_IPSBAR + 0x0010000F) -#define MCFGPIO_PORTTD (MCF_IPSBAR + 0x00100010) -#define MCFGPIO_PORTUA (MCF_IPSBAR + 0x00100011) - -#define MCFGPIO_DDRA (MCF_IPSBAR + 0x00100014) -#define MCFGPIO_DDRB (MCF_IPSBAR + 0x00100015) -#define MCFGPIO_DDRC (MCF_IPSBAR + 0x00100016) -#define MCFGPIO_DDRD (MCF_IPSBAR + 0x00100017) -#define MCFGPIO_DDRE (MCF_IPSBAR + 0x00100018) -#define MCFGPIO_DDRF (MCF_IPSBAR + 0x00100019) -#define MCFGPIO_DDRG (MCF_IPSBAR + 0x0010001A) -#define MCFGPIO_DDRH (MCF_IPSBAR + 0x0010001B) -#define MCFGPIO_DDRJ (MCF_IPSBAR + 0x0010001C) -#define MCFGPIO_DDRDD (MCF_IPSBAR + 0x0010001D) -#define MCFGPIO_DDREH (MCF_IPSBAR + 0x0010001E) -#define MCFGPIO_DDREL (MCF_IPSBAR + 0x0010001F) -#define MCFGPIO_DDRAS (MCF_IPSBAR + 0x00100020) -#define MCFGPIO_DDRQS (MCF_IPSBAR + 0x00100021) -#define MCFGPIO_DDRSD (MCF_IPSBAR + 0x00100022) -#define MCFGPIO_DDRTC (MCF_IPSBAR + 0x00100023) -#define MCFGPIO_DDRTD (MCF_IPSBAR + 0x00100024) -#define MCFGPIO_DDRUA (MCF_IPSBAR + 0x00100025) - -#define MCFGPIO_PORTAP (MCF_IPSBAR + 0x00100028) -#define MCFGPIO_PORTBP (MCF_IPSBAR + 0x00100029) -#define MCFGPIO_PORTCP (MCF_IPSBAR + 0x0010002A) -#define MCFGPIO_PORTDP (MCF_IPSBAR + 0x0010002B) -#define MCFGPIO_PORTEP (MCF_IPSBAR + 0x0010002C) -#define MCFGPIO_PORTFP (MCF_IPSBAR + 0x0010002D) -#define MCFGPIO_PORTGP (MCF_IPSBAR + 0x0010002E) -#define MCFGPIO_PORTHP (MCF_IPSBAR + 0x0010002F) -#define MCFGPIO_PORTJP (MCF_IPSBAR + 0x00100030) -#define MCFGPIO_PORTDDP (MCF_IPSBAR + 0x00100031) -#define MCFGPIO_PORTEHP (MCF_IPSBAR + 0x00100032) -#define MCFGPIO_PORTELP (MCF_IPSBAR + 0x00100033) -#define MCFGPIO_PORTASP (MCF_IPSBAR + 0x00100034) -#define MCFGPIO_PORTQSP (MCF_IPSBAR + 0x00100035) -#define MCFGPIO_PORTSDP (MCF_IPSBAR + 0x00100036) -#define MCFGPIO_PORTTCP (MCF_IPSBAR + 0x00100037) -#define MCFGPIO_PORTTDP (MCF_IPSBAR + 0x00100038) -#define MCFGPIO_PORTUAP (MCF_IPSBAR + 0x00100039) - -#define MCFGPIO_SETA (MCF_IPSBAR + 0x00100028) -#define MCFGPIO_SETB (MCF_IPSBAR + 0x00100029) -#define MCFGPIO_SETC (MCF_IPSBAR + 0x0010002A) -#define MCFGPIO_SETD (MCF_IPSBAR + 0x0010002B) -#define MCFGPIO_SETE (MCF_IPSBAR + 0x0010002C) -#define MCFGPIO_SETF (MCF_IPSBAR + 0x0010002D) -#define MCFGPIO_SETG (MCF_IPSBAR + 0x0010002E) -#define MCFGPIO_SETH (MCF_IPSBAR + 0x0010002F) -#define MCFGPIO_SETJ (MCF_IPSBAR + 0x00100030) -#define MCFGPIO_SETDD (MCF_IPSBAR + 0x00100031) -#define MCFGPIO_SETEH (MCF_IPSBAR + 0x00100032) -#define MCFGPIO_SETEL (MCF_IPSBAR + 0x00100033) -#define MCFGPIO_SETAS (MCF_IPSBAR + 0x00100034) -#define MCFGPIO_SETQS (MCF_IPSBAR + 0x00100035) -#define MCFGPIO_SETSD (MCF_IPSBAR + 0x00100036) -#define MCFGPIO_SETTC (MCF_IPSBAR + 0x00100037) -#define MCFGPIO_SETTD (MCF_IPSBAR + 0x00100038) -#define MCFGPIO_SETUA (MCF_IPSBAR + 0x00100039) - -#define MCFGPIO_CLRA (MCF_IPSBAR + 0x0010003C) -#define MCFGPIO_CLRB (MCF_IPSBAR + 0x0010003D) -#define MCFGPIO_CLRC (MCF_IPSBAR + 0x0010003E) -#define MCFGPIO_CLRD (MCF_IPSBAR + 0x0010003F) -#define MCFGPIO_CLRE (MCF_IPSBAR + 0x00100040) -#define MCFGPIO_CLRF (MCF_IPSBAR + 0x00100041) -#define MCFGPIO_CLRG (MCF_IPSBAR + 0x00100042) -#define MCFGPIO_CLRH (MCF_IPSBAR + 0x00100043) -#define MCFGPIO_CLRJ (MCF_IPSBAR + 0x00100044) -#define MCFGPIO_CLRDD (MCF_IPSBAR + 0x00100045) -#define MCFGPIO_CLREH (MCF_IPSBAR + 0x00100046) -#define MCFGPIO_CLREL (MCF_IPSBAR + 0x00100047) -#define MCFGPIO_CLRAS (MCF_IPSBAR + 0x00100048) -#define MCFGPIO_CLRQS (MCF_IPSBAR + 0x00100049) -#define MCFGPIO_CLRSD (MCF_IPSBAR + 0x0010004A) -#define MCFGPIO_CLRTC (MCF_IPSBAR + 0x0010004B) -#define MCFGPIO_CLRTD (MCF_IPSBAR + 0x0010004C) -#define MCFGPIO_CLRUA (MCF_IPSBAR + 0x0010004D) +#define MCFGPIO_PODR_A (MCF_IPSBAR + 0x00100000) +#define MCFGPIO_PODR_B (MCF_IPSBAR + 0x00100001) +#define MCFGPIO_PODR_C (MCF_IPSBAR + 0x00100002) +#define MCFGPIO_PODR_D (MCF_IPSBAR + 0x00100003) +#define MCFGPIO_PODR_E (MCF_IPSBAR + 0x00100004) +#define MCFGPIO_PODR_F (MCF_IPSBAR + 0x00100005) +#define MCFGPIO_PODR_G (MCF_IPSBAR + 0x00100006) +#define MCFGPIO_PODR_H (MCF_IPSBAR + 0x00100007) +#define MCFGPIO_PODR_J (MCF_IPSBAR + 0x00100008) +#define MCFGPIO_PODR_DD (MCF_IPSBAR + 0x00100009) +#define MCFGPIO_PODR_EH (MCF_IPSBAR + 0x0010000A) +#define MCFGPIO_PODR_EL (MCF_IPSBAR + 0x0010000B) +#define MCFGPIO_PODR_AS (MCF_IPSBAR + 0x0010000C) +#define MCFGPIO_PODR_QS (MCF_IPSBAR + 0x0010000D) +#define MCFGPIO_PODR_SD (MCF_IPSBAR + 0x0010000E) +#define MCFGPIO_PODR_TC (MCF_IPSBAR + 0x0010000F) +#define MCFGPIO_PODR_TD (MCF_IPSBAR + 0x00100010) +#define MCFGPIO_PODR_UA (MCF_IPSBAR + 0x00100011) + +#define MCFGPIO_PDDR_A (MCF_IPSBAR + 0x00100014) +#define MCFGPIO_PDDR_B (MCF_IPSBAR + 0x00100015) +#define MCFGPIO_PDDR_C (MCF_IPSBAR + 0x00100016) +#define MCFGPIO_PDDR_D (MCF_IPSBAR + 0x00100017) +#define MCFGPIO_PDDR_E (MCF_IPSBAR + 0x00100018) +#define MCFGPIO_PDDR_F (MCF_IPSBAR + 0x00100019) +#define MCFGPIO_PDDR_G (MCF_IPSBAR + 0x0010001A) +#define MCFGPIO_PDDR_H (MCF_IPSBAR + 0x0010001B) +#define MCFGPIO_PDDR_J (MCF_IPSBAR + 0x0010001C) +#define MCFGPIO_PDDR_DD (MCF_IPSBAR + 0x0010001D) +#define MCFGPIO_PDDR_EH (MCF_IPSBAR + 0x0010001E) +#define MCFGPIO_PDDR_EL (MCF_IPSBAR + 0x0010001F) +#define MCFGPIO_PDDR_AS (MCF_IPSBAR + 0x00100020) +#define MCFGPIO_PDDR_QS (MCF_IPSBAR + 0x00100021) +#define MCFGPIO_PDDR_SD (MCF_IPSBAR + 0x00100022) +#define MCFGPIO_PDDR_TC (MCF_IPSBAR + 0x00100023) +#define MCFGPIO_PDDR_TD (MCF_IPSBAR + 0x00100024) +#define MCFGPIO_PDDR_UA (MCF_IPSBAR + 0x00100025) + +#define MCFGPIO_PPDSDR_A (MCF_IPSBAR + 0x00100028) +#define MCFGPIO_PPDSDR_B (MCF_IPSBAR + 0x00100029) +#define MCFGPIO_PPDSDR_C (MCF_IPSBAR + 0x0010002A) +#define MCFGPIO_PPDSDR_D (MCF_IPSBAR + 0x0010002B) +#define MCFGPIO_PPDSDR_E (MCF_IPSBAR + 0x0010002C) +#define MCFGPIO_PPDSDR_F (MCF_IPSBAR + 0x0010002D) +#define MCFGPIO_PPDSDR_G (MCF_IPSBAR + 0x0010002E) +#define MCFGPIO_PPDSDR_H (MCF_IPSBAR + 0x0010002F) +#define MCFGPIO_PPDSDR_J (MCF_IPSBAR + 0x00100030) +#define MCFGPIO_PPDSDR_DD (MCF_IPSBAR + 0x00100031) +#define MCFGPIO_PPDSDR_EH (MCF_IPSBAR + 0x00100032) +#define MCFGPIO_PPDSDR_EL (MCF_IPSBAR + 0x00100033) +#define MCFGPIO_PPDSDR_AS (MCF_IPSBAR + 0x00100034) +#define MCFGPIO_PPDSDR_QS (MCF_IPSBAR + 0x00100035) +#define MCFGPIO_PPDSDR_SD (MCF_IPSBAR + 0x00100036) +#define MCFGPIO_PPDSDR_TC (MCF_IPSBAR + 0x00100037) +#define MCFGPIO_PPDSDR_TD (MCF_IPSBAR + 0x00100038) +#define MCFGPIO_PPDSDR_UA (MCF_IPSBAR + 0x00100039) + +#define MCFGPIO_PCLRR_A (MCF_IPSBAR + 0x0010003C) +#define MCFGPIO_PCLRR_B (MCF_IPSBAR + 0x0010003D) +#define MCFGPIO_PCLRR_C (MCF_IPSBAR + 0x0010003E) +#define MCFGPIO_PCLRR_D (MCF_IPSBAR + 0x0010003F) +#define MCFGPIO_PCLRR_E (MCF_IPSBAR + 0x00100040) +#define MCFGPIO_PCLRR_F (MCF_IPSBAR + 0x00100041) +#define MCFGPIO_PCLRR_G (MCF_IPSBAR + 0x00100042) +#define MCFGPIO_PCLRR_H (MCF_IPSBAR + 0x00100043) +#define MCFGPIO_PCLRR_J (MCF_IPSBAR + 0x00100044) +#define MCFGPIO_PCLRR_DD (MCF_IPSBAR + 0x00100045) +#define MCFGPIO_PCLRR_EH (MCF_IPSBAR + 0x00100046) +#define MCFGPIO_PCLRR_EL (MCF_IPSBAR + 0x00100047) +#define MCFGPIO_PCLRR_AS (MCF_IPSBAR + 0x00100048) +#define MCFGPIO_PCLRR_QS (MCF_IPSBAR + 0x00100049) +#define MCFGPIO_PCLRR_SD (MCF_IPSBAR + 0x0010004A) +#define MCFGPIO_PCLRR_TC (MCF_IPSBAR + 0x0010004B) +#define MCFGPIO_PCLRR_TD (MCF_IPSBAR + 0x0010004C) +#define MCFGPIO_PCLRR_UA (MCF_IPSBAR + 0x0010004D)#define MCFGPIO_PBCDPAR (MCF_IPSBAR + 0x00100050)#define MCFGPIO_PFPAR (MCF_IPSBAR + 0x00100051)
@@ -242,11 +223,11 @@* definitions for generic gpio support * */ -#define MCFGPIO_PODR MCFGPIO_PORTA/* port output data */ -#define MCFGPIO_PDDR MCFGPIO_DDRA/* port data direction */ -#define MCFGPIO_PPDR MCFGPIO_PORTAP/* port pin data */ -#define MCFGPIO_SETR MCFGPIO_SETA/* set output */ -#define MCFGPIO_CLRR MCFGPIO_CLRA/* clr output */ +#define MCFGPIO_PODR MCFGPIO_PODR_A/* port output data */ +#define MCFGPIO_PDDR MCFGPIO_PDDR_A/* port data direction */ +#define MCFGPIO_PPDR MCFGPIO_PPDSDR_A/* port pin data */ +#define MCFGPIO_SETR MCFGPIO_PPDSDR_A/* set output */ +#define MCFGPIO_CLRR MCFGPIO_PCLRR_A/* clr output */ #define MCFGPIO_IRQ_MAX 8#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
arch/m68k/platform/528x/gpio.c +23 -404
433 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 9/22 m68knommu: switch to GPIO init macros in ColdFire 5307 init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/5307/gpio.c | 16 +--------------- 1 files changed, 1 insertions(+), 15 deletions(-)
arch/m68k/platform/5307/gpio.c +1 -15
@@ -21,21 +21,7 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PP" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =16 , - }, - .pddr = (void __iomem *)MCFSIM_PADDR , - .podr = (void __iomem *)MCFSIM_PADAT , - .ppdr = (void __iomem *)MCFSIM_PADAT , - }, +MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 10/22 m68knommu: switch to GPIO init macros in ColdFire 5407 init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/5407/gpio.c | 16 +--------------- 1 files changed, 1 insertions(+), 15 deletions(-)
arch/m68k/platform/5407/gpio.c +1 -15
@@ -21,21 +21,7 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PP" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =16 , - }, - .pddr = (void __iomem *)MCFSIM_PADDR , - .podr = (void __iomem *)MCFSIM_PADAT , - .ppdr = (void __iomem *)MCFSIM_PADAT , - }, +MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 11/22 m68knommu: switch to GPIO init macros in ColdFire 532x init code
In reply to [email protected]From: Greg Ungerer <[email protected]>
Modify the GPIO setup table to use the mcfgpio.h macros for table init. Simplifies code and reduces line count significantly.
--- arch/m68k/platform/532x/gpio.c | 320 ++------------------------------------- 1 files changed, 17 insertions(+), 303 deletions(-)
arch/m68k/platform/532x/gpio.c +17 -303
@@ -21,309 +21,23 @@#include <asm/mcfgpio.h> static struct mcf_gpio_chip mcf_gpio_chips[] = { - { - .gpio_chip = { - .label ="PIRQ" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value, - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFEPORT_EPDDR , - .podr = (void __iomem *)MCFEPORT_EPDR , - .ppdr = (void __iomem *)MCFEPORT_EPPDR , - }, - { - .gpio_chip = { - .label ="FECH" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =8 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECH , - .podr = (void __iomem *)MCFGPIO_PODR_FECH , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECH , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECH , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECH , - }, - { - .gpio_chip = { - .label ="FECL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =16 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECL , - .podr = (void __iomem *)MCFGPIO_PODR_FECL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECL , - }, - { - .gpio_chip = { - .label ="SSI" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =24 , - .ngpio =5 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_SSI , - .podr = (void __iomem *)MCFGPIO_PODR_SSI , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_SSI , - .setr = (void __iomem *)MCFGPIO_PPDSDR_SSI , - .clrr = (void __iomem *)MCFGPIO_PCLRR_SSI , - }, - { - .gpio_chip = { - .label ="BUSCTL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =32 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_BUSCTL , - .podr = (void __iomem *)MCFGPIO_PODR_BUSCTL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_BUSCTL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_BUSCTL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_BUSCTL , - }, - { - .gpio_chip = { - .label ="BE" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =40 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_BE , - .podr = (void __iomem *)MCFGPIO_PODR_BE , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_BE , - .setr = (void __iomem *)MCFGPIO_PPDSDR_BE , - .clrr = (void __iomem *)MCFGPIO_PCLRR_BE , - }, - { - .gpio_chip = { - .label ="CS" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =49 , - .ngpio =5 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_CS , - .podr = (void __iomem *)MCFGPIO_PODR_CS , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_CS , - .setr = (void __iomem *)MCFGPIO_PPDSDR_CS , - .clrr = (void __iomem *)MCFGPIO_PCLRR_CS , - }, - { - .gpio_chip = { - .label ="PWM" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =58 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_PWM , - .podr = (void __iomem *)MCFGPIO_PODR_PWM , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_PWM , - .setr = (void __iomem *)MCFGPIO_PPDSDR_PWM , - .clrr = (void __iomem *)MCFGPIO_PCLRR_PWM , - }, - { - .gpio_chip = { - .label ="FECI2C" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =64 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_FECI2C , - .podr = (void __iomem *)MCFGPIO_PODR_FECI2C , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_FECI2C , - .setr = (void __iomem *)MCFGPIO_PPDSDR_FECI2C , - .clrr = (void __iomem *)MCFGPIO_PCLRR_FECI2C , - }, - { - .gpio_chip = { - .label ="UART" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =72 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_UART , - .podr = (void __iomem *)MCFGPIO_PODR_UART , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_UART , - .setr = (void __iomem *)MCFGPIO_PPDSDR_UART , - .clrr = (void __iomem *)MCFGPIO_PCLRR_UART , - }, - { - .gpio_chip = { - .label ="QSPI" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =80 , - .ngpio =6 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_QSPI , - .podr = (void __iomem *)MCFGPIO_PODR_QSPI , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_QSPI , - .setr = (void __iomem *)MCFGPIO_PPDSDR_QSPI , - .clrr = (void __iomem *)MCFGPIO_PCLRR_QSPI , - }, - { - .gpio_chip = { - .label ="TIMER" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =88 , - .ngpio =4 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_TIMER , - .podr = (void __iomem *)MCFGPIO_PODR_TIMER , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_TIMER , - .setr = (void __iomem *)MCFGPIO_PPDSDR_TIMER , - .clrr = (void __iomem *)MCFGPIO_PCLRR_TIMER , - }, - { - .gpio_chip = { - .label ="LCDDATAH" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =96 , - .ngpio =2 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_LCDDATAH , - .podr = (void __iomem *)MCFGPIO_PODR_LCDDATAH , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_LCDDATAH , - .setr = (void __iomem *)MCFGPIO_PPDSDR_LCDDATAH , - .clrr = (void __iomem *)MCFGPIO_PCLRR_LCDDATAH , - }, - { - .gpio_chip = { - .label ="LCDDATAM" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =104 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_LCDDATAM , - .podr = (void __iomem *)MCFGPIO_PODR_LCDDATAM , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_LCDDATAM , - .setr = (void __iomem *)MCFGPIO_PPDSDR_LCDDATAM , - .clrr = (void __iomem *)MCFGPIO_PCLRR_LCDDATAM , - }, - { - .gpio_chip = { - .label ="LCDDATAL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =112 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_LCDDATAL , - .podr = (void __iomem *)MCFGPIO_PODR_LCDDATAL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_LCDDATAL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_LCDDATAL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_LCDDATAL , - }, - { - .gpio_chip = { - .label ="LCDCTLH" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =120 , - .ngpio =1 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_LCDCTLH , - .podr = (void __iomem *)MCFGPIO_PODR_LCDCTLH , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_LCDCTLH , - .setr = (void __iomem *)MCFGPIO_PPDSDR_LCDCTLH , - .clrr = (void __iomem *)MCFGPIO_PCLRR_LCDCTLH , - }, - { - .gpio_chip = { - .label ="LCDCTLL" , - .request = mcf_gpio_request, - .free = mcf_gpio_free, - .direction_input = mcf_gpio_direction_input, - .direction_output = mcf_gpio_direction_output, - .get = mcf_gpio_get_value, - .set = mcf_gpio_set_value_fast, - .base =128 , - .ngpio =8 , - }, - .pddr = (void __iomem *)MCFGPIO_PDDR_LCDCTLL , - .podr = (void __iomem *)MCFGPIO_PODR_LCDCTLL , - .ppdr = (void __iomem *)MCFGPIO_PPDSDR_LCDCTLL , - .setr = (void __iomem *)MCFGPIO_PPDSDR_LCDCTLL , - .clrr = (void __iomem *)MCFGPIO_PCLRR_LCDCTLL , - }, +MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (FECH ,8 ,8 ), +MCFGPF (FECL ,16 ,8 ), +MCFGPF (SSI ,24 ,5 ), +MCFGPF (BUSCTL ,32 ,4 ), +MCFGPF (BE ,40 ,4 ), +MCFGPF (CS ,49 ,5 ), +MCFGPF (PWM ,58 ,4 ), +MCFGPF (FECI2C ,64 ,4 ), +MCFGPF (UART ,72 ,8 ), +MCFGPF (QSPI ,80 ,6 ), +MCFGPF (TIMER ,88 ,4 ), +MCFGPF (LCDDATAH ,96 ,2 ), +MCFGPF (LCDDATAM ,104 ,8 ), +MCFGPF (LCDDATAL ,112 ,8 ), +MCFGPF (LCDCTLH ,120 ,1 ), +MCFGPF (LCDCTLL ,128 ,8 ), };static int __init mcf_gpio_init (void )
Signature · 1 line
1.7.0.4
PATCH 13/22 m68knommu: simplify the ColdFire 5206 GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/5206/Makefile | 2 +- arch/m68k/platform/5206/config.c | 9 +++++++++ arch/m68k/platform/5206/gpio.c | 27 --------------------------- 3 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 arch/m68k/platform/5206/gpio.c
arch/m68k/platform/5206/Makefile +1 -1
@@ -14,5 +14,5 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/5206/config.c +9 -0
@@ -16,6 +16,15 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> +#include <asm/mcfgpio.h> + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PP ,0 ,8 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);/***************************************************************************/
arch/m68k/platform/5206/gpio.c deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PP ,0 ,8 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
PATCH 12/22 m68knommu: make duplicated ColdFire GPIO init code common for all
In reply to [email protected]From: Greg Ungerer <[email protected]>
The code that adds each ColdFire platforms GPIO signals is duplicated in each platforms specific code. Remove it from each platforms code and put a single version in the existing ColdFire gpio subsystem init code.
--- arch/m68k/include/asm/mcfgpio.h | 3 +++ arch/m68k/platform/5206/gpio.c | 12 ++---------- arch/m68k/platform/520x/gpio.c | 12 ++---------- arch/m68k/platform/523x/gpio.c | 12 ++---------- arch/m68k/platform/5249/gpio.c | 12 ++---------- arch/m68k/platform/5272/gpio.c | 12 ++---------- arch/m68k/platform/527x/gpio.c | 12 ++---------- arch/m68k/platform/528x/gpio.c | 12 ++---------- arch/m68k/platform/5307/gpio.c | 12 ++---------- arch/m68k/platform/532x/gpio.c | 12 ++---------- arch/m68k/platform/5407/gpio.c | 12 ++---------- arch/m68k/platform/coldfire/gpio.c | 4 ++++ 12 files changed, 27 insertions(+), 100 deletions(-)
arch/m68k/include/asm/mcfgpio.h +3 -0
@@ -29,6 +29,9 @@ struct mcf_gpio_chip {const u8 *gpio_to_pinmux; }; +extern struct mcf_gpio_chip mcf_gpio_chips[]; +extern unsigned int mcf_gpio_chips_size; +int mcf_gpio_direction_input (struct gpio_chip *,unsigned );int mcf_gpio_get_value (struct gpio_chip *,unsigned );int mcf_gpio_direction_output (struct gpio_chip *,unsigned ,int );
arch/m68k/platform/5206/gpio.c +2 -10
@@ -20,16 +20,8 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PP ,0 ,8 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/520x/gpio.c +2 -10
@@ -20,7 +20,7 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ),MCFGPF (CS ,9 ,3 ),MCFGPF (FECI2C ,16 ,4 ),
@@ -31,12 +31,4 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = { MCFGPF(FECL, 56, 8), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/523x/gpio.c +2 -10
@@ -20,7 +20,7 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PIRQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ),MCFGPF (ADDR ,13 ,3 ),MCFGPF (DATAH ,16 ,8 ),
@@ -37,12 +37,4 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = { MCFGPF(ETPU, 104, 3), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/5249/gpio.c +2 -10
@@ -20,17 +20,9 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (GPIO0 ,0 ,32 ,MCFSIM2_GPIOENABLE ,MCFSIM2_GPIOWRITE ,MCFSIM2_GPIOREAD ),MCFGPS (GPIO1 ,32 ,32 ,MCFSIM2_GPIO1ENABLE ,MCFSIM2_GPIO1WRITE ,MCFSIM2_GPIO1READ ), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/5272/gpio.c +2 -10
@@ -20,18 +20,10 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PA ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ),MCFGPS (PB ,16 ,16 ,MCFSIM_PBDDR ,MCFSIM_PBDAT ,MCFSIM_PBDAT ),MCFGPS (Pc,32 ,16 ,MCFSIM_PCDDR ,MCFSIM_PCDAT ,MCFSIM_PCDAT ), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/527x/gpio.c +2 -10
@@ -20,7 +20,7 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {#if defined(CONFIG_M5271 )MCFGPS (PIRQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), MCFGPF(ADDR, 13, 3),
@@ -58,12 +58,4 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = {#endif }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/528x/gpio.c +2 -10
@@ -20,7 +20,7 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (NQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ),MCFGPS (TA ,8 ,4 ,MCFGPTA_GPTDDR ,MCFGPTA_GPTPORT ,MCFGPTB_GPTPORT ),MCFGPS (TB ,16 ,4 ,MCFGPTB_GPTDDR ,MCFGPTB_GPTPORT ,MCFGPTB_GPTPORT ),
@@ -46,12 +46,4 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = { MCFGPF(UA, 176, 4), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/5307/gpio.c +2 -10
@@ -20,16 +20,8 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/532x/gpio.c +2 -10
@@ -20,7 +20,7 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ),MCFGPF (FECH ,8 ,8 ),MCFGPF (FECL ,16 ,8 ),
@@ -40,12 +40,4 @@ static struct mcf_gpio_chip mcf_gpio_chips[] = { MCFGPF(LCDCTLL, 128, 8), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/5407/gpio.c +2 -10
@@ -20,16 +20,8 @@#include <asm/mcfsim.h> #include <asm/mcfgpio.h> -static struct mcf_gpio_chip mcf_gpio_chips[] = { +struct mcf_gpio_chip mcf_gpio_chips[] = {MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), }; -static int __init mcf_gpio_init (void ) -{ -unsigned i =0 ; -while (i <ARRAY_SIZE (mcf_gpio_chips)) - (void )gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]); -return 0 ; -} - -core_initcall (mcf_gpio_init); +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
arch/m68k/platform/coldfire/gpio.c +4 -0
@@ -122,6 +122,10 @@ struct bus_type mcf_gpio_subsys = {static int __init mcf_gpio_sysinit (void ) { +unsigned int i =0 ; + +while (i < mcf_gpio_chips_size) +gpiochip_add ((struct gpio_chip *)&mcf_gpio_chips[i++]);return subsys_system_register (&mcf_gpio_subsys,NULL ); }
Signature · 1 line
1.7.0.4
PATCH 14/22 m68knommu: simplify the ColdFire 520x GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/520x/Makefile | 2 +- arch/m68k/platform/520x/config.c | 16 ++++++++++++++++ arch/m68k/platform/520x/gpio.c | 34 ---------------------------------- 3 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 arch/m68k/platform/520x/gpio.c
arch/m68k/platform/520x/Makefile +1 -1
@@ -14,4 +14,4 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/520x/config.c +16 -0
@@ -19,6 +19,22 @@#include <asm/coldfire.h> #include <asm/mcfsim.h> #include <asm/mcfuart.h> +#include <asm/mcfgpio.h> + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (CS ,9 ,3 ), +MCFGPF (FECI2C ,16 ,4 ), +MCFGPF (QSPI ,24 ,4 ), +MCFGPF (TIMER ,32 ,4 ), +MCFGPF (UART ,40 ,8 ), +MCFGPF (FECH ,48 ,8 ), +MCFGPF (FECL ,56 ,8 ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);/***************************************************************************/
arch/m68k/platform/520x/gpio.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), -MCFGPF (CS ,9 ,3 ), -MCFGPF (FECI2C ,16 ,4 ), -MCFGPF (QSPI ,24 ,4 ), -MCFGPF (TIMER ,32 ,4 ), -MCFGPF (UART ,40 ,8 ), -MCFGPF (FECH ,48 ,8 ), -MCFGPF (FECL ,56 ,8 ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
PATCH 15/22 m68knommu: simplify the ColdFire 523x GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/523x/Makefile | 2 +- arch/m68k/platform/523x/config.c | 22 ++++++++++++++++++++ arch/m68k/platform/523x/gpio.c | 40 -------------------------------------- 3 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 arch/m68k/platform/523x/gpio.c
arch/m68k/platform/523x/Makefile +1 -1
@@ -14,4 +14,4 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/523x/config.c +22 -0
@@ -19,6 +19,28 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> +#include <asm/mcfgpio.h> + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PIRQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (ADDR ,13 ,3 ), +MCFGPF (DATAH ,16 ,8 ), +MCFGPF (DATAL ,24 ,8 ), +MCFGPF (BUSCTL ,32 ,8 ), +MCFGPF (BS ,40 ,4 ), +MCFGPF (CS ,49 ,7 ), +MCFGPF (SDRAM ,56 ,6 ), +MCFGPF (FECI2C ,64 ,4 ), +MCFGPF (UARTH ,72 ,2 ), +MCFGPF (UARTL ,80 ,8 ), +MCFGPF (QSPI ,88 ,5 ), +MCFGPF (TIMER ,96 ,8 ), +MCFGPF (ETPU ,104 ,3 ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);/***************************************************************************/
arch/m68k/platform/523x/gpio.c deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PIRQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), -MCFGPF (ADDR ,13 ,3 ), -MCFGPF (DATAH ,16 ,8 ), -MCFGPF (DATAL ,24 ,8 ), -MCFGPF (BUSCTL ,32 ,8 ), -MCFGPF (BS ,40 ,4 ), -MCFGPF (CS ,49 ,7 ), -MCFGPF (SDRAM ,56 ,6 ), -MCFGPF (FECI2C ,64 ,4 ), -MCFGPF (UARTH ,72 ,2 ), -MCFGPF (UARTL ,80 ,8 ), -MCFGPF (QSPI ,88 ,5 ), -MCFGPF (TIMER ,96 ,8 ), -MCFGPF (ETPU ,104 ,3 ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
PATCH 16/22 m68knommu: simplify the ColdFire 5249 GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/5249/Makefile | 2 +- arch/m68k/platform/5249/config.c | 10 ++++++++++ arch/m68k/platform/5249/gpio.c | 28 ---------------------------- 3 files changed, 11 insertions(+), 29 deletions(-) delete mode 100644 arch/m68k/platform/5249/gpio.c
arch/m68k/platform/5249/Makefile +1 -1
@@ -14,5 +14,5 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o intc2.o +obj-y := config.o intc2.o
arch/m68k/platform/5249/config.c +10 -0
@@ -16,6 +16,16 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> +#include <asm/mcfgpio.h> + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (GPIO0 ,0 ,32 ,MCFSIM2_GPIOENABLE ,MCFSIM2_GPIOWRITE ,MCFSIM2_GPIOREAD ), +MCFGPS (GPIO1 ,32 ,32 ,MCFSIM2_GPIO1ENABLE ,MCFSIM2_GPIO1WRITE ,MCFSIM2_GPIO1READ ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);/***************************************************************************/
arch/m68k/platform/5249/gpio.c deleted +0 -28
@@ -1,28 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (GPIO0 ,0 ,32 ,MCFSIM2_GPIOENABLE ,MCFSIM2_GPIOWRITE ,MCFSIM2_GPIOREAD ), -MCFGPS (GPIO1 ,32 ,32 ,MCFSIM2_GPIO1ENABLE ,MCFSIM2_GPIO1WRITE ,MCFSIM2_GPIO1READ ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
PATCH 17/22 m68knommu: simplify the ColdFire 5272 GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/5272/Makefile | 2 +- arch/m68k/platform/5272/config.c | 11 +++++++++++ arch/m68k/platform/5272/gpio.c | 29 ----------------------------- 3 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 arch/m68k/platform/5272/gpio.c
arch/m68k/platform/5272/Makefile +1 -1
@@ -14,5 +14,5 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o intc.o +obj-y := config.o intc.o
arch/m68k/platform/5272/config.c +11 -0
@@ -19,6 +19,7 @@#include <asm/coldfire.h> #include <asm/mcfsim.h> #include <asm/mcfuart.h> +#include <asm/mcfgpio.h> /***************************************************************************/
@@ -30,6 +31,16 @@ unsigned char ledbank = 0xff;/***************************************************************************/ +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PA ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), +MCFGPS (PB ,16 ,16 ,MCFSIM_PBDDR ,MCFSIM_PBDAT ,MCFSIM_PBDAT ), +MCFGPS (Pc,32 ,16 ,MCFSIM_PCDDR ,MCFSIM_PCDAT ,MCFSIM_PCDAT ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips); + +/***************************************************************************/ +static void __init m5272_uarts_init (void ) {u32 v;
arch/m68k/platform/5272/gpio.c deleted +0 -29
@@ -1,29 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PA ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), -MCFGPS (PB ,16 ,16 ,MCFSIM_PBDDR ,MCFSIM_PBDAT ,MCFSIM_PBDAT ), -MCFGPS (Pc,32 ,16 ,MCFSIM_PCDDR ,MCFSIM_PCDAT ,MCFSIM_PCDAT ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
PATCH 18/22 m68knommu: simplify the ColdFire 527x GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/527x/Makefile | 2 +- arch/m68k/platform/527x/config.c | 43 ++++++++++++++++++++++++++ arch/m68k/platform/527x/gpio.c | 61 -------------------------------------- 3 files changed, 44 insertions(+), 62 deletions(-) delete mode 100644 arch/m68k/platform/527x/gpio.c
arch/m68k/platform/527x/Makefile +1 -1
@@ -14,5 +14,5 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/527x/config.c +43 -0
49 lines not on this page · raw message
arch/m68k/platform/527x/gpio.c deleted +0 -61
61 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 19/22 m68knommu: simplify the ColdFire 528x GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/528x/Makefile | 2 +- arch/m68k/platform/528x/config.c | 31 ++++++++++++++++++++++++ arch/m68k/platform/528x/gpio.c | 49 -------------------------------------- 3 files changed, 32 insertions(+), 50 deletions(-) delete mode 100644 arch/m68k/platform/528x/gpio.c
arch/m68k/platform/528x/Makefile +1 -1
@@ -14,5 +14,5 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/528x/config.c +31 -0
@@ -21,6 +21,37 @@#include <asm/coldfire.h> #include <asm/mcfsim.h> #include <asm/mcfuart.h> +#include <asm/mcfgpio.h> + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (NQ ,1 ,7 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPS (TA ,8 ,4 ,MCFGPTA_GPTDDR ,MCFGPTA_GPTPORT ,MCFGPTB_GPTPORT ), +MCFGPS (TB ,16 ,4 ,MCFGPTB_GPTDDR ,MCFGPTB_GPTPORT ,MCFGPTB_GPTPORT ), +MCFGPS (QA ,24 ,4 ,MCFQADC_DDRQA ,MCFQADC_PORTQA ,MCFQADC_PORTQA ), +MCFGPS (QA ,32 ,4 ,MCFQADC_DDRQB ,MCFQADC_PORTQB ,MCFQADC_PORTQB ), +MCFGPF (A ,40 ,8 ), +MCFGPF (B ,48 ,8 ), +MCFGPF (C ,56 ,8 ), +MCFGPF (D ,64 ,8 ), +MCFGPF (E ,72 ,8 ), +MCFGPF (F ,80 ,8 ), +MCFGPF (G ,88 ,8 ), +MCFGPF (H ,96 ,8 ), +MCFGPF (J ,104 ,8 ), +MCFGPF (DD ,112 ,8 ), +MCFGPF (EH ,120 ,8 ), +MCFGPF (EL ,128 ,8 ), +MCFGPF (AS ,136 ,6 ), +MCFGPF (QS ,144 ,7 ), +MCFGPF (SD ,152 ,6 ), +MCFGPF (TC ,160 ,4 ), +MCFGPF (TD ,168 ,4 ), +MCFGPF (UA ,176 ,4 ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);/***************************************************************************/
arch/m68k/platform/528x/gpio.c deleted +0 -49
49 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 20/22 m68knommu: simplify the ColdFire 5307 GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/5307/Makefile | 2 +- arch/m68k/platform/5307/config.c | 9 +++++++++ arch/m68k/platform/5307/gpio.c | 27 --------------------------- 3 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 arch/m68k/platform/5307/gpio.c
arch/m68k/platform/5307/Makefile +1 -1
@@ -14,7 +14,7 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y += config.o gpio.o +obj-y += config.o obj-$(CONFIG_NETtel) += nettel.o obj-$(CONFIG_CLEOPATRA) += nettel.o
arch/m68k/platform/5307/config.c +9 -0
@@ -16,6 +16,7 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> +#include <asm/mcfgpio.h> #include <asm/mcfwdebug.h> /***************************************************************************/
@@ -28,6 +29,14 @@ unsigned char ledbank = 0xff;/***************************************************************************/ +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips); + +/***************************************************************************/ +void __init config_BSP (char *commandp,int size) { #if defined(CONFIG_NETtel) || \
arch/m68k/platform/5307/gpio.c deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
PATCH 21/22 m68knommu: simplify the ColdFire 532x GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/532x/Makefile | 2 +- arch/m68k/platform/532x/config.c | 25 ++++++++++++++++++++++ arch/m68k/platform/532x/gpio.c | 43 -------------------------------------- 3 files changed, 26 insertions(+), 44 deletions(-) delete mode 100644 arch/m68k/platform/532x/gpio.c
arch/m68k/platform/532x/Makefile +1 -1
@@ -15,4 +15,4 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 #obj-y := config.o usb-mcf532x.o spi-mcf532x.o -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/532x/config.c +25 -0
@@ -26,10 +26,35 @@#include <asm/mcfsim.h> #include <asm/mcfuart.h> #include <asm/mcfdma.h> +#include <asm/mcfgpio.h> #include <asm/mcfwdebug.h> /***************************************************************************/ +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (FECH ,8 ,8 ), +MCFGPF (FECL ,16 ,8 ), +MCFGPF (SSI ,24 ,5 ), +MCFGPF (BUSCTL ,32 ,4 ), +MCFGPF (BE ,40 ,4 ), +MCFGPF (CS ,49 ,5 ), +MCFGPF (PWM ,58 ,4 ), +MCFGPF (FECI2C ,64 ,4 ), +MCFGPF (UART ,72 ,8 ), +MCFGPF (QSPI ,80 ,6 ), +MCFGPF (TIMER ,88 ,4 ), +MCFGPF (LCDDATAH ,96 ,2 ), +MCFGPF (LCDDATAM ,104 ,8 ), +MCFGPF (LCDDATAL ,112 ,8 ), +MCFGPF (LCDCTLH ,120 ,1 ), +MCFGPF (LCDCTLL ,128 ,8 ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips); + +/***************************************************************************/ +#ifdef CONFIG_SPI_COLDFIRE_QSPI static void __init m532x_qspi_init (void )
arch/m68k/platform/532x/gpio.c deleted +0 -43
43 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 22/22 m68knommu: simplify the ColdFire 5407 GPIO struct setup
In reply to [email protected]From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform gpio.c file. So move it to the platform config.c code and remove the gpio.c file.
--- arch/m68k/platform/5407/Makefile | 2 +- arch/m68k/platform/5407/config.c | 9 +++++++++ arch/m68k/platform/5407/gpio.c | 27 --------------------------- 3 files changed, 10 insertions(+), 28 deletions(-) delete mode 100644 arch/m68k/platform/5407/gpio.c
arch/m68k/platform/5407/Makefile +1 -1
@@ -14,5 +14,5 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 -obj-y := config.o gpio.o +obj-y := config.o
arch/m68k/platform/5407/config.c +9 -0
@@ -16,6 +16,15 @@#include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> +#include <asm/mcfgpio.h> + +/***************************************************************************/ + +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);/***************************************************************************/
arch/m68k/platform/5407/gpio.c deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PP ,0 ,16 ,MCFSIM_PADDR ,MCFSIM_PADAT ,MCFSIM_PADAT ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips);
Signature · 1 line
1.7.0.4
Re: [PATCH 21/22] m68knommu: simplify the ColdFire 532x GPIO struct setup
In reply to [email protected]that's a Fucking spam man !!
Quoted 130 lines · On Thu, Apr 26, 2012 at 2:26 AM, <[email protected]> wrote:
From: Greg Ungerer <[email protected]>
The GPIO data struct setup is now the only remaining code in the platform
gpio.cfile. So move it to the platformconfig.ccode and remove thegpio.cfile.Signed-off-by Greg Ungerer <[email protected]>--- arch/m68k/platform/532x/Makefile | 2 +- arch/m68k/platform/532x/config.c | 25 ++++++++++++++++++++++ arch/m68k/platform/532x/gpio.c | 43 -------------------------------------- 3 files changed, 26 insertions(+), 44 deletions(-) delete mode 100644 arch/m68k/platform/532x/gpio.carch/m68k/platform/532x/Makefile +1
-1@@ -15,4 +15,4 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 #obj-y := config.o usb-mcf532x.o spi-mcf532x.o -obj-y := config.o gpio.o +obj-y := config.oarch/m68k/platform/532x/config.c +25
-0@@ -26,10 +26,35 @@#include <asm/mcfsim.h> #include <asm/mcfuart.h> #include <asm/mcfdma.h> +#include <asm/mcfgpio.h> #include <asm/mcfwdebug.h> /***************************************************************************/ +struct mcf_gpio_chip mcf_gpio_chips[] = { +MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), +MCFGPF (FECH ,8 ,8 ), +MCFGPF (FECL ,16 ,8 ), +MCFGPF (SSI ,24 ,5 ), +MCFGPF (BUSCTL ,32 ,4 ), +MCFGPF (BE ,40 ,4 ), +MCFGPF (CS ,49 ,5 ), +MCFGPF (PWM ,58 ,4 ), +MCFGPF (FECI2C ,64 ,4 ), +MCFGPF (UART ,72 ,8 ), +MCFGPF (QSPI ,80 ,6 ), +MCFGPF (TIMER ,88 ,4 ), +MCFGPF (LCDDATAH ,96 ,2 ), +MCFGPF (LCDDATAM ,104 ,8 ), +MCFGPF (LCDDATAL ,112 ,8 ), +MCFGPF (LCDCTLH ,120 ,1 ), +MCFGPF (LCDCTLL ,128 ,8 ), +}; + +unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips); + +/***************************************************************************/ +#ifdef CONFIG_SPI_COLDFIRE_QSPI static void
__initm532x_qspi_init(void)arch/m68k/platform/532x/gpio.c deleted +0
-44@@ -1,43 +0,0 @@ -/* -* Coldfire generic GPIO support -* -* (C) Copyright 2009, Steven King <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; version 2 of the License. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/init.h> - -#include <asm/coldfire.h> -#include <asm/mcfsim.h> -#include <asm/mcfgpio.h> - -struct mcf_gpio_chip mcf_gpio_chips[] = { -MCFGPS (PIRQ ,0 ,8 ,MCFEPORT_EPDDR ,MCFEPORT_EPDR ,MCFEPORT_EPPDR ), -MCFGPF (FECH ,8 ,8 ), -MCFGPF (FECL ,16 ,8 ), -MCFGPF (SSI ,24 ,5 ), -MCFGPF (BUSCTL ,32 ,4 ), -MCFGPF (BE ,40 ,4 ), -MCFGPF (CS ,49 ,5 ), -MCFGPF (PWM ,58 ,4 ), -MCFGPF (FECI2C ,64 ,4 ), -MCFGPF (UART ,72 ,8 ), -MCFGPF (QSPI ,80 ,6 ), -MCFGPF (TIMER ,88 ,4 ), -MCFGPF (LCDDATAH ,96 ,2 ), -MCFGPF (LCDDATAM ,104 ,8 ), -MCFGPF (LCDDATAL ,112 ,8 ), -MCFGPF (LCDCTLH ,120 ,1 ), -MCFGPF (LCDCTLL ,128 ,8 ), -}; - -unsigned int mcf_gpio_chips_size =ARRAY_SIZE (mcf_gpio_chips); --1.7.0.4
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Signature · 3 lines
______ Mohamed Nabil Hafez Embedded Software Engineer
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 21/22] m68knommu: simplify the ColdFire 532x GPIO struct setup
Quoted 1 line · mohamed nabil
that's a Fucking spam man !!
Huh?
Thats how open source development works. If you don't like it don't subscribe to a developers list.
Regards
Greg
Quoted 145 lines
On Thu, Apr 26, 2012 at 2:26 AM, <[email protected] <mailto:[email protected]>> wrote:
From: Greg Ungerer <[email protected] <mailto:[email protected]>>
The GPIO data struct setup is now the only remaining code in the platform
gpio.cfile. So move it to the platformconfig.ccode and remove thegpio.c
file.Signed-off-by Greg Ungerer <[email protected] <mailto:[email protected]>>---
arch/m68k/platform/532x/Makefile| 2 +-
arch/m68k/platform/532x/config.c| 25 ++++++++++++++++++++++
arch/m68k/platform/532x/gpio.c| 43
--------------------------------------
3 files changed, 26 insertions(+), 44 deletions(-) delete mode 100644arch/m68k/platform/532x/gpio.cdiff --git a/arch/m68k/platform/532x/Makefile b/arch/m68k/platform/532x/Makefile
index ce01669..c0d8cf8 100644
--- a/arch/m68k/platform/532x/Makefile
+++ b/arch/m68k/platform/532x/Makefile
@@ -15,4 +15,4 @@
asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1#obj-y := config.o usb-mcf532x.o spi-mcf532x.o
-obj-y := config.o gpio.o
+obj-y := config.o
diff --gita/arch/m68k/platform/532x/config.cb/arch/m68k/platform/532x/config.c
index 2bec347..a4dd3d8 100644
---a/arch/m68k/platform/532x/config.c+++b/arch/m68k/platform/532x/config.c@@ -26,10 +26,35 @@
#include <asm/mcfsim.h>
#include <asm/mcfuart.h>
#include <asm/mcfdma.h>
+#include <asm/mcfgpio.h>
#include <asm/mcfwdebug.h>/***************************************************************************/
+struct
mcf_gpio_chipmcf_gpio_chips[] = {
+ MCFGPS(PIRQ, 0, 8,MCFEPORT_EPDDR,MCFEPORT_EPDR,
MCFEPORT_EPPDR),
+MCFGPF(FECH, 8, 8),
+MCFGPF(FECL, 16, 8),
+MCFGPF(SSI, 24, 5),
+MCFGPF(BUSCTL, 32, 4),
+MCFGPF(BE, 40, 4),
+MCFGPF(CS, 49, 5),
+MCFGPF(PWM, 58, 4),
+MCFGPF(FECI2C, 64, 4),
+MCFGPF(UART, 72, 8),
+MCFGPF(QSPI, 80, 6),
+MCFGPF(TIMER, 88, 4),
+MCFGPF(LCDDATAH, 96, 2),
+MCFGPF(LCDDATAM, 104, 8),
+MCFGPF(LCDDATAL, 112, 8),
+MCFGPF(LCDCTLH, 120, 1),
+MCFGPF(LCDCTLL, 128, 8),
+};
+
+unsigned intmcf_gpio_chips_size=ARRAY_SIZE(mcf_gpio_chips);
+ +/***************************************************************************/ +
#ifdefCONFIG_SPI_COLDFIRE_QSPIstatic void
__initm532x_qspi_init(void)
diff --gita/arch/m68k/platform/532x/gpio.cb/arch/m68k/platform/532x/gpio.c
deleted file mode 100644
index 3e1b71d..0000000
---a/arch/m68k/platform/532x/gpio.c
+++/dev/null
@@ -1,43 +0,0 @@
-/*
- * Coldfire generic GPIO support
- *
- * (C) Copyright 2009, Steven King <[email protected] <mailto:[email protected]>>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-*/
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-
-#include <asm/coldfire.h>
-#include <asm/mcfsim.h>
-#include <asm/mcfgpio.h>
-
-structmcf_gpio_chipmcf_gpio_chips[] = {
- MCFGPS(PIRQ, 0, 8,MCFEPORT_EPDDR,MCFEPORT_EPDR,
MCFEPORT_EPPDR),
-MCFGPF(FECH, 8, 8),
-MCFGPF(FECL, 16, 8),
-MCFGPF(SSI, 24, 5),
-MCFGPF(BUSCTL, 32, 4),
-MCFGPF(BE, 40, 4),
-MCFGPF(CS, 49, 5),
-MCFGPF(PWM, 58, 4),
-MCFGPF(FECI2C, 64, 4),
-MCFGPF(UART, 72, 8),
-MCFGPF(QSPI, 80, 6),
-MCFGPF(TIMER, 88, 4),
-MCFGPF(LCDDATAH, 96, 2),
-MCFGPF(LCDDATAM, 104, 8),
-MCFGPF(LCDDATAL, 112, 8),
-MCFGPF(LCDCTLH, 120, 1),
-MCFGPF(LCDCTLL, 128, 8),
-};
-
-unsigned intmcf_gpio_chips_size=ARRAY_SIZE(mcf_gpio_chips); --
1.7.0.4_______________________________________________
uClinux-dev mailing list [email protected] <mailto:[email protected]>
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] <mailto:[email protected]>
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev--
______
Mohamed Nabil Hafez
Embedded Software Engineer
Signature · 12 lines
------------------------------------------------------------------------ Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 01/22] m68knommu: introduce macros to simplify ColdFire GPIO table initialization
In reply to [email protected]Hi Greg,
Quoted 8 lines · On Thu, Apr 26, 2012 at 10:25:41AM +1000, [email protected] wrote:
From: Greg Ungerer <[email protected]>
We have very large tables in the ColdFire CPU GPIO setup code that essentially boil down to 2 distinct types of GPIO pin initiaization. Using 2 macros we can reduce these large tables to at most a dozen lines of setup code, and in quite a few cases a single table entry.
Introduce these 2 macros into the existing
mcfgpio.hheader.
...
Quoted 4 lines
arch/m68k/include/asm/mcfgpio.h +4
-0+/* +* Define macros to ease the pain of setting up the gpio tables. +*/ +#define MCFGPS (mlabel, mbase, mngpio, mpddr, mpodr, mppdr) \
...
Quoted 1 line
+#define
MCFGPF(mlabel, mbase, mngpio)\
...
Maybe a small comment to explain when to use MCFGPS and when to use MCFGPF ?
Best regards
Philippe
Quoted 5 lines · On Wednesday 25 April 2012 5:25:40 pm [email protected] wrote:
The GPIO init code for the ColdFire cores is a set of very large tables, one for each ColdFire SoC type. Each SoC type has very different GPIO pin arrangements, so one for each is unavoidable. But there is fundamentaly two types of setup/access that we are trying to support.
Quoted 7 lines
With some pre-processor macro magic we can reduce the tables significantly, making them easier to read, easier to get correct, and easier to maintain.
The following patches implement a set of simplifying changes. What do others think? Overall we remove close to 2000 lines of code, and the end tables are much easier to read and get correct.
Hi Greg,
This looks fine to me.
You can add my Acked-by: Steven King <[email protected]>
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 01/22] m68knommu: introduce macros to simplify ColdFire GPIO table initialization
In reply to Philippe De MuyterHi Philippe,
Quoted 17 lines · Philippe De Muyter
Hi Greg,
Quoted 8 lines · On Thu, Apr 26, 2012 at 10:25:41AM +1000, [email protected] wrote:
From: Greg Ungerer<[email protected]>
We have very large tables in the ColdFire CPU GPIO setup code that essentially boil down to 2 distinct types of GPIO pin initiaization. Using 2 macros we can reduce these large tables to at most a dozen lines of setup code, and in quite a few cases a single table entry.
Introduce these 2 macros into the existing
mcfgpio.hheader....
Quoted 4 lines
arch/m68k/include/asm/mcfgpio.h +4
-0+/* +* Define macros to ease the pain of setting up the gpio tables. +*/ +#define MCFGPS (mlabel, mbase, mngpio, mpddr, mpodr, mppdr) \...
Quoted 4 lines
Quoted 1 line
+#define
MCFGPF(mlabel, mbase, mngpio)\...
Maybe a small comment to explain when to use MCFGPS and when to use MCFGPF ?
Yep, that sounds like a good idea. I'll do that.
Thanks
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Hi Steven,
Quoted 14 lines · Steven King
Quoted 5 lines · On Wednesday 25 April 2012 5:25:40 pm [email protected] wrote:
The GPIO init code for the ColdFire cores is a set of very large tables, one for each ColdFire SoC type. Each SoC type has very different GPIO pin arrangements, so one for each is unavoidable. But there is fundamentaly two types of setup/access that we are trying to support.
Quoted 7 lines
With some pre-processor macro magic we can reduce the tables significantly, making them easier to read, easier to get correct, and easier to maintain.
The following patches implement a set of simplifying changes. What do others think? Overall we remove close to 2000 lines of code, and the end tables are much easier to read and get correct.
Quoted 4 lines
Hi Greg,
This looks fine to me.
You can add my Acked-by: Steven King<[email protected]>
Great, thanks.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 21/22] m68knommu: simplify the ColdFire 532x GPIO struct setup
In reply to mohamed nabilQuoted 1 line · mohamed nabil
that's a Fucking spam man !!
It was an overview and 22 patch files, sent in standard git email style. Very organized, all in one thread, easy to read. Nothing wrong with it.
Signature · 8 lines
Len Sorensen _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 21/22] m68knommu: simplify the ColdFire 532x GPIO struct setup
can somebody stop this please?
Quoted 6 lines
Date: Thu, 26 Apr 2012 12:14:17 -0400
To: [email protected]
From: [email protected]
CC: [email protected]; [email protected]
Subject: Re: [uClinux-dev] [PATCH 21/22] m68knommu: simplify the ColdFire 532x GPIO struct setup
Quoted 15 lines
Quoted 1 line · mohamed nabil
that's a Fucking spam man !!
It was an overview and 22 patch files, sent in standard git email style. Very organized, all in one thread, easy to read. Nothing wrong with it.
Signature · 8 lines
Len Sorensen _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
_______________________________________________
uClinux-dev mailing list [email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected] To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [PATCH 08/22] m68knommu: switch to GPIO init macros in ColdFire 528x init code
In reply to [email protected]arch/m68k/platform/528x/gpio.c line 28
Quoted 2 lines · On Thu, 26 Apr 2012, [email protected] wrote:
arch/m68k/platform/528x/gpio.c +2
-0+MCFGPS (QA ,24 ,4 ,MCFQADC_DDRQA ,MCFQADC_PORTQA ,MCFQADC_PORTQA ), + MCFGPS(QA, 32, 4, MCFQADC_DDRQB, MCFQADC_PORTQB, MCFQADC_PORTQB),
I think the second label should be "QB".
Also affected is "[PATCH 19/22] m68knommu: simplify the ColdFire 528x GPIO struct setup".
Finn
Re: [PATCH 08/22] m68knommu: switch to GPIO init macros in ColdFire 528x init code
Hi Finn,
Quoted 9 lines · Finn Thain
arch/m68k/platform/528x/gpio.c line 28
Quoted 2 lines · On Thu, 26 Apr 2012, [email protected] wrote:
arch/m68k/platform/528x/gpio.c +2
-0+MCFGPS (QA ,24 ,4 ,MCFQADC_DDRQA ,MCFQADC_PORTQA ,MCFQADC_PORTQA ), + MCFGPS(QA, 32, 4, MCFQADC_DDRQB, MCFQADC_PORTQB, MCFQADC_PORTQB),I think the second label should be "QB".
Also affected is "[PATCH 19/22] m68knommu: simplify the ColdFire 528x GPIO struct setup".
Good catch!
Thanks, I'll fix that up.
Regards
Greg
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com