Skip to contentSkip to conversation

ARM: mach-shmobile: sh7367 and G3EVM pinmux support

PATCH In review Magnus Damm 2 participants 2 messages Feb 10, 2010 – Feb 12, 2010

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 ARM: mach-shmobile: sh7367 and G3EVM pinmux support

From: Magnus Damm <[email protected]>

Add support for the sh7367 pinmux using drivers/sh/pfc.c and select serial console pins and some LEDs on G3EVM.

---

 arch/arm/mach-shmobile/Kconfig               |    1 
 arch/arm/mach-shmobile/Makefile              |    4 
 arch/arm/mach-shmobile/board-g3evm.c         |   25 
 arch/arm/mach-shmobile/include/mach/common.h |    1 
 arch/arm/mach-shmobile/include/mach/gpio.h   |   50 
 arch/arm/mach-shmobile/include/mach/sh7367.h |  332 ++++
 arch/arm/mach-shmobile/pfc-sh7367.c          | 1801 ++++++++++++++++++++++++++
 7 files changed, 2213 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/Kconfig +1 -0
@@ -31,6 +31,7 @@ comment "SH-Mobile Board Type"
 config MACH_G3EVM
 	bool "G3EVM board"
 	depends on ARCH_SH7367
+	select ARCH_REQUIRE_GPIOLIB
 
 config MACH_G4EVM
 	bool "G4EVM board"
arch/arm/mach-shmobile/Makefile +4 -0
@@ -10,6 +10,10 @@ obj-$(CONFIG_ARCH_SH7367)	+= setup-sh736
 obj-$(CONFIG_ARCH_SH7377)	+= setup-sh7377.o clock-sh7367.o
 obj-$(CONFIG_ARCH_SH7372)	+= setup-sh7372.o clock-sh7367.o
 
+# Pinmux setup
+pfc-$(CONFIG_ARCH_SH7367)	:= pfc-sh7367.o
+obj-$(CONFIG_GENERIC_GPIO)	+= $(pfc-y)
+
 # Board objects
 obj-$(CONFIG_MACH_G3EVM)	+= board-g3evm.o
 obj-$(CONFIG_MACH_G4EVM)	+= board-g4evm.o
arch/arm/mach-shmobile/board-g3evm.c +25 -0
@@ -27,6 +27,8 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
+#include <linux/gpio.h>
+#include <mach/sh7367.h>
 #include <mach/common.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -112,6 +114,29 @@ static void __init g3evm_map_io(void)
 
 static void __init g3evm_init(void)
 {
+	sh7367_pinmux_init();
+
+	/* Lit DS4 LED */
+	gpio_request(GPIO_PORT22, NULL);
+	gpio_direction_output(GPIO_PORT22, 1);
+	gpio_export(GPIO_PORT22, 0);
+
+	/* Lit DS8 LED */
+	gpio_request(GPIO_PORT23, NULL);
+	gpio_direction_output(GPIO_PORT23, 1);
+	gpio_export(GPIO_PORT23, 0);
+
+	/* Lit DS3 LED */
+	gpio_request(GPIO_PORT24, NULL);
+	gpio_direction_output(GPIO_PORT24, 1);
+	gpio_export(GPIO_PORT24, 0);
+
+	/* SCIFA1 */
+	gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
+	gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
+	gpio_request(GPIO_FN_SCIFA1_CTS, NULL);
+	gpio_request(GPIO_FN_SCIFA1_RTS, NULL);
+
 	sh7367_add_standard_devices();
 
 	platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -7,6 +7,7 @@ extern void sh7367_init_irq(void);
 extern void sh7367_add_early_devices(void);
 extern void sh7367_add_standard_devices(void);
 extern void sh7367_clock_init(void);
+extern void sh7367_pinmux_init(void);
 
 extern void sh7377_init_irq(void);
 extern void sh7377_add_early_devices(void);
arch/arm/mach-shmobile/include/mach/gpio.h +49 -1

50 lines not on this page · raw message

arch/arm/mach-shmobile/include/mach/sh7367.h new file +332 -0

332 lines not on this page · raw message

arch/arm/mach-shmobile/pfc-sh7367.c new file +1801 -0

1,801 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Magnus Damm

Add support for the sh7367 pinmux using drivers/sh/pfc.c and select serial console pins and some LEDs on G3EVM.

Quoted 2 lines · Magnus Damm

Add G3EVM platform data and a magic setup sequence to initialize the r8a66597 block aka USBHS in sh7367.

These two have been applied, thanks.