aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-09-21 21:18:30 +0000
committerRafał Miłecki <zajec5@gmail.com>2014-09-21 21:18:30 +0000
commit1683576ed05186ecd8bbda229f50f83e4cb0aa66 (patch)
tree977a852095ef044bad27e66e67dab6ab4e54b795
parent93ba0ae51f75028933bc05fe22678d29b5d4ad26 (diff)
downloadupstream-1683576ed05186ecd8bbda229f50f83e4cb0aa66.tar.gz
upstream-1683576ed05186ecd8bbda229f50f83e4cb0aa66.tar.bz2
upstream-1683576ed05186ecd8bbda229f50f83e4cb0aa66.zip
bcm53xx: add support for GPIOs
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42638 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/bcm53xx/config-3.146
-rw-r--r--target/linux/bcm53xx/patches-3.14/045-ARM-BCM5301X-select-GPIOLIB-as-optional.patch29
-rw-r--r--target/linux/bcm53xx/patches-3.14/122-bcma-gpio-use-ChipCommon-GPIO-IRQ-on-BCM47XX-arch-on.patch37
3 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/config-3.14 b/target/linux/bcm53xx/config-3.14
index c6f154465a..f8610793bc 100644
--- a/target/linux/bcm53xx/config-3.14
+++ b/target/linux/bcm53xx/config-3.14
@@ -21,6 +21,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_ARM=y
CONFIG_ARM_APPENDED_DTB=y
# CONFIG_ARM_ATAG_DTB_COMPAT is not set
@@ -47,6 +48,7 @@ CONFIG_BCMA=y
CONFIG_BCMA_BLOCKIO=y
CONFIG_BCMA_DEBUG=y
CONFIG_BCMA_DRIVER_GMAC_CMN=y
+CONFIG_BCMA_DRIVER_GPIO=y
CONFIG_BCMA_HOST_PCI=y
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
CONFIG_BCMA_HOST_SOC=y
@@ -105,6 +107,9 @@ CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_GPIO_SYSFS=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
@@ -180,6 +185,7 @@ CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
+CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_MDIO=y
CONFIG_OF_MTD=y
diff --git a/target/linux/bcm53xx/patches-3.14/045-ARM-BCM5301X-select-GPIOLIB-as-optional.patch b/target/linux/bcm53xx/patches-3.14/045-ARM-BCM5301X-select-GPIOLIB-as-optional.patch
new file mode 100644
index 0000000000..887650e4f7
--- /dev/null
+++ b/target/linux/bcm53xx/patches-3.14/045-ARM-BCM5301X-select-GPIOLIB-as-optional.patch
@@ -0,0 +1,29 @@
+From e7b1065712e769eb4de7b9d4aa222a4531c2b8fd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Sat, 20 Sep 2014 18:21:19 +0200
+Subject: [PATCH V2] ARM: BCM5301X: select GPIOLIB as optional
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+All routers (or 99% of them) based on BCM5301X use GPIOs to control LEDs
+and buttons.
+
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+---
+V2: Don't select GPIOLIB. We may still think about making it default at
+ some point, but we dont' really require it to boot successfully.
+---
+ arch/arm/mach-bcm/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/mach-bcm/Kconfig
++++ b/arch/arm/mach-bcm/Kconfig
+@@ -35,6 +35,7 @@ config ARCH_BCM_MOBILE
+ config ARCH_BCM_5301X
+ bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
+ depends on MMU
++ select ARCH_WANT_OPTIONAL_GPIOLIB
+ select ARM_GIC
+ select CACHE_L2X0
+ select HAVE_ARM_SCU if SMP
diff --git a/target/linux/bcm53xx/patches-3.14/122-bcma-gpio-use-ChipCommon-GPIO-IRQ-on-BCM47XX-arch-on.patch b/target/linux/bcm53xx/patches-3.14/122-bcma-gpio-use-ChipCommon-GPIO-IRQ-on-BCM47XX-arch-on.patch
new file mode 100644
index 0000000000..4ea4b5ae64
--- /dev/null
+++ b/target/linux/bcm53xx/patches-3.14/122-bcma-gpio-use-ChipCommon-GPIO-IRQ-on-BCM47XX-arch-on.patch
@@ -0,0 +1,37 @@
+From dfe45880e4ac50ebaa57e5f8a52b69e7e74cb7ca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
+Date: Sun, 21 Sep 2014 20:40:32 +0200
+Subject: [PATCH] bcma: gpio: use ChipCommon GPIO IRQ on BCM47XX arch only
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GPIOs can be also used on bcm53xx, however this arch requires different
+implementation of IRQ support. It uses different IRQ number (117) and
+different masks & acking.
+
+Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
+---
+ drivers/bcma/driver_gpio.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/bcma/driver_gpio.c
++++ b/drivers/bcma/driver_gpio.c
+@@ -76,7 +76,7 @@ static void bcma_gpio_free(struct gpio_c
+ bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
+ }
+
+-#if IS_BUILTIN(CONFIG_BCMA_HOST_SOC)
++#if IS_BUILTIN(CONFIG_BCM47XX)
+ static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
+ {
+ struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
+@@ -215,7 +215,7 @@ int bcma_gpio_init(struct bcma_drv_cc *c
+ chip->set = bcma_gpio_set_value;
+ chip->direction_input = bcma_gpio_direction_input;
+ chip->direction_output = bcma_gpio_direction_output;
+-#if IS_BUILTIN(CONFIG_BCMA_HOST_SOC)
++#if IS_BUILTIN(CONFIG_BCM47XX)
+ chip->to_irq = bcma_gpio_to_irq;
+ #endif
+ switch (cc->core->bus->chipinfo.id) {