linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform
@ 2014-05-15 11:31 Simon Horman
  2014-05-15 11:31 ` [PATCH v6 01/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
                   ` (16 more replies)
  0 siblings, 17 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

The aim of this series is to add common clock framework and in turn
multiplatform support to the r8a7779 SoC and marzen-reference.  It
subsequently removes non-multiplatform support from marzen-reference.

This is based on work for R-Car Gen2 by Laurent Pinchart and Magnus Damm.


This series is a minor update to v5 to take into account:
* An Ack
* Request for caching of the pin mode
* Patches that have been queued up for v3.16

I intend to merge this series unless there are objections.


Applied on top of a merge of:
* The renesas-devel-v3.15-rc1-20140515 tag of my renesas tree.
* The clk-next branch of Mike Turquettes's tree
  This is to provide the following which were previously part of this series:
  - clk: shmobile: r8a7779: Add MSTP clock support
  - clk: shmobile: r8a7779: Add clocks support


Caveats:

* SMSC_PHY is known not to work with marzen though the reason for
  this is not known. As this is selected in the shmobile_defconfig
  it should be manually disabled before compiling that configuration
  for use on Marzen.

Simon Horman (17):
  ARM: shmobile: r8a7779: Add clock index macros for DT sources
  ARM: shmobile: r8a7779: Add clocks
  ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
  ARM: shmobile: marzen: Specify external clock frequency in DT
  ARM: shmobile: r8a7779: Reference clocks
  ARM: shmobile: r8a7779: Add helper to read mode pins
  ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to
    clock-r8a7779.c
  ARM: shmobile: marzen-reference: Move clock and OF device
    initialisation into board code
  ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h
  ARM: shmobile: r8a7779: Initial multiplatform support
  ARM: shmobile: marzen-reference: Initialize CPG device
  ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU
  ARM: shmobile: marzen: Add to shmobile defconfig
  ARM: shmobile: Remove non-multiplatform Marzen reference support
  ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  ARM: shmobile: Remove Marzen reference DTS
  ARM: shmobile: marzen-reference: Remove legacy clock support

 arch/arm/boot/dts/Makefile                      |   4 +-
 arch/arm/boot/dts/r8a7779-marzen-reference.dts  | 121 ------------------
 arch/arm/boot/dts/r8a7779-marzen.dts            |  98 +++++++++++++++
 arch/arm/boot/dts/r8a7779.dtsi                  | 156 ++++++++++++++++++++++++
 arch/arm/configs/shmobile_defconfig             |   2 +
 arch/arm/mach-shmobile/Kconfig                  |  23 ++--
 arch/arm/mach-shmobile/Makefile                 |   2 +-
 arch/arm/mach-shmobile/Makefile.boot            |   1 -
 arch/arm/mach-shmobile/board-marzen-reference.c |  28 +++++
 arch/arm/mach-shmobile/clock-r8a7779.c          |  22 ++--
 arch/arm/mach-shmobile/include/mach/r8a7779.h   |   2 +-
 arch/arm/mach-shmobile/setup-r8a7779.c          |  32 ++---
 include/dt-bindings/clock/r8a7779-clock.h       |  64 ++++++++++
 13 files changed, 393 insertions(+), 162 deletions(-)
 delete mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 include/dt-bindings/clock/r8a7779-clock.h

-- 
1.8.5.2

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

* [PATCH v6 01/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
@ 2014-05-15 11:31 ` Simon Horman
  2014-05-15 11:31 ` [PATCH v6 02/17] ARM: shmobile: r8a7779: Add clocks Simon Horman
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

Add macros usable by device tree sources to reference r8a7779 clocks by
index.

Based on work for the r8a7791 SoC by Laurent Pinchart.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v5
* No Change

v4
* Add R8A7779_CLK_B

v3
* As suggested by Laurent Pinchart
  - Consolidate R8A7779_CLK_HSPI{0,1,2} into R8A7779_CLK_HSPI
  - Correct inverted indexes of R8A7779_CLK_TMU{1,2}
  - Consolidate R8A7779_CLK_{E,O}HCI{0,1} into R8A7779_CLK_USB{0,1}
  - Add ethernet, MMC and HSCIF entries
  - Replace R8A7779_SCIF6 with R8A7779_CLK_SCIF5

* Add R8A7779_CLK_PCIE

v2
* No change
---
 include/dt-bindings/clock/r8a7779-clock.h | 64 +++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 include/dt-bindings/clock/r8a7779-clock.h

diff --git a/include/dt-bindings/clock/r8a7779-clock.h b/include/dt-bindings/clock/r8a7779-clock.h
new file mode 100644
index 0000000..381a611
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7779-clock.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2013  Horms Solutions Ltd.
+ *
+ * Contact: Simon Horman <horms@verge.net.au>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_R8A7779_H__
+#define __DT_BINDINGS_CLOCK_R8A7779_H__
+
+/* CPG */
+#define R8A7779_CLK_PLLA	0
+#define R8A7779_CLK_Z		1
+#define R8A7779_CLK_ZS		2
+#define R8A7779_CLK_S		3
+#define R8A7779_CLK_S1		4
+#define R8A7779_CLK_P		5
+#define R8A7779_CLK_B		6
+#define R8A7779_CLK_OUT		7
+
+/* MSTP 0 */
+#define R8A7779_CLK_HSPI	7
+#define R8A7779_CLK_TMU2	14
+#define R8A7779_CLK_TMU1	15
+#define R8A7779_CLK_TMU0	16
+#define R8A7779_CLK_HSCIF1	18
+#define R8A7779_CLK_HSCIF0	19
+#define R8A7779_CLK_SCIF5	21
+#define R8A7779_CLK_SCIF4	22
+#define R8A7779_CLK_SCIF3	23
+#define R8A7779_CLK_SCIF2	24
+#define R8A7779_CLK_SCIF1	25
+#define R8A7779_CLK_SCIF0	26
+#define R8A7779_CLK_I2C3	27
+#define R8A7779_CLK_I2C2	28
+#define R8A7779_CLK_I2C1	29
+#define R8A7779_CLK_I2C0	30
+
+/* MSTP 1 */
+#define R8A7779_CLK_USB01	0
+#define R8A7779_CLK_USB2	1
+#define R8A7779_CLK_DU		3
+#define R8A7779_CLK_VIN2	8
+#define R8A7779_CLK_VIN1	9
+#define R8A7779_CLK_VIN0	10
+#define R8A7779_CLK_ETHER	14
+#define R8A7779_CLK_SATA	15
+#define R8A7779_CLK_PCIE	16
+#define R8A7779_CLK_VIN3	20
+
+/* MSTP 3 */
+#define R8A7779_CLK_SDHI3	20
+#define R8A7779_CLK_SDHI2	21
+#define R8A7779_CLK_SDHI1	22
+#define R8A7779_CLK_SDHI0	23
+#define R8A7779_CLK_MMC1	30
+#define R8A7779_CLK_MMC0	31
+
+
+#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
-- 
1.8.5.2

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

* [PATCH v6 02/17] ARM: shmobile: r8a7779: Add clocks
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
  2014-05-15 11:31 ` [PATCH v6 01/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
@ 2014-05-15 11:31 ` Simon Horman
  2014-05-15 11:31 ` [PATCH v6 03/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS Simon Horman
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

Declare all core and MSTP clocks currently used by r8a7779-based boards.

Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.

Acked-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v6
* Add Ack by Laurent Pinchart

v5
* As suggested by Laurent Pinchart
  - Do not add duplicate HSPI or USB clocks
  - Add TMU1 and TMU2 clocks instead of duplicate TMU0 clocks

v4
* As suggested by Laurent Pinchart
  - Do not duplicate clocks
  - Use TMU2 and TMU1 instead of TMU0 three times.
  - Correct order of tmu clock output names
  - Use usb01 and usb2 as clock output names instead
    of ehci0 and ehci1.
* As suggested by Geert Uytterhoeven
  - Wrap lines at < 80columns
  - Beef-up short lines towards 80 columns
* As suggested by Laurent Pinchart
  - Add HSCIF clocks
  - Correct many clock sources
  - Correct reg of cpg_clocks
* Add CPG clock "b" which is now part of the binding

v3
* As suggested by Laurent Pinchart
  - Add and use extal_clk
  - Fix bogus status register use for MSTP clocks
  - Fix bogus mstp3_cls to use its own entries rather than
    that of mstp1_clks

* Update to use "main" in cpg_clocks as per updated
  binding in previous patch
* Update for new, consolidated and renamed index macros
  - R8A7779_CLK_ETHER
  - R8A7779_CLK_HSCIF
  - R8A7779_CLK_HSPI
  - R8A7779_CLK_MMC0,1
  - R8A7779_CLK_PCIE
  - R8A7779_CLK_USB01,2
---
 arch/arm/boot/dts/r8a7779.dtsi | 144 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 144 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index b517c8e..5a62970 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -11,6 +11,7 @@
 
 /include/ "skeleton.dtsi"
 
+#include <dt-bindings/clock/r8a7779-clock.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
@@ -265,4 +266,147 @@
 		#size-cells = <0>;
 		status = "disabled";
 	};
+
+	clocks {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* External root clock */
+		extal_clk: extal_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			/* This value must be overriden by the board. */
+			clock-frequency = <0>;
+			clock-output-names = "extal";
+		};
+
+		/* Special CPG clocks */
+		cpg_clocks: cpg_clocks at 0xe6150000 {
+			compatible = "renesas,r8a7779-cpg-clocks";
+			reg = <0 0xffc80000 0 0x30>;
+			clocks = <&extal_clk>;
+			#clock-cells = <1>;
+			clock-output-names = "plla", "z", "zs", "s",
+					     "s1", "p", "b", "out";
+		};
+
+		/* Fixed factor clocks */
+		i_clk: i_clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
+			#clock-cells = <0>;
+			clock-div = <2>;
+			clock-mult = <1>;
+			clock-output-names = "i";
+		};
+		s3_clk: s3_clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
+			#clock-cells = <0>;
+			clock-div = <8>;
+			clock-mult = <1>;
+			clock-output-names = "s3";
+		};
+		s4_clk: s4_clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
+			#clock-cells = <0>;
+			clock-div = <16>;
+			clock-mult = <1>;
+			clock-output-names = "s4";
+		};
+		g_clk: g_clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&cpg_clocks R8A7779_CLK_PLLA>;
+			#clock-cells = <0>;
+			clock-div = <24>;
+			clock-mult = <1>;
+			clock-output-names = "g";
+		};
+
+		/* Gate clocks */
+		mstp0_clks: mstp0_clks {
+			compatible = "renesas,r8a7779-mstp-clocks",
+			             "renesas,cpg-mstp-clocks";
+			reg = <0 0xffc80030 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_S>,
+			         <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_S>,
+				 <&cpg_clocks R8A7779_CLK_S>,
+				 <&cpg_clocks R8A7779_CLK_S1>,
+				 <&cpg_clocks R8A7779_CLK_S1>,
+				 <&cpg_clocks R8A7779_CLK_S1>,
+				 <&cpg_clocks R8A7779_CLK_S1>,
+				 <&cpg_clocks R8A7779_CLK_S1>,
+				 <&cpg_clocks R8A7779_CLK_S1>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>;
+			#clock-cells = <1>;
+			renesas,clock-indices = <
+				R8A7779_CLK_HSPI R8A7779_CLK_TMU2
+				R8A7779_CLK_TMU1 R8A7779_CLK_TMU0
+				R8A7779_CLK_HSCIF1 R8A7779_CLK_HSCIF0
+				R8A7779_CLK_SCIF5 R8A7779_CLK_SCIF4
+				R8A7779_CLK_SCIF3 R8A7779_CLK_SCIF2
+				R8A7779_CLK_SCIF1 R8A7779_CLK_SCIF0
+				R8A7779_CLK_I2C3 R8A7779_CLK_I2C2
+				R8A7779_CLK_I2C1 R8A7779_CLK_I2C0
+			>;
+			clock-output-names =
+				"hspi", "tmu2", "tmu1", "tmu0", "hscif1",
+				"hscif0", "scif5", "scif4", "scif3", "scif2",
+				"scif1", "scif0", "i2c3", "i2c2", "i2c1",
+				"i2c0";
+		};
+		mstp1_clks: mstp1_clks {
+			compatible = "renesas,r8a7779-mstp-clocks",
+			             "renesas,cpg-mstp-clocks";
+			reg = <0 0xffc80034 0 4>, <0 0xffc80044 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_S>,
+				 <&cpg_clocks R8A7779_CLK_S>,
+				 <&cpg_clocks R8A7779_CLK_S>,
+				 <&cpg_clocks R8A7779_CLK_S>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_S>;
+			#clock-cells = <1>;
+			renesas,clock-indices = <
+				R8A7779_CLK_USB01 R8A7779_CLK_USB2
+				R8A7779_CLK_DU R8A7779_CLK_VIN2
+				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
+				R8A7779_CLK_ETHER R8A7779_CLK_SATA
+				R8A7779_CLK_PCIE R8A7779_CLK_VIN3
+			>;
+			clock-output-names =
+				"usb01", "usb2",
+				"du", "vin2",
+				"vin1", "vin0",
+				"ether", "sata",
+				"pcie", "vin3";
+		};
+		mstp3_clks: mstp3_clks {
+			compatible = "renesas,r8a7779-mstp-clocks",
+			             "renesas,cpg-mstp-clocks";
+			reg = <0 0xffc8003c 0 4>;
+			clocks = <&s4_clk>, <&s4_clk>, <&s4_clk>, <&s4_clk>,
+				 <&s4_clk>, <&s4_clk>;
+			#clock-cells = <1>;
+			renesas,clock-indices = <
+				R8A7779_CLK_SDHI3 R8A7779_CLK_SDHI2
+				R8A7779_CLK_SDHI1 R8A7779_CLK_SDHI0
+				R8A7779_CLK_MMC1 R8A7779_CLK_MMC0
+			>;
+			clock-output-names =
+				"sdhi3", "sdhi2", "sdhi1", "sdhi0",
+				"mmc1", "mmc0";
+		};
+	};
 };
-- 
1.8.5.2

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

* [PATCH v6 03/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
  2014-05-15 11:31 ` [PATCH v6 01/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
  2014-05-15 11:31 ` [PATCH v6 02/17] ARM: shmobile: r8a7779: Add clocks Simon Horman
@ 2014-05-15 11:31 ` Simon Horman
  2014-05-15 11:31 ` [PATCH v6 04/17] ARM: shmobile: marzen: Specify external clock frequency in DT Simon Horman
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

Copy the device nodes from Marzen reference into the Marzen device tree
file. This will allow us to use a single DTS file regardless of kernel
configuration. In case of legacy C board code the device nodes may or
may not be used, but in the multiplatform case all the DT device nodes
will be used.

Based on a similar change for the Lager board by Laurent Pinchart.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v6
* Updated for recent changes to Marzen reference DTS

v4 - v5
* No change

v3
* Updated for recent changes to Marzen reference DTS
---
 arch/arm/boot/dts/r8a7779-marzen.dts | 94 ++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index a7af2c2..ddf9b9e 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -11,6 +11,8 @@
 
 /dts-v1/;
 #include "r8a7779.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 	model = "marzen";
@@ -24,4 +26,96 @@
 		device_type = "memory";
 		reg = <0x60000000 0x40000000>;
 	};
+
+	fixedregulator3v3: fixedregulator at 0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	lan0 at 18000000 {
+		compatible = "smsc,lan9220", "smsc,lan9115";
+		reg = <0x18000000 0x100>;
+		pinctrl-0 = <&lan0_pins>;
+		pinctrl-names = "default";
+
+		phy-mode = "mii";
+		interrupt-parent = <&irqpin0>;
+		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+		smsc,irq-push-pull;
+		reg-io-width = <4>;
+		vddvario-supply = <&fixedregulator3v3>;
+		vdd33a-supply = <&fixedregulator3v3>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		led2 {
+			gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+		};
+		led3 {
+			gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
+		};
+		led4 {
+			gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&irqpin0 {
+	status = "okay";
+};
+
+&pfc {
+	pinctrl-0 = <&scif2_pins &scif4_pins>;
+	pinctrl-names = "default";
+
+	lan0_pins: lan0 {
+		intc {
+			renesas,groups = "intc_irq1_b";
+			renesas,function = "intc";
+		};
+		lbsc {
+			renesas,groups = "lbsc_ex_cs0";
+			renesas,function = "lbsc";
+		};
+	};
+
+	scif2_pins: serial2 {
+		renesas,groups = "scif2_data_c";
+		renesas,function = "scif2";
+	};
+
+	scif4_pins: serial4 {
+		renesas,groups = "scif4_data";
+		renesas,function = "scif4";
+	};
+
+	sdhi0_pins: sd0 {
+		renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd";
+		renesas,function = "sdhi0";
+	};
+
+	hspi0_pins: hspi0 {
+		renesas,groups = "hspi0";
+		renesas,function = "hspi0";
+	};
+};
+
+&sdhi0 {
+	pinctrl-0 = <&sdhi0_pins>;
+	pinctrl-names = "default";
+
+	vmmc-supply = <&fixedregulator3v3>;
+	bus-width = <4>;
+	status = "okay";
+};
+
+&hspi0 {
+	pinctrl-0 = <&hspi0_pins>;
+	pinctrl-names = "default";
+	status = "okay";
 };
-- 
1.8.5.2

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

* [PATCH v6 04/17] ARM: shmobile: marzen: Specify external clock frequency in DT
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (2 preceding siblings ...)
  2014-05-15 11:31 ` [PATCH v6 03/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS Simon Horman
@ 2014-05-15 11:31 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 05/17] ARM: shmobile: r8a7779: Reference clocks Simon Horman
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

The external crystal frequency is 31.25 on the Marzen board.
Specify it in the device tree.

Based on work for the Lager board by Laurent Pinchart.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4 - v5
* No change

v3
* Update r8a7779-marzen.dts instead of r8a7779-marzen-reference.dts
---
 arch/arm/boot/dts/r8a7779-marzen.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index ddf9b9e..363f693 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -69,6 +69,10 @@
 	status = "okay";
 };
 
+&extal_clk {
+	clock-frequency = <31250000>;
+};
+
 &pfc {
 	pinctrl-0 = <&scif2_pins &scif4_pins>;
 	pinctrl-names = "default";
-- 
1.8.5.2

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

* [PATCH v6 05/17] ARM: shmobile: r8a7779: Reference clocks
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (3 preceding siblings ...)
  2014-05-15 11:31 ` [PATCH v6 04/17] ARM: shmobile: marzen: Specify external clock frequency in DT Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 06/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Reference clocks using a "clocks" property in all nodes corresponding to
devices that require a clock.

Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoC.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4 - v5
* No change

v3
* Also update the following nodes which are now present
  - hspi{0,1,2}
  - sata: Suggested by Laurent Pinchart
---
 arch/arm/boot/dts/r8a7779.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index 5a62970..bdaaadc 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -158,6 +158,7 @@
 		compatible = "renesas,i2c-r8a7779";
 		reg = <0xffc70000 0x1000>;
 		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
 		status = "disabled";
 	};
 
@@ -167,6 +168,7 @@
 		compatible = "renesas,i2c-r8a7779";
 		reg = <0xffc71000 0x1000>;
 		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
 		status = "disabled";
 	};
 
@@ -176,6 +178,7 @@
 		compatible = "renesas,i2c-r8a7779";
 		reg = <0xffc72000 0x1000>;
 		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
 		status = "disabled";
 	};
 
@@ -185,6 +188,7 @@
 		compatible = "renesas,i2c-r8a7779";
 		reg = <0xffc73000 0x1000>;
 		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
 		status = "disabled";
 	};
 
@@ -202,12 +206,14 @@
 		compatible = "renesas,rcar-sata";
 		reg = <0xfc600000 0x2000>;
 		interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp1_clks R8A7779_CLK_SATA>;
 	};
 
 	sdhi0: sd at ffe4c000 {
 		compatible = "renesas,sdhi-r8a7779";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -217,6 +223,7 @@
 		compatible = "renesas,sdhi-r8a7779";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -226,6 +233,7 @@
 		compatible = "renesas,sdhi-r8a7779";
 		reg = <0xffe4e000 0x100>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -235,6 +243,7 @@
 		compatible = "renesas,sdhi-r8a7779";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -246,6 +255,7 @@
 		interrupts = <0 73 IRQ_TYPE_LEVEL_HIGH>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
 		status = "disabled";
 	};
 
@@ -255,6 +265,7 @@
 		interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
 		status = "disabled";
 	};
 
@@ -264,6 +275,7 @@
 		interrupts = <0 75 IRQ_TYPE_LEVEL_HIGH>;
 		#address-cells = <1>;
 		#size-cells = <0>;
+		clocks = <&mstp0_clks R8A7779_CLK_HSPI>;
 		status = "disabled";
 	};
 
-- 
1.8.5.2

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

* [PATCH v6 06/17] ARM: shmobile: r8a7779: Add helper to read mode pins
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (4 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 05/17] ARM: shmobile: r8a7779: Reference clocks Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 07/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c Simon Horman
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add and use helper to read mode pins.
This will be re-used when moving marzen-reference to
the common clock framework.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---

There seems to be some scope to share this code
with similar code in setup-rcar-gen2.c

v6
* As suggested by Geert Uytterhoeven
  - Cache result

v2 - v5
* No change
---
 arch/arm/mach-shmobile/clock-r8a7779.c        | 11 ++---------
 arch/arm/mach-shmobile/include/mach/r8a7779.h |  1 +
 arch/arm/mach-shmobile/setup-r8a7779.c        | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index a13298b..e9d3348 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -25,6 +25,7 @@
 #include <linux/clkdev.h>
 #include <mach/clock.h>
 #include <mach/common.h>
+#include <mach/r8a7779.h>
 
 /*
  *		MD1 = 1			MD1 = 0
@@ -52,9 +53,6 @@
 #define MSTPCR3		IOMEM(0xffc8003c)
 #define MSTPSR1		IOMEM(0xffc80044)
 
-#define MODEMR		0xffcc0020
-
-
 /* ioremap() through clock mapping mandatory to avoid
  * collision with ARM coherent DMA virtual memory range.
  */
@@ -207,14 +205,9 @@ static struct clk_lookup lookups[] = {
 
 void __init r8a7779_clock_init(void)
 {
-	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
-	u32 mode;
+	u32 mode = r8a7779_read_mode_pins();
 	int k, ret = 0;
 
-	BUG_ON(!modemr);
-	mode = ioread32(modemr);
-	iounmap(modemr);
-
 	if (mode & MD(1)) {
 		plla_clk.rate = 1500000000;
 
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index 88eecea..d5ba2d8 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -32,6 +32,7 @@ extern void r8a7779_add_early_devices(void);
 extern void r8a7779_add_standard_devices(void);
 extern void r8a7779_add_standard_devices_dt(void);
 extern void r8a7779_init_late(void);
+extern u32 r8a7779_read_mode_pins(void);
 extern void r8a7779_clock_init(void);
 extern void r8a7779_pinmux_init(void);
 extern void r8a7779_pm_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index d197b5a..6d091bd 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -762,6 +762,24 @@ void __init r8a7779_add_standard_devices_dt(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
+#define MODEMR		0xffcc0020
+
+u32 __init r8a7779_read_mode_pins(void)
+{
+	static u32 mode;
+	static bool mode_valid;
+
+	if (!mode_valid) {
+		void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
+		BUG_ON(!modemr);
+		mode = ioread32(modemr);
+		iounmap(modemr);
+		mode_valid = true;
+	}
+
+	return mode;
+}
+
 static const char *r8a7779_compat_dt[] __initdata = {
 	"renesas,r8a7779",
 	NULL,
-- 
1.8.5.2

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

* [PATCH v6 07/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (5 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 06/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 08/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Simon Horman
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

r8a7779_earlytimer_init() calls r8a7779_clock_init() and
r8a7779_clock_init() is defined in clock-r8a7779.c.

If both CONFIG_COMMON_CLK and CONFIG_ARCH_R8A7779 are enabled,
as will be the case when marzen-reference moves to use
the common clock framework, then setup-r8a7779.c is compiled
but clock-r8a7779.c is not.

As r8a7779_earlytimer_init() is not used by marzen-reference
simply move it to clock-r8a7779.c.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7779.c | 11 +++++++++++
 arch/arm/mach-shmobile/setup-r8a7779.c | 10 ----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index e9d3348..4c8add9 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -23,6 +23,7 @@
 #include <linux/io.h>
 #include <linux/sh_clk.h>
 #include <linux/clkdev.h>
+#include <linux/sh_timer.h>
 #include <mach/clock.h>
 #include <mach/common.h>
 #include <mach/r8a7779.h>
@@ -261,3 +262,13 @@ void __init r8a7779_clock_init(void)
 	else
 		panic("failed to setup r8a7779 clocks\n");
 }
+
+/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
+void __init __weak r8a7779_register_twd(void) { }
+
+void __init r8a7779_earlytimer_init(void)
+{
+	r8a7779_clock_init();
+	r8a7779_register_twd();
+	shmobile_earlytimer_init();
+}
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 6d091bd..6c1aef0 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -674,16 +674,6 @@ void __init r8a7779_add_standard_devices(void)
 	r8a7779_register_hpb_dmae();
 }
 
-/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
-void __init __weak r8a7779_register_twd(void) { }
-
-void __init r8a7779_earlytimer_init(void)
-{
-	r8a7779_clock_init();
-	r8a7779_register_twd();
-	shmobile_earlytimer_init();
-}
-
 void __init r8a7779_add_early_devices(void)
 {
 	early_platform_add_devices(r8a7779_devices_dt,
-- 
1.8.5.2

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

* [PATCH v6 08/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (6 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 07/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 09/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h Simon Horman
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Move the clock initialisation and OF device population from
SoC to board code. This is in keeping with the pattern used by Lager.
And the clock portion is part of decoupling clock initialisation
from SoC code in preparation for moving to the common clock framework.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 3 +++
 arch/arm/mach-shmobile/setup-r8a7779.c          | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 2773936..c22e5c2 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/of_platform.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
@@ -27,7 +28,9 @@
 
 static void __init marzen_init(void)
 {
+	r8a7779_clock_init();
 	r8a7779_add_standard_devices_dt();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 	r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
 }
 
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 6c1aef0..c0e61d5 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -744,12 +744,8 @@ void __init r8a7779_init_delay(void)
 
 void __init r8a7779_add_standard_devices_dt(void)
 {
-	/* clocks are setup late during boot in the case of DT */
-	r8a7779_clock_init();
-
 	platform_add_devices(r8a7779_devices_dt,
 			     ARRAY_SIZE(r8a7779_devices_dt));
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 #define MODEMR		0xffcc0020
-- 
1.8.5.2

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

* [PATCH v6 09/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (7 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 08/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 10/17] ARM: shmobile: r8a7779: Initial multiplatform support Simon Horman
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Do not include sh_clk.h in r8a7779.h as it is not necessary.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index d5ba2d8..757b903 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -1,7 +1,6 @@
 #ifndef __ASM_R8A7779_H__
 #define __ASM_R8A7779_H__
 
-#include <linux/sh_clk.h>
 #include <linux/pm_domain.h>
 #include <mach/pm-rcar.h>
 
-- 
1.8.5.2

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

* [PATCH v6 10/17] ARM: shmobile: r8a7779: Initial multiplatform support
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (8 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 09/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 11/17] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add Marzen and r8a7779 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.

Marzen board support exists in 3 flavours:
1) SHMOBILE_MULTI, MACH_MARZEN - board-marzen-reference.c (CCF + DT)
2) SHMOBILE, MACH_MARZEN_REFERENCE - board-marzen-reference.c (DT)
3) SHMOBILE, MACH_MARZEN - board-marzen.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.

Based on work for the Koelsch and r8a7791 by Magnus Damm.

Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v5
* Select SYS_SUPPORTS_SH_TMU

v4
* No change

v3
* Select RENESAS_INTC_IRQPIN

fix ARCH_R8A7779

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                      |  3 ++-
 arch/arm/mach-shmobile/Kconfig                  | 10 ++++++++++
 arch/arm/mach-shmobile/Makefile                 |  1 +
 arch/arm/mach-shmobile/board-marzen-reference.c |  5 +++++
 4 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index fbebf73..4694dcb 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -316,7 +316,8 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r7s72100-genmai-reference.dtb \
 	r8a7791-henninger.dtb \
 	r8a7791-koelsch.dtb \
-	r8a7790-lager.dtb
+	r8a7790-lager.dtb \
+	r8a7779-marzen-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 037c006..28d7e86 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -26,6 +26,11 @@ config ARCH_R7S72100
 	bool "RZ/A1H (R7S72100)"
 	select SYS_SUPPORTS_SH_MTU2
 
+config ARCH_R8A7779
+	bool "R-Car H1 (R8A77790)"
+	select RENESAS_INTC_IRQPIN
+	select SYS_SUPPORTS_SH_TMU
+
 config ARCH_R8A7790
 	bool "R-Car H2 (R8A77900)"
 	select RENESAS_IRQC
@@ -52,6 +57,11 @@ config MACH_LAGER
 	depends on ARCH_R8A7790
 	select MICREL_PHY if SH_ETH
 
+config MACH_MARZEN
+	bool "MARZEN board"
+	depends on ARCH_R8A7779
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+
 comment "Renesas ARM SoCs System Configuration"
 endif
 
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 9c5cd8c..ed49315 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -59,6 +59,7 @@ ifdef CONFIG_ARCH_SHMOBILE_MULTI
 obj-$(CONFIG_MACH_GENMAI)	+= board-genmai-reference.o
 obj-$(CONFIG_MACH_KOELSCH)	+= board-koelsch-reference.o
 obj-$(CONFIG_MACH_LAGER)	+= board-lager-reference.o
+obj-$(CONFIG_MACH_MARZEN)	+= board-marzen-reference.o
 else
 obj-$(CONFIG_MACH_APE6EVM)	+= board-ape6evm.o
 obj-$(CONFIG_MACH_APE6EVM_REFERENCE)	+= board-ape6evm-reference.o
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index c22e5c2..d3e8319 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-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/of_platform.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -28,7 +29,11 @@
 
 static void __init marzen_init(void)
 {
+#ifdef CONFIG_COMMON_CLK
+	of_clk_init(NULL);
+#else
 	r8a7779_clock_init();
+#endif
 	r8a7779_add_standard_devices_dt();
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 	r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
-- 
1.8.5.2

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

* [PATCH v6 11/17] ARM: shmobile: marzen-reference: Initialize CPG device
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (9 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 10/17] ARM: shmobile: r8a7779: Initial multiplatform support Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 12/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU Simon Horman
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

On multiplatform kernels clocks are handled by the CCF CPG driver. It
must be explicitly initialized by a call to r8a7779_clocks_init() with
the value of the boot mode pins.

Based on similar work for the Koelsch board by Laurent Pinchart.

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

diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index d3e8319..e261431 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -19,7 +19,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/clk-provider.h>
+#include <linux/clk/shmobile.h>
+#include <linux/clocksource.h>
 #include <linux/of_platform.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
@@ -27,11 +28,17 @@
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 
-static void __init marzen_init(void)
+static void __init marzen_init_timer(void)
 {
 #ifdef CONFIG_COMMON_CLK
-	of_clk_init(NULL);
-#else
+	r8a7779_clocks_init(r8a7779_read_mode_pins());
+#endif
+	clocksource_of_init();
+}
+
+static void __init marzen_init(void)
+{
+#ifndef CONFIG_COMMON_CLK
 	r8a7779_clock_init();
 #endif
 	r8a7779_add_standard_devices_dt();
@@ -48,6 +55,7 @@ DT_MACHINE_START(MARZEN, "marzen")
 	.smp		= smp_ops(r8a7779_smp_ops),
 	.map_io		= r8a7779_map_io,
 	.init_early	= r8a7779_init_delay,
+	.init_time	= marzen_init_timer,
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.init_irq	= r8a7779_init_irq_dt,
 	.init_machine	= marzen_init,
-- 
1.8.5.2

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

* [PATCH v6 12/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (10 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 11/17] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig Simon Horman
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the common clock framework is supported, the clock lookup
entries in clock-r8a7779.c are not registered anymore. Devices must
instead reference their clocks in the device tree. However, SCIF and CMT
devices are still instantiated through platform code, and thus need a
clock lookup entry.

Retrieve the SCIF and CMT clock entries by name and register clkdevs for
the corresponding devices. This will be removed when the SCIF and CMT
devices will be instantiated from the device tree.

Based on work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v6
* Update for "ARM: shmobile: r8a7778: Switch to new style TMU device"

v5
* No change

v4
* As suggested by Geert Uytterhoeven and Magnus Damm
  - Make use of shmobile_clk_workaround()
  - This patch now depends on
    "ARM: shmobile: Introduce shmobile_clk_workaround()"

v3
* Initialise TMU clocks instead of CMT clocks
  - It is TMU that Marzen uses as a clocksource
* Refactor clock initialisation hack as per more recent mainline
  code for Koelsch
* Use IS_ERR to check the return value of clk_get()
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index e261431..d09e850 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -23,6 +23,7 @@
 #include <linux/clocksource.h>
 #include <linux/of_platform.h>
 #include <mach/r8a7779.h>
+#include <mach/clock.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
 #include <asm/irq.h>
@@ -36,9 +37,27 @@ static void __init marzen_init_timer(void)
 	clocksource_of_init();
 }
 
+#ifdef CONFIG_COMMON_CLK
+/*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+ */
+static const struct clk_name clk_names[] __initconst = {
+	{ "scif0", NULL, "sh-sci.0" },
+	{ "scif1", NULL, "sh-sci.1" },
+	{ "scif2", NULL, "sh-sci.2" },
+	{ "scif3", NULL, "sh-sci.3" },
+	{ "scif4", NULL, "sh-sci.4" },
+	{ "scif5", NULL, "sh-sci.5" },
+	{ "tmu0", "fck", "sh-tmu.0" },
+};
+#endif
+
 static void __init marzen_init(void)
 {
-#ifndef CONFIG_COMMON_CLK
+#ifdef CONFIG_COMMON_CLK
+	shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
+#else
 	r8a7779_clock_init();
 #endif
 	r8a7779_add_standard_devices_dt();
-- 
1.8.5.2

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (11 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 12/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:57   ` Geert Uytterhoeven
  2014-05-15 11:32 ` [PATCH v6 14/17] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add marzen to shmobile defconfig now that it supports multiplatform

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/configs/shmobile_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index 6d6437c..ea7673a 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -9,11 +9,13 @@ CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_SLAB=y
 CONFIG_ARCH_SHMOBILE_MULTI=y
+CONFIG_ARCH_R8A7779=y
 CONFIG_ARCH_EMEV2=y
 CONFIG_ARCH_R8A7790=y
 CONFIG_ARCH_R8A7791=y
 CONFIG_MACH_KOELSCH=y
 CONFIG_MACH_LAGER=y
+CONFIG_MACH_MARZEN=y
 # CONFIG_SWP_EMULATE is not set
 CONFIG_CPU_BPREDICT_DISABLE=y
 CONFIG_PL310_ERRATA_588369=y
-- 
1.8.5.2

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

* [PATCH v6 14/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (12 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 15/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Now that r8a7779 has CCF support remove the legacy Marzen reference
Kconfig bits CONFIG_MACH_MARZEN_REFERENCE for the non-multiplatform
case.

Starting from this commit Marzen board support is always enabled via
CONFIG_MACH_MARZEN, and CONFIG_ARCH_MULTIPLATFORM is used to select
between board-marzen.c and board-marzen-reference.c

The file board-marzen-reference.c can no longer be used together with
the legacy sh-clk clock framework, instead CCF is used.

Based on work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile           |  1 -
 arch/arm/mach-shmobile/Kconfig       | 13 -------------
 arch/arm/mach-shmobile/Makefile      |  1 -
 arch/arm/mach-shmobile/Makefile.boot |  1 -
 4 files changed, 16 deletions(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 4694dcb..0d05589 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -304,7 +304,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += r7s72100-genmai.dtb \
 	r8a7778-bockw-reference.dtb \
 	r8a7740-armadillo800eva-reference.dtb \
 	r8a7779-marzen.dtb \
-	r8a7779-marzen-reference.dtb \
 	r8a7791-koelsch.dtb \
 	r8a7790-lager.dtb \
 	sh73a0-kzm9g.dtb \
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 28d7e86..bcb83dd 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -257,19 +257,6 @@ config MACH_MARZEN
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 	select USE_OF
 
-config MACH_MARZEN_REFERENCE
-	bool "MARZEN board - Reference Device Tree Implementation"
-	depends on ARCH_R8A7779
-	select ARCH_REQUIRE_GPIOLIB
-	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-	select USE_OF
-	---help---
-	   Use reference implementation of Marzen 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_LAGER
 	bool "Lager board"
 	depends on ARCH_R8A7790
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index ed49315..591966e 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -69,7 +69,6 @@ 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
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)	+= board-armadillo800eva-reference.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 99455ec..4200b94 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -14,7 +14,6 @@ loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
 loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
 loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
 loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
-loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
 
 __ZRELADDR	:= $(sort $(loadaddr-y))
    zreladdr-y   += $(__ZRELADDR)
-- 
1.8.5.2

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

* [PATCH v6 15/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (13 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 14/17] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 16/17] ARM: shmobile: Remove Marzen reference DTS Simon Horman
  2014-05-15 11:32 ` [PATCH v6 17/17] ARM: shmobile: marzen-reference: Remove legacy clock support Simon Horman
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Let the multiplatform Marzen support boot with the legacy DTS for
Marzen as well as the Marzen reference DTS.

Based on work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/Makefile                      | 2 +-
 arch/arm/mach-shmobile/board-marzen-reference.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0d05589..840a922 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -316,7 +316,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r8a7791-henninger.dtb \
 	r8a7791-koelsch.dtb \
 	r8a7790-lager.dtb \
-	r8a7779-marzen-reference.dtb
+	r8a7779-marzen.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \
 	socfpga_cyclone5_socdk.dtb \
 	socfpga_cyclone5_sockit.dtb \
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index d09e850..21c8cee 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -66,6 +66,7 @@ static void __init marzen_init(void)
 }
 
 static const char *marzen_boards_compat_dt[] __initdata = {
+	"renesas,marzen",
 	"renesas,marzen-reference",
 	NULL,
 };
-- 
1.8.5.2

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

* [PATCH v6 16/17] ARM: shmobile: Remove Marzen reference DTS
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (14 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 15/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  2014-05-15 11:32 ` [PATCH v6 17/17] ARM: shmobile: marzen-reference: Remove legacy clock support Simon Horman
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the DTS file r8a7779-marzen.dts can be used with
board-marzen.c and board-marzen-reference.c, proceed with removing
r8a7779-marzen-reference.dts.

Based on work for the Koelsch board by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v6
* Rebase

v5
* As suggested by Magnus Damm
  - Refer to r8a7779 instead of r8a7790 in the changelog
---
 arch/arm/boot/dts/r8a7779-marzen-reference.dts | 121 -------------------------
 1 file changed, 121 deletions(-)
 delete mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts

diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
deleted file mode 100644
index b27c637..0000000
--- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Reference Device Tree Source for the Marzen board
- *
- * Copyright (C) 2013 Renesas Solutions Corp.
- * Copyright (C) 2013 Simon Horman
- *
- * 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 "r8a7779.dtsi"
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "marzen";
-	compatible = "renesas,marzen-reference", "renesas,r8a7779";
-
-	chosen {
-		bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on rw";
-	};
-
-	memory {
-		device_type = "memory";
-		reg = <0x60000000 0x40000000>;
-	};
-
-	fixedregulator3v3: fixedregulator at 0 {
-		compatible = "regulator-fixed";
-		regulator-name = "fixed-3.3V";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		regulator-boot-on;
-		regulator-always-on;
-	};
-
-	lan0 at 18000000 {
-		compatible = "smsc,lan9220", "smsc,lan9115";
-		reg = <0x18000000 0x100>;
-		pinctrl-0 = <&lan0_pins>;
-		pinctrl-names = "default";
-
-		phy-mode = "mii";
-		interrupt-parent = <&irqpin0>;
-		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
-		smsc,irq-push-pull;
-		reg-io-width = <4>;
-		vddvario-supply = <&fixedregulator3v3>;
-		vdd33a-supply = <&fixedregulator3v3>;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-		led2 {
-			gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
-		};
-		led3 {
-			gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
-		};
-		led4 {
-			gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
-		};
-	};
-};
-
-&irqpin0 {
-	status = "okay";
-};
-
-&pfc {
-	pinctrl-0 = <&scif2_pins &scif4_pins>;
-	pinctrl-names = "default";
-
-	lan0_pins: lan0 {
-		intc {
-			renesas,groups = "intc_irq1_b";
-			renesas,function = "intc";
-		};
-		lbsc {
-			renesas,groups = "lbsc_ex_cs0";
-			renesas,function = "lbsc";
-		};
-	};
-
-	scif2_pins: serial2 {
-		renesas,groups = "scif2_data_c";
-		renesas,function = "scif2";
-	};
-
-	scif4_pins: serial4 {
-		renesas,groups = "scif4_data";
-		renesas,function = "scif4";
-	};
-
-	sdhi0_pins: sd0 {
-		renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd";
-		renesas,function = "sdhi0";
-	};
-
-	hspi0_pins: hspi0 {
-		renesas,groups = "hspi0";
-		renesas,function = "hspi0";
-	};
-};
-
-&sdhi0 {
-	pinctrl-0 = <&sdhi0_pins>;
-	pinctrl-names = "default";
-
-	vmmc-supply = <&fixedregulator3v3>;
-	bus-width = <4>;
-	status = "okay";
-};
-
-&hspi0 {
-	pinctrl-0 = <&hspi0_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-- 
1.8.5.2

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

* [PATCH v6 17/17] ARM: shmobile: marzen-reference: Remove legacy clock support
  2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
                   ` (15 preceding siblings ...)
  2014-05-15 11:32 ` [PATCH v6 16/17] ARM: shmobile: Remove Marzen reference DTS Simon Horman
@ 2014-05-15 11:32 ` Simon Horman
  16 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-15 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

Marzen DT reference is now only built for multiplatform
which means that CCF comes with the package. Remove unused legacy
code ifdefs to clean up the code.

Based on similar work for the Koelsch board by Magnus Damm.

Cc: Magnus Damm <damm@opensource.se>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v5, v6
* Rebase

v4
* As suggested by Geert Uytterhoeven
  - Remove bogus "these" from changelog
* Rebase
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 21c8cee..c6c133d 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -31,13 +31,10 @@
 
 static void __init marzen_init_timer(void)
 {
-#ifdef CONFIG_COMMON_CLK
 	r8a7779_clocks_init(r8a7779_read_mode_pins());
-#endif
 	clocksource_of_init();
 }
 
-#ifdef CONFIG_COMMON_CLK
 /*
  * This is a really crude hack to provide clkdev support to platform
  * devices until they get moved to DT.
@@ -51,15 +48,10 @@ static const struct clk_name clk_names[] __initconst = {
 	{ "scif5", NULL, "sh-sci.5" },
 	{ "tmu0", "fck", "sh-tmu.0" },
 };
-#endif
 
 static void __init marzen_init(void)
 {
-#ifdef CONFIG_COMMON_CLK
 	shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
-#else
-	r8a7779_clock_init();
-#endif
 	r8a7779_add_standard_devices_dt();
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 	r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */
-- 
1.8.5.2

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-15 11:32 ` [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig Simon Horman
@ 2014-05-15 11:57   ` Geert Uytterhoeven
  2014-05-15 22:50     ` Simon Horman
  0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2014-05-15 11:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Thu, May 15, 2014 at 1:32 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> index 6d6437c..ea7673a 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -9,11 +9,13 @@ CONFIG_EMBEDDED=y
>  CONFIG_PERF_EVENTS=y
>  CONFIG_SLAB=y
>  CONFIG_ARCH_SHMOBILE_MULTI=y
> +CONFIG_ARCH_R8A7779=y
>  CONFIG_ARCH_EMEV2=y
>  CONFIG_ARCH_R8A7790=y
>  CONFIG_ARCH_R8A7791=y
>  CONFIG_MACH_KOELSCH=y
>  CONFIG_MACH_LAGER=y
> +CONFIG_MACH_MARZEN=y
>  # CONFIG_SWP_EMULATE is not set
>  CONFIG_CPU_BPREDICT_DISABLE=y
>  CONFIG_PL310_ERRATA_588369=y

I think you also need:
    CONFIG_SPI_SH_HSPI=y
    CONFIG_USB_RCAR_PHY=y
    CONFIG_PM_RUNTIME=y

(the last one is set in all shmobile defconfigs, except ape6evm and shmobile).

The other differences seem to be cruft not really related to hardware support.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-15 11:57   ` Geert Uytterhoeven
@ 2014-05-15 22:50     ` Simon Horman
  2014-05-16  0:04       ` Simon Horman
  0 siblings, 1 reply; 25+ messages in thread
From: Simon Horman @ 2014-05-15 22:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 15, 2014 at 01:57:58PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Thu, May 15, 2014 at 1:32 PM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> > index 6d6437c..ea7673a 100644
> > --- a/arch/arm/configs/shmobile_defconfig
> > +++ b/arch/arm/configs/shmobile_defconfig
> > @@ -9,11 +9,13 @@ CONFIG_EMBEDDED=y
> >  CONFIG_PERF_EVENTS=y
> >  CONFIG_SLAB=y
> >  CONFIG_ARCH_SHMOBILE_MULTI=y
> > +CONFIG_ARCH_R8A7779=y
> >  CONFIG_ARCH_EMEV2=y
> >  CONFIG_ARCH_R8A7790=y
> >  CONFIG_ARCH_R8A7791=y
> >  CONFIG_MACH_KOELSCH=y
> >  CONFIG_MACH_LAGER=y
> > +CONFIG_MACH_MARZEN=y
> >  # CONFIG_SWP_EMULATE is not set
> >  CONFIG_CPU_BPREDICT_DISABLE=y
> >  CONFIG_PL310_ERRATA_588369=y
> 
> I think you also need:
>     CONFIG_SPI_SH_HSPI=y
>     CONFIG_USB_RCAR_PHY=y
>     CONFIG_PM_RUNTIME=y
> 
> (the last one is set in all shmobile defconfigs, except ape6evm and shmobile).
> 
> The other differences seem to be cruft not really related to hardware support.

Thanks, I'll verify that and make a follow-up patch.

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-15 22:50     ` Simon Horman
@ 2014-05-16  0:04       ` Simon Horman
  2014-05-16  8:43         ` Geert Uytterhoeven
  0 siblings, 1 reply; 25+ messages in thread
From: Simon Horman @ 2014-05-16  0:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 16, 2014 at 07:50:28AM +0900, Simon Horman wrote:
> On Thu, May 15, 2014 at 01:57:58PM +0200, Geert Uytterhoeven wrote:
> > Hi Simon,
> > 
> > On Thu, May 15, 2014 at 1:32 PM, Simon Horman
> > <horms+renesas@verge.net.au> wrote:
> > > diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> > > index 6d6437c..ea7673a 100644
> > > --- a/arch/arm/configs/shmobile_defconfig
> > > +++ b/arch/arm/configs/shmobile_defconfig
> > > @@ -9,11 +9,13 @@ CONFIG_EMBEDDED=y
> > >  CONFIG_PERF_EVENTS=y
> > >  CONFIG_SLAB=y
> > >  CONFIG_ARCH_SHMOBILE_MULTI=y
> > > +CONFIG_ARCH_R8A7779=y
> > >  CONFIG_ARCH_EMEV2=y
> > >  CONFIG_ARCH_R8A7790=y
> > >  CONFIG_ARCH_R8A7791=y
> > >  CONFIG_MACH_KOELSCH=y
> > >  CONFIG_MACH_LAGER=y
> > > +CONFIG_MACH_MARZEN=y
> > >  # CONFIG_SWP_EMULATE is not set
> > >  CONFIG_CPU_BPREDICT_DISABLE=y
> > >  CONFIG_PL310_ERRATA_588369=y
> > 
> > I think you also need:
> >     CONFIG_SPI_SH_HSPI=y
> >     CONFIG_USB_RCAR_PHY=y
> >     CONFIG_PM_RUNTIME=y
> > 
> > (the last one is set in all shmobile defconfigs, except ape6evm and shmobile).
> > 
> > The other differences seem to be cruft not really related to hardware support.
> 
> Thanks, I'll verify that and make a follow-up patch.

After some more consideration I have decided on a slightly modified plan.

1. SPI_SH_HSPI and USB_RCAR_PHY

   Thanks for noticing these. I think they do belong in this patch.
   I plan to queue up the version below:

2. PM_RUNTIME

   I would like to handle this as a follow-up patch.
   In particular, I seem to recall that Magnus wanted to
   hold back on this at some point. So I'd like his input.

From: Simon Horman <horms+renesas@verge.net.au>

[PATCH v6.1] ARM: shmobile: marzen: Add to shmobile defconfig

Add marzen to shmobile defconfig now that it supports multiplatform

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v6.1
* Also enable SPI_SH_HSPI and USB_RCAR_PHY

v2 - v6
* No Change

diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index b76fb9b..114e88e 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -10,10 +10,12 @@ CONFIG_PERF_EVENTS=y
 CONFIG_SLAB=y
 CONFIG_ARCH_SHMOBILE_MULTI=y
 CONFIG_ARCH_EMEV2=y
+CONFIG_ARCH_R8A7779=y
 CONFIG_ARCH_R8A7790=y
 CONFIG_ARCH_R8A7791=y
 CONFIG_MACH_KOELSCH=y
 CONFIG_MACH_LAGER=y
+CONFIG_MACH_MARZEN=y
 # CONFIG_SWP_EMULATE is not set
 CONFIG_CPU_BPREDICT_DISABLE=y
 CONFIG_PL310_ERRATA_588369=y
@@ -81,6 +83,7 @@ CONFIG_I2C_RCAR=y
 CONFIG_SPI=y
 CONFIG_SPI_RSPI=y
 CONFIG_SPI_SH_MSIOF=y
+CONFIG_SPI_SH_HSPI=y
 CONFIG_GPIO_EM=y
 CONFIG_GPIO_RCAR=y
 # CONFIG_HWMON is not set
@@ -108,12 +111,14 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_SOC_RCAR=y
 CONFIG_USB=y
-CONFIG_USB_RCAR_GEN2_PHY=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_RENESAS_USBHS=y
+CONFIG_USB_RCAR_PHY=y
+CONFIG_USB_RCAR_GEN2_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_RENESAS_USBHS_UDC=y
+CONFIG_USB_ETH=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHI=y
 CONFIG_MMC_SH_MMCIF=y

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-16  0:04       ` Simon Horman
@ 2014-05-16  8:43         ` Geert Uytterhoeven
  2014-05-16  8:51           ` Simon Horman
  0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2014-05-16  8:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Fri, May 16, 2014 at 2:04 AM, Simon Horman <horms@verge.net.au> wrote:
> Add marzen to shmobile defconfig now that it supports multiplatform
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
> ---
> v6.1
> * Also enable SPI_SH_HSPI and USB_RCAR_PHY
>
> v2 - v6
> * No Change
>
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> index b76fb9b..114e88e 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig

> +CONFIG_USB_RCAR_PHY=y
> +CONFIG_USB_RCAR_GEN2_PHY=y

While I don't dispute the need for CONFIG_USB_RCAR_GEN2_PHY in
shmobile_defconfig, this is not needed for Marzen, right?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-16  8:43         ` Geert Uytterhoeven
@ 2014-05-16  8:51           ` Simon Horman
  2014-05-16  9:00             ` Geert Uytterhoeven
  0 siblings, 1 reply; 25+ messages in thread
From: Simon Horman @ 2014-05-16  8:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 16, 2014 at 10:43:33AM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Fri, May 16, 2014 at 2:04 AM, Simon Horman <horms@verge.net.au> wrote:
> > Add marzen to shmobile defconfig now that it supports multiplatform
> >
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >
> > ---
> > v6.1
> > * Also enable SPI_SH_HSPI and USB_RCAR_PHY
> >
> > v2 - v6
> > * No Change
> >
> > diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> > index b76fb9b..114e88e 100644
> > --- a/arch/arm/configs/shmobile_defconfig
> > +++ b/arch/arm/configs/shmobile_defconfig
> 
> > +CONFIG_USB_RCAR_PHY=y
> > +CONFIG_USB_RCAR_GEN2_PHY=y
> 
> While I don't dispute the need for CONFIG_USB_RCAR_GEN2_PHY in
> shmobile_defconfig, this is not needed for Marzen, right?

The CONFIG_USB_RCAR_GEN2_PHY was moved from above (by savedefconfig).
I decided to include that change due to proximity to the new
CONFIG_USB_RCAR_PHY line. But perhaps it would have been better not to.

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-16  8:51           ` Simon Horman
@ 2014-05-16  9:00             ` Geert Uytterhoeven
  2014-05-16  9:08               ` Simon Horman
  0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2014-05-16  9:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 16, 2014 at 10:51 AM, Simon Horman <horms@verge.net.au> wrote:
>> > --- a/arch/arm/configs/shmobile_defconfig
>> > +++ b/arch/arm/configs/shmobile_defconfig
>>
>> > +CONFIG_USB_RCAR_PHY=y
>> > +CONFIG_USB_RCAR_GEN2_PHY=y
>>
>> While I don't dispute the need for CONFIG_USB_RCAR_GEN2_PHY in
>> shmobile_defconfig, this is not needed for Marzen, right?
>
> The CONFIG_USB_RCAR_GEN2_PHY was moved from above (by savedefconfig).

Sorry, I had missed that.

> I decided to include that change due to proximity to the new
> CONFIG_USB_RCAR_PHY line. But perhaps it would have been better not to.

Nevermind.

BTW, avoiding this moving around in real changes is another reason for
refreshing the defconfigs on a regular basis ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig
  2014-05-16  9:00             ` Geert Uytterhoeven
@ 2014-05-16  9:08               ` Simon Horman
  0 siblings, 0 replies; 25+ messages in thread
From: Simon Horman @ 2014-05-16  9:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 16, 2014 at 11:00:24AM +0200, Geert Uytterhoeven wrote:
> On Fri, May 16, 2014 at 10:51 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > --- a/arch/arm/configs/shmobile_defconfig
> >> > +++ b/arch/arm/configs/shmobile_defconfig
> >>
> >> > +CONFIG_USB_RCAR_PHY=y
> >> > +CONFIG_USB_RCAR_GEN2_PHY=y
> >>
> >> While I don't dispute the need for CONFIG_USB_RCAR_GEN2_PHY in
> >> shmobile_defconfig, this is not needed for Marzen, right?
> >
> > The CONFIG_USB_RCAR_GEN2_PHY was moved from above (by savedefconfig).
> 
> Sorry, I had missed that.
> 
> > I decided to include that change due to proximity to the new
> > CONFIG_USB_RCAR_PHY line. But perhaps it would have been better not to.
> 
> Nevermind.
> 
> BTW, avoiding this moving around in real changes is another reason for
> refreshing the defconfigs on a regular basis ;-)

Good point.

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

end of thread, other threads:[~2014-05-16  9:08 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 11:31 [PATCH v6 00/17] ARM: shmobile: r8a7779, marzen: CCF and multiplatform Simon Horman
2014-05-15 11:31 ` [PATCH v6 01/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
2014-05-15 11:31 ` [PATCH v6 02/17] ARM: shmobile: r8a7779: Add clocks Simon Horman
2014-05-15 11:31 ` [PATCH v6 03/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS Simon Horman
2014-05-15 11:31 ` [PATCH v6 04/17] ARM: shmobile: marzen: Specify external clock frequency in DT Simon Horman
2014-05-15 11:32 ` [PATCH v6 05/17] ARM: shmobile: r8a7779: Reference clocks Simon Horman
2014-05-15 11:32 ` [PATCH v6 06/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
2014-05-15 11:32 ` [PATCH v6 07/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c Simon Horman
2014-05-15 11:32 ` [PATCH v6 08/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Simon Horman
2014-05-15 11:32 ` [PATCH v6 09/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h Simon Horman
2014-05-15 11:32 ` [PATCH v6 10/17] ARM: shmobile: r8a7779: Initial multiplatform support Simon Horman
2014-05-15 11:32 ` [PATCH v6 11/17] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
2014-05-15 11:32 ` [PATCH v6 12/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU Simon Horman
2014-05-15 11:32 ` [PATCH v6 13/17] ARM: shmobile: marzen: Add to shmobile defconfig Simon Horman
2014-05-15 11:57   ` Geert Uytterhoeven
2014-05-15 22:50     ` Simon Horman
2014-05-16  0:04       ` Simon Horman
2014-05-16  8:43         ` Geert Uytterhoeven
2014-05-16  8:51           ` Simon Horman
2014-05-16  9:00             ` Geert Uytterhoeven
2014-05-16  9:08               ` Simon Horman
2014-05-15 11:32 ` [PATCH v6 14/17] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
2014-05-15 11:32 ` [PATCH v6 15/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
2014-05-15 11:32 ` [PATCH v6 16/17] ARM: shmobile: Remove Marzen reference DTS Simon Horman
2014-05-15 11:32 ` [PATCH v6 17/17] ARM: shmobile: marzen-reference: Remove legacy clock support Simon Horman

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).