Skip to contentSkip to conversation

add gpio primcell pl061 support

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 2 participants 6 messages Oct 5, 2012

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

v2 cover add gpio primcell pl061 support

Hi,

The following changes since commit 6bb06524d665b4fbcefddb6b914273466fe801dd:

ARM pbl: actually create cached mappings in the decompressor (2012-10-04 18:30:58 +0200)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git tags/gpio_arm

for you to fetch changes up to 74968e99803d7d974c7423052e40443848e8be99:

versatilepb: add gpio support (2012-10-05 15:08:05 +0800)

----------------------------------------------------------------
add gpio primcell pl061 support

update gpiolib to select GENERIC_GPIO and provice a generic header

use is on versatilepb

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (4):
gpiolib: select GENERIC_GPIO
gpio: provide generic gpio header
gpio: add ARM Primcell pl061 support
versatilepb: add gpio support

 arch/arm/Kconfig                            |    1 +
 arch/arm/configs/versatilepb_defconfig      |    2 +
 arch/arm/mach-ep93xx/include/mach/gpio.h    |   27 +-------------
 arch/arm/mach-imx/include/mach/gpio.h       |    7 +---
 arch/arm/mach-mxs/include/mach/gpio.h       |    6 +--
 arch/arm/mach-omap/include/mach/gpio.h      |   43 +---------------------
 arch/arm/mach-samsung/include/mach/gpio.h   |    6 +--
 arch/arm/mach-versatile/core.c              |   10 +++++
 arch/arm/mach-versatile/include/mach/gpio.h |    1 +
 drivers/gpio/Kconfig                        |    7 ++++
 drivers/gpio/Makefile                       |    2 +
 drivers/gpio/gpio-pl061.c                   |  158 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/asm-generic/gpio.h                  |   10 +++++
 include/linux/amba/pl061.h                  |   12 ++++++
 14 files changed, 211 insertions(+), 81 deletions(-)
 create mode 100644 arch/arm/mach-versatile/include/mach/gpio.h
 create mode 100644 drivers/gpio/gpio-pl061.c
 create mode 100644 include/asm-generic/gpio.h
 create mode 100644 include/linux/amba/pl061.h

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH v2 1/4 gpiolib: select GENERIC_GPIO

---
 drivers/gpio/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/gpio/Kconfig +1 -0
index 022a309..f03fbf6 100644
@@ -1,5 +1,6 @@
 config GPIOLIB
 	bool
+	select GENERIC_GPIO
 
 if GPIOLIB
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH v2 3/4 gpio: add ARM Primcell pl061 support

---
 drivers/gpio/Kconfig       |    6 ++
 drivers/gpio/Makefile      |    2 +
 drivers/gpio/gpio-pl061.c  |  158 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/amba/pl061.h |   12 ++++
 4 files changed, 178 insertions(+)
 create mode 100644 drivers/gpio/gpio-pl061.c
 create mode 100644 include/linux/amba/pl061.h
drivers/gpio/Kconfig +6 -0
index f03fbf6..a0e9b58 100644
@@ -6,6 +6,12 @@ if GPIOLIB
 
 menu "GPIO                          "
 
+config GPIO_PL061
+	bool "PrimeCell PL061 GPIO support"
+	depends on ARM_AMBA
+	help
+	  Say yes here to support the PrimeCell PL061 GPIO device
+
 config GPIO_STMPE
 	depends on I2C_STMPE
 	bool "STMPE GPIO Expander"
drivers/gpio/Makefile +2 -0
index 945122b..e2e97d3 100644
@@ -1,2 +1,4 @@
 obj-$(CONFIG_GPIOLIB) += gpio.o
+
+obj-$(CONFIG_GPIO_PL061)	+= gpio-pl061.o
 obj-$(CONFIG_GPIO_STMPE) += gpio-stmpe.o
drivers/gpio/gpio-pl061.c new file +158 -0

158 lines not on this page · raw message

include/linux/amba/pl061.h new file +12 -0
new file mode 100644
index 0000000..d498cd7
@@ -0,0 +1,12 @@
+#ifndef __AMBA_PL061_H__
+#define __AMBA_PL061_H__
+
+#include <linux/types.h>
+
+/* platform data for the PL061 GPIO driver */
+
+struct pl061_platform_data {
+	/* number of the first GPIO */
+	unsigned	gpio_base;
+};
+#endif /* __AMBA_PL061_H__ */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH v2 4/4 versatilepb: add gpio support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/Kconfig                            |    1 +
 arch/arm/configs/versatilepb_defconfig      |    2 ++
 arch/arm/mach-versatile/core.c              |   10 ++++++++++
 arch/arm/mach-versatile/include/mach/gpio.h |    1 +
 4 files changed, 14 insertions(+)
 create mode 100644 arch/arm/mach-versatile/include/mach/gpio.h
arch/arm/Kconfig +1 -0
index 8278c82..a771274 100644
@@ -89,6 +89,7 @@ config ARCH_S3C64xx
 config ARCH_VERSATILE
 	bool "ARM Versatile boards (ARM926EJ-S)"
 	select CPU_ARM926T
+	select GPIOLIB
 
 config ARCH_TEGRA
 	bool "Nvidia Tegra-based boards"
arch/arm/configs/versatilepb_defconfig +2 -0
index 87aec4d..4c71c3c 100644
@@ -32,6 +32,7 @@ CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
 CONFIG_CMD_TIMEOUT=y
 CONFIG_CMD_PARTITION=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_UNCOMPRESS=y
 CONFIG_NET=y
 CONFIG_NET_DHCP=y
@@ -43,6 +44,7 @@ CONFIG_NET_NETCONSOLE=y
 CONFIG_NET_RESOLV=y
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_DRIVER_NET_SMC91111=y
+CONFIG_GPIO_PL061=y
 CONFIG_FS_CRAMFS=y
 CONFIG_SHA1=y
 CONFIG_SHA256=y
arch/arm/mach-versatile/core.c +10 -0
index 5c75e11..6e913df 100644
@@ -196,3 +196,13 @@ void __noreturn reset_cpu (unsigned long ignored)
 	while(1);
 }
 EXPORT_SYMBOL(reset_cpu);
+
+static int versatile_init(void)
+{
+	amba_apb_device_add(NULL, "pl061_gpio", 0, 0x101e4000, 4096, NULL, 0);
+	amba_apb_device_add(NULL, "pl061_gpio", 1, 0x101e5000, 4096, NULL, 0);
+	amba_apb_device_add(NULL, "pl061_gpio", 2, 0x101e6000, 4096, NULL, 0);
+	amba_apb_device_add(NULL, "pl061_gpio", 3, 0x101e7000, 4096, NULL, 0);
+	return 0;
+}
+coredevice_initcall(versatile_init);
arch/arm/mach-versatile/include/mach/gpio.h new file +1 -0
new file mode 100644
index 0000000..306ab4c
@@ -0,0 +1 @@
+#include <asm-generic/gpio.h>
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 2/4 gpio: provide generic gpio header

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/mach-ep93xx/include/mach/gpio.h           |   27 +-----------
 arch/arm/mach-imx/include/mach/gpio.h              |    7 +---
 arch/arm/mach-mxs/include/mach/gpio.h              |    6 +--
 arch/arm/mach-omap/include/mach/gpio.h             |   43 +-------------------
 arch/arm/mach-samsung/include/mach/gpio.h          |    6 +--
 .../include/mach => include/asm-generic}/gpio.h    |    7 ++--
 6 files changed, 11 insertions(+), 85 deletions(-)
 rewrite arch/arm/mach-ep93xx/include/mach/gpio.h (100%)
 rewrite arch/arm/mach-omap/include/mach/gpio.h (100%)
 copy {arch/arm/mach-imx/include/mach => include/asm-generic}/gpio.h (60%)
arch/arm/mach-ep93xx/include/mach/gpio.h +1 -26
dissimilarity index 100%
index 5f1b4bc..306ab4c 100644
@@ -1,26 +1 @@
-/*
- * Copyright (C) 2010 Matthias Kaehlcke <[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; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- *
- */
-
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-void gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_direction_input(unsigned gpio);
-
-#endif /* __ASM_ARCH_GPIO_H */
-
+#include <asm-generic/gpio.h>
arch/arm/mach-imx/include/mach/gpio.h +2 -5
index 0ebc3f9..489ae2c 100644
@@ -1,11 +1,8 @@
 #ifndef __ASM_ARCH_GPIO_H
 #define __ASM_ARCH_GPIO_H
 
+#include <asm-generic/gpio.h>
+
 void imx_gpio_mode(int gpio_mode);
-void gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_direction_input(unsigned gpio);
 
 #endif /* __ASM_ARCH_GPIO_H */
-
arch/arm/mach-mxs/include/mach/gpio.h +2 -4
index 1e575fa..4e7c8fe 100644
@@ -25,10 +25,8 @@
 # include <mach/iomux-imx28.h>
 #endif
 
+#include <asm-generic/gpio.h>
+
 void imx_gpio_mode(uint32_t);
-void gpio_set_value(unsigned, int);
-int gpio_direction_input(unsigned);
-int gpio_direction_output(unsigned, int);
-int gpio_get_value(unsigned);
 
 #endif /* __ASM_MACH_GPIO_H */
arch/arm/mach-omap/include/mach/gpio.h +1 -42

43 lines not on this page · raw message

arch/arm/mach-samsung/include/mach/gpio.h +2 -4
index 2b45695..9e64a84 100644
@@ -23,10 +23,8 @@
 # include <mach/iomux-s5pcxx.h>
 #endif
 
-void gpio_set_value(unsigned, int);
-int gpio_direction_input(unsigned);
-int gpio_direction_output(unsigned, int);
-int gpio_get_value(unsigned);
+#include <asm-generic/gpio.h>
+
 void s3c_gpio_mode(unsigned);
 
 #endif /* __ASM_MACH_GPIO_H */
include/asm-generic/gpio.h renamed from arch/arm/mach-imx/include/mach/gpio.h +3 -4
similarity index 60%
copy from arch/arm/mach-imx/include/mach/gpio.h
copy to include/asm-generic/gpio.h
index 0ebc3f9..1997888 100644
@@ -1,11 +1,10 @@
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
+#ifndef __ASM_GENERIC_GPIO_H
+#define __ASM_GENERIC_GPIO_H
 
-void imx_gpio_mode(int gpio_mode);
 void gpio_set_value(unsigned gpio, int value);
 int gpio_get_value(unsigned gpio);
 int gpio_direction_output(unsigned gpio, int value);
 int gpio_direction_input(unsigned gpio);
 
-#endif /* __ASM_ARCH_GPIO_H */
+#endif /* __ASM_GENERIC_GPIO_H */
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#5 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD

Hi,

The following changes since commit 6bb06524d665b4fbcefddb6b914273466fe801dd:

ARM pbl: actually create cached mappings in the decompressor (2012-10-04 18:30:58 +0200)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git tags/gpio_arm

pulled, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox