powerpc: Implement GPIO LIB API on CPM2 Freescale SoC.
PATCH 1/1 powerpc: Implement GPIO LIB API on CPM2 Freescale SoC.
This patch implement GPIO LIB support for the CPM2 GPIOs.
The code is based on Jochen Friedrich's patch for the CPM1.
--- arch/powerpc/platforms/Kconfig | 2 + arch/powerpc/sysdev/cpm2.c | 123 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 0 deletions(-)
arch/powerpc/platforms/Kconfig +2 -0
@@ -283,6 +283,8 @@ config CPM2 depends on MPC85xx || 8260 select CPM select PPC_LIB_RHEAP + select GENERIC_GPIO + select HAVE_GPIO_LIB help The CPM2 (Communications Processor Module) is a coprocessor on embedded CPUs made by Freescale. Selecting this option means that
arch/powerpc/sysdev/cpm2.c +123 -0
139 lines not on this page · raw message
Signature · 13 lines
1.5.0 -- Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Hi Laurent,
Quoted 3 lines
This patch implement GPIO LIB support for the CPM2 GPIOs.
The code is based on Jochen Friedrich's patch for the CPM1.
I guess most of this should go to cpm_common.c and should be used for Port E on CPM1, as well. This port uses the same layout as CPM2 while Port B uses a different layout. See the discussion in
http://patchwork.ozlabs.org/linuxppc/patch?id=16282
Thanks,
Jochen
Quoted 10 lines · Jochen Friedrich
Hi Laurent,
Quoted 3 lines
This patch implement GPIO LIB support for the CPM2 GPIOs.
The code is based on Jochen Friedrich's patch for the CPM1.
I guess most of this should go to
cpm_common.cand should be used for Port E on CPM1, as well. This port uses the same layout as CPM2 while Port B uses a different layout. See the discussion in
http://patchwork.ozlabs.org/linuxppc/patch?id=16282
The link doesn't seem to be related.
I'll rework the patch to move CPM2 GPIO support to cpm_common.c. Have you thought about a proper name for the compatible property ?
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Hi Laurent,
Quoted 3 lines
Quoted 1 line
The link doesn't seem to be related.
http://patchwork.ozlabs.org/linuxppc/patch?id=17490 is the correct one.
Quoted 2 lines
I'll rework the patch to move CPM2 GPIO support to
cpm_common.c. Have you thought about a proper name for the compatible property ?
I would leave cpm_init_par_io() in cpm2.c and just move the other parts.
- for cpm2, the property fsl,cpm2-pario-bank is correct.
- for cpm1, i'm thinking of something like fsl,cpm1-pario-bank32b and fsl,cpm1-pario-bank32e.
I'll update the CPM1 parts on top of your patch...
Thanks,
Jochen
Quoted 7 lines · Jochen Friedrich
Hi Laurent,
Quoted 3 lines
Quoted 1 line
The link doesn't seem to be related.
http://patchwork.ozlabs.org/linuxppc/patch?id=17490 is the correct one.
Thanks.
Quoted 6 lines
Quoted 2 lines
I'll rework the patch to move CPM2 GPIO support to
cpm_common.c. Have you thought about a proper name for the compatible property ?I would leave
cpm_init_par_io()incpm2.cand just move the other parts.
- for cpm2, the property fsl,cpm2-pario-bank is correct.
- for cpm1, i'm thinking of something like fsl,cpm1-pario-bank32b and
fsl,cpm1-pario-bank32e.
Any preference for common function names ? cpm2_gpio32* might be too CPM2-specific for cpm_common.c. cpm_gpio32* is a bit too generic as it doesn't support port E on the CPM1.
BTW, what's the purpose of the shadow data register in the CPM GPIO chip structure ? As the set operation is protected by a spinlock, the only use I can think of is to prevent changing bits in the PDAT register for pins configured as inputs. Is that correct ? If so this should be clearly documented in the code.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussee de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Hi Laurent,
Quoted 5 lines
BTW, what's the purpose of the shadow data register in the CPM GPIO chip structure ? As the set operation is protected by a spinlock, the only use I can think of is to prevent changing bits in the PDAT register for pins configured as inputs. Is that correct ? If so this should be clearly documented in the code.
It's for pins configured as open drain. See the discussion in:
http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050826.html
Thanks,
Jochen
Hi Laurent,
Quoted 3 lines
Any preference for common function names ? cpm2_gpio32* might be too CPM2-specific for
cpm_common.c. cpm_gpio32* is a bit too generic as it doesn't support port E on the CPM1.
I would keep the cpm2 name. I'll just add a comment to cpm1.c that fsl,cpm1-pario-bank32e uses cpm2 layout.
Thanks,
Jochen