ARM: S5PV310: Add support GPIOlib
Subsystems (3)
v2 cover ARM: S5PV310: Add support GPIOlib
This patch adds support for S5PV310/S5PC210 GPIOlib
The patch series contains:
[PATCH V2 1/2] ARM: S5P: Add initial map for GPIO2 and GPIO3 [PATCH V2 2/2] ARM: S5PV310: Add support GPIOlib
PATCH v2 1/2 ARM: S5P: Add initial map for GPIO2 and GPIO3
From: Jongpill Lee <[email protected]>
This patch adds initial map for GPIO2 and GPIO3. S5PV310/S5PC210 has separated GPIO1, GPIO2 and GPIO3.
---
Changes since v1:
- Rebased on latest for-next from Kukjin Kim's git tree
- Added S5P_VA_GPIO1 according to S5PV310_PA_GPIO1
arch/arm/mach-s5pv310/cpu.c | 12 +++++++++++- arch/arm/plat-s5p/include/plat/map-s5p.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv310/cpu.c +11 -1
@@ -57,11 +57,21 @@ static struct map_desc s5pv310_iodesc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, { - .virtual = (unsigned long)S5P_VA_GPIO, + .virtual = (unsigned long)S5P_VA_GPIO1, .pfn = __phys_to_pfn(S5PV310_PA_GPIO1), .length = SZ_4K, .type = MT_DEVICE, }, { + .virtual = (unsigned long)S5P_VA_GPIO2, + .pfn = __phys_to_pfn(S5PV310_PA_GPIO2), + .length = SZ_4K, + .type = MT_DEVICE, + }, { + .virtual = (unsigned long)S5P_VA_GPIO3, + .pfn = __phys_to_pfn(S5PV310_PA_GPIO3), + .length = SZ_256K, + .type = MT_DEVICE, + }, { .virtual = (unsigned long)S5P_VA_DMC0, .pfn = __phys_to_pfn(S5PV310_PA_DMC0), .length = SZ_4K,
arch/arm/plat-s5p/include/plat/map-s5p.h +3 -0
@@ -16,6 +16,9 @@#define S5P_VA_CHIPID S3C_ADDR(0x02000000)#define S5P_VA_CMU S3C_ADDR(0x02100000)#define S5P_VA_GPIO S3C_ADDR(0x02200000) +#define S5P_VA_GPIO1 S5P_VA_GPIO +#define S5P_VA_GPIO2 S3C_ADDR(0x02240000) +#define S5P_VA_GPIO3 S3C_ADDR(0x02280000)#define S5P_VA_SYSRAM S3C_ADDR(0x02400000)#define S5P_VA_DMC0 S3C_ADDR(0x02440000)
Signature · 1 line
1.6.2.5
PATCH v2 1/2 ARM: S5P: Add initial map for GPIO2 and GPIO3
Quoted 50 lines · Sangbeom Kim
From: Jongpill Lee <[email protected]>
This patch adds initial map for GPIO2 and GPIO3. S5PV310/S5PC210 has separated GPIO1, GPIO2 and GPIO3.
Signed-off-by Jongpill Lee <[email protected]>Signed-off-by Sangbeom Kim <[email protected]>---
Changes since v1:
- Rebased on latest for-next from Kukjin Kim's git tree
- AddedS5P_VA_GPIO1according toS5PV310_PA_GPIO1arch/arm/mach-s5pv310/cpu.c | 12 +++++++++++- arch/arm/plat-s5p/include/plat/map-s5p.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletions(-)arch/arm/mach-s5pv310/cpu.c +11
-1@@ -57,11 +57,21 @@ static struct map_desc s5pv310_iodesc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, { - .virtual = (unsigned long)S5P_VA_GPIO, + .virtual = (unsigned long)S5P_VA_GPIO1, .pfn = __phys_to_pfn(S5PV310_PA_GPIO1), .length = SZ_4K, .type = MT_DEVICE, }, { + .virtual = (unsigned long)S5P_VA_GPIO2, + .pfn = __phys_to_pfn(S5PV310_PA_GPIO2), + .length = SZ_4K, + .type = MT_DEVICE, + }, { + .virtual = (unsigned long)S5P_VA_GPIO3, + .pfn = __phys_to_pfn(S5PV310_PA_GPIO3), + .length = SZ_256K, + .type = MT_DEVICE, + }, { .virtual = (unsigned long)S5P_VA_DMC0, .pfn = __phys_to_pfn(S5PV310_PA_DMC0), .length = SZ_4K,arch/arm/plat- renamed from arch/arm/plat-s5p/include/plat/map-s5p.h +0
-0
s5p/include/plat/map-s5p.h
index ec96a19..fef353d 100644
arch/arm/plat-s5p/include/plat/map-s5p.h
Quoted 10 lines
arch/arm/plat-s5p/include/plat/map-s5p.h +3
-1@@ -16,6 +16,9 @@#define S5P_VA_CHIPID S3C_ADDR(0x02000000)#define S5P_VA_CMU S3C_ADDR(0x02100000)#define S5P_VA_GPIO S3C_ADDR(0x02200000) +#define S5P_VA_GPIO1 S5P_VA_GPIO +#define S5P_VA_GPIO2 S3C_ADDR(0x02240000) +#define S5P_VA_GPIO3 S3C_ADDR(0x02280000)#define S5P_VA_SYSRAM S3C_ADDR(0x02400000)#define S5P_VA_DMC0 S3C_ADDR(0x02440000) --
Looks ok to me...will apply.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v2 1/2 ARM: S5P: Add initial map for GPIO2 and GPIO3
Quoted 32 lines · Kukjin Kim
Quoted 31 lines · Sangbeom Kim
From: Jongpill Lee <[email protected]>
This patch adds initial map for GPIO2 and GPIO3. S5PV310/S5PC210 has separated GPIO1, GPIO2 and GPIO3.
Signed-off-by Jongpill Lee <[email protected]>Signed-off-by Sangbeom Kim <[email protected]>---
Changes since v1:
- Rebased on latest for-next from Kukjin Kim's git tree
- AddedS5P_VA_GPIO1according toS5PV310_PA_GPIO1?arch/arm/mach-s5pv310/cpu.c ? ? ? ? ? ? ?| ? 12 +++++++++++- ?arch/arm/plat-s5p/include/plat/map-s5p.h | ? ?3 +++ ?2 files changed, 14 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv310/cpu.c +1
-1@@ -57,11 +57,21 @@ static struct map_desc s5pv310_iodesc[] __initdata = { ? ? ? ? ? ? ? .length ? ? ? ? = SZ_4K, ? ? ? ? ? ? ? .type ? ? ? ? ? = MT_DEVICE, ? ? ? }, { - ? ? ? ? ? ? .virtual ? ? ? ?= (unsigned long)S5P_VA_GPIO, + ? ? ? ? ? ? .virtual ? ? ? ?= (unsigned long)S5P_VA_GPIO1, ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(S5PV310_PA_GPIO1), ? ? ? ? ? ? ? .length ? ? ? ? = SZ_4K, ? ? ? ? ? ? ? .type ? ? ? ? ? = MT_DEVICE, ? ? ? }, {
Quoted 8 lines
arch/arm/mach-s5pv310/cpu.c static struct map_desc s5pv310_iodesc[] __initdata = { · line 72
Quoted 8 lines
arch/arm/mach-s5pv310/cpu.c +8
-0+ ? ? ? ? ? ? .virtual ? ? ? ?= (unsigned long)S5P_VA_GPIO2, + ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(S5PV310_PA_GPIO2), + ? ? ? ? ? ? .length ? ? ? ? = SZ_4K, + ? ? ? ? ? ? .type ? ? ? ? ? = MT_DEVICE, + ? ? }, { + ? ? ? ? ? ? .virtual ? ? ? ?= (unsigned long)S5P_VA_GPIO3, + ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(S5PV310_PA_GPIO3), + ? ? ? ? ? ? .length ? ? ? ? = SZ_256K,
Why 256K?
Quoted 38 lines
Quoted 11 lines
arch/arm/mach-s5pv310/cpu.c +2
-0+ ? ? ? ? ? ? .type ? ? ? ? ? = MT_DEVICE, + ? ? }, { ? ? ? ? ? ? ? .virtual ? ? ? ?= (unsigned long)S5P_VA_DMC0, ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(S5PV310_PA_DMC0), ? ? ? ? ? ? ? .length ? ? ? ? = SZ_4K,arch/arm/plat- renamed from arch/arm/plat-s5p/include/plat/map-s5p.h +0
-0
s5p/include/plat/map-s5p.h
index ec96a19..fef353d 100644arch/arm/plat-s5p/include/plat/map-s5p.h
Quoted 10 lines
arch/arm/plat-s5p/include/plat/map-s5p.h +3
-1@@ -16,6 +16,9 @@ ?#define S5P_VA_CHIPID ? ? ? ? ? ? ? ?S3C_ADDR(0x02000000) ?#define S5P_VA_CMU ? ? ? ? ? S3C_ADDR(0x02100000) ?#define S5P_VA_GPIO ? ? ? ? ?S3C_ADDR(0x02200000) +#define S5P_VA_GPIO1 ? ? ? ? S5P_VA_GPIO +#define S5P_VA_GPIO2 ? ? ? ? S3C_ADDR(0x02240000) +#define S5P_VA_GPIO3 ? ? ? ? S3C_ADDR(0x02280000) ?#define S5P_VA_SYSRAM ? ? ? ? ? ? ? ?S3C_ADDR(0x02400000) ?#define S5P_VA_DMC0 ? ? ? ? ?S3C_ADDR(0x02440000) --Looks ok to me...will apply.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd._______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 1/2 ARM: S5P: Add initial map for GPIO2 and GPIO3
Quoted 19 lines · Kyungmin Park
Quoted 17 lines · Kukjin Kim
Quoted 16 lines · Sangbeom Kim
From: Jongpill Lee <[email protected]>
This patch adds initial map for GPIO2 and GPIO3. S5PV310/S5PC210 has separated GPIO1, GPIO2 and GPIO3.
Signed-off-by Jongpill Lee <[email protected]>Signed-off-by Sangbeom Kim <[email protected]>---
Changes since v1:
- Rebased on latest for-next from Kukjin Kim's git tree
- AddedS5P_VA_GPIO1according toS5PV310_PA_GPIO1arch/arm/mach-s5pv310/cpu.c | 12 +++++++++++-
arch/arm/plat-s5p/include/plat/map-s5p.h| 3 +++2 files changed, 14 insertions(+), 1 deletions(-)
(snip)
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
+ .virtual = (unsigned long)S5P_VA_GPIO3,
+ .pfn =__phys_to_pfn(S5PV310_PA_GPIO3),
+ .length =SZ_256K,Why 256K?
Oh...yeah, it's typo :-(
Maybe 256?...
Hmm...I will change it when merge.
Thanks for your pointing out.
(snip)
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v2 2/2 ARM: S5PV310: Add support GPIOlib
In reply to Sangbeom KimFrom: Jongpill Lee <[email protected]>
This patch adds GPIOlib support for S5PV310 and S5PC210.
---
NOTE:
This patch used mapped VA IO as GPIO virtual address. because firstly other Samsung SoC's GPIO used same method. and I think that it's better to keep the same method.
And ioremap also can be used for it.
But in the GPIO, there is no need to allocate VA area dynamically. because GPIO can be used in any drivers anytime so it can't iounmap GPIO VA area.
arch/arm/mach-s5pv310/Makefile | 2 +- arch/arm/mach-s5pv310/gpiolib.c | 304 +++++++++++++++++++++++++++++ arch/arm/mach-s5pv310/include/mach/irqs.h | 7 +- 3 files changed, 311 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-s5pv310/gpiolib.c
arch/arm/mach-s5pv310/Makefile +1 -1
@@ -13,7 +13,7 @@ obj- := # Core support for S5PV310 system obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o -obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o +obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o
arch/arm/mach-s5pv310/gpiolib.c new file +304 -0
304 lines not on this page · raw message
arch/arm/mach-s5pv310/include/mach/irqs.h +6 -1
@@ -3,7 +3,7 @@* Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * -* S5PV210 - IRQ definitions +* S5PV310 - IRQ definitions * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -91,4 +91,9 @@#define MAX_COMBINER_NR 40 +#define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) + +#define S5P_EINT_BASE1 (S5P_IRQ_EINT_BASE + 0) +#define S5P_EINT_BASE2 (S5P_IRQ_EINT_BASE + 16) +#endif /* __ASM_ARCH_IRQS_H */
Signature · 1 line
1.6.2.5
PATCH v2 2/2 ARM: S5PV310: Add support GPIOlib
Quoted 7 lines · Sangbeom Kim
From: Jongpill Lee <[email protected]>
This patch adds GPIOlib support for S5PV310 and S5PC210.
Signed-off-by Jongpill Lee <[email protected]>Signed-off-by Sangbeom Kim <[email protected]>
Quoted 10 lines
---
NOTE:
This patch used mapped VA IO as GPIO virtual address. because firstly other Samsung SoC's GPIO used same method. and I think that it's better to keep the same method.
And ioremap also can be used for it.
But in the GPIO, there is no need to allocate VA area dynamically. because GPIO can be used in any drivers anytime so it can't iounmap GPIO VA area.
Ok...
(snip)
arch/arm/mach-s5pv310/include/mach/irqs.h line 98
Quoted 7 lines
#define
MAX_COMBINER_NR40arch/arm/mach-s5pv310/include/mach/irqs.h +5
-0+#define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) + +#define S5P_EINT_BASE1 (S5P_IRQ_EINT_BASE + 0) +#define S5P_EINT_BASE2 (S5P_IRQ_EINT_BASE + 16) +
Hmm...
If you want to add external interrupt, should be changed NR_IRQS too.
Will apply with fixing NR_IRQS.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v2 2/2 ARM: S5PV310: Add support GPIOlib
Quoted 32 lines · Sangbeom Kim
Quoted 7 lines
From: Jongpill Lee <[email protected]>
This patch adds GPIOlib support for S5PV310 and S5PC210.
Signed-off-by Jongpill Lee <[email protected]>Signed-off-by Sangbeom Kim <[email protected]>Quoted 10 lines
---
NOTE:
This patch used mapped VA IO as GPIO virtual address. because firstly other Samsung SoC's GPIO used same method. and I think that it's better to keep the same method.
And ioremap also can be used for it.
But in the GPIO, there is no need to allocate VA area dynamically. because GPIO can be used in any drivers anytime so it can't iounmap GPIO VA area.Ok...
(snip)
arch/arm/mach-s5pv310/include/mach/irqs.h line 98
Quoted 7 lines
#define
MAX_COMBINER_NR40arch/arm/mach-s5pv310/include/mach/irqs.h +5
-0+#define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) + +#define S5P_EINT_BASE1 (S5P_IRQ_EINT_BASE + 0) +#define S5P_EINT_BASE2 (S5P_IRQ_EINT_BASE + 16) +Hmm...
If you want to add external interrupt, should be changedNR_IRQStoo.
Quoted 2 lines
Will apply with fixing
NR_IRQS.
It seems that S5P_IRQ_EINT_BASE has wrong definition. S5P_IRQ_EINT_BASE has to be COMBINER_IRQ(MAX_COMBINER_NR - 1, 0).
Thanks.
Quoted 13 lines
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd._______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 2/2 ARM: S5PV310: Add support GPIOlib
Quoted 7 lines · Jongsun Han
Quoted 5 lines · Sangbeom Kim
Quoted 5 lines
From: Jongpill Lee <[email protected]>
This patch adds GPIOlib support for S5PV310 and S5PC210.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Signed-off-by Jongpill Lee <[email protected]>Signed-off-by Sangbeom Kim <[email protected]>---
NOTE:
This patch used mapped VA IO as GPIO virtual address. because firstly other Samsung SoC's GPIO used same method. and I think that it's better to keep the same method. And ioremap also can be used for it.
But in the GPIO, there is no need to allocate VA area dynamically. because GPIO can be used in any drivers anytime so it can't iounmap
GPIO
Quoted 18 lines
Quoted 9 lines
Quoted 2 lines
VA area.
Ok...
(snip)
Quoted 3 lines
#define
MAX_COMBINER_NR40+#define
S5P_IRQ_EINT_BASE
COMBINER_IRQ(MAX_COMBINER_NR, 0)Quoted 8 lines
arch/arm/mach-s5pv310/include/mach/irqs.h line 98
Quoted 4 lines
arch/arm/mach-s5pv310/include/mach/irqs.h +4
-0+ +#define S5P_EINT_BASE1 (S5P_IRQ_EINT_BASE + 0) +#define S5P_EINT_BASE2 (S5P_IRQ_EINT_BASE + 16) +Hmm...
If you want to add external interrupt, should be changedNR_IRQStoo.
Quoted 4 lines
Quoted 2 lines
Will apply with fixing
NR_IRQS.It seems that
S5P_IRQ_EINT_BASEhas wrong definition.
I think...No!
Quoted 2 lines
S5P_IRQ_EINT_BASEhas to beCOMBINER_IRQ(MAX_COMBINER_NR - 1, 0).
Maybe you mean COMBINER_IRQ(MAX_COMBINER_NR - 1, 1)...because IRQ_EINT16_31 is COMBINER_IRQ(39, 0)
Anyway in my opinion, each COMBINER_GROUP(x) can has 8 combined interrupts even though actually just used only 1.
Therefore, to use next COMBINER_GROUP, so that COMBINER_GROUP(39) can use 8 interrupts like others is better.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.