aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2012-09-27 23:54:21 -0400
committerStephen Warren <swarren@wwwdotorg.org>2012-10-25 22:42:51 -0400
commit805504abdc73cfc745a5fee3d616cdb24bb2a68c (patch)
treeb531ce1bcc94b540d783b8153f90567dd3c735cc
parentd0f1c7ffaa32bdda2d413d2db41c51bbdd105834 (diff)
ARM: bcm2835: enable GPIO/pinctrl
Enable GPIO and pinctrl in Kconfig. Add required <mach/gpio.h> for gpiolib. Instantiate the BCM2835 GPIO module in bcm2835.dtsi. Add a pinctrl definition to bcm2835-rpi-b.dts that sets up all of the board's required pinmux configuration. GPIO aren't specified; that's left to gpio_request(). Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/Kconfig5
-rw-r--r--arch/arm/boot/dts/bcm2835-rpi-b.dts15
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi23
-rw-r--r--arch/arm/mach-bcm2835/include/mach/gpio.h1
4 files changed, 43 insertions, 1 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 73067efd4845..7cce11a1849e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -336,7 +336,7 @@ config ARCH_AT91
336 336
337config ARCH_BCM2835 337config ARCH_BCM2835
338 bool "Broadcom BCM2835 family" 338 bool "Broadcom BCM2835 family"
339 select ARCH_WANT_OPTIONAL_GPIOLIB 339 select ARCH_REQUIRE_GPIOLIB
340 select ARM_AMBA 340 select ARM_AMBA
341 select ARM_ERRATA_411920 341 select ARM_ERRATA_411920
342 select ARM_TIMER_SP804 342 select ARM_TIMER_SP804
@@ -344,7 +344,10 @@ config ARCH_BCM2835
344 select COMMON_CLK 344 select COMMON_CLK
345 select CPU_V6 345 select CPU_V6
346 select GENERIC_CLOCKEVENTS 346 select GENERIC_CLOCKEVENTS
347 select GENERIC_GPIO
347 select MULTI_IRQ_HANDLER 348 select MULTI_IRQ_HANDLER
349 select PINCTRL
350 select PINCTRL_BCM2835
348 select SPARSE_IRQ 351 select SPARSE_IRQ
349 select USE_OF 352 select USE_OF
350 help 353 help
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 7dd860f83f96..9b72054a0bc0 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -10,3 +10,18 @@
10 reg = <0 0x10000000>; 10 reg = <0 0x10000000>;
11 }; 11 };
12}; 12};
13
14&gpio {
15 pinctrl-names = "default";
16 pinctrl-0 = <&alt0 &alt3>;
17
18 alt0: alt0 {
19 brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11 14 15 40 45>;
20 brcm,function = <4>; /* alt0 */
21 };
22
23 alt3: alt3 {
24 brcm,pins = <48 49 50 51 52 53>;
25 brcm,function = <7>; /* alt3 */
26 };
27};
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index 5c5cbafed191..8917550fd1bb 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -40,5 +40,28 @@
40 interrupts = <2 25>; 40 interrupts = <2 25>;
41 clock-frequency = <3000000>; 41 clock-frequency = <3000000>;
42 }; 42 };
43
44 gpio: gpio {
45 compatible = "brcm,bcm2835-gpio";
46 reg = <0x7e200000 0xb4>;
47 /*
48 * The GPIO IP block is designed for 3 banks of GPIOs.
49 * Each bank has a GPIO interrupt for itself.
50 * There is an overall "any bank" interrupt.
51 * In order, these are GIC interrupts 17, 18, 19, 20.
52 * Since the BCM2835 only has 2 banks, the 2nd bank
53 * interrupt output appears to be mirrored onto the
54 * 3rd bank's interrupt signal.
55 * So, a bank0 interrupt shows up on 17, 20, and
56 * a bank1 interrupt shows up on 18, 19, 20!
57 */
58 interrupts = <2 17>, <2 18>, <2 19>, <2 20>;
59
60 gpio-controller;
61 #gpio-cells = <2>;
62
63 interrupt-controller;
64 #interrupt-cells = <2>;
65 };
43 }; 66 };
44}; 67};
diff --git a/arch/arm/mach-bcm2835/include/mach/gpio.h b/arch/arm/mach-bcm2835/include/mach/gpio.h
new file mode 100644
index 000000000000..40a8c178f10d
--- /dev/null
+++ b/arch/arm/mach-bcm2835/include/mach/gpio.h
@@ -0,0 +1 @@
/* empty */