linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14
@ 2013-12-23  2:06 Simon Horman
  2013-12-23  2:07 ` [PATCH 01/26] ARM: shmobile: bockw: use regulator for MMCIF Simon Horman
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:06 UTC (permalink / raw)
  To: linux-arm-kernel

The following changes since commit ea8d8a911f4850312834a0ff45c3d5ebc31fb1f1:

  Merge tag 'renesas-cleanup-for-v3.14' into boards-base (2013-12-10 17:22:55 +0900)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-boards-for-v3.14

for you to fetch changes up to be0647d556985ae58a42e7fc3751a293c418c41e:

  ARM: shmobile: lager: add gpio/fixed regulator for SDHI (2013-12-10 17:24:50 +0900)

----------------------------------------------------------------
Renesas ARM based SoC board updates for v3.14

* Global
  - Kconfig: Mention Renesas ARM SoCs instead of SH-Mobile

* r7s72100 SoC (RZ/A1H) based Genmai Board
  - Add Multiplatform support
  - Add Reference DT

* r8a7791 (R-Car M2) based Koelsch board
  - Add pinctrl_register_mappings() for Koelsch
  - Hook up SW30-SW36 on Koelsch
  - Mark GPIO keys as wake-up sources
  - Use ->init_late()
  - Add Multiplatform support
  - Set .debounce_interval for GPIO keys
  - Add SW2 to GPIO keys
  - Add Led 6, 7 and 8 support
  - Add reference DT
  - Enable PFC/GPIO

* r8a7790 (R-Car H2) based Lager board
  - Add gpio/fixed regulator for SDHI
  - Add SPI FLASH support on QSPI
  - Mark GPIO keys as wake-up sources
  - Use ->init_late()
  - Set .debounce_interval for GPIO keys

* r8a7778 (R-Car M1) based Bock-W board
  - bockw: remove unused RSND_SSI_CLK_FROM_ADG
  - Set .debounce_interval for GPIO keys
  - Correct FPGA ioremap area
  - Use regulator for MMCIF

* r8a7740 (R-Mobile A1) based Armadillo board
  - Correct FSI address size

* sh7374 (SH-Mobile AP4) based Mackerel board
  - Use pinconf API to configure pin pull-down
  - clk_round_rate() can return a zero to indicate an error

----------------------------------------------------------------
Hiep Cao Minh (1):
      ARM: shmobile: Lager:add SPI FLASH support on QSPI

Kuninori Morimoto (6):
      ARM: shmobile: bockw: use regulator for MMCIF
      ARM: shmobile: bockw: fixup FPGA ioremap area
      ARM: shmobile: bockw: add pin pull-up setting for SDHI
      ARM: shmobile: armadillo: fixup FSI address size
      ARM: shmobile: bockw: remove unused RSND_SSI_CLK_FROM_ADG
      ARM: shmobile: lager: add gpio/fixed regulator for SDHI

Laurent Pinchart (2):
      ARM: shmobile: mackerel: Use pinconf API to configure pin pull-down
      ARM: Kconfig: Mention Renesas ARM SoCs instead of SH-Mobile

Magnus Damm (13):
      ARM: shmobile: Enable PFC/GPIO on the Koelsch board
      ARM: shmobile: Add Koelsch LED6, LED7 and LED8 support
      ARM: shmobile: Add Koelsch SW2 support
      ARM: shmobile: r8a7791 Koelsch DT reference C bits
      ARM: shmobile: Initial r8a7791 and Koelsch multiplatform support
      ARM: shmobile: r7s72100 Genmai DT reference DTS bits
      ARM: shmobile: r7s72100 Genmai DT reference C bits
      ARM: shmobile: r7s72100 Genmai Multiplatform
      ARM: shmobile: Use ->init_late() on Koelsch
      ARM: shmobile: koelsch: mark GPIO keys as wake-up sources
      ARM: shmobile: Hook up SW30-SW36 on Koelsch
      ARM: shmobile: Use ->init_late() on Lager
      ARM: shmobile: Add pinctrl_register_mappings() for Koelsch

Paul Walmsley (1):
      ARM: shmobile: mackerel: clk_round_rate() can return a zero to indicate an error

Shinya Kuribayashi (2):
      ARM: shmobile: lager: set .debounce_interval
      ARM: shmobile: lager: mark GPIO keys as wake-up sources

Simon Horman (1):
      ARM: shmobile: koelsch: set .debounce_interval

 arch/arm/Kconfig                                 |   7 +-
 arch/arm/boot/dts/Makefile                       |   5 +-
 arch/arm/boot/dts/r7s72100-genmai-reference.dts  |  31 +++++
 arch/arm/mach-shmobile/Kconfig                   |  55 +++++++--
 arch/arm/mach-shmobile/Makefile                  |   4 +
 arch/arm/mach-shmobile/Makefile.boot             |   4 +-
 arch/arm/mach-shmobile/board-armadillo800eva.c   |   2 +-
 arch/arm/mach-shmobile/board-bockw-reference.c   |  19 ++-
 arch/arm/mach-shmobile/board-bockw.c             |  17 ++-
 arch/arm/mach-shmobile/board-genmai-reference.c  |  49 ++++++++
 arch/arm/mach-shmobile/board-koelsch-reference.c |  53 ++++++++
 arch/arm/mach-shmobile/board-koelsch.c           |  73 ++++++++++-
 arch/arm/mach-shmobile/board-lager-reference.c   |   2 +
 arch/arm/mach-shmobile/board-lager.c             | 151 ++++++++++++++++++++++-
 arch/arm/mach-shmobile/board-mackerel.c          |  21 ++--
 arch/arm/mach-shmobile/sh-gpio.h                 |  19 ---
 include/sound/rcar_snd.h                         |   1 -
 17 files changed, 458 insertions(+), 55 deletions(-)
 create mode 100644 arch/arm/boot/dts/r7s72100-genmai-reference.dts
 create mode 100644 arch/arm/mach-shmobile/board-genmai-reference.c
 create mode 100644 arch/arm/mach-shmobile/board-koelsch-reference.c

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 01/26] ARM: shmobile: bockw: use regulator for MMCIF
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 10/26] ARM: shmobile: Initial r8a7791 and Koelsch multiplatform support Simon Horman
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

When regulators are used with MMC devices, sh_mmcif_plat_data::ocr
is not needed, they can be removed from platform data.
This patch adds v3.3 regulator settings,
and moved fixed-dummy regulator registration position

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-bockw.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 3861152..540f0dc 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -116,6 +116,11 @@ static struct regulator_consumer_supply dummy_supplies[] = {
 	REGULATOR_SUPPLY("vdd33a", "smsc911x"),
 };
 
+static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
+	REGULATOR_SUPPLY("vmmc", "sh_mmcif"),
+	REGULATOR_SUPPLY("vqmmc", "sh_mmcif"),
+};
+
 static struct smsc911x_platform_config smsc911x_data __initdata = {
 	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
 	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
@@ -271,7 +276,6 @@ static struct resource mmc_resources[] __initdata = {
 
 static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
 	.sup_pclk	= 0,
-	.ocr		= MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
 	.caps		= MMC_CAP_4_BIT_DATA |
 			  MMC_CAP_8_BIT_DATA |
 			  MMC_CAP_NEEDS_POLL,
@@ -614,6 +618,10 @@ static void __init bockw_init(void)
 		&usb_phy_platform_data,
 		sizeof(struct rcar_phy_platform_data));
 
+	regulator_register_fixed(0, dummy_supplies,
+				 ARRAY_SIZE(dummy_supplies));
+	regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
+				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
 
 	/* for SMSC */
 	fpga = ioremap_nocache(FPGA, SZ_1M);
@@ -629,9 +637,6 @@ static void __init bockw_init(void)
 		val &= ~(1 << 4); /* enable SMSC911x */
 		iowrite16(val, fpga + IRQ0MR);
 
-		regulator_register_fixed(0, dummy_supplies,
-					 ARRAY_SIZE(dummy_supplies));
-
 		platform_device_register_resndata(
 			&platform_bus, "smsc911x", -1,
 			smsc911x_resources, ARRAY_SIZE(smsc911x_resources),
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 10/26] ARM: shmobile: Initial r8a7791 and Koelsch multiplatform support
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
  2013-12-23  2:07 ` [PATCH 01/26] ARM: shmobile: bockw: use regulator for MMCIF Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 11/26] ARM: shmobile: r7s72100 Genmai DT reference DTS bits Simon Horman
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add Koelsch and r8a7791 to CONFIG_SHMOBILE_MULTI. At this
point CCF is not yet supported so you cannot run this code
yet. For CCF support to happen several different components
are needed, and this is one simple portion that moves us
forward. Other patches need to build on top of this one.

Koelsch board support exists in 3 flavors:
1) SHMOBILE_MULTI, MACH_KOELSCH - board-koelsch-reference.c (CCF + DT)
2) SHMOBILE, MACH_KOELSCH_REFERENCE - board-koelsch-reference.c (DT)
3) SHMOBILE, MACH_KOELSCH - board-koelsch.c (legacy C code)

When CCF is done then 2) will be removed. When 1) includes same features
as 3) then 3) will be removed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                       | 3 ++-
 arch/arm/mach-shmobile/Kconfig                   | 8 ++++++++
 arch/arm/mach-shmobile/Makefile                  | 1 +
 arch/arm/mach-shmobile/board-koelsch-reference.c | 5 +++++
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5839077..8254bfc 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -232,7 +232,8 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	r8a73a4-ape6evm.dtb \
 	r8a73a4-ape6evm-reference.dtb \
 	sh7372-mackerel.dtb
-dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb
+dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
+	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \
 	socfpga_cyclone5_socdk.dtb \
 	socfpga_cyclone5_sockit.dtb \
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 8eac47f..17a4f40 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -24,8 +24,16 @@ comment "SH-Mobile System Type"
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
 
+config ARCH_R8A7791
+	bool "R-Car M2 (R8A77910)"
+	select RENESAS_IRQC
+
 comment "SH-Mobile Board Type"
 
+config MACH_KOELSCH
+	bool "Koelsch board"
+	depends on ARCH_R8A7791
+
 config MACH_KZM9D
 	bool "KZM9D board"
 	depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 8bca9b5..021775d 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= pm-r8a7779.o
 
 # Board objects
 ifdef CONFIG_ARCH_SHMOBILE_MULTI
+obj-$(CONFIG_MACH_KOELSCH)	+= board-koelsch-reference.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d-reference.o
 else
 obj-$(CONFIG_MACH_APE6EVM)	+= board-ape6evm.o
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index beecc8b..25b558f 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/clk-provider.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <mach/rcar-gen2.h>
@@ -27,7 +28,11 @@
 
 static void __init koelsch_add_standard_devices(void)
 {
+#ifdef CONFIG_COMMON_CLK
+	of_clk_init(NULL);
+#else
 	r8a7791_clock_init();
+#endif
 	r8a7791_add_dt_devices();
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 02/26] ARM: shmobile: Enable PFC/GPIO on the Koelsch board
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (2 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 11/26] ARM: shmobile: r7s72100 Genmai DT reference DTS bits Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 03/26] ARM: shmobile: Add Koelsch LED6, LED7 and LED8 support Simon Horman
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Enable r8a7791 PFC and GPIO on the Koelsch board.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index ace1711..d099eaf 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -30,6 +30,7 @@
 static void __init koelsch_add_standard_devices(void)
 {
 	r8a7791_clock_init();
+	r8a7791_pinmux_init();
 	r8a7791_add_standard_devices();
 }
 
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 11/26] ARM: shmobile: r7s72100 Genmai DT reference DTS bits
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
  2013-12-23  2:07 ` [PATCH 01/26] ARM: shmobile: bockw: use regulator for MMCIF Simon Horman
  2013-12-23  2:07 ` [PATCH 10/26] ARM: shmobile: Initial r8a7791 and Koelsch multiplatform support Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 02/26] ARM: shmobile: Enable PFC/GPIO on the Koelsch board Simon Horman
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add the DT bits for r7s72100 Genmai DT reference support.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                      |  1 +
 arch/arm/boot/dts/r7s72100-genmai-reference.dts | 31 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 arch/arm/boot/dts/r7s72100-genmai-reference.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 8254bfc..b17de79 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -218,6 +218,7 @@ dtb-$(CONFIG_ARCH_S3C64XX) += s3c6410-mini6410.dtb \
 	s3c6410-smdk6410.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	r7s72100-genmai.dtb \
+	r7s72100-genmai-reference.dtb \
 	r8a7740-armadillo800eva.dtb \
 	r8a7778-bockw.dtb \
 	r8a7778-bockw-reference.dtb \
diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
new file mode 100644
index 0000000..da19c70
--- /dev/null
+++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
@@ -0,0 +1,31 @@
+/*
+ * Device Tree Source for the Genmai board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r7s72100.dtsi"
+
+/ {
+	model = "Genmai";
+	compatible = "renesas,genmai-reference", "renesas,r7s72100";
+
+	chosen {
+		bootargs = "console=ttySC2,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x08000000 0x08000000>;
+	};
+
+	lbsc {
+		#address-cells = <1>;
+		#size-cells = <1>;
+	};
+};
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 03/26] ARM: shmobile: Add Koelsch LED6, LED7 and LED8 support
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (3 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 02/26] ARM: shmobile: Enable PFC/GPIO on the Koelsch board Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 12/26] ARM: shmobile: r7s72100 Genmai DT reference C bits Simon Horman
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Enable Koelsch LEDs for GPIO output testing purpose.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index d099eaf..2299d65 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -20,6 +20,8 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/leds.h>
+#include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
 #include <mach/common.h>
 #include <mach/r8a7791.h>
@@ -27,11 +29,36 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+/* LEDS */
+static struct gpio_led koelsch_leds[] = {
+	{
+		.name		= "led8",
+		.gpio		= RCAR_GP_PIN(2, 21),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led7",
+		.gpio		= RCAR_GP_PIN(2, 20),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led6",
+		.gpio		= RCAR_GP_PIN(2, 19),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	},
+};
+
+static const struct gpio_led_platform_data koelsch_leds_pdata __initconst = {
+	.leds		= koelsch_leds,
+	.num_leds	= ARRAY_SIZE(koelsch_leds),
+};
+
 static void __init koelsch_add_standard_devices(void)
 {
 	r8a7791_clock_init();
 	r8a7791_pinmux_init();
 	r8a7791_add_standard_devices();
+	platform_device_register_data(&platform_bus, "leds-gpio", -1,
+				      &koelsch_leds_pdata,
+				      sizeof(koelsch_leds_pdata));
 }
 
 static const char * const koelsch_boards_compat_dt[] __initconst = {
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 12/26] ARM: shmobile: r7s72100 Genmai DT reference C bits
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (4 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 03/26] ARM: shmobile: Add Koelsch LED6, LED7 and LED8 support Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 13/26] ARM: shmobile: r7s72100 Genmai Multiplatform Simon Horman
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add C code support for r7s72100 Genmai DT reference.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/Kconfig                  | 11 +++++++
 arch/arm/mach-shmobile/Makefile                 |  1 +
 arch/arm/mach-shmobile/Makefile.boot            |  3 +-
 arch/arm/mach-shmobile/board-genmai-reference.c | 44 +++++++++++++++++++++++++
 4 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-shmobile/board-genmai-reference.c

diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 17a4f40..8bc7308 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -207,6 +207,17 @@ config MACH_GENMAI
 	depends on ARCH_R7S72100
 	select USE_OF
 
+config MACH_GENMAI_REFERENCE
+	bool "Genmai board - Reference Device Tree Implementation"
+	depends on ARCH_R7S72100
+	select USE_OF
+	---help---
+	   Use reference implementation of Genmai board support
+	   which makes use of device tree at the expense
+	   of not supporting a number of devices.
+
+	   This is intended to aid developers
+
 config MACH_MARZEN
 	bool "MARZEN board"
 	depends on ARCH_R8A7779
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 021775d..d2b8342 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -65,6 +65,7 @@ obj-$(CONFIG_MACH_MACKEREL)	+= board-mackerel.o
 obj-$(CONFIG_MACH_BOCKW)	+= board-bockw.o
 obj-$(CONFIG_MACH_BOCKW_REFERENCE)	+= board-bockw-reference.o
 obj-$(CONFIG_MACH_GENMAI)	+= board-genmai.o
+obj-$(CONFIG_MACH_GENMAI_REFERENCE)	+= board-genmai-reference.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
 obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_LAGER)	+= board-lager.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 892d4ab..759e4f8f 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -6,7 +6,8 @@ loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000
 loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
 loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
-loadaddr-$(CONFIG_MACH_GENMAI) += 0x8008000
+loadaddr-$(CONFIG_MACH_GENMAI) += 0x08008000
+loadaddr-$(CONFIG_MACH_GENMAI_REFERENCE) += 0x08008000
 loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000
 loadaddr-$(CONFIG_MACH_KOELSCH_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c
new file mode 100644
index 0000000..34c9881
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-genmai-reference.c
@@ -0,0 +1,44 @@
+/*
+ * Genmai board support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Magnus Damm
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+#include <mach/common.h>
+#include <mach/r7s72100.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+static void __init genmai_add_standard_devices(void)
+{
+	r7s72100_clock_init();
+	r7s72100_add_dt_devices();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char * const genmai_boards_compat_dt[] __initconst = {
+	"renesas,genmai-reference",
+	NULL,
+};
+
+DT_MACHINE_START(GENMAI_DT, "genmai")
+	.init_early	= r7s72100_init_early,
+	.init_machine	= genmai_add_standard_devices,
+	.dt_compat	= genmai_boards_compat_dt,
+MACHINE_END
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 04/26] ARM: shmobile: Add Koelsch SW2 support
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (6 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 13/26] ARM: shmobile: r7s72100 Genmai Multiplatform Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 05/26] ARM: shmobile: r8a7791 Koelsch DT reference C bits Simon Horman
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Enable Koelsch GPIO switch for GPIO input and IRQ testing purpose.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 2299d65..59fa0b9 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -19,6 +19,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/gpio.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
 #include <linux/platform_data/gpio-rcar.h>
@@ -51,6 +54,22 @@ static const struct gpio_led_platform_data koelsch_leds_pdata __initconst = {
 	.num_leds	= ARRAY_SIZE(koelsch_leds),
 };
 
+/* GPIO KEY */
+#define GPIO_KEY(c, g, d, ...) \
+	{ .code = c, .gpio = g, .desc = d, .active_low = 1 }
+
+static struct gpio_keys_button gpio_buttons[] = {
+	GPIO_KEY(KEY_4,		RCAR_GP_PIN(5, 3),	"SW2-pin4"),
+	GPIO_KEY(KEY_3,		RCAR_GP_PIN(5, 2),	"SW2-pin3"),
+	GPIO_KEY(KEY_2,		RCAR_GP_PIN(5, 1),	"SW2-pin2"),
+	GPIO_KEY(KEY_1,		RCAR_GP_PIN(5, 0),	"SW2-pin1"),
+};
+
+static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
+	.buttons	= gpio_buttons,
+	.nbuttons	= ARRAY_SIZE(gpio_buttons),
+};
+
 static void __init koelsch_add_standard_devices(void)
 {
 	r8a7791_clock_init();
@@ -59,6 +78,9 @@ static void __init koelsch_add_standard_devices(void)
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
 				      &koelsch_leds_pdata,
 				      sizeof(koelsch_leds_pdata));
+	platform_device_register_data(&platform_bus, "gpio-keys", -1,
+				      &koelsch_keys_pdata,
+				      sizeof(koelsch_keys_pdata));
 }
 
 static const char * const koelsch_boards_compat_dt[] __initconst = {
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 13/26] ARM: shmobile: r7s72100 Genmai Multiplatform
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (5 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 12/26] ARM: shmobile: r7s72100 Genmai DT reference C bits Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 04/26] ARM: shmobile: Add Koelsch SW2 support Simon Horman
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add r7s72100 Genmai to SHMOBILE_MULTI.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                      | 1 +
 arch/arm/mach-shmobile/Kconfig                  | 7 +++++++
 arch/arm/mach-shmobile/Makefile                 | 1 +
 arch/arm/mach-shmobile/board-genmai-reference.c | 5 +++++
 4 files changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b17de79..5ef42fc 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -234,6 +234,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	r8a73a4-ape6evm-reference.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
+	r7s72100-genmai-reference.dtb \
 	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \
 	socfpga_cyclone5_socdk.dtb \
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 8bc7308..bb0837b 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -24,12 +24,19 @@ comment "SH-Mobile System Type"
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
 
+config ARCH_R7S72100
+	bool "RZ/A1H (R7S72100)"
+
 config ARCH_R8A7791
 	bool "R-Car M2 (R8A77910)"
 	select RENESAS_IRQC
 
 comment "SH-Mobile Board Type"
 
+config MACH_GENMAI
+	bool "Genmai board"
+	depends on ARCH_R7S72100
+
 config MACH_KOELSCH
 	bool "Koelsch board"
 	depends on ARCH_R8A7791
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index d2b8342..1c13104 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= pm-r8a7779.o
 
 # Board objects
 ifdef CONFIG_ARCH_SHMOBILE_MULTI
+obj-$(CONFIG_MACH_GENMAI)	+= board-genmai-reference.o
 obj-$(CONFIG_MACH_KOELSCH)	+= board-koelsch-reference.o
 obj-$(CONFIG_MACH_KZM9D)	+= board-kzm9d-reference.o
 else
diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c
index 34c9881..7630c10 100644
--- a/arch/arm/mach-shmobile/board-genmai-reference.c
+++ b/arch/arm/mach-shmobile/board-genmai-reference.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/clk-provider.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <mach/common.h>
@@ -27,7 +28,11 @@
 
 static void __init genmai_add_standard_devices(void)
 {
+#ifdef CONFIG_COMMON_CLK
+	of_clk_init(NULL);
+#else
 	r7s72100_clock_init();
+#endif
 	r7s72100_add_dt_devices();
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 05/26] ARM: shmobile: r8a7791 Koelsch DT reference C bits
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (7 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 04/26] ARM: shmobile: Add Koelsch SW2 support Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 14/26] ARM: shmobile: lager: mark GPIO keys as wake-up sources Simon Horman
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add DT reference support for the r8a7791 Koelsch board.

This board support file will be used together with common
clocks and multiplatform in the future.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/Kconfig                   | 11 ++++++
 arch/arm/mach-shmobile/Makefile                  |  1 +
 arch/arm/mach-shmobile/Makefile.boot             |  1 +
 arch/arm/mach-shmobile/board-koelsch-reference.c | 46 ++++++++++++++++++++++++
 4 files changed, 59 insertions(+)
 create mode 100644 arch/arm/mach-shmobile/board-koelsch-reference.c

diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index aa9017b..8eac47f 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -240,6 +240,17 @@ config MACH_KOELSCH
 	depends on ARCH_R8A7791
 	select USE_OF
 
+config MACH_KOELSCH_REFERENCE
+	bool "Koelsch board - Reference Device Tree Implementation"
+	depends on ARCH_R8A7791
+	select USE_OF
+	---help---
+	   Use reference implementation of Koelsch board support
+	   which makes use of device tree at the expense
+	   of not supporting a number of devices.
+
+	   This is intended to aid developers
+
 config MACH_KZM9G
 	bool "KZM-A9-GT board"
 	depends on ARCH_SH73A0
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index c7e8774..8bca9b5 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -71,6 +71,7 @@ obj-$(CONFIG_MACH_LAGER_REFERENCE)	+= board-lager-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)	+= board-armadillo800eva-reference.o
 obj-$(CONFIG_MACH_KOELSCH)	+= board-koelsch.o
+obj-$(CONFIG_MACH_KOELSCH_REFERENCE)	+= board-koelsch-reference.o
 obj-$(CONFIG_MACH_KZM9G)	+= board-kzm9g.o
 obj-$(CONFIG_MACH_KZM9G_REFERENCE)	+= board-kzm9g-reference.o
 endif
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 4f30e3d..892d4ab 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -8,6 +8,7 @@ loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
 loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
 loadaddr-$(CONFIG_MACH_GENMAI) += 0x8008000
 loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000
+loadaddr-$(CONFIG_MACH_KOELSCH_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
 loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
 loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
new file mode 100644
index 0000000..beecc8b
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -0,0 +1,46 @@
+/*
+ * Koelsch board support - Reference DT implementation
+ *
+ * Copyright (C) 2013  Renesas Electronics Corporation
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Magnus Damm
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+#include <mach/rcar-gen2.h>
+#include <mach/r8a7791.h>
+#include <asm/mach/arch.h>
+
+static void __init koelsch_add_standard_devices(void)
+{
+	r8a7791_clock_init();
+	r8a7791_add_dt_devices();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char * const koelsch_boards_compat_dt[] __initconst = {
+	"renesas,koelsch-reference",
+	NULL,
+};
+
+DT_MACHINE_START(KOELSCH_DT, "koelsch")
+	.smp		= smp_ops(r8a7791_smp_ops),
+	.init_early	= r8a7791_init_early,
+	.init_time	= rcar_gen2_timer_init,
+	.init_machine	= koelsch_add_standard_devices,
+	.dt_compat	= koelsch_boards_compat_dt,
+MACHINE_END
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 14/26] ARM: shmobile: lager: mark GPIO keys as wake-up sources
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (8 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 05/26] ARM: shmobile: r8a7791 Koelsch DT reference C bits Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 15/26] ARM: shmobile: Use ->init_late() on Koelsch Simon Horman
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>

Enable wakeup for the GPIO keys on the Lager board.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-lager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index fcf06fd..f5dab34 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -121,7 +121,7 @@ static const struct gpio_led_platform_data lager_leds_pdata __initconst = {
 /* GPIO KEY */
 #define GPIO_KEY(c, g, d, ...) \
 	{ .code = c, .gpio = g, .desc = d, .active_low = 1, \
-	  .debounce_interval = 20 }
+	  .wakeup = 1, .debounce_interval = 20 }
 
 static struct gpio_keys_button gpio_buttons[] = {
 	GPIO_KEY(KEY_4,		RCAR_GP_PIN(1, 28),	"SW2-pin4"),
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 06/26] ARM: shmobile: bockw: fixup FPGA ioremap area
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (10 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 15/26] ARM: shmobile: Use ->init_late() on Koelsch Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 16/26] ARM: shmobile: koelsch: mark GPIO keys as wake-up sources Simon Horman
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Don't keep FPGA ioremap area.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-bockw-reference.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c
index 1687df9..c7b217d 100644
--- a/arch/arm/mach-shmobile/board-bockw-reference.c
+++ b/arch/arm/mach-shmobile/board-bockw-reference.c
@@ -40,7 +40,7 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
 #define COMCTLR	0x101c
 static void __init bockw_init(void)
 {
-	static void __iomem *fpga;
+	void __iomem *fpga;
 
 	r8a7778_clock_init();
 	r8a7778_init_irq_extpin_dt(1);
@@ -62,6 +62,8 @@ static void __init bockw_init(void)
 		u16 val = ioread16(fpga + IRQ0MR);
 		val &= ~(1 << 4); /* enable SMSC911x */
 		iowrite16(val, fpga + IRQ0MR);
+
+		iounmap(fpga);
 	}
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 15/26] ARM: shmobile: Use ->init_late() on Koelsch
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (9 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 14/26] ARM: shmobile: lager: mark GPIO keys as wake-up sources Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 06/26] ARM: shmobile: bockw: fixup FPGA ioremap area Simon Horman
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Hook in shmobile_init_late() on Koelsch. This enables some PM
related things like CPUIdle and Suspend-to-RAM.

With this patch applied it is possible to use Suspend-to-RAM:
# echo enabled > /sys/class/tty/ttySC6/power/wakeup
# echo mem > /sys/power/state
(wake by sending a character on the serial console)

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch-reference.c | 2 ++
 arch/arm/mach-shmobile/board-koelsch.c           | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 25b558f..a804a17 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -22,6 +22,7 @@
 #include <linux/clk-provider.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <mach/common.h>
 #include <mach/rcar-gen2.h>
 #include <mach/r8a7791.h>
 #include <asm/mach/arch.h>
@@ -47,5 +48,6 @@ DT_MACHINE_START(KOELSCH_DT, "koelsch")
 	.init_early	= r8a7791_init_early,
 	.init_time	= rcar_gen2_timer_init,
 	.init_machine	= koelsch_add_standard_devices,
+	.init_late	= shmobile_init_late,
 	.dt_compat	= koelsch_boards_compat_dt,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 5b81a34..135929b 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -92,7 +92,8 @@ static const char * const koelsch_boards_compat_dt[] __initconst = {
 DT_MACHINE_START(KOELSCH_DT, "koelsch")
 	.smp		= smp_ops(r8a7791_smp_ops),
 	.init_early	= r8a7791_init_early,
-	.init_machine	= koelsch_add_standard_devices,
 	.init_time	= rcar_gen2_timer_init,
+	.init_machine	= koelsch_add_standard_devices,
+	.init_late	= shmobile_init_late,
 	.dt_compat	= koelsch_boards_compat_dt,
 MACHINE_END
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 16/26] ARM: shmobile: koelsch: mark GPIO keys as wake-up sources
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (11 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 06/26] ARM: shmobile: bockw: fixup FPGA ioremap area Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 07/26] ARM: shmobile: bockw: add pin pull-up setting for SDHI Simon Horman
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Enable wakeup for the GPIO keys on the Koelsch board.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 135929b..f0fe5d4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -57,7 +57,7 @@ static const struct gpio_led_platform_data koelsch_leds_pdata __initconst = {
 /* GPIO KEY */
 #define GPIO_KEY(c, g, d, ...) \
 	{ .code = c, .gpio = g, .desc = d, .active_low = 1, \
-	  .debounce_interval = 20 }
+	  .wakeup = 1, .debounce_interval = 20 }
 
 static struct gpio_keys_button gpio_buttons[] = {
 	GPIO_KEY(KEY_4,		RCAR_GP_PIN(5, 3),	"SW2-pin4"),
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 07/26] ARM: shmobile: bockw: add pin pull-up setting for SDHI
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (12 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 16/26] ARM: shmobile: koelsch: mark GPIO keys as wake-up sources Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 08/26] ARM: shmobile: lager: set .debounce_interval Simon Horman
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

SDHI CD/WP pin needs pull-up

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-bockw-reference.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c
index c7b217d..6586f5c 100644
--- a/arch/arm/mach-shmobile/board-bockw-reference.c
+++ b/arch/arm/mach-shmobile/board-bockw-reference.c
@@ -38,9 +38,13 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
 #define FPGA	0x18200000
 #define IRQ0MR	0x30
 #define COMCTLR	0x101c
+
+#define PFC	0xfffc0000
+#define PUPR4	0x110
 static void __init bockw_init(void)
 {
 	void __iomem *fpga;
+	void __iomem *pfc;
 
 	r8a7778_clock_init();
 	r8a7778_init_irq_extpin_dt(1);
@@ -66,6 +70,17 @@ static void __init bockw_init(void)
 		iounmap(fpga);
 	}
 
+	pfc = ioremap_nocache(PFC, 0x200);
+	if (pfc) {
+		/*
+		 * FIXME
+		 *
+		 * SDHI CD/WP pin needs pull-up
+		 */
+		iowrite32(ioread32(pfc + PUPR4) | (3 << 26), pfc + PUPR4);
+		iounmap(pfc);
+	}
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 17/26] ARM: shmobile: Hook up SW30-SW36 on Koelsch
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (14 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 08/26] ARM: shmobile: lager: set .debounce_interval Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 09/26] ARM: shmobile: koelsch: set .debounce_interval Simon Horman
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add support for Koelsch SW30-SW36 using GPIO keys.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index f0fe5d4..412e153 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -64,6 +64,13 @@ static struct gpio_keys_button gpio_buttons[] = {
 	GPIO_KEY(KEY_3,		RCAR_GP_PIN(5, 2),	"SW2-pin3"),
 	GPIO_KEY(KEY_2,		RCAR_GP_PIN(5, 1),	"SW2-pin2"),
 	GPIO_KEY(KEY_1,		RCAR_GP_PIN(5, 0),	"SW2-pin1"),
+	GPIO_KEY(KEY_G,		RCAR_GP_PIN(7, 6),	"SW36"),
+	GPIO_KEY(KEY_F,		RCAR_GP_PIN(7, 5),	"SW35"),
+	GPIO_KEY(KEY_E,		RCAR_GP_PIN(7, 4),	"SW34"),
+	GPIO_KEY(KEY_D,		RCAR_GP_PIN(7, 3),	"SW33"),
+	GPIO_KEY(KEY_C,		RCAR_GP_PIN(7, 2),	"SW32"),
+	GPIO_KEY(KEY_B,		RCAR_GP_PIN(7, 1),	"SW31"),
+	GPIO_KEY(KEY_A,		RCAR_GP_PIN(7, 0),	"SW30"),
 };
 
 static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 08/26] ARM: shmobile: lager: set .debounce_interval
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (13 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 07/26] ARM: shmobile: bockw: add pin pull-up setting for SDHI Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 17/26] ARM: shmobile: Hook up SW30-SW36 on Koelsch Simon Horman
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>

In R-Car GPIO hardware block, 'chattering removal' feature can be
enabled on GPIO-n-[3:0] pins, but it's not supported on rest of pins
GPIO-n-[31:4].

Set an appropriate debounce interval, instead.  We could confirm that
spurious/unnecessary GPIO interrupts are prevented by this settings.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-lager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 78a31b6..fcf06fd 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -120,7 +120,8 @@ static const struct gpio_led_platform_data lager_leds_pdata __initconst = {
 
 /* GPIO KEY */
 #define GPIO_KEY(c, g, d, ...) \
-	{ .code = c, .gpio = g, .desc = d, .active_low = 1 }
+	{ .code = c, .gpio = g, .desc = d, .active_low = 1, \
+	  .debounce_interval = 20 }
 
 static struct gpio_keys_button gpio_buttons[] = {
 	GPIO_KEY(KEY_4,		RCAR_GP_PIN(1, 28),	"SW2-pin4"),
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 18/26] ARM: shmobile: Use ->init_late() on Lager
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (16 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 09/26] ARM: shmobile: koelsch: set .debounce_interval Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 19/26] ARM: shmobile: Add pinctrl_register_mappings() for Koelsch Simon Horman
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Hook in shmobile_init_late() on Lager V2. This enables some PM
related things like CPUIdle and Suspend-to-RAM.

With this patch applied it is possible to use Suspend-to-RAM:
# echo enabled > /sys/class/tty/ttySC6/power/wakeup
# echo mem > /sys/power/state
(wake by sending a character on the serial console)

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-lager-reference.c | 2 ++
 arch/arm/mach-shmobile/board-lager.c           | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 7df9ea0..51a3bcc 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -20,6 +20,7 @@
 
 #include <linux/init.h>
 #include <linux/of_platform.h>
+#include <mach/common.h>
 #include <mach/rcar-gen2.h>
 #include <mach/r8a7790.h>
 #include <asm/mach/arch.h>
@@ -41,5 +42,6 @@ DT_MACHINE_START(LAGER_DT, "lager")
 	.init_early	= r8a7790_init_early,
 	.init_time	= rcar_gen2_timer_init,
 	.init_machine	= lager_add_standard_devices,
+	.init_late	= shmobile_init_late,
 	.dt_compat	= lager_boards_compat_dt,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index f5dab34..d47052e 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -259,5 +259,6 @@ DT_MACHINE_START(LAGER_DT, "lager")
 	.init_early	= r8a7790_init_early,
 	.init_time	= rcar_gen2_timer_init,
 	.init_machine	= lager_init,
+	.init_late	= shmobile_init_late,
 	.dt_compat	= lager_boards_compat_dt,
 MACHINE_END
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 09/26] ARM: shmobile: koelsch: set .debounce_interval
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (15 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 17/26] ARM: shmobile: Hook up SW30-SW36 on Koelsch Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 18/26] ARM: shmobile: Use ->init_late() on Lager Simon Horman
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

In R-Car GPIO hardware block, 'chattering removal' feature can be
enabled on GPIO-n-[3:0] pins, but it's not supported on rest of pins
GPIO-n-[31:4].

Set an appropriate debounce interval, instead.  We could confirm that
spurious/unnecessary GPIO interrupts are prevented by this settings.

Based on work for the lager board by Shinya Kuribayashi.

Cc: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 59fa0b9..5b81a34 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -56,7 +56,8 @@ static const struct gpio_led_platform_data koelsch_leds_pdata __initconst = {
 
 /* GPIO KEY */
 #define GPIO_KEY(c, g, d, ...) \
-	{ .code = c, .gpio = g, .desc = d, .active_low = 1 }
+	{ .code = c, .gpio = g, .desc = d, .active_low = 1, \
+	  .debounce_interval = 20 }
 
 static struct gpio_keys_button gpio_buttons[] = {
 	GPIO_KEY(KEY_4,		RCAR_GP_PIN(5, 3),	"SW2-pin4"),
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 19/26] ARM: shmobile: Add pinctrl_register_mappings() for Koelsch
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (17 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 18/26] ARM: shmobile: Use ->init_late() on Lager Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 20/26] ARM: shmobile: mackerel: clk_round_rate() can return a zero to indicate an error Simon Horman
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add code to setup the r8a7791 PFC for the Koelsch board.

At this point serial consoles are added, and in the near
future other platform-device-only devices will be added
here like for instance the r8a7791 DU.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-koelsch.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 412e153..6e12914 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -24,6 +24,7 @@
 #include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
 #include <mach/common.h>
@@ -78,9 +79,20 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
 	.nbuttons	= ARRAY_SIZE(gpio_buttons),
 };
 
+static const struct pinctrl_map koelsch_pinctrl_map[] = {
+	/* SCIF0 (CN19: DEBUG SERIAL0) */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791",
+				  "scif0_data_d", "scif0"),
+	/* SCIF1 (CN20: DEBUG SERIAL1) */
+	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791",
+				  "scif1_data_d", "scif1"),
+};
+
 static void __init koelsch_add_standard_devices(void)
 {
 	r8a7791_clock_init();
+	pinctrl_register_mappings(koelsch_pinctrl_map,
+				  ARRAY_SIZE(koelsch_pinctrl_map));
 	r8a7791_pinmux_init();
 	r8a7791_add_standard_devices();
 	platform_device_register_data(&platform_bus, "leds-gpio", -1,
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 20/26] ARM: shmobile: mackerel: clk_round_rate() can return a zero to indicate an error
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (18 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 19/26] ARM: shmobile: Add pinctrl_register_mappings() for Koelsch Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 21/26] ARM: shmobile: Lager:add SPI FLASH support on QSPI Simon Horman
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Paul Walmsley <pwalmsley@nvidia.com>

Treat both negative and zero return values from clk_round_rate() as
errors.  This is needed since subsequent patches will convert
clk_round_rate()'s return value to be an unsigned type, rather than a
signed type, since some clock sources can generate rates higher than
(2^31)-1 Hz.

Eventually, when calling clk_round_rate(), only a return value of zero
will be considered a error.  All other values will be considered valid
rates.  The comparison against values less than 0 is kept to preserve
the correct behavior in the meantime.

Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index af06753..d90d2f1 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -548,9 +548,9 @@ static void __init hdmi_init_pm_clock(void)
 		 clk_get_rate(&sh7372_pllc2_clk));
 
 	rate = clk_round_rate(&sh7372_pllc2_clk, 594000000);
-	if (rate < 0) {
+	if (rate <= 0) {
 		pr_err("Cannot get suitable rate: %ld\n", rate);
-		ret = rate;
+		ret = -EINVAL;
 		goto out;
 	}
 
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 21/26] ARM: shmobile: Lager:add SPI FLASH support on QSPI
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (19 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 20/26] ARM: shmobile: mackerel: clk_round_rate() can return a zero to indicate an error Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 22/26] ARM: shmobile: mackerel: Use pinconf API to configure pin pull-down Simon Horman
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Hiep Cao Minh <cm-hiep@jinso.co.jp>

This patch enables Spansion S25FL512SAGMFIG11 chip on QSPI,
Add support for the QSPI interface on Lager.

Signed-off-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-lager.c | 64 ++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index d47052e..04cb932 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -39,6 +39,11 @@
 #include <mach/r8a7790.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/mtd.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/rspi.h>
+#include <linux/spi/spi.h>
 
 /* DU */
 static struct rcar_du_encoder_data lager_du_encoders[] = {
@@ -166,6 +171,59 @@ static const struct resource ether_resources[] __initconst = {
 	DEFINE_RES_IRQ(gic_spi(162)),
 };
 
+/* SPI Flash memory (Spansion S25FL512SAGMFIG11 64Mb) */
+static struct mtd_partition spi_flash_part[] = {
+	/* Reserved for user loader program, read-only */
+	{
+		.name = "loader",
+		.offset = 0,
+		.size = SZ_256K,
+		.mask_flags = MTD_WRITEABLE,
+	},
+	/* Reserved for user program, read-only */
+	{
+		.name = "user",
+		.offset = MTDPART_OFS_APPEND,
+		.size = SZ_4M,
+		.mask_flags = MTD_WRITEABLE,
+	},
+	/* All else is writable (e.g. JFFS2) */
+	{
+		.name = "flash",
+		.offset = MTDPART_OFS_APPEND,
+		.size = MTDPART_SIZ_FULL,
+		.mask_flags = 0,
+	},
+};
+
+static struct flash_platform_data spi_flash_data = {
+	.name           = "m25p80",
+	.parts          = spi_flash_part,
+	.nr_parts       = ARRAY_SIZE(spi_flash_part),
+	.type           = "s25fl512s",
+};
+
+static const struct rspi_plat_data qspi_pdata __initconst = {
+	.num_chipselect	= 1,
+};
+
+static const struct spi_board_info spi_info[] __initconst = {
+	{
+		.modalias               = "m25p80",
+		.platform_data          = &spi_flash_data,
+		.mode                   = SPI_MODE_0,
+		.max_speed_hz           = 30000000,
+		.bus_num                = 0,
+		.chip_select            = 0,
+	},
+};
+
+/* QSPI resource */
+static const struct resource qspi_resources[] __initconst = {
+	DEFINE_RES_MEM(0xe6b10000, 0x1000),
+	DEFINE_RES_IRQ(gic_spi(184)),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* DU (CN10: ARGB0, CN13: LVDS) */
 	PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
@@ -223,6 +281,12 @@ static void __init lager_add_standard_devices(void)
 					  &ether_pdata, sizeof(ether_pdata));
 
 	lager_add_du_device();
+
+	platform_device_register_resndata(&platform_bus, "qspi", 0,
+					  qspi_resources,
+					  ARRAY_SIZE(qspi_resources),
+					  &qspi_pdata, sizeof(qspi_pdata));
+	spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
 }
 
 /*
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 22/26] ARM: shmobile: mackerel: Use pinconf API to configure pin pull-down
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (20 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 21/26] ARM: shmobile: Lager:add SPI FLASH support on QSPI Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 23/26] ARM: Kconfig: Mention Renesas ARM SoCs instead of SH-Mobile Simon Horman
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

The USB0 and USB1 VBUS pins must be pulled down. Add corresponding
configuration entries in the pinctrl map table instead of manually
poking the pin control registers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-mackerel.c | 17 +++++++++--------
 arch/arm/mach-shmobile/sh-gpio.h        | 19 -------------------
 2 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index d90d2f1..207acf0 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -41,6 +41,7 @@
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/sh_flctl.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/pinctrl/pinconf-generic.h>
 #include <linux/platform_data/gpio_backlight.h>
 #include <linux/pm_clock.h>
 #include <linux/regulator/fixed.h>
@@ -1311,6 +1312,10 @@ static struct i2c_board_info i2c1_devices[] = {
 	},
 };
 
+static unsigned long pin_pulldown_conf[] = {
+	PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 0),
+};
+
 static const struct pinctrl_map mackerel_pinctrl_map[] = {
 	/* ADXL34X */
 	PIN_MAP_MUX_GROUP_DEFAULT("1-0053", "pfc-sh7372",
@@ -1396,17 +1401,19 @@ static const struct pinctrl_map mackerel_pinctrl_map[] = {
 	/* USBHS0 */
 	PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372",
 				  "usb0_vbus", "usb0"),
+	PIN_MAP_CONFIGS_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372",
+				      "usb0_vbus", pin_pulldown_conf),
 	/* USBHS1 */
 	PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372",
 				  "usb1_vbus", "usb1"),
+	PIN_MAP_CONFIGS_GROUP_DEFAULT("renesas_usbhs.&", "pfc-sh7372",
+				      "usb1_vbus", pin_pulldown_conf),
 	PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372",
 				  "usb1_otg_id_0", "usb1"),
 };
 
 #define GPIO_PORT9CR	IOMEM(0xE6051009)
 #define GPIO_PORT10CR	IOMEM(0xE605100A)
-#define GPIO_PORT167CR	IOMEM(0xE60520A7)
-#define GPIO_PORT168CR	IOMEM(0xE60520A8)
 #define SRCR4		IOMEM(0xe61580bc)
 #define USCCR1		IOMEM(0xE6058144)
 static void __init mackerel_init(void)
@@ -1446,12 +1453,6 @@ static void __init mackerel_init(void)
 
 	gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
 
-	/* USBHS0 */
-	gpio_request_pulldown(GPIO_PORT168CR); /* VBUS0_0 pull down */
-
-	/* USBHS1 */
-	gpio_request_pulldown(GPIO_PORT167CR); /* VBUS0_1 pull down */
-
 	/* FSI2 port A (ak4643) */
 	gpio_request_one(161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
 
diff --git a/arch/arm/mach-shmobile/sh-gpio.h b/arch/arm/mach-shmobile/sh-gpio.h
index e834763..2c41414 100644
--- a/arch/arm/mach-shmobile/sh-gpio.h
+++ b/arch/arm/mach-shmobile/sh-gpio.h
@@ -26,23 +26,4 @@ static inline void __init gpio_direction_none(void __iomem * addr)
 	__raw_writeb(0x00, addr);
 }
 
-static inline void __init gpio_request_pullup(void __iomem * addr)
-{
-	u8 data = __raw_readb(addr);
-
-	data &= 0x0F;
-	data |= 0xC0;
-	__raw_writeb(data, addr);
-}
-
-static inline void __init gpio_request_pulldown(void __iomem * addr)
-{
-	u8 data = __raw_readb(addr);
-
-	data &= 0x0F;
-	data |= 0xA0;
-
-	__raw_writeb(data, addr);
-}
-
 #endif /* __ASM_ARCH_GPIO_H */
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 23/26] ARM: Kconfig: Mention Renesas ARM SoCs instead of SH-Mobile
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (21 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 22/26] ARM: shmobile: mackerel: Use pinconf API to configure pin pull-down Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 24/26] ARM: shmobile: armadillo: fixup FSI address size Simon Horman
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Only the SH-Mobile product name is mentioned in the Kconfig descriptions
and help texts. This makes it difficult for external engineers working
on other Renesas platforms to find upstream platform support as the
combination of the SH-Mobile name and using the product number proved an
effective method of concealment.

Replace the "SH-Mobile" name with "Renesas ARM SoCs" in all the related
descriptions, help texts and comments.

Reported-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/Kconfig               |  7 ++++---
 arch/arm/mach-shmobile/Kconfig | 18 +++++++++---------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 483d316..341b67d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -645,7 +645,7 @@ config ARCH_MSM
 	  (clock and power control, etc).
 
 config ARCH_SHMOBILE_LEGACY
-	bool "Renesas SH-Mobile / R-Mobile (non-multiplatform)"
+	bool "Renesas ARM SoCs (non-multiplatform)"
 	select ARCH_SHMOBILE
 	select ARM_PATCH_PHYS_VIRT
 	select CLKDEV_LOOKUP
@@ -661,8 +661,9 @@ config ARCH_SHMOBILE_LEGACY
 	select PM_GENERIC_DOMAINS if PM
 	select SPARSE_IRQ
 	help
-	  Support for Renesas's SH-Mobile and R-Mobile ARM platforms using
-	  a non-multiplatform kernel.
+	  Support for Renesas ARM SoC platforms using a non-multiplatform
+	  kernel. This includes the SH-Mobile, R-Mobile, EMMA-Mobile, R-Car
+	  and RZ families.
 
 config ARCH_RPC
 	bool "RiscPC"
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index bb0837b..3e57d45 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -2,7 +2,7 @@ config ARCH_SHMOBILE
 	bool
 
 config ARCH_SHMOBILE_MULTI
-	bool "SH-Mobile Series" if ARCH_MULTI_V7
+	bool "Renesas ARM SoCs" if ARCH_MULTI_V7
 	depends on MMU
 	select ARCH_SHMOBILE
 	select CPU_V7
@@ -19,7 +19,7 @@ config ARCH_SHMOBILE_MULTI
 
 if ARCH_SHMOBILE_MULTI
 
-comment "SH-Mobile System Type"
+comment "Renesas ARM SoCs System Type"
 
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
@@ -31,7 +31,7 @@ config ARCH_R8A7791
 	bool "R-Car M2 (R8A77910)"
 	select RENESAS_IRQC
 
-comment "SH-Mobile Board Type"
+comment "Renesas ARM SoCs Board Type"
 
 config MACH_GENMAI
 	bool "Genmai board"
@@ -46,12 +46,12 @@ config MACH_KZM9D
 	depends on ARCH_EMEV2
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
-comment "SH-Mobile System Configuration"
+comment "Renesas ARM SoCs System Configuration"
 endif
 
 if ARCH_SHMOBILE_LEGACY
 
-comment "SH-Mobile System Type"
+comment "Renesas ARM SoCs System Type"
 
 config ARCH_SH7372
 	bool "SH-Mobile AP4 (SH7372)"
@@ -137,7 +137,7 @@ config ARCH_R7S72100
 	select CPU_V7
 	select SH_CLK_CPG
 
-comment "SH-Mobile Board Type"
+comment "Renesas ARM SoCs Board Type"
 
 config MACH_APE6EVM
 	bool "APE6EVM board"
@@ -301,7 +301,7 @@ config MACH_KZM9G_REFERENCE
 
 	   This is intended to aid developers
 
-comment "SH-Mobile System Configuration"
+comment "Renesas ARM SoCs System Configuration"
 
 config CPU_HAS_INTEVT
         bool
@@ -326,8 +326,8 @@ config SHMOBILE_TIMER_HZ
 	  Allows the configuration of the timer frequency. It is customary
 	  to have the timer interrupt run at 1000 Hz or 100 Hz, but in the
 	  case of low timer frequencies other values may be more suitable.
-	  SH-Mobile systems using a 32768 Hz RCLK for clock events may want
-	  to select a HZ value such as 128 that can evenly divide RCLK.
+	  Renesas ARM SoC systems using a 32768 Hz RCLK for clock events may
+	  want to select a HZ value such as 128 that can evenly divide RCLK.
 	  A HZ value that does not divide evenly may cause timer drift.
 
 config SH_TIMER_CMT
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 24/26] ARM: shmobile: armadillo: fixup FSI address size
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (22 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 23/26] ARM: Kconfig: Mention Renesas ARM SoCs instead of SH-Mobile Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 25/26] ARM: shmobile: bockw: remove unused RSND_SSI_CLK_FROM_ADG Simon Horman
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

FSI address size is 0x400, not 0x8400

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-armadillo800eva.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 958e3cb..d9e28c7a 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -958,7 +958,7 @@ static struct resource fsi_resources[] = {
 	[0] = {
 		.name	= "FSI",
 		.start	= 0xfe1f0000,
-		.end	= 0xfe1f8400 - 1,
+		.end	= 0xfe1f0400 - 1,
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 25/26] ARM: shmobile: bockw: remove unused RSND_SSI_CLK_FROM_ADG
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (23 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 24/26] ARM: shmobile: armadillo: fixup FSI address size Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-23  2:07 ` [PATCH 26/26] ARM: shmobile: lager: add gpio/fixed regulator for SDHI Simon Horman
  2013-12-29 21:16 ` [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Olof Johansson
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

92eba04e4bcd469518cc759ac1bf1a49acaa5cc1
(ASoC: rcar: remove RSND_SSI_CLK_FROM_ADG) removed
RSND_SSI_CLK_FROM_ADG, it is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-bockw.c | 4 ++--
 include/sound/rcar_snd.h             | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 540f0dc..eb5b54f 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -332,11 +332,11 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
 	RSND_SSI_UNUSED, /* SSI 1 */
 	RSND_SSI_UNUSED, /* SSI 2 */
 	RSND_SSI_SET(1, 0, gic_iid(0x85), RSND_SSI_PLAY),
-	RSND_SSI_SET(2, 0, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE | RSND_SSI_CLK_FROM_ADG),
+	RSND_SSI_SET(2, 0, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
 	RSND_SSI_SET(0, 0, gic_iid(0x86), RSND_SSI_PLAY),
 	RSND_SSI_SET(0, 0, gic_iid(0x86), 0),
 	RSND_SSI_SET(3, 0, gic_iid(0x86), RSND_SSI_PLAY),
-	RSND_SSI_SET(4, 0, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE | RSND_SSI_CLK_FROM_ADG),
+	RSND_SSI_SET(4, 0, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
 };
 
 static struct rsnd_scu_platform_info rsnd_scu[9] = {
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
index 12afab1..6ce506b 100644
--- a/include/sound/rcar_snd.h
+++ b/include/sound/rcar_snd.h
@@ -34,7 +34,6 @@
  * B : SSI direction
  */
 #define RSND_SSI_CLK_PIN_SHARE		(1 << 31)
-#define RSND_SSI_CLK_FROM_ADG		(1 << 30) /* clock parent is master */
 #define RSND_SSI_SYNC			(1 << 29) /* SSI34_sync etc */
 
 #define RSND_SSI_PLAY			(1 << 24)
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 26/26] ARM: shmobile: lager: add gpio/fixed regulator for SDHI
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (24 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 25/26] ARM: shmobile: bockw: remove unused RSND_SSI_CLK_FROM_ADG Simon Horman
@ 2013-12-23  2:07 ` Simon Horman
  2013-12-29 21:16 ` [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Olof Johansson
  26 siblings, 0 replies; 28+ messages in thread
From: Simon Horman @ 2013-12-23  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Fixed regulator is used for SDHI0/2 Vcc.
We should use da9063 driver for Vccq,
but, it doesn't have regulator support at this point.
This patch uses gpio-regulator for it as quick-hack.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-lager.c | 83 +++++++++++++++++++++++++++++++++++-
 1 file changed, 82 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 04cb932..267f2b3 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -31,7 +31,9 @@
 #include <linux/platform_data/rcar-du.h>
 #include <linux/platform_device.h>
 #include <linux/phy.h>
+#include <linux/regulator/driver.h>
 #include <linux/regulator/fixed.h>
+#include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
 #include <linux/sh_eth.h>
 #include <mach/common.h>
@@ -146,6 +148,71 @@ static struct regulator_consumer_supply fixed3v3_power_consumers[] =
 	REGULATOR_SUPPLY("vmmc", "sh_mmcif.1"),
 };
 
+/*
+ * SDHI regulator macro
+ *
+ ** FIXME**
+ * Lager board vqmmc is provided via DA9063 PMIC chip,
+ * and we should use ${LINK}/drivers/mfd/da9063-* driver for it.
+ * but, it doesn't have regulator support at this point.
+ * It uses gpio-regulator for vqmmc as quick-hack.
+ */
+#define SDHI_REGULATOR(idx, vdd_pin, vccq_pin)				\
+static struct regulator_consumer_supply vcc_sdhi##idx##_consumer =	\
+	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi." #idx);		\
+									\
+static struct regulator_init_data vcc_sdhi##idx##_init_data = {		\
+	.constraints = {						\
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,		\
+	},								\
+	.consumer_supplies	= &vcc_sdhi##idx##_consumer,		\
+	.num_consumer_supplies	= 1,					\
+};									\
+									\
+static const struct fixed_voltage_config vcc_sdhi##idx##_info __initconst = {\
+	.supply_name	= "SDHI" #idx "Vcc",				\
+	.microvolts	= 3300000,					\
+	.gpio		= vdd_pin,					\
+	.enable_high	= 1,						\
+	.init_data	= &vcc_sdhi##idx##_init_data,			\
+};									\
+									\
+static struct regulator_consumer_supply vccq_sdhi##idx##_consumer =	\
+	REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi." #idx);		\
+									\
+static struct regulator_init_data vccq_sdhi##idx##_init_data = {	\
+	.constraints = {						\
+		.input_uV	= 3300000,				\
+		.min_uV		= 1800000,				\
+		.max_uV		= 3300000,				\
+		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |		\
+				  REGULATOR_CHANGE_STATUS,		\
+	},								\
+	.consumer_supplies	= &vccq_sdhi##idx##_consumer,		\
+	.num_consumer_supplies	= 1,					\
+};									\
+									\
+static struct gpio vccq_sdhi##idx##_gpio =				\
+	{ vccq_pin, GPIOF_OUT_INIT_HIGH, "vccq-sdhi" #idx };		\
+									\
+static struct gpio_regulator_state vccq_sdhi##idx##_states[] = {	\
+	{ .value = 1800000, .gpios = 0 },				\
+	{ .value = 3300000, .gpios = 1 },				\
+};									\
+									\
+static const struct gpio_regulator_config vccq_sdhi##idx##_info __initconst = {\
+	.supply_name	= "vqmmc",					\
+	.gpios		= &vccq_sdhi##idx##_gpio,			\
+	.nr_gpios	= 1,						\
+	.states		= vccq_sdhi##idx##_states,			\
+	.nr_states	= ARRAY_SIZE(vccq_sdhi##idx##_states),		\
+	.type		= REGULATOR_VOLTAGE,				\
+	.init_data	= &vccq_sdhi##idx##_init_data,			\
+};
+
+SDHI_REGULATOR(0, RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 29));
+SDHI_REGULATOR(2, RCAR_GP_PIN(5, 25), RCAR_GP_PIN(5, 30));
+
 /* MMCIF */
 static const struct sh_mmcif_plat_data mmcif1_pdata __initconst = {
 	.caps		= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
@@ -256,6 +323,9 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
 
 static void __init lager_add_standard_devices(void)
 {
+	int fixed_regulator_idx = 0;
+	int gpio_regulator_idx = 0;
+
 	r8a7790_clock_init();
 
 	pinctrl_register_mappings(lager_pinctrl_map,
@@ -269,7 +339,8 @@ static void __init lager_add_standard_devices(void)
 	platform_device_register_data(&platform_bus, "gpio-keys", -1,
 				      &lager_keys_pdata,
 				      sizeof(lager_keys_pdata));
-	regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
+	regulator_register_always_on(fixed_regulator_idx++,
+				     "fixed-3.3V", fixed3v3_power_consumers,
 				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
 	platform_device_register_resndata(&platform_bus, "sh_mmcif", 1,
 					  mmcif1_resources, ARRAY_SIZE(mmcif1_resources),
@@ -287,6 +358,16 @@ static void __init lager_add_standard_devices(void)
 					  ARRAY_SIZE(qspi_resources),
 					  &qspi_pdata, sizeof(qspi_pdata));
 	spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
+
+	platform_device_register_data(&platform_bus, "reg-fixed-voltage", fixed_regulator_idx++,
+				      &vcc_sdhi0_info, sizeof(struct fixed_voltage_config));
+	platform_device_register_data(&platform_bus, "reg-fixed-voltage", fixed_regulator_idx++,
+				      &vcc_sdhi2_info, sizeof(struct fixed_voltage_config));
+
+	platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
+				      &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
+	platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
+				      &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
 }
 
 /*
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14
  2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
                   ` (25 preceding siblings ...)
  2013-12-23  2:07 ` [PATCH 26/26] ARM: shmobile: lager: add gpio/fixed regulator for SDHI Simon Horman
@ 2013-12-29 21:16 ` Olof Johansson
  26 siblings, 0 replies; 28+ messages in thread
From: Olof Johansson @ 2013-12-29 21:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 23, 2013 at 11:06:53AM +0900, Simon Horman wrote:
> The following changes since commit ea8d8a911f4850312834a0ff45c3d5ebc31fb1f1:
> 
>   Merge tag 'renesas-cleanup-for-v3.14' into boards-base (2013-12-10 17:22:55 +0900)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-boards-for-v3.14
> 
> for you to fetch changes up to be0647d556985ae58a42e7fc3751a293c418c41e:
> 
>   ARM: shmobile: lager: add gpio/fixed regulator for SDHI (2013-12-10 17:24:50 +0900)

Pulled, thanks.

-Olof

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2013-12-29 21:16 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23  2:06 [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Simon Horman
2013-12-23  2:07 ` [PATCH 01/26] ARM: shmobile: bockw: use regulator for MMCIF Simon Horman
2013-12-23  2:07 ` [PATCH 10/26] ARM: shmobile: Initial r8a7791 and Koelsch multiplatform support Simon Horman
2013-12-23  2:07 ` [PATCH 11/26] ARM: shmobile: r7s72100 Genmai DT reference DTS bits Simon Horman
2013-12-23  2:07 ` [PATCH 02/26] ARM: shmobile: Enable PFC/GPIO on the Koelsch board Simon Horman
2013-12-23  2:07 ` [PATCH 03/26] ARM: shmobile: Add Koelsch LED6, LED7 and LED8 support Simon Horman
2013-12-23  2:07 ` [PATCH 12/26] ARM: shmobile: r7s72100 Genmai DT reference C bits Simon Horman
2013-12-23  2:07 ` [PATCH 13/26] ARM: shmobile: r7s72100 Genmai Multiplatform Simon Horman
2013-12-23  2:07 ` [PATCH 04/26] ARM: shmobile: Add Koelsch SW2 support Simon Horman
2013-12-23  2:07 ` [PATCH 05/26] ARM: shmobile: r8a7791 Koelsch DT reference C bits Simon Horman
2013-12-23  2:07 ` [PATCH 14/26] ARM: shmobile: lager: mark GPIO keys as wake-up sources Simon Horman
2013-12-23  2:07 ` [PATCH 15/26] ARM: shmobile: Use ->init_late() on Koelsch Simon Horman
2013-12-23  2:07 ` [PATCH 06/26] ARM: shmobile: bockw: fixup FPGA ioremap area Simon Horman
2013-12-23  2:07 ` [PATCH 16/26] ARM: shmobile: koelsch: mark GPIO keys as wake-up sources Simon Horman
2013-12-23  2:07 ` [PATCH 07/26] ARM: shmobile: bockw: add pin pull-up setting for SDHI Simon Horman
2013-12-23  2:07 ` [PATCH 08/26] ARM: shmobile: lager: set .debounce_interval Simon Horman
2013-12-23  2:07 ` [PATCH 17/26] ARM: shmobile: Hook up SW30-SW36 on Koelsch Simon Horman
2013-12-23  2:07 ` [PATCH 09/26] ARM: shmobile: koelsch: set .debounce_interval Simon Horman
2013-12-23  2:07 ` [PATCH 18/26] ARM: shmobile: Use ->init_late() on Lager Simon Horman
2013-12-23  2:07 ` [PATCH 19/26] ARM: shmobile: Add pinctrl_register_mappings() for Koelsch Simon Horman
2013-12-23  2:07 ` [PATCH 20/26] ARM: shmobile: mackerel: clk_round_rate() can return a zero to indicate an error Simon Horman
2013-12-23  2:07 ` [PATCH 21/26] ARM: shmobile: Lager:add SPI FLASH support on QSPI Simon Horman
2013-12-23  2:07 ` [PATCH 22/26] ARM: shmobile: mackerel: Use pinconf API to configure pin pull-down Simon Horman
2013-12-23  2:07 ` [PATCH 23/26] ARM: Kconfig: Mention Renesas ARM SoCs instead of SH-Mobile Simon Horman
2013-12-23  2:07 ` [PATCH 24/26] ARM: shmobile: armadillo: fixup FSI address size Simon Horman
2013-12-23  2:07 ` [PATCH 25/26] ARM: shmobile: bockw: remove unused RSND_SSI_CLK_FROM_ADG Simon Horman
2013-12-23  2:07 ` [PATCH 26/26] ARM: shmobile: lager: add gpio/fixed regulator for SDHI Simon Horman
2013-12-29 21:16 ` [GIT PULL 00/26] Renesas ARM based SoC board updates for v3.14 Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).