All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC v2 00/17] ARM: shmobile: r8a7779, marzen: multiplatform
@ 2013-11-26  7:32 ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

The aim of this series is to adding 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 last step is provided to illustrate that it can be done, it may not be
desirable to do so for some time.

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

I expect the R-Car Gen2 work in this area to change and
I intend to update this series as necessary.


This series is based on the clocks/ccf/rcar-gen2 branch
of Laurent's fbdev tree. I expect that branch to be rebased/changed,
but it seems to be an adequate base for an RFC.

I have made this series, including its base, available
in the topic/clocks/ccf/r8a7779-marzen branch of my renesas tree.
That branch is likely to be rebased/changed in the future.


v2
* Fix various trivial problems that slipped into v1

Simon Horman (17):
  clk: shmobile: r8a7779: Add clocks support
  clk: shmobile: r8a7779: Add MSTP clock support
  ARM: shmobile: r8a7779: Add clock index macros for DT sources
  ARM: shmobile: r8a7779: Add clocks
  ARM: shmobile: r8a7779: Reference clocks
  ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
  ARM: shmobile: r8a7779: Sort headers alphabetically
  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 CMT
  ARM: shmobile: Remove non-multiplatform Marzen reference support
  ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  ARM: shmobile: Remove Marzen reference DTS

 .../bindings/clock/renesas,cpg-mstp-clocks.txt     |   1 +
 .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
 arch/arm/boot/dts/Makefile                         |   2 +-
 arch/arm/boot/dts/r8a7779-marzen-reference.dts     | 110 --------------
 arch/arm/boot/dts/r8a7779-marzen.dts               |  82 ++++++++++
 arch/arm/boot/dts/r8a7779.dtsi                     | 132 ++++++++++++++++
 arch/arm/mach-shmobile/Kconfig                     |  21 +--
 arch/arm/mach-shmobile/Makefile                    |   2 +-
 arch/arm/mach-shmobile/Makefile.boot               |   1 -
 arch/arm/mach-shmobile/board-marzen-reference.c    |  43 ++++++
 arch/arm/mach-shmobile/board-marzen.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             |  28 ++--
 drivers/clk/shmobile/Makefile                      |   1 +
 drivers/clk/shmobile/clk-r8a7779.c                 | 166 +++++++++++++++++++++
 include/dt-bindings/clock/r8a7779-clock.h          |  61 ++++++++
 include/linux/clk/shmobile.h                       |   1 +
 18 files changed, 561 insertions(+), 164 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
 delete mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 drivers/clk/shmobile/clk-r8a7779.c
 create mode 100644 include/dt-bindings/clock/r8a7779-clock.h

-- 
1.8.4


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

* [PATCH RFC v2 00/17] ARM: shmobile: r8a7779, marzen: multiplatform
@ 2013-11-26  7:32 ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

The aim of this series is to adding 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 last step is provided to illustrate that it can be done, it may not be
desirable to do so for some time.

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

I expect the R-Car Gen2 work in this area to change and
I intend to update this series as necessary.


This series is based on the clocks/ccf/rcar-gen2 branch
of Laurent's fbdev tree. I expect that branch to be rebased/changed,
but it seems to be an adequate base for an RFC.

I have made this series, including its base, available
in the topic/clocks/ccf/r8a7779-marzen branch of my renesas tree.
That branch is likely to be rebased/changed in the future.


v2
* Fix various trivial problems that slipped into v1

Simon Horman (17):
  clk: shmobile: r8a7779: Add clocks support
  clk: shmobile: r8a7779: Add MSTP clock support
  ARM: shmobile: r8a7779: Add clock index macros for DT sources
  ARM: shmobile: r8a7779: Add clocks
  ARM: shmobile: r8a7779: Reference clocks
  ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
  ARM: shmobile: r8a7779: Sort headers alphabetically
  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 CMT
  ARM: shmobile: Remove non-multiplatform Marzen reference support
  ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  ARM: shmobile: Remove Marzen reference DTS

 .../bindings/clock/renesas,cpg-mstp-clocks.txt     |   1 +
 .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
 arch/arm/boot/dts/Makefile                         |   2 +-
 arch/arm/boot/dts/r8a7779-marzen-reference.dts     | 110 --------------
 arch/arm/boot/dts/r8a7779-marzen.dts               |  82 ++++++++++
 arch/arm/boot/dts/r8a7779.dtsi                     | 132 ++++++++++++++++
 arch/arm/mach-shmobile/Kconfig                     |  21 +--
 arch/arm/mach-shmobile/Makefile                    |   2 +-
 arch/arm/mach-shmobile/Makefile.boot               |   1 -
 arch/arm/mach-shmobile/board-marzen-reference.c    |  43 ++++++
 arch/arm/mach-shmobile/board-marzen.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             |  28 ++--
 drivers/clk/shmobile/Makefile                      |   1 +
 drivers/clk/shmobile/clk-r8a7779.c                 | 166 +++++++++++++++++++++
 include/dt-bindings/clock/r8a7779-clock.h          |  61 ++++++++
 include/linux/clk/shmobile.h                       |   1 +
 18 files changed, 561 insertions(+), 164 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
 delete mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
 create mode 100644 drivers/clk/shmobile/clk-r8a7779.c
 create mode 100644 include/dt-bindings/clock/r8a7779-clock.h

-- 
1.8.4

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

* [PATCH RFC v2 01/17] clk: shmobile: r8a7779: Add clocks support
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add clocks support for the r8a7779 SoC

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

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
 drivers/clk/shmobile/Makefile                      |   1 +
 drivers/clk/shmobile/clk-r8a7779.c                 | 166 +++++++++++++++++++++
 include/linux/clk/shmobile.h                       |   1 +
 4 files changed, 190 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
 create mode 100644 drivers/clk/shmobile/clk-r8a7779.c

diff --git a/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
new file mode 100644
index 0000000..5636685
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
@@ -0,0 +1,22 @@
+* Renesas R8A7779 Clock Pulse Generator (CPG)
+
+The CPG generates core clocks for the R8A7779. It includes one PLL and
+several fixed ratio dividers.
+
+Required Properties:
+
+  - compatible: Must be "renesas,r8a7779-cpg-clocks"
+  - reg: Base address and length of the memory resource used by the CPG
+  - clock-output-names: Supported clocks are "plla", "z", "zs", "s", "s1",
+    "p", "out".
+
+
+Example
+-------
+
+	cpg_clocks: cpg_clocks@ffc80000 {
+		compatible = "renesas,r8a7779-cpg-clocks";
+		reg = <0 0xffc80000 0 0x80>;
+		#clock-cells = <1>;
+		clock-output-names = "plla", "z", "zs", "s", "s1", "p", "out";
+	};
diff --git a/drivers/clk/shmobile/Makefile b/drivers/clk/shmobile/Makefile
index 4df35a0..49b852a 100644
--- a/drivers/clk/shmobile/Makefile
+++ b/drivers/clk/shmobile/Makefile
@@ -1,6 +1,7 @@
 obj-$(CONFIG_ARCH_EMEV2)		+= clk-emev2.o
 obj-$(CONFIG_ARCH_R8A7790)		+= clk-rcar-gen2.o
 obj-$(CONFIG_ARCH_R8A7791)		+= clk-rcar-gen2.o
+obj-$(CONFIG_ARCH_R8A7779)		+= clk-r8a7779.o
 obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-div6.o
 obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-mstp.o
 
diff --git a/drivers/clk/shmobile/clk-r8a7779.c b/drivers/clk/shmobile/clk-r8a7779.c
new file mode 100644
index 0000000..dee898e
--- /dev/null
+++ b/drivers/clk/shmobile/clk-r8a7779.c
@@ -0,0 +1,166 @@
+/*
+ * r8a7779 Core CPG Clocks
+ *
+ * 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; version 2 of the License.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/clk/shmobile.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/spinlock.h>
+
+#include <dt-bindings/clock/r8a7779-clock.h>
+
+#define CPG_NUM_CLOCKS			(R8A7779_CLK_OUT + 1)
+
+struct r8a7779_cpg {
+	struct clk_onecell_data data;
+	spinlock_t lock;
+	void __iomem *reg;
+};
+
+/*
+ *		MD1 = 1			MD1 = 0
+ *		(PLLA = 1500)		(PLLA = 1600)
+ *		(MHz)			(MHz)
+ *------------------------------------------------+--------------------
+ * clkz		1000   (2/3)		800   (1/2)
+ * clkzs	 250   (1/6)		200   (1/8)
+ * clki		 750   (1/2)		800   (1/2)
+ * clks		 250   (1/6)		200   (1/8)
+ * clks1	 125   (1/12)		100   (1/16)
+ * clks3	 187.5 (1/8)		200   (1/8)
+ * clks4	  93.7 (1/16)		100   (1/16)
+ * clkp		  62.5 (1/24)		 50   (1/32)
+ * clkg		  62.5 (1/24)		 66.6 (1/24)
+ * clkb, CLKOUT
+ * (MD2 = 0)	  62.5 (1/24)		 66.6 (1/24)
+ * (MD2 = 1)	  41.6 (1/36)		 50   (1/32)
+ */
+
+#define CPG_CLK_CONFIG_INDEX(md)	(((md) & (BIT(1)|BIT(2))) >> 1)
+
+struct cpg_clk_config {
+	unsigned int plla;
+	unsigned int z_mult;
+	unsigned int z;
+	unsigned int zs_and_s;
+	unsigned int s1;
+	unsigned int p;
+	unsigned int out;
+};
+
+static const struct cpg_clk_config cpg_clk_configs[4] __initconst = {
+	{ 1500000000, 1, 2, 8, 16, 32, 24 },
+	{ 1500000000, 1, 2, 8, 16, 32, 24 },
+	{ 1600000000, 2, 3, 6, 12, 24, 36 },
+	{ 1600000000, 2, 3, 6, 12, 24, 32 },
+};
+
+static u32 cpg_mode __initdata;
+
+static struct clk * __init
+r8a7779_cpg_register_clock(struct device_node *np, struct r8a7779_cpg *cpg,
+			   const struct cpg_clk_config *config,
+			   const char *name)
+{
+	const char *parent_name = "plla";
+	unsigned int mult = 1;
+	unsigned int div = 1;
+	unsigned int rate = 0;
+
+	if (!strcmp(name, "plla")) {
+		parent_name = of_clk_get_parent_name(np, 0);
+		rate = config->plla;
+	} else if (!strcmp(name, "z")) {
+		div = config->z;
+		mult = config->z_mult;
+	} else if (!strcmp(name, "zs") || !strcmp(name, "s")) {
+		div = config->zs_and_s;
+	} else if (!strcmp(name, "s1")) {
+		div = config->s1;
+	} else if (!strcmp(name, "p")) {
+		div = config->p;
+	} else if (!strcmp(name, "out")) {
+		div = config->out;
+	}
+
+	if (rate)
+		return clk_register_fixed_rate(NULL, name, parent_name,
+					       0, rate);
+	else
+		return clk_register_fixed_factor(NULL, name, parent_name,
+						 0, mult, div);
+}
+
+static void __init r8a7779_cpg_clocks_init(struct device_node *np)
+{
+	const struct cpg_clk_config *config;
+	struct r8a7779_cpg *cpg;
+	struct clk **clks;
+	unsigned int i;
+	int num_clks;
+
+	num_clks = of_property_count_strings(np, "clock-output-names");
+	if (num_clks < 0) {
+		pr_err("%s: failed to count clocks\n", __func__);
+		return;
+	}
+
+	cpg = kzalloc(sizeof *cpg, GFP_KERNEL);
+	clks = kzalloc(CPG_NUM_CLOCKS * sizeof *clks, GFP_KERNEL);
+	if (cpg = NULL || clks = NULL) {
+		/* We're leaking memory on purpose, there's no point in cleaning
+		 * up as the system won't boot anyway.
+		 */
+		pr_err("%s: failed to allocate cpg\n", __func__);
+		return;
+	}
+
+	spin_lock_init(&cpg->lock);
+
+	cpg->data.clks = clks;
+	cpg->data.clk_num = CPG_NUM_CLOCKS;
+
+	cpg->reg = of_iomap(np, 0);
+	if (WARN_ON(cpg->reg = NULL))
+		return;
+
+	config = &cpg_clk_configs[CPG_CLK_CONFIG_INDEX(cpg_mode)];
+
+	for (i = 0; i < num_clks; ++i) {
+		const char *name;
+		struct clk *clk;
+
+		of_property_read_string_index(np, "clock-output-names", i,
+					      &name);
+
+		clk = r8a7779_cpg_register_clock(np, cpg, config, name);
+		if (IS_ERR(clk))
+			pr_err("%s: failed to register %s %s clock (%ld)\n",
+			       __func__, np->name, name, PTR_ERR(clk));
+		else
+			cpg->data.clks[i] = clk;
+	}
+
+	of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
+}
+CLK_OF_DECLARE(r8a7779_cpg_clks, "renesas,r8a7779-cpg-clocks",
+	       r8a7779_cpg_clocks_init);
+
+void __init r8a7779_clocks_init(u32 mode)
+{
+	cpg_mode = mode;
+
+	of_clk_init(NULL);
+}
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
index f9bf080..34bb19d 100644
--- a/include/linux/clk/shmobile.h
+++ b/include/linux/clk/shmobile.h
@@ -15,5 +15,6 @@
 #include <linux/types.h>
 
 void rcar_gen2_clocks_init(u32 mode);
+void r8a7779_clocks_init(u32 mode);
 
 #endif
-- 
1.8.4


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

* [PATCH RFC v2 01/17] clk: shmobile: r8a7779: Add clocks support
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add clocks support for the r8a7779 SoC

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

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
 drivers/clk/shmobile/Makefile                      |   1 +
 drivers/clk/shmobile/clk-r8a7779.c                 | 166 +++++++++++++++++++++
 include/linux/clk/shmobile.h                       |   1 +
 4 files changed, 190 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
 create mode 100644 drivers/clk/shmobile/clk-r8a7779.c

diff --git a/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
new file mode 100644
index 0000000..5636685
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
@@ -0,0 +1,22 @@
+* Renesas R8A7779 Clock Pulse Generator (CPG)
+
+The CPG generates core clocks for the R8A7779. It includes one PLL and
+several fixed ratio dividers.
+
+Required Properties:
+
+  - compatible: Must be "renesas,r8a7779-cpg-clocks"
+  - reg: Base address and length of the memory resource used by the CPG
+  - clock-output-names: Supported clocks are "plla", "z", "zs", "s", "s1",
+    "p", "out".
+
+
+Example
+-------
+
+	cpg_clocks: cpg_clocks at ffc80000 {
+		compatible = "renesas,r8a7779-cpg-clocks";
+		reg = <0 0xffc80000 0 0x80>;
+		#clock-cells = <1>;
+		clock-output-names = "plla", "z", "zs", "s", "s1", "p", "out";
+	};
diff --git a/drivers/clk/shmobile/Makefile b/drivers/clk/shmobile/Makefile
index 4df35a0..49b852a 100644
--- a/drivers/clk/shmobile/Makefile
+++ b/drivers/clk/shmobile/Makefile
@@ -1,6 +1,7 @@
 obj-$(CONFIG_ARCH_EMEV2)		+= clk-emev2.o
 obj-$(CONFIG_ARCH_R8A7790)		+= clk-rcar-gen2.o
 obj-$(CONFIG_ARCH_R8A7791)		+= clk-rcar-gen2.o
+obj-$(CONFIG_ARCH_R8A7779)		+= clk-r8a7779.o
 obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-div6.o
 obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-mstp.o
 
diff --git a/drivers/clk/shmobile/clk-r8a7779.c b/drivers/clk/shmobile/clk-r8a7779.c
new file mode 100644
index 0000000..dee898e
--- /dev/null
+++ b/drivers/clk/shmobile/clk-r8a7779.c
@@ -0,0 +1,166 @@
+/*
+ * r8a7779 Core CPG Clocks
+ *
+ * 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; version 2 of the License.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/clk/shmobile.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/spinlock.h>
+
+#include <dt-bindings/clock/r8a7779-clock.h>
+
+#define CPG_NUM_CLOCKS			(R8A7779_CLK_OUT + 1)
+
+struct r8a7779_cpg {
+	struct clk_onecell_data data;
+	spinlock_t lock;
+	void __iomem *reg;
+};
+
+/*
+ *		MD1 = 1			MD1 = 0
+ *		(PLLA = 1500)		(PLLA = 1600)
+ *		(MHz)			(MHz)
+ *------------------------------------------------+--------------------
+ * clkz		1000   (2/3)		800   (1/2)
+ * clkzs	 250   (1/6)		200   (1/8)
+ * clki		 750   (1/2)		800   (1/2)
+ * clks		 250   (1/6)		200   (1/8)
+ * clks1	 125   (1/12)		100   (1/16)
+ * clks3	 187.5 (1/8)		200   (1/8)
+ * clks4	  93.7 (1/16)		100   (1/16)
+ * clkp		  62.5 (1/24)		 50   (1/32)
+ * clkg		  62.5 (1/24)		 66.6 (1/24)
+ * clkb, CLKOUT
+ * (MD2 = 0)	  62.5 (1/24)		 66.6 (1/24)
+ * (MD2 = 1)	  41.6 (1/36)		 50   (1/32)
+ */
+
+#define CPG_CLK_CONFIG_INDEX(md)	(((md) & (BIT(1)|BIT(2))) >> 1)
+
+struct cpg_clk_config {
+	unsigned int plla;
+	unsigned int z_mult;
+	unsigned int z;
+	unsigned int zs_and_s;
+	unsigned int s1;
+	unsigned int p;
+	unsigned int out;
+};
+
+static const struct cpg_clk_config cpg_clk_configs[4] __initconst = {
+	{ 1500000000, 1, 2, 8, 16, 32, 24 },
+	{ 1500000000, 1, 2, 8, 16, 32, 24 },
+	{ 1600000000, 2, 3, 6, 12, 24, 36 },
+	{ 1600000000, 2, 3, 6, 12, 24, 32 },
+};
+
+static u32 cpg_mode __initdata;
+
+static struct clk * __init
+r8a7779_cpg_register_clock(struct device_node *np, struct r8a7779_cpg *cpg,
+			   const struct cpg_clk_config *config,
+			   const char *name)
+{
+	const char *parent_name = "plla";
+	unsigned int mult = 1;
+	unsigned int div = 1;
+	unsigned int rate = 0;
+
+	if (!strcmp(name, "plla")) {
+		parent_name = of_clk_get_parent_name(np, 0);
+		rate = config->plla;
+	} else if (!strcmp(name, "z")) {
+		div = config->z;
+		mult = config->z_mult;
+	} else if (!strcmp(name, "zs") || !strcmp(name, "s")) {
+		div = config->zs_and_s;
+	} else if (!strcmp(name, "s1")) {
+		div = config->s1;
+	} else if (!strcmp(name, "p")) {
+		div = config->p;
+	} else if (!strcmp(name, "out")) {
+		div = config->out;
+	}
+
+	if (rate)
+		return clk_register_fixed_rate(NULL, name, parent_name,
+					       0, rate);
+	else
+		return clk_register_fixed_factor(NULL, name, parent_name,
+						 0, mult, div);
+}
+
+static void __init r8a7779_cpg_clocks_init(struct device_node *np)
+{
+	const struct cpg_clk_config *config;
+	struct r8a7779_cpg *cpg;
+	struct clk **clks;
+	unsigned int i;
+	int num_clks;
+
+	num_clks = of_property_count_strings(np, "clock-output-names");
+	if (num_clks < 0) {
+		pr_err("%s: failed to count clocks\n", __func__);
+		return;
+	}
+
+	cpg = kzalloc(sizeof *cpg, GFP_KERNEL);
+	clks = kzalloc(CPG_NUM_CLOCKS * sizeof *clks, GFP_KERNEL);
+	if (cpg == NULL || clks == NULL) {
+		/* We're leaking memory on purpose, there's no point in cleaning
+		 * up as the system won't boot anyway.
+		 */
+		pr_err("%s: failed to allocate cpg\n", __func__);
+		return;
+	}
+
+	spin_lock_init(&cpg->lock);
+
+	cpg->data.clks = clks;
+	cpg->data.clk_num = CPG_NUM_CLOCKS;
+
+	cpg->reg = of_iomap(np, 0);
+	if (WARN_ON(cpg->reg == NULL))
+		return;
+
+	config = &cpg_clk_configs[CPG_CLK_CONFIG_INDEX(cpg_mode)];
+
+	for (i = 0; i < num_clks; ++i) {
+		const char *name;
+		struct clk *clk;
+
+		of_property_read_string_index(np, "clock-output-names", i,
+					      &name);
+
+		clk = r8a7779_cpg_register_clock(np, cpg, config, name);
+		if (IS_ERR(clk))
+			pr_err("%s: failed to register %s %s clock (%ld)\n",
+			       __func__, np->name, name, PTR_ERR(clk));
+		else
+			cpg->data.clks[i] = clk;
+	}
+
+	of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
+}
+CLK_OF_DECLARE(r8a7779_cpg_clks, "renesas,r8a7779-cpg-clocks",
+	       r8a7779_cpg_clocks_init);
+
+void __init r8a7779_clocks_init(u32 mode)
+{
+	cpg_mode = mode;
+
+	of_clk_init(NULL);
+}
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
index f9bf080..34bb19d 100644
--- a/include/linux/clk/shmobile.h
+++ b/include/linux/clk/shmobile.h
@@ -15,5 +15,6 @@
 #include <linux/types.h>
 
 void rcar_gen2_clocks_init(u32 mode);
+void r8a7779_clocks_init(u32 mode);
 
 #endif
-- 
1.8.4

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

* [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add MSTP clock support for the r8a7779 SoC

The only change required appears to be to note a new
compatibility string in the bindings.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
index 126b17e..f0a4b83 100644
--- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
@@ -12,6 +12,7 @@ Required Properties:
   - compatible: Must be one of the following
     - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
     - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2) MSTP gate clocks
+    - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
     - "renesas,cpg-mstp-clock" for generic MSTP gate clocks
   - reg: Base address and length of the memory resource used by the MSTP
     clocks
-- 
1.8.4


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

* [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Add MSTP clock support for the r8a7779 SoC

The only change required appears to be to note a new
compatibility string in the bindings.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
index 126b17e..f0a4b83 100644
--- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
@@ -12,6 +12,7 @@ Required Properties:
   - compatible: Must be one of the following
     - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
     - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2) MSTP gate clocks
+    - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
     - "renesas,cpg-mstp-clock" for generic MSTP gate clocks
   - reg: Base address and length of the memory resource used by the MSTP
     clocks
-- 
1.8.4

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

* [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 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 r8a7790 and r8a7791 SoCs by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 include/dt-bindings/clock/r8a7779-clock.h | 61 +++++++++++++++++++++++++++++++
 1 file changed, 61 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..b05fa8b
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7779-clock.h
@@ -0,0 +1,61 @@
+/*
+ * 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_OUT		6
+
+/* MSTP 0 */
+#define R8A7779_CLK_HSPI0	7
+#define R8A7779_CLK_HSPI1	7
+#define R8A7779_CLK_HSPI2	7
+#define R8A7779_CLK_TMU0	16
+#define R8A7779_CLK_TMU1	16
+#define R8A7779_CLK_TMU2	16
+#define R8A7779_CLK_SCIF6	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_EHCI0	0
+#define R8A7779_CLK_OHCI0	0
+#define R8A7779_CLK_EHCI1	1
+#define R8A7779_CLK_OHCI1	1
+#define R8A7779_CLK_DU		3
+#define R8A7779_CLK_VIN2	8
+#define R8A7779_CLK_VIN1	9
+#define R8A7779_CLK_VIN0	10
+#define R8A7779_CLK_SATA	15
+#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
+
+
+#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
-- 
1.8.4


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

* [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 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 r8a7790 and r8a7791 SoCs by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 include/dt-bindings/clock/r8a7779-clock.h | 61 +++++++++++++++++++++++++++++++
 1 file changed, 61 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..b05fa8b
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7779-clock.h
@@ -0,0 +1,61 @@
+/*
+ * 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_OUT		6
+
+/* MSTP 0 */
+#define R8A7779_CLK_HSPI0	7
+#define R8A7779_CLK_HSPI1	7
+#define R8A7779_CLK_HSPI2	7
+#define R8A7779_CLK_TMU0	16
+#define R8A7779_CLK_TMU1	16
+#define R8A7779_CLK_TMU2	16
+#define R8A7779_CLK_SCIF6	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_EHCI0	0
+#define R8A7779_CLK_OHCI0	0
+#define R8A7779_CLK_EHCI1	1
+#define R8A7779_CLK_OHCI1	1
+#define R8A7779_CLK_DU		3
+#define R8A7779_CLK_VIN2	8
+#define R8A7779_CLK_VIN1	9
+#define R8A7779_CLK_VIN0	10
+#define R8A7779_CLK_SATA	15
+#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
+
+
+#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
-- 
1.8.4

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

* [PATCH RFC v2 04/17] ARM: shmobile: r8a7779: Add clocks
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 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.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/boot/dts/r8a7779-marzen.dts |   1 +
 arch/arm/boot/dts/r8a7779.dtsi       | 124 +++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index a7af2c2..ee3fb60 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "r8a7779.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "marzen";
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index b2b418a..d524b3f 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -10,6 +10,7 @@
  */
 
 /include/ "skeleton.dtsi"
+#include <dt-bindings/clock/r8a7779-clock.h>
 
 #include <dt-bindings/interrupt-controller/irq.h>
 
@@ -248,4 +249,127 @@
 		cap-sdio-irq;
 		status = "disabled";
 	};
+
+	clocks {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* Special CPG clocks */
+		cpg_clocks: cpg_clocks@0xe6150000 {
+			compatible = "renesas,r8a7779-cpg-clocks";
+			reg = <0 0xe6150000 0 0x1000>;
+			#clock-cells = <1>;
+			clock-output-names = "plla", "z", "zs", "s", "s1",
+					     "p", "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>, <0 0xffc80034 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&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_HSPI0 R8A7779_CLK_HSPI1 R8A7779_CLK_HSPI2
+				R8A7779_CLK_TMU0 R8A7779_CLK_TMU1 R8A7779_CLK_TMU2
+				R8A7779_CLK_SCIF6 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 +				"hspi0", "hspi1", "hspi2",
+				"tmu0", "tmu1", "tmu2",
+				"scif6", "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 0xffc80038 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&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_EHCI0 R8A7779_CLK_OHCI0
+				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
+				R8A7779_CLK_DU R8A7779_CLK_VIN2
+				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
+				R8A7779_CLK_SATA R8A7779_CLK_VIN3
+			>;
+			clock-output-names +				"ehci0", "ohci0",
+				"ehci1", "ohci1",
+				"du", "vin2",
+				"vin1", "vin0",
+				"sata", "vin3";
+		};
+		mstp3_clks: mstp3_clks {
+			compatible = "renesas,r8a7779-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0 0xffc8003c 0 4>, <0 0xffc80040 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&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_EHCI0 R8A7779_CLK_OHCI0
+				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
+				R8A7779_CLK_DU R8A7779_CLK_VIN2
+				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
+				R8A7779_CLK_SATA R8A7779_CLK_VIN3
+			>;
+			clock-output-names +				"ehci0", "ohci0",
+				"ehci1", "ohci1",
+				"du", "vin2",
+				"vin1", "vin0",
+				"sata", "vin3";
+		};
+	};
 };
-- 
1.8.4


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

* [PATCH RFC v2 04/17] ARM: shmobile: r8a7779: Add clocks
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 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.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 arch/arm/boot/dts/r8a7779-marzen.dts |   1 +
 arch/arm/boot/dts/r8a7779.dtsi       | 124 +++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index a7af2c2..ee3fb60 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "r8a7779.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "marzen";
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index b2b418a..d524b3f 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -10,6 +10,7 @@
  */
 
 /include/ "skeleton.dtsi"
+#include <dt-bindings/clock/r8a7779-clock.h>
 
 #include <dt-bindings/interrupt-controller/irq.h>
 
@@ -248,4 +249,127 @@
 		cap-sdio-irq;
 		status = "disabled";
 	};
+
+	clocks {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/* Special CPG clocks */
+		cpg_clocks: cpg_clocks at 0xe6150000 {
+			compatible = "renesas,r8a7779-cpg-clocks";
+			reg = <0 0xe6150000 0 0x1000>;
+			#clock-cells = <1>;
+			clock-output-names = "plla", "z", "zs", "s", "s1",
+					     "p", "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>, <0 0xffc80034 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&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_HSPI0 R8A7779_CLK_HSPI1 R8A7779_CLK_HSPI2
+				R8A7779_CLK_TMU0 R8A7779_CLK_TMU1 R8A7779_CLK_TMU2
+				R8A7779_CLK_SCIF6 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 =
+				"hspi0", "hspi1", "hspi2",
+				"tmu0", "tmu1", "tmu2",
+				"scif6", "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 0xffc80038 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&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_EHCI0 R8A7779_CLK_OHCI0
+				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
+				R8A7779_CLK_DU R8A7779_CLK_VIN2
+				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
+				R8A7779_CLK_SATA R8A7779_CLK_VIN3
+			>;
+			clock-output-names =
+				"ehci0", "ohci0",
+				"ehci1", "ohci1",
+				"du", "vin2",
+				"vin1", "vin0",
+				"sata", "vin3";
+		};
+		mstp3_clks: mstp3_clks {
+			compatible = "renesas,r8a7779-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0 0xffc8003c 0 4>, <0 0xffc80040 0 4>;
+			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
+				 <&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_EHCI0 R8A7779_CLK_OHCI0
+				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
+				R8A7779_CLK_DU R8A7779_CLK_VIN2
+				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
+				R8A7779_CLK_SATA R8A7779_CLK_VIN3
+			>;
+			clock-output-names =
+				"ehci0", "ohci0",
+				"ehci1", "ohci1",
+				"du", "vin2",
+				"vin1", "vin0",
+				"sata", "vin3";
+		};
+	};
 };
-- 
1.8.4

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

* [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 SoCs.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index d524b3f..623dd39 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -160,6 +160,7 @@
 		reg = <0xffc70000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
 		status = "disabled";
 	};
 
@@ -170,6 +171,7 @@
 		reg = <0xffc71000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
 		status = "disabled";
 	};
 
@@ -180,6 +182,7 @@
 		reg = <0xffc72000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
 		status = "disabled";
 	};
 
@@ -190,6 +193,7 @@
 		reg = <0xffc73000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
 		status = "disabled";
 	};
 
@@ -215,6 +219,7 @@
 		reg = <0xffe4c000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -225,6 +230,7 @@
 		reg = <0xffe4d000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -235,6 +241,7 @@
 		reg = <0xffe4e000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -245,6 +252,7 @@
 		reg = <0xffe4f000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
-- 
1.8.4


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

* [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 SoCs.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index d524b3f..623dd39 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -160,6 +160,7 @@
 		reg = <0xffc70000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
 		status = "disabled";
 	};
 
@@ -170,6 +171,7 @@
 		reg = <0xffc71000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
 		status = "disabled";
 	};
 
@@ -180,6 +182,7 @@
 		reg = <0xffc72000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
 		status = "disabled";
 	};
 
@@ -190,6 +193,7 @@
 		reg = <0xffc73000 0x1000>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
 		status = "disabled";
 	};
 
@@ -215,6 +219,7 @@
 		reg = <0xffe4c000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -225,6 +230,7 @@
 		reg = <0xffe4d000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -235,6 +241,7 @@
 		reg = <0xffe4e000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
@@ -245,6 +252,7 @@
 		reg = <0xffe4f000 0x100>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
 		cap-sd-highspeed;
 		cap-sdio-irq;
 		status = "disabled";
-- 
1.8.4

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

* [PATCH RFC v2 06/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 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 regarless 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
are used.

Based on a similar change for the Lager 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/r8a7779-marzen.dts | 81 ++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index ee3fb60..4e1a871 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -25,4 +25,85 @@
 		device_type = "memory";
 		reg = <0x60000000 0x40000000>;
 	};
+
+	fixedregulator3v3: fixedregulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	lan0@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>;
+		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",
+				 "sdhi0_wp";
+		renesas,function = "sdhi0";
+	};
+};
+
+&sdhi0 {
+	pinctrl-0 = <&sdhi0_pins>;
+	pinctrl-names = "default";
+
+	vmmc-supply = <&fixedregulator3v3>;
+	bus-width = <4>;
+	status = "okay";
 };
-- 
1.8.4


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

* [PATCH RFC v2 06/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 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 regarless 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
are used.

Based on a similar change for the Lager 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/r8a7779-marzen.dts | 81 ++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts
index ee3fb60..4e1a871 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -25,4 +25,85 @@
 		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>;
+		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",
+				 "sdhi0_wp";
+		renesas,function = "sdhi0";
+	};
+};
+
+&sdhi0 {
+	pinctrl-0 = <&sdhi0_pins>;
+	pinctrl-names = "default";
+
+	vmmc-supply = <&fixedregulator3v3>;
+	bus-width = <4>;
+	status = "okay";
 };
-- 
1.8.4

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

* [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 4f9e3ec..e202c64 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -19,35 +19,35 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/kernel.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/traps.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
 #include <linux/leds.h>
-#include <linux/dma-mapping.h>
+#include <linux/mfd/tmio.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/camera-rcar.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_data/rcar-du.h>
 #include <linux/platform_data/usb-rcar-phy.h>
+#include <linux/platform_device.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/smsc911x.h>
-#include <linux/spi/spi.h>
 #include <linux/spi/sh_hspi.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
-#include <linux/mfd/tmio.h>
-#include <media/soc_camera.h>
-#include <mach/r8a7779.h>
+#include <linux/spi/spi.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/traps.h>
+#include <mach/r8a7779.h>
+#include <media/soc_camera.h>
 
 /* Fixed 3.3V regulator to be used by SDHI0 */
 static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
-- 
1.8.4


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

* [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index 4f9e3ec..e202c64 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -19,35 +19,35 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/kernel.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/traps.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
 #include <linux/leds.h>
-#include <linux/dma-mapping.h>
+#include <linux/mfd/tmio.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/camera-rcar.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_data/rcar-du.h>
 #include <linux/platform_data/usb-rcar-phy.h>
+#include <linux/platform_device.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/smsc911x.h>
-#include <linux/spi/spi.h>
 #include <linux/spi/sh_hspi.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
-#include <linux/mfd/tmio.h>
-#include <media/soc_camera.h>
-#include <mach/r8a7779.h>
+#include <linux/spi/spi.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/traps.h>
+#include <mach/r8a7779.h>
+#include <media/soc_camera.h>
 
 /* Fixed 3.3V regulator to be used by SDHI0 */
 static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
-- 
1.8.4

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

* [PATCH RFC v2 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>
---
 arch/arm/mach-shmobile/clock-r8a7779.c        | 11 ++---------
 arch/arm/mach-shmobile/include/mach/r8a7779.h |  1 +
 arch/arm/mach-shmobile/setup-r8a7779.c        | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index b7ce0e7..decf122 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
@@ -59,9 +60,6 @@
 #define MSTPCR6		IOMEM(0xffc80058)
 #define MSTPCR7		IOMEM(0xffc80040)
 
-#define MODEMR		0xffcc0020
-
-
 /* ioremap() through clock mapping mandatory to avoid
  * collision with ARM coherent DMA virtual memory range.
  */
@@ -213,14 +211,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 5014145..bd66cd82 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -39,6 +39,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 8f94531..4e3fbfb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -874,6 +874,20 @@ 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)
+{
+	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
+	u32 mode;
+
+	BUG_ON(!modemr);
+	mode = ioread32(modemr);
+	iounmap(modemr);
+
+	return mode;
+}
+
 static const char *r8a7779_compat_dt[] __initdata = {
 	"renesas,r8a7779",
 	NULL,
-- 
1.8.4


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

* [PATCH RFC v2 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>
---
 arch/arm/mach-shmobile/clock-r8a7779.c        | 11 ++---------
 arch/arm/mach-shmobile/include/mach/r8a7779.h |  1 +
 arch/arm/mach-shmobile/setup-r8a7779.c        | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index b7ce0e7..decf122 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
@@ -59,9 +60,6 @@
 #define MSTPCR6		IOMEM(0xffc80058)
 #define MSTPCR7		IOMEM(0xffc80040)
 
-#define MODEMR		0xffcc0020
-
-
 /* ioremap() through clock mapping mandatory to avoid
  * collision with ARM coherent DMA virtual memory range.
  */
@@ -213,14 +211,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 5014145..bd66cd82 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -39,6 +39,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 8f94531..4e3fbfb 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -874,6 +874,20 @@ 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)
+{
+	void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
+	u32 mode;
+
+	BUG_ON(!modemr);
+	mode = ioread32(modemr);
+	iounmap(modemr);
+
+	return mode;
+}
+
 static const char *r8a7779_compat_dt[] __initdata = {
 	"renesas,r8a7779",
 	NULL,
-- 
1.8.4

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

* [PATCH RFC v2 09/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 decf122..182a71a 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>
@@ -267,3 +268,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 4e3fbfb..73bb67f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -786,16 +786,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.4


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

* [PATCH RFC v2 09/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 decf122..182a71a 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>
@@ -267,3 +268,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 4e3fbfb..73bb67f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -786,16 +786,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.4

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

* [PATCH RFC v2 10/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into b
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 73bb67f..d98e863 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -856,12 +856,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.4


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

* [PATCH RFC v2 10/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 73bb67f..d98e863 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -856,12 +856,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.4

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

* [PATCH RFC v2 11/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 bd66cd82..8284962 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>
 
 /* HPB-DMA slave IDs */
-- 
1.8.4


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

* [PATCH RFC v2 11/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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 bd66cd82..8284962 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>
 
 /* HPB-DMA slave IDs */
-- 
1.8.4

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

* [PATCH RFC v2 12/17] ARM: shmobile: r8a7779: Initial multiplatform support
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>

---
v2
* Do not add spurious blank line
---
 arch/arm/boot/dts/Makefile                      | 1 +
 arch/arm/mach-shmobile/Kconfig                  | 8 ++++++++
 arch/arm/mach-shmobile/Makefile                 | 1 +
 arch/arm/mach-shmobile/board-marzen-reference.c | 5 +++++
 4 files changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 609d27f..723fe71 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -217,6 +217,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r7s72100-genmai-reference.dtb \
+	r8a7779-marzen-reference.dtb \
 	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index bc8108b..4216baa 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -21,6 +21,9 @@ if ARCH_SHMOBILE_MULTI
 
 comment "SH-Mobile System Type"
 
+config ARCH_R8A7779
+	bool "R-Car H1 (R8A77790)"
+
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
 
@@ -46,6 +49,11 @@ config MACH_KZM9D
 	depends on ARCH_EMEV2
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
+config MACH_MARZEN
+	bool "MARZEN board"
+	depends on ARCH_R8A7779
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+
 comment "SH-Mobile System Configuration"
 endif
 
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 1c13104..6d75ae8 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_KZM9D)	+= board-kzm9d-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.4


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

* [PATCH RFC v2 12/17] ARM: shmobile: r8a7779: Initial multiplatform support
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>

---
v2
* Do not add spurious blank line
---
 arch/arm/boot/dts/Makefile                      | 1 +
 arch/arm/mach-shmobile/Kconfig                  | 8 ++++++++
 arch/arm/mach-shmobile/Makefile                 | 1 +
 arch/arm/mach-shmobile/board-marzen-reference.c | 5 +++++
 4 files changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 609d27f..723fe71 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -217,6 +217,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r7s72100-genmai-reference.dtb \
+	r8a7779-marzen-reference.dtb \
 	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index bc8108b..4216baa 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -21,6 +21,9 @@ if ARCH_SHMOBILE_MULTI
 
 comment "SH-Mobile System Type"
 
+config ARCH_R8A7779
+	bool "R-Car H1 (R8A77790)"
+
 config ARCH_EMEV2
 	bool "Emma Mobile EV2"
 
@@ -46,6 +49,11 @@ config MACH_KZM9D
 	depends on ARCH_EMEV2
 	select REGULATOR_FIXED_VOLTAGE if REGULATOR
 
+config MACH_MARZEN
+	bool "MARZEN board"
+	depends on ARCH_R8A7779
+	select REGULATOR_FIXED_VOLTAGE if REGULATOR
+
 comment "SH-Mobile System Configuration"
 endif
 
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 1c13104..6d75ae8 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_KZM9D)	+= board-kzm9d-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.4

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

* [PATCH RFC v2 13/17] ARM: shmobile: marzen-reference: Initialize CPG device
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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.

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

---
v2
* Correct changelog to refer to r8a7779_clocks_init()
---
 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.4


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

* [PATCH RFC v2 13/17] ARM: shmobile: marzen-reference: Initialize CPG device
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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.

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

---
v2
* Correct changelog to refer to r8a7779_clocks_init()
---
 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.4

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

* [PATCH RFC v2 14/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and CMT
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 28 ++++++++++++++++++++++++-
 1 file changed, 27 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..1a2fac1 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -19,7 +19,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/clk.h>
 #include <linux/clk/shmobile.h>
+#include <linux/clkdev.h>
 #include <linux/clocksource.h>
 #include <linux/of_platform.h>
 #include <mach/r8a7779.h>
@@ -38,7 +40,31 @@ static void __init marzen_init_timer(void)
 
 static void __init marzen_init(void)
 {
-#ifndef CONFIG_COMMON_CLK
+#ifdef CONFIG_COMMON_CLK
+	/*
+	 * This is a really crude hack to provide clkdev support to the SCIF
+	 * and CMT devices until they get moved to DT.
+	 */
+	static const char * const scif_names[] = {
+		"scif0", "scif1", "scif2", "scif3", "scif4", "scif5",
+	};
+	struct clk *clk;
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(scif_names); i++) {
+		clk = clk_get(NULL, scif_names[i]);
+		if (clk) {
+			clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
+			clk_put(clk);
+		}
+	}
+
+	clk = clk_get(NULL, "cmt0");
+	if (clk) {
+		clk_register_clkdev(clk, NULL, "sh_cmt.0");
+		clk_put(clk);
+	}
+#else
 	r8a7779_clock_init();
 #endif
 	r8a7779_add_standard_devices_dt();
-- 
1.8.4


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

* [PATCH RFC v2 14/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and CMT
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>
---
 arch/arm/mach-shmobile/board-marzen-reference.c | 28 ++++++++++++++++++++++++-
 1 file changed, 27 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..1a2fac1 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -19,7 +19,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/clk.h>
 #include <linux/clk/shmobile.h>
+#include <linux/clkdev.h>
 #include <linux/clocksource.h>
 #include <linux/of_platform.h>
 #include <mach/r8a7779.h>
@@ -38,7 +40,31 @@ static void __init marzen_init_timer(void)
 
 static void __init marzen_init(void)
 {
-#ifndef CONFIG_COMMON_CLK
+#ifdef CONFIG_COMMON_CLK
+	/*
+	 * This is a really crude hack to provide clkdev support to the SCIF
+	 * and CMT devices until they get moved to DT.
+	 */
+	static const char * const scif_names[] = {
+		"scif0", "scif1", "scif2", "scif3", "scif4", "scif5",
+	};
+	struct clk *clk;
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(scif_names); i++) {
+		clk = clk_get(NULL, scif_names[i]);
+		if (clk) {
+			clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
+			clk_put(clk);
+		}
+	}
+
+	clk = clk_get(NULL, "cmt0");
+	if (clk) {
+		clk_register_clkdev(clk, NULL, "sh_cmt.0");
+		clk_put(clk);
+	}
+#else
 	r8a7779_clock_init();
 #endif
 	r8a7779_add_standard_devices_dt();
-- 
1.8.4

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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>

---
v2
* Correct changelog to refer to marzen instead of koelsch
* Do not add typo to Makefile
---
 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 723fe71..166e3dd 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -205,7 +205,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	r8a7778-bockw-reference.dtb \
 	r8a7740-armadillo800eva-reference.dtb \
 	r8a7779-marzen.dtb \
-	r8a7779-marzen-reference.dtb \
 	r8a7791-koelsch.dtb \
 	r8a7791-koelsch-reference.dtb \
 	r8a7790-lager.dtb \
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4216baa..a27d60c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -239,19 +239,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 6d75ae8..e7f586c 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_LAGER_REFERENCE)	+= board-lager-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 759e4f8f..6f761b4 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -16,7 +16,6 @@ loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
 loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 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.4


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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>

---
v2
* Correct changelog to refer to marzen instead of koelsch
* Do not add typo to Makefile
---
 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 723fe71..166e3dd 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -205,7 +205,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	r8a7778-bockw-reference.dtb \
 	r8a7740-armadillo800eva-reference.dtb \
 	r8a7779-marzen.dtb \
-	r8a7779-marzen-reference.dtb \
 	r8a7791-koelsch.dtb \
 	r8a7791-koelsch-reference.dtb \
 	r8a7790-lager.dtb \
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4216baa..a27d60c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -239,19 +239,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 6d75ae8..e7f586c 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_LAGER_REFERENCE)	+= board-lager-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 759e4f8f..6f761b4 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -16,7 +16,6 @@ loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
 loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 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.4

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

* [PATCH RFC v2 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>

---
v2
* Remove spurious change to board-koelsch-reference.c
---
 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 166e3dd..2812344 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -216,7 +216,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r7s72100-genmai-reference.dtb \
-	r8a7779-marzen-reference.dtb \
+	r8a7779-marzen.dtb \
 	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 1a2fac1..476fd7e 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -73,6 +73,7 @@ static void __init marzen_init(void)
 }
 
 static const char *marzen_boards_compat_dt[] __initdata = {
+	"renesas,marzen",
 	"renesas,marzen-reference",
 	NULL,
 };
-- 
1.8.4


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

* [PATCH RFC v2 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7: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>

---
v2
* Remove spurious change to board-koelsch-reference.c
---
 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 166e3dd..2812344 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -216,7 +216,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
 	sh7372-mackerel.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \
 	r7s72100-genmai-reference.dtb \
-	r8a7779-marzen-reference.dtb \
+	r8a7779-marzen.dtb \
 	r8a7791-koelsch-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 	socfpga_vt.dtb
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
index 1a2fac1..476fd7e 100644
--- a/arch/arm/mach-shmobile/board-marzen-reference.c
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -73,6 +73,7 @@ static void __init marzen_init(void)
 }
 
 static const char *marzen_boards_compat_dt[] __initdata = {
+	"renesas,marzen",
 	"renesas,marzen-reference",
 	NULL,
 };
-- 
1.8.4

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

* [PATCH RFC v2 17/17] ARM: shmobile: Remove Marzen reference DTS
  2013-11-26  7:32 ` Simon Horman
@ 2013-11-26  7:32   ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the DTS file r8a7790-marzen.dts can be used with
board-marzen.c and board-marzen-reference.c, proceed with removing
r8a7790-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/r8a7779-marzen-reference.dts | 110 -------------------------
 1 file changed, 110 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 13fa8be..0000000
--- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts
+++ /dev/null
@@ -1,110 +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@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "fixed-3.3V";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		regulator-boot-on;
-		regulator-always-on;
-	};
-
-	lan0@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>;
-		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",
-				 "sdhi0_wp";
-		renesas,function = "sdhi0";
-	};
-};
-
-&sdhi0 {
-	pinctrl-0 = <&sdhi0_pins>;
-	pinctrl-names = "default";
-
-	vmmc-supply = <&fixedregulator3v3>;
-	bus-width = <4>;
-	status = "okay";
-};
-- 
1.8.4


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

* [PATCH RFC v2 17/17] ARM: shmobile: Remove Marzen reference DTS
@ 2013-11-26  7:32   ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-26  7:32 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the DTS file r8a7790-marzen.dts can be used with
board-marzen.c and board-marzen-reference.c, proceed with removing
r8a7790-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/r8a7779-marzen-reference.dts | 110 -------------------------
 1 file changed, 110 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 13fa8be..0000000
--- a/arch/arm/boot/dts/r8a7779-marzen-reference.dts
+++ /dev/null
@@ -1,110 +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>;
-		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",
-				 "sdhi0_wp";
-		renesas,function = "sdhi0";
-	};
-};
-
-&sdhi0 {
-	pinctrl-0 = <&sdhi0_pins>;
-	pinctrl-names = "default";
-
-	vmmc-supply = <&fixedregulator3v3>;
-	bus-width = <4>;
-	status = "okay";
-};
-- 
1.8.4

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

* Re: [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26  9:33     ` Sergei Shtylyov
  -1 siblings, 0 replies; 68+ messages in thread
From: Sergei Shtylyov @ 2013-11-26  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 26-11-2013 11:32, Simon Horman wrote:

> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
>   1 file changed, 14 insertions(+), 14 deletions(-)

> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 4f9e3ec..e202c64 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -19,35 +19,35 @@
>    * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>    */
>
> -#include <linux/kernel.h>
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <asm/traps.h>
> +#include <linux/delay.h>
> +#include <linux/dma-mapping.h>
>   #include <linux/init.h>
>   #include <linux/interrupt.h>
> -#include <linux/irq.h>
> -#include <linux/platform_device.h>
> -#include <linux/delay.h>
>   #include <linux/io.h>
> +#include <linux/irq.h>
> +#include <linux/kernel.h>
>   #include <linux/leds.h>
> -#include <linux/dma-mapping.h>
> +#include <linux/mfd/tmio.h>
> +#include <linux/mmc/host.h>
> +#include <linux/mmc/sh_mobile_sdhi.h>
>   #include <linux/pinctrl/machine.h>
>   #include <linux/platform_data/camera-rcar.h>
>   #include <linux/platform_data/gpio-rcar.h>
>   #include <linux/platform_data/rcar-du.h>
>   #include <linux/platform_data/usb-rcar-phy.h>
> +#include <linux/platform_device.h>
>   #include <linux/regulator/fixed.h>
>   #include <linux/regulator/machine.h>
>   #include <linux/smsc911x.h>
> -#include <linux/spi/spi.h>
>   #include <linux/spi/sh_hspi.h>
> -#include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
> -#include <linux/mfd/tmio.h>
> -#include <media/soc_camera.h>
> -#include <mach/r8a7779.h>
> +#include <linux/spi/spi.h>
>   #include <mach/common.h>
>   #include <mach/irqs.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include <asm/traps.h>
> +#include <mach/r8a7779.h>
> +#include <media/soc_camera.h>

    I thought it was a good idea to keep the #include's in the order of the 
most generic to most machine specific ones: <linux/*.h> first, then <asm/*.h>, 
then <mach/*.h>, only with empty lines between groups (which weren't used 
here) with each group kept sorted...

WBR, Sergei


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

* [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
@ 2013-11-26  9:33     ` Sergei Shtylyov
  0 siblings, 0 replies; 68+ messages in thread
From: Sergei Shtylyov @ 2013-11-26  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 26-11-2013 11:32, Simon Horman wrote:

> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
>   1 file changed, 14 insertions(+), 14 deletions(-)

> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 4f9e3ec..e202c64 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -19,35 +19,35 @@
>    * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>    */
>
> -#include <linux/kernel.h>
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <asm/traps.h>
> +#include <linux/delay.h>
> +#include <linux/dma-mapping.h>
>   #include <linux/init.h>
>   #include <linux/interrupt.h>
> -#include <linux/irq.h>
> -#include <linux/platform_device.h>
> -#include <linux/delay.h>
>   #include <linux/io.h>
> +#include <linux/irq.h>
> +#include <linux/kernel.h>
>   #include <linux/leds.h>
> -#include <linux/dma-mapping.h>
> +#include <linux/mfd/tmio.h>
> +#include <linux/mmc/host.h>
> +#include <linux/mmc/sh_mobile_sdhi.h>
>   #include <linux/pinctrl/machine.h>
>   #include <linux/platform_data/camera-rcar.h>
>   #include <linux/platform_data/gpio-rcar.h>
>   #include <linux/platform_data/rcar-du.h>
>   #include <linux/platform_data/usb-rcar-phy.h>
> +#include <linux/platform_device.h>
>   #include <linux/regulator/fixed.h>
>   #include <linux/regulator/machine.h>
>   #include <linux/smsc911x.h>
> -#include <linux/spi/spi.h>
>   #include <linux/spi/sh_hspi.h>
> -#include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
> -#include <linux/mfd/tmio.h>
> -#include <media/soc_camera.h>
> -#include <mach/r8a7779.h>
> +#include <linux/spi/spi.h>
>   #include <mach/common.h>
>   #include <mach/irqs.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include <asm/traps.h>
> +#include <mach/r8a7779.h>
> +#include <media/soc_camera.h>

    I thought it was a good idea to keep the #include's in the order of the 
most generic to most machine specific ones: <linux/*.h> first, then <asm/*.h>, 
then <mach/*.h>, only with empty lines between groups (which weren't used 
here) with each group kept sorted...

WBR, Sergei

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

* Re: [PATCH RFC v2 01/17] clk: shmobile: r8a7779: Add clocks support
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26 14:35     ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:03 Simon Horman wrote:
> Add clocks support for the r8a7779 SoC
> 
> Based on work for the r8a7790 and r8a7791 SoCs by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
>  drivers/clk/shmobile/Makefile                      |   1 +
>  drivers/clk/shmobile/clk-r8a7779.c                 | 166 ++++++++++++++++++
>  include/linux/clk/shmobile.h                       |   1 +
>  4 files changed, 190 insertions(+)
>  create mode 100644
> Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> create mode 100644 drivers/clk/shmobile/clk-r8a7779.c
> 
> diff --git
> a/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> new file mode 100644
> index 0000000..5636685
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> @@ -0,0 +1,22 @@
> +* Renesas R8A7779 Clock Pulse Generator (CPG)
> +
> +The CPG generates core clocks for the R8A7779. It includes one PLL and
> +several fixed ratio dividers.

The H1 CPG looks pretty similar to the M1 CPG. What about rcar-gen1 CPG 
bindings ?

> +Required Properties:
> +
> +  - compatible: Must be "renesas,r8a7779-cpg-clocks"
> +  - reg: Base address and length of the memory resource used by the CPG
> +  - clock-output-names: Supported clocks are "plla", "z", "zs", "s", "s1",
> +    "p", "out".

Doesn't the CPG have an external clock input that needs to be specified, and 
thus need a clocks property ?

> +Example
> +-------
> +
> +	cpg_clocks: cpg_clocks@ffc80000 {
> +		compatible = "renesas,r8a7779-cpg-clocks";
> +		reg = <0 0xffc80000 0 0x80>;
> +		#clock-cells = <1>;
> +		clock-output-names = "plla", "z", "zs", "s", "s1", "p", "out";
> +	};
> diff --git a/drivers/clk/shmobile/Makefile b/drivers/clk/shmobile/Makefile
> index 4df35a0..49b852a 100644
> --- a/drivers/clk/shmobile/Makefile
> +++ b/drivers/clk/shmobile/Makefile
> @@ -1,6 +1,7 @@
>  obj-$(CONFIG_ARCH_EMEV2)		+= clk-emev2.o
>  obj-$(CONFIG_ARCH_R8A7790)		+= clk-rcar-gen2.o
>  obj-$(CONFIG_ARCH_R8A7791)		+= clk-rcar-gen2.o
> +obj-$(CONFIG_ARCH_R8A7779)		+= clk-r8a7779.o
>  obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-div6.o
>  obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-mstp.o
> 
> diff --git a/drivers/clk/shmobile/clk-r8a7779.c
> b/drivers/clk/shmobile/clk-r8a7779.c new file mode 100644
> index 0000000..dee898e
> --- /dev/null
> +++ b/drivers/clk/shmobile/clk-r8a7779.c
> @@ -0,0 +1,166 @@
> +/*
> + * r8a7779 Core CPG Clocks
> + *
> + * 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; version 2 of the License.
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/clkdev.h>
> +#include <linux/clk/shmobile.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/spinlock.h>
> +
> +#include <dt-bindings/clock/r8a7779-clock.h>
> +
> +#define CPG_NUM_CLOCKS			(R8A7779_CLK_OUT + 1)
> +
> +struct r8a7779_cpg {
> +	struct clk_onecell_data data;
> +	spinlock_t lock;
> +	void __iomem *reg;
> +};
> +
> +/*
> + *		MD1 = 1			MD1 = 0
> + *		(PLLA = 1500)		(PLLA = 1600)
> + *		(MHz)			(MHz)
> + *------------------------------------------------+--------------------
> + * clkz		1000   (2/3)		800   (1/2)
> + * clkzs	 250   (1/6)		200   (1/8)
> + * clki		 750   (1/2)		800   (1/2)
> + * clks		 250   (1/6)		200   (1/8)
> + * clks1	 125   (1/12)		100   (1/16)
> + * clks3	 187.5 (1/8)		200   (1/8)
> + * clks4	  93.7 (1/16)		100   (1/16)
> + * clkp		  62.5 (1/24)		 50   (1/32)
> + * clkg		  62.5 (1/24)		 66.6 (1/24)
> + * clkb, CLKOUT
> + * (MD2 = 0)	  62.5 (1/24)		 66.6 (1/24)
> + * (MD2 = 1)	  41.6 (1/36)		 50   (1/32)
> + */
> +
> +#define CPG_CLK_CONFIG_INDEX(md)	(((md) & (BIT(1)|BIT(2))) >> 1)
> +

The PLLA ratio is also configurable, by bits MD11 and MD12.

> +struct cpg_clk_config {
> +	unsigned int plla;
> +	unsigned int z_mult;
> +	unsigned int z;
> +	unsigned int zs_and_s;
> +	unsigned int s1;
> +	unsigned int p;
> +	unsigned int out;

Could you rename the last five fields with a _div suffix to express more 
clearly what that mean ?

> +};
> +
> +static const struct cpg_clk_config cpg_clk_configs[4] __initconst = {
> +	{ 1500000000, 1, 2, 8, 16, 32, 24 },
> +	{ 1500000000, 1, 2, 8, 16, 32, 24 },
> +	{ 1600000000, 2, 3, 6, 12, 24, 36 },
> +	{ 1600000000, 2, 3, 6, 12, 24, 32 },
> +};
> +
> +static u32 cpg_mode __initdata;
> +
> +static struct clk * __init
> +r8a7779_cpg_register_clock(struct device_node *np, struct r8a7779_cpg *cpg,
> +			   const struct cpg_clk_config *config,
> +			   const char *name)
> +{
> +	const char *parent_name = "plla";
> +	unsigned int mult = 1;
> +	unsigned int div = 1;
> +	unsigned int rate = 0;
> +
> +	if (!strcmp(name, "plla")) {
> +		parent_name = of_clk_get_parent_name(np, 0);
> +		rate = config->plla;
> +	} else if (!strcmp(name, "z")) {
> +		div = config->z;
> +		mult = config->z_mult;
> +	} else if (!strcmp(name, "zs") || !strcmp(name, "s")) {
> +		div = config->zs_and_s;
> +	} else if (!strcmp(name, "s1")) {
> +		div = config->s1;
> +	} else if (!strcmp(name, "p")) {
> +		div = config->p;
> +	} else if (!strcmp(name, "out")) {
> +		div = config->out;
> +	}
> +
> +	if (rate)
> +		return clk_register_fixed_rate(NULL, name, parent_name,
> +					       0, rate);

As far as I can tell the only fixed rate clock is the external crystal, from 
which all clocks derive. All the other clocks are fixed-factor clocks. You 
should thus register the PLLA clock as a fixed factor clock.

> +	else
> +		return clk_register_fixed_factor(NULL, name, parent_name,
> +						 0, mult, div);
> +}
> +
> +static void __init r8a7779_cpg_clocks_init(struct device_node *np)
> +{
> +	const struct cpg_clk_config *config;
> +	struct r8a7779_cpg *cpg;
> +	struct clk **clks;
> +	unsigned int i;
> +	int num_clks;
> +
> +	num_clks = of_property_count_strings(np, "clock-output-names");
> +	if (num_clks < 0) {
> +		pr_err("%s: failed to count clocks\n", __func__);
> +		return;
> +	}
> +
> +	cpg = kzalloc(sizeof *cpg, GFP_KERNEL);
> +	clks = kzalloc(CPG_NUM_CLOCKS * sizeof *clks, GFP_KERNEL);

Not my preferred style either, but the kernel coding style uses sizeof().

> +	if (cpg = NULL || clks = NULL) {
> +		/* We're leaking memory on purpose, there's no point in cleaning
> +		 * up as the system won't boot anyway.
> +		 */
> +		pr_err("%s: failed to allocate cpg\n", __func__);
> +		return;
> +	}
> +
> +	spin_lock_init(&cpg->lock);
> +
> +	cpg->data.clks = clks;
> +	cpg->data.clk_num = CPG_NUM_CLOCKS;

s/CPG_NUM_CLOCKS/num_clks/

You can then remove the CPG_NUM_CLOCKS definition above, as well as the dt-
bindings/clock/r8a7779-clock.h include.

> +
> +	cpg->reg = of_iomap(np, 0);
> +	if (WARN_ON(cpg->reg = NULL))
> +		return;
> +
> +	config = &cpg_clk_configs[CPG_CLK_CONFIG_INDEX(cpg_mode)];
> +
> +	for (i = 0; i < num_clks; ++i) {
> +		const char *name;
> +		struct clk *clk;
> +
> +		of_property_read_string_index(np, "clock-output-names", i,
> +					      &name);
> +
> +		clk = r8a7779_cpg_register_clock(np, cpg, config, name);
> +		if (IS_ERR(clk))
> +			pr_err("%s: failed to register %s %s clock (%ld)\n",
> +			       __func__, np->name, name, PTR_ERR(clk));
> +		else
> +			cpg->data.clks[i] = clk;
> +	}
> +
> +	of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
> +}
> +CLK_OF_DECLARE(r8a7779_cpg_clks, "renesas,r8a7779-cpg-clocks",
> +	       r8a7779_cpg_clocks_init);
> +
> +void __init r8a7779_clocks_init(u32 mode)
> +{
> +	cpg_mode = mode;
> +
> +	of_clk_init(NULL);
> +}
> diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
> index f9bf080..34bb19d 100644
> --- a/include/linux/clk/shmobile.h
> +++ b/include/linux/clk/shmobile.h
> @@ -15,5 +15,6 @@
>  #include <linux/types.h>
> 
>  void rcar_gen2_clocks_init(u32 mode);
> +void r8a7779_clocks_init(u32 mode);
> 
>  #endif
-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 01/17] clk: shmobile: r8a7779: Add clocks support
@ 2013-11-26 14:35     ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:03 Simon Horman wrote:
> Add clocks support for the r8a7779 SoC
> 
> Based on work for the r8a7790 and r8a7791 SoCs by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  .../bindings/clock/renesas,r8a7779-cpg-clocks.txt  |  22 +++
>  drivers/clk/shmobile/Makefile                      |   1 +
>  drivers/clk/shmobile/clk-r8a7779.c                 | 166 ++++++++++++++++++
>  include/linux/clk/shmobile.h                       |   1 +
>  4 files changed, 190 insertions(+)
>  create mode 100644
> Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> create mode 100644 drivers/clk/shmobile/clk-r8a7779.c
> 
> diff --git
> a/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> new file mode 100644
> index 0000000..5636685
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/renesas,r8a7779-cpg-clocks.txt
> @@ -0,0 +1,22 @@
> +* Renesas R8A7779 Clock Pulse Generator (CPG)
> +
> +The CPG generates core clocks for the R8A7779. It includes one PLL and
> +several fixed ratio dividers.

The H1 CPG looks pretty similar to the M1 CPG. What about rcar-gen1 CPG 
bindings ?

> +Required Properties:
> +
> +  - compatible: Must be "renesas,r8a7779-cpg-clocks"
> +  - reg: Base address and length of the memory resource used by the CPG
> +  - clock-output-names: Supported clocks are "plla", "z", "zs", "s", "s1",
> +    "p", "out".

Doesn't the CPG have an external clock input that needs to be specified, and 
thus need a clocks property ?

> +Example
> +-------
> +
> +	cpg_clocks: cpg_clocks at ffc80000 {
> +		compatible = "renesas,r8a7779-cpg-clocks";
> +		reg = <0 0xffc80000 0 0x80>;
> +		#clock-cells = <1>;
> +		clock-output-names = "plla", "z", "zs", "s", "s1", "p", "out";
> +	};
> diff --git a/drivers/clk/shmobile/Makefile b/drivers/clk/shmobile/Makefile
> index 4df35a0..49b852a 100644
> --- a/drivers/clk/shmobile/Makefile
> +++ b/drivers/clk/shmobile/Makefile
> @@ -1,6 +1,7 @@
>  obj-$(CONFIG_ARCH_EMEV2)		+= clk-emev2.o
>  obj-$(CONFIG_ARCH_R8A7790)		+= clk-rcar-gen2.o
>  obj-$(CONFIG_ARCH_R8A7791)		+= clk-rcar-gen2.o
> +obj-$(CONFIG_ARCH_R8A7779)		+= clk-r8a7779.o
>  obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-div6.o
>  obj-$(CONFIG_ARCH_SHMOBILE_MULTI)	+= clk-mstp.o
> 
> diff --git a/drivers/clk/shmobile/clk-r8a7779.c
> b/drivers/clk/shmobile/clk-r8a7779.c new file mode 100644
> index 0000000..dee898e
> --- /dev/null
> +++ b/drivers/clk/shmobile/clk-r8a7779.c
> @@ -0,0 +1,166 @@
> +/*
> + * r8a7779 Core CPG Clocks
> + *
> + * 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; version 2 of the License.
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/clkdev.h>
> +#include <linux/clk/shmobile.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/spinlock.h>
> +
> +#include <dt-bindings/clock/r8a7779-clock.h>
> +
> +#define CPG_NUM_CLOCKS			(R8A7779_CLK_OUT + 1)
> +
> +struct r8a7779_cpg {
> +	struct clk_onecell_data data;
> +	spinlock_t lock;
> +	void __iomem *reg;
> +};
> +
> +/*
> + *		MD1 = 1			MD1 = 0
> + *		(PLLA = 1500)		(PLLA = 1600)
> + *		(MHz)			(MHz)
> + *------------------------------------------------+--------------------
> + * clkz		1000   (2/3)		800   (1/2)
> + * clkzs	 250   (1/6)		200   (1/8)
> + * clki		 750   (1/2)		800   (1/2)
> + * clks		 250   (1/6)		200   (1/8)
> + * clks1	 125   (1/12)		100   (1/16)
> + * clks3	 187.5 (1/8)		200   (1/8)
> + * clks4	  93.7 (1/16)		100   (1/16)
> + * clkp		  62.5 (1/24)		 50   (1/32)
> + * clkg		  62.5 (1/24)		 66.6 (1/24)
> + * clkb, CLKOUT
> + * (MD2 = 0)	  62.5 (1/24)		 66.6 (1/24)
> + * (MD2 = 1)	  41.6 (1/36)		 50   (1/32)
> + */
> +
> +#define CPG_CLK_CONFIG_INDEX(md)	(((md) & (BIT(1)|BIT(2))) >> 1)
> +

The PLLA ratio is also configurable, by bits MD11 and MD12.

> +struct cpg_clk_config {
> +	unsigned int plla;
> +	unsigned int z_mult;
> +	unsigned int z;
> +	unsigned int zs_and_s;
> +	unsigned int s1;
> +	unsigned int p;
> +	unsigned int out;

Could you rename the last five fields with a _div suffix to express more 
clearly what that mean ?

> +};
> +
> +static const struct cpg_clk_config cpg_clk_configs[4] __initconst = {
> +	{ 1500000000, 1, 2, 8, 16, 32, 24 },
> +	{ 1500000000, 1, 2, 8, 16, 32, 24 },
> +	{ 1600000000, 2, 3, 6, 12, 24, 36 },
> +	{ 1600000000, 2, 3, 6, 12, 24, 32 },
> +};
> +
> +static u32 cpg_mode __initdata;
> +
> +static struct clk * __init
> +r8a7779_cpg_register_clock(struct device_node *np, struct r8a7779_cpg *cpg,
> +			   const struct cpg_clk_config *config,
> +			   const char *name)
> +{
> +	const char *parent_name = "plla";
> +	unsigned int mult = 1;
> +	unsigned int div = 1;
> +	unsigned int rate = 0;
> +
> +	if (!strcmp(name, "plla")) {
> +		parent_name = of_clk_get_parent_name(np, 0);
> +		rate = config->plla;
> +	} else if (!strcmp(name, "z")) {
> +		div = config->z;
> +		mult = config->z_mult;
> +	} else if (!strcmp(name, "zs") || !strcmp(name, "s")) {
> +		div = config->zs_and_s;
> +	} else if (!strcmp(name, "s1")) {
> +		div = config->s1;
> +	} else if (!strcmp(name, "p")) {
> +		div = config->p;
> +	} else if (!strcmp(name, "out")) {
> +		div = config->out;
> +	}
> +
> +	if (rate)
> +		return clk_register_fixed_rate(NULL, name, parent_name,
> +					       0, rate);

As far as I can tell the only fixed rate clock is the external crystal, from 
which all clocks derive. All the other clocks are fixed-factor clocks. You 
should thus register the PLLA clock as a fixed factor clock.

> +	else
> +		return clk_register_fixed_factor(NULL, name, parent_name,
> +						 0, mult, div);
> +}
> +
> +static void __init r8a7779_cpg_clocks_init(struct device_node *np)
> +{
> +	const struct cpg_clk_config *config;
> +	struct r8a7779_cpg *cpg;
> +	struct clk **clks;
> +	unsigned int i;
> +	int num_clks;
> +
> +	num_clks = of_property_count_strings(np, "clock-output-names");
> +	if (num_clks < 0) {
> +		pr_err("%s: failed to count clocks\n", __func__);
> +		return;
> +	}
> +
> +	cpg = kzalloc(sizeof *cpg, GFP_KERNEL);
> +	clks = kzalloc(CPG_NUM_CLOCKS * sizeof *clks, GFP_KERNEL);

Not my preferred style either, but the kernel coding style uses sizeof().

> +	if (cpg == NULL || clks == NULL) {
> +		/* We're leaking memory on purpose, there's no point in cleaning
> +		 * up as the system won't boot anyway.
> +		 */
> +		pr_err("%s: failed to allocate cpg\n", __func__);
> +		return;
> +	}
> +
> +	spin_lock_init(&cpg->lock);
> +
> +	cpg->data.clks = clks;
> +	cpg->data.clk_num = CPG_NUM_CLOCKS;

s/CPG_NUM_CLOCKS/num_clks/

You can then remove the CPG_NUM_CLOCKS definition above, as well as the dt-
bindings/clock/r8a7779-clock.h include.

> +
> +	cpg->reg = of_iomap(np, 0);
> +	if (WARN_ON(cpg->reg == NULL))
> +		return;
> +
> +	config = &cpg_clk_configs[CPG_CLK_CONFIG_INDEX(cpg_mode)];
> +
> +	for (i = 0; i < num_clks; ++i) {
> +		const char *name;
> +		struct clk *clk;
> +
> +		of_property_read_string_index(np, "clock-output-names", i,
> +					      &name);
> +
> +		clk = r8a7779_cpg_register_clock(np, cpg, config, name);
> +		if (IS_ERR(clk))
> +			pr_err("%s: failed to register %s %s clock (%ld)\n",
> +			       __func__, np->name, name, PTR_ERR(clk));
> +		else
> +			cpg->data.clks[i] = clk;
> +	}
> +
> +	of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
> +}
> +CLK_OF_DECLARE(r8a7779_cpg_clks, "renesas,r8a7779-cpg-clocks",
> +	       r8a7779_cpg_clocks_init);
> +
> +void __init r8a7779_clocks_init(u32 mode)
> +{
> +	cpg_mode = mode;
> +
> +	of_clk_init(NULL);
> +}
> diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
> index f9bf080..34bb19d 100644
> --- a/include/linux/clk/shmobile.h
> +++ b/include/linux/clk/shmobile.h
> @@ -15,5 +15,6 @@
>  #include <linux/types.h>
> 
>  void rcar_gen2_clocks_init(u32 mode);
> +void r8a7779_clocks_init(u32 mode);
> 
>  #endif
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26 14:36     ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:04 Simon Horman wrote:
> Add MSTP clock support for the r8a7779 SoC
> 
> The only change required appears to be to note a new
> compatibility string in the bindings.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt index
> 126b17e..f0a4b83 100644
> --- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> @@ -12,6 +12,7 @@ Required Properties:
>    - compatible: Must be one of the following
>      - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
>      - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2) MSTP gate clocks
> +    - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks

Alphabetical order ? :-)

>      - "renesas,cpg-mstp-clock" for generic MSTP gate clocks
>    - reg: Base address and length of the memory resource used by the MSTP
>      clocks
-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support
@ 2013-11-26 14:36     ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:04 Simon Horman wrote:
> Add MSTP clock support for the r8a7779 SoC
> 
> The only change required appears to be to note a new
> compatibility string in the bindings.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git
> a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt index
> 126b17e..f0a4b83 100644
> --- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> @@ -12,6 +12,7 @@ Required Properties:
>    - compatible: Must be one of the following
>      - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
>      - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2) MSTP gate clocks
> +    - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks

Alphabetical order ? :-)

>      - "renesas,cpg-mstp-clock" for generic MSTP gate clocks
>    - reg: Base address and length of the memory resource used by the MSTP
>      clocks
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26 14:43     ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:05 Simon Horman wrote:
> Add macros usable by device tree sources to reference r8a7779 clocks by
> index.
> 
> Based on work for the r8a7790 and r8a7791 SoCs by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  include/dt-bindings/clock/r8a7779-clock.h | 61 ++++++++++++++++++++++++++++
>  1 file changed, 61 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..b05fa8b
> --- /dev/null
> +++ b/include/dt-bindings/clock/r8a7779-clock.h
> @@ -0,0 +1,61 @@
> +/*
> + * 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_OUT		6
> +
> +/* MSTP 0 */
> +#define R8A7779_CLK_HSPI0	7
> +#define R8A7779_CLK_HSPI1	7
> +#define R8A7779_CLK_HSPI2	7

I would create a single clock named R8A7779_CLK_HSPI and reference it from the 
3 HSPI instances.

> +#define R8A7779_CLK_TMU0	16
> +#define R8A7779_CLK_TMU1	16
> +#define R8A7779_CLK_TMU2	16

Indices for TMU1 and TMU2 should be 15 and 14.

Shouldn't you add the HSCIF clocks ?

> +#define R8A7779_CLK_SCIF6	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_EHCI0	0
> +#define R8A7779_CLK_OHCI0	0
> +#define R8A7779_CLK_EHCI1	1
> +#define R8A7779_CLK_OHCI1	1

What about naming those USB01 and USB2 instead ?

> +#define R8A7779_CLK_DU		3
> +#define R8A7779_CLK_VIN2	8
> +#define R8A7779_CLK_VIN1	9
> +#define R8A7779_CLK_VIN0	10

Could you add the ethernet clock as well ? We'll need it soon.

> +#define R8A7779_CLK_SATA	15
> +#define R8A7779_CLK_VIN3	20
> +
> +/* MSTP 3 */

Could you please add the MMC0 and MMC1 clocks as well ?

> +#define R8A7779_CLK_SDHI3	20
> +#define R8A7779_CLK_SDHI2	21
> +#define R8A7779_CLK_SDHI1	22
> +#define R8A7779_CLK_SDHI0	23
> +
> +
> +#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
@ 2013-11-26 14:43     ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:05 Simon Horman wrote:
> Add macros usable by device tree sources to reference r8a7779 clocks by
> index.
> 
> Based on work for the r8a7790 and r8a7791 SoCs by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  include/dt-bindings/clock/r8a7779-clock.h | 61 ++++++++++++++++++++++++++++
>  1 file changed, 61 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..b05fa8b
> --- /dev/null
> +++ b/include/dt-bindings/clock/r8a7779-clock.h
> @@ -0,0 +1,61 @@
> +/*
> + * 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_OUT		6
> +
> +/* MSTP 0 */
> +#define R8A7779_CLK_HSPI0	7
> +#define R8A7779_CLK_HSPI1	7
> +#define R8A7779_CLK_HSPI2	7

I would create a single clock named R8A7779_CLK_HSPI and reference it from the 
3 HSPI instances.

> +#define R8A7779_CLK_TMU0	16
> +#define R8A7779_CLK_TMU1	16
> +#define R8A7779_CLK_TMU2	16

Indices for TMU1 and TMU2 should be 15 and 14.

Shouldn't you add the HSCIF clocks ?

> +#define R8A7779_CLK_SCIF6	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_EHCI0	0
> +#define R8A7779_CLK_OHCI0	0
> +#define R8A7779_CLK_EHCI1	1
> +#define R8A7779_CLK_OHCI1	1

What about naming those USB01 and USB2 instead ?

> +#define R8A7779_CLK_DU		3
> +#define R8A7779_CLK_VIN2	8
> +#define R8A7779_CLK_VIN1	9
> +#define R8A7779_CLK_VIN0	10

Could you add the ethernet clock as well ? We'll need it soon.

> +#define R8A7779_CLK_SATA	15
> +#define R8A7779_CLK_VIN3	20
> +
> +/* MSTP 3 */

Could you please add the MMC0 and MMC1 clocks as well ?

> +#define R8A7779_CLK_SDHI3	20
> +#define R8A7779_CLK_SDHI2	21
> +#define R8A7779_CLK_SDHI1	22
> +#define R8A7779_CLK_SDHI0	23
> +
> +
> +#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 04/17] ARM: shmobile: r8a7779: Add clocks
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26 14:48     ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thanks for the patch.

On Tuesday 26 November 2013 16:32:06 Simon Horman wrote:
> Declare all core and MSTP clocks currently used by r8a7779-based boards.
> 
> Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  arch/arm/boot/dts/r8a7779-marzen.dts |   1 +
>  arch/arm/boot/dts/r8a7779.dtsi       | 124 ++++++++++++++++++++++++++++++++
>  2 files changed, 125 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts
> b/arch/arm/boot/dts/r8a7779-marzen.dts index a7af2c2..ee3fb60 100644
> --- a/arch/arm/boot/dts/r8a7779-marzen.dts
> +++ b/arch/arm/boot/dts/r8a7779-marzen.dts
> @@ -11,6 +11,7 @@
> 
>  /dts-v1/;
>  #include "r8a7779.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> 
>  / {
>  	model = "marzen";
> diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
> index b2b418a..d524b3f 100644
> --- a/arch/arm/boot/dts/r8a7779.dtsi
> +++ b/arch/arm/boot/dts/r8a7779.dtsi
> @@ -10,6 +10,7 @@
>   */
> 
>  /include/ "skeleton.dtsi"
> +#include <dt-bindings/clock/r8a7779-clock.h>
> 
>  #include <dt-bindings/interrupt-controller/irq.h>
> 
> @@ -248,4 +249,127 @@
>  		cap-sdio-irq;
>  		status = "disabled";
>  	};
> +
> +	clocks {
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +
> +		/* Special CPG clocks */
> +		cpg_clocks: cpg_clocks@0xe6150000 {
> +			compatible = "renesas,r8a7779-cpg-clocks";
> +			reg = <0 0xe6150000 0 0x1000>;
> +			#clock-cells = <1>;
> +			clock-output-names = "plla", "z", "zs", "s", "s1",
> +					     "p", "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";
> +		};

clks2 is missing, either as a fixed-factor-clock in DT, or as a CPG special 
clock.

> +		/* Gate clocks */
> +		mstp0_clks: mstp0_clks {
> +			compatible = "renesas,r8a7779-mstp-clocks", "renesas,cpg-mstp-
clocks";
> +			reg = <0 0xffc80030 0 4>, <0 0xffc80034 0 4>;

There's no status register for MSTP0.

> +			clocks = <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>,
> +				<&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>,
> +				 <&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_HSPI0 R8A7779_CLK_HSPI1 R8A7779_CLK_HSPI2
> +				R8A7779_CLK_TMU0 R8A7779_CLK_TMU1 R8A7779_CLK_TMU2
> +				R8A7779_CLK_SCIF6 R8A7779_CLK_SCIF4 R8A7779_CLK_SCIF3

s/SCIF6/SCIF5/ (and in 04/17 as well) ?

> +				R8A7779_CLK_SCIF2 R8A7779_CLK_SCIF1 R8A7779_CLK_SCIF0
> +				R8A7779_CLK_I2C3 R8A7779_CLK_I2C2 R8A7779_CLK_I2C1
> +				R8A7779_CLK_I2C0
> +			>;
> +			clock-output-names > +				"hspi0", "hspi1", "hspi2",
> +				"tmu0", "tmu1", "tmu2",
> +				"scif6", "scif4", "scif3",

Here too.

> +				"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 0xffc80038 0 4>;

The status register is at 0xffc80044.

> +			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks 
R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&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_EHCI0 R8A7779_CLK_OHCI0
> +				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
> +				R8A7779_CLK_DU R8A7779_CLK_VIN2
> +				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
> +				R8A7779_CLK_SATA R8A7779_CLK_VIN3
> +			>;
> +			clock-output-names > +				"ehci0", "ohci0",
> +				"ehci1", "ohci1",
> +				"du", "vin2",
> +				"vin1", "vin0",
> +				"sata", "vin3";
> +		};
> +		mstp3_clks: mstp3_clks {
> +			compatible = "renesas,r8a7779-mstp-clocks", "renesas,cpg-mstp-
clocks";
> +			reg = <0 0xffc8003c 0 4>, <0 0xffc80040 0 4>;

There's no status register for MSTP3.

> +			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks 
R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&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_EHCI0 R8A7779_CLK_OHCI0
> +				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
> +				R8A7779_CLK_DU R8A7779_CLK_VIN2
> +				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
> +				R8A7779_CLK_SATA R8A7779_CLK_VIN3

That's for MSTP1, not MSTP3.

> +			>;
> +			clock-output-names > +				"ehci0", "ohci0",
> +				"ehci1", "ohci1",
> +				"du", "vin2",
> +				"vin1", "vin0",
> +				"sata", "vin3";
> +		};
> +	};
>  };
-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 04/17] ARM: shmobile: r8a7779: Add clocks
@ 2013-11-26 14:48     ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thanks for the patch.

On Tuesday 26 November 2013 16:32:06 Simon Horman wrote:
> Declare all core and MSTP clocks currently used by r8a7779-based boards.
> 
> Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  arch/arm/boot/dts/r8a7779-marzen.dts |   1 +
>  arch/arm/boot/dts/r8a7779.dtsi       | 124 ++++++++++++++++++++++++++++++++
>  2 files changed, 125 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts
> b/arch/arm/boot/dts/r8a7779-marzen.dts index a7af2c2..ee3fb60 100644
> --- a/arch/arm/boot/dts/r8a7779-marzen.dts
> +++ b/arch/arm/boot/dts/r8a7779-marzen.dts
> @@ -11,6 +11,7 @@
> 
>  /dts-v1/;
>  #include "r8a7779.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> 
>  / {
>  	model = "marzen";
> diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
> index b2b418a..d524b3f 100644
> --- a/arch/arm/boot/dts/r8a7779.dtsi
> +++ b/arch/arm/boot/dts/r8a7779.dtsi
> @@ -10,6 +10,7 @@
>   */
> 
>  /include/ "skeleton.dtsi"
> +#include <dt-bindings/clock/r8a7779-clock.h>
> 
>  #include <dt-bindings/interrupt-controller/irq.h>
> 
> @@ -248,4 +249,127 @@
>  		cap-sdio-irq;
>  		status = "disabled";
>  	};
> +
> +	clocks {
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +
> +		/* Special CPG clocks */
> +		cpg_clocks: cpg_clocks at 0xe6150000 {
> +			compatible = "renesas,r8a7779-cpg-clocks";
> +			reg = <0 0xe6150000 0 0x1000>;
> +			#clock-cells = <1>;
> +			clock-output-names = "plla", "z", "zs", "s", "s1",
> +					     "p", "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";
> +		};

clks2 is missing, either as a fixed-factor-clock in DT, or as a CPG special 
clock.

> +		/* Gate clocks */
> +		mstp0_clks: mstp0_clks {
> +			compatible = "renesas,r8a7779-mstp-clocks", "renesas,cpg-mstp-
clocks";
> +			reg = <0 0xffc80030 0 4>, <0 0xffc80034 0 4>;

There's no status register for MSTP0.

> +			clocks = <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>,
> +				<&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> <&cpg_clocks R8A7779_CLK_P>,
> +				 <&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_HSPI0 R8A7779_CLK_HSPI1 R8A7779_CLK_HSPI2
> +				R8A7779_CLK_TMU0 R8A7779_CLK_TMU1 R8A7779_CLK_TMU2
> +				R8A7779_CLK_SCIF6 R8A7779_CLK_SCIF4 R8A7779_CLK_SCIF3

s/SCIF6/SCIF5/ (and in 04/17 as well) ?

> +				R8A7779_CLK_SCIF2 R8A7779_CLK_SCIF1 R8A7779_CLK_SCIF0
> +				R8A7779_CLK_I2C3 R8A7779_CLK_I2C2 R8A7779_CLK_I2C1
> +				R8A7779_CLK_I2C0
> +			>;
> +			clock-output-names =
> +				"hspi0", "hspi1", "hspi2",
> +				"tmu0", "tmu1", "tmu2",
> +				"scif6", "scif4", "scif3",

Here too.

> +				"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 0xffc80038 0 4>;

The status register is at 0xffc80044.

> +			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks 
R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&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_EHCI0 R8A7779_CLK_OHCI0
> +				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
> +				R8A7779_CLK_DU R8A7779_CLK_VIN2
> +				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
> +				R8A7779_CLK_SATA R8A7779_CLK_VIN3
> +			>;
> +			clock-output-names =
> +				"ehci0", "ohci0",
> +				"ehci1", "ohci1",
> +				"du", "vin2",
> +				"vin1", "vin0",
> +				"sata", "vin3";
> +		};
> +		mstp3_clks: mstp3_clks {
> +			compatible = "renesas,r8a7779-mstp-clocks", "renesas,cpg-mstp-
clocks";
> +			reg = <0 0xffc8003c 0 4>, <0 0xffc80040 0 4>;

There's no status register for MSTP3.

> +			clocks = <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks 
R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&cpg_clocks R8A7779_CLK_P>, <&cpg_clocks R8A7779_CLK_P>,
> +				 <&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_EHCI0 R8A7779_CLK_OHCI0
> +				R8A7779_CLK_EHCI1 R8A7779_CLK_OHCI1
> +				R8A7779_CLK_DU R8A7779_CLK_VIN2
> +				R8A7779_CLK_VIN1 R8A7779_CLK_VIN0
> +				R8A7779_CLK_SATA R8A7779_CLK_VIN3

That's for MSTP1, not MSTP3.

> +			>;
> +			clock-output-names =
> +				"ehci0", "ohci0",
> +				"ehci1", "ohci1",
> +				"du", "vin2",
> +				"vin1", "vin0",
> +				"sata", "vin3";
> +		};
> +	};
>  };
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26 14:50     ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:07 Simon Horman wrote:
> Reference clocks using a "clocks" property in all nodes corresponding to
> devices that require a clock.

There's a sata node in your latest devel branch that you're missing.

> Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
> index d524b3f..623dd39 100644
> --- a/arch/arm/boot/dts/r8a7779.dtsi
> +++ b/arch/arm/boot/dts/r8a7779.dtsi
> @@ -160,6 +160,7 @@
>  		reg = <0xffc70000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
>  		status = "disabled";
>  	};
> 
> @@ -170,6 +171,7 @@
>  		reg = <0xffc71000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
>  		status = "disabled";
>  	};
> 
> @@ -180,6 +182,7 @@
>  		reg = <0xffc72000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
>  		status = "disabled";
>  	};
> 
> @@ -190,6 +193,7 @@
>  		reg = <0xffc73000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
>  		status = "disabled";
>  	};
> 
> @@ -215,6 +219,7 @@
>  		reg = <0xffe4c000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
> @@ -225,6 +230,7 @@
>  		reg = <0xffe4d000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
> @@ -235,6 +241,7 @@
>  		reg = <0xffe4e000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
> @@ -245,6 +252,7 @@
>  		reg = <0xffe4f000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks
@ 2013-11-26 14:50     ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:07 Simon Horman wrote:
> Reference clocks using a "clocks" property in all nodes corresponding to
> devices that require a clock.

There's a sata node in your latest devel branch that you're missing.

> Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
> index d524b3f..623dd39 100644
> --- a/arch/arm/boot/dts/r8a7779.dtsi
> +++ b/arch/arm/boot/dts/r8a7779.dtsi
> @@ -160,6 +160,7 @@
>  		reg = <0xffc70000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
>  		status = "disabled";
>  	};
> 
> @@ -170,6 +171,7 @@
>  		reg = <0xffc71000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
>  		status = "disabled";
>  	};
> 
> @@ -180,6 +182,7 @@
>  		reg = <0xffc72000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
>  		status = "disabled";
>  	};
> 
> @@ -190,6 +193,7 @@
>  		reg = <0xffc73000 0x1000>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
>  		status = "disabled";
>  	};
> 
> @@ -215,6 +219,7 @@
>  		reg = <0xffe4c000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
> @@ -225,6 +230,7 @@
>  		reg = <0xffe4d000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
> @@ -235,6 +241,7 @@
>  		reg = <0xffe4e000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
> @@ -245,6 +252,7 @@
>  		reg = <0xffe4f000 0x100>;
>  		interrupt-parent = <&gic>;
>  		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
> +		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
>  		cap-sd-highspeed;
>  		cap-sdio-irq;
>  		status = "disabled";
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-26 14:52     ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:17 Simon Horman wrote:
> 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.

You should then modify it to remove the #ifdef CONFIG_COMMON_CLK conditional 
compilation.

> 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>
> 
> ---
> v2
> * Correct changelog to refer to marzen instead of koelsch
> * Do not add typo to Makefile
> ---
>  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 723fe71..166e3dd 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -205,7 +205,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
>  	r8a7778-bockw-reference.dtb \
>  	r8a7740-armadillo800eva-reference.dtb \
>  	r8a7779-marzen.dtb \
> -	r8a7779-marzen-reference.dtb \
>  	r8a7791-koelsch.dtb \
>  	r8a7791-koelsch-reference.dtb \
>  	r8a7790-lager.dtb \
> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> index 4216baa..a27d60c 100644
> --- a/arch/arm/mach-shmobile/Kconfig
> +++ b/arch/arm/mach-shmobile/Kconfig
> @@ -239,19 +239,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 6d75ae8..e7f586c 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_LAGER_REFERENCE)	+= board-lager-reference.o
>  obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
> diff --git a/arch/arm/mach-shmobile/Makefile.boot
> b/arch/arm/mach-shmobile/Makefile.boot index 759e4f8f..6f761b4 100644
> --- a/arch/arm/mach-shmobile/Makefile.boot
> +++ b/arch/arm/mach-shmobile/Makefile.boot
> @@ -16,7 +16,6 @@ loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
>  loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 0x40008000
>  loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
>  loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
> -loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
> 
>  __ZRELADDR	:= $(sort $(loadaddr-y))
>     zreladdr-y   += $(__ZRELADDR)
-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-26 14:52     ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-26 14:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Tuesday 26 November 2013 16:32:17 Simon Horman wrote:
> 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.

You should then modify it to remove the #ifdef CONFIG_COMMON_CLK conditional 
compilation.

> 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>
> 
> ---
> v2
> * Correct changelog to refer to marzen instead of koelsch
> * Do not add typo to Makefile
> ---
>  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 723fe71..166e3dd 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -205,7 +205,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \
>  	r8a7778-bockw-reference.dtb \
>  	r8a7740-armadillo800eva-reference.dtb \
>  	r8a7779-marzen.dtb \
> -	r8a7779-marzen-reference.dtb \
>  	r8a7791-koelsch.dtb \
>  	r8a7791-koelsch-reference.dtb \
>  	r8a7790-lager.dtb \
> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> index 4216baa..a27d60c 100644
> --- a/arch/arm/mach-shmobile/Kconfig
> +++ b/arch/arm/mach-shmobile/Kconfig
> @@ -239,19 +239,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 6d75ae8..e7f586c 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_LAGER_REFERENCE)	+= board-lager-reference.o
>  obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
> diff --git a/arch/arm/mach-shmobile/Makefile.boot
> b/arch/arm/mach-shmobile/Makefile.boot index 759e4f8f..6f761b4 100644
> --- a/arch/arm/mach-shmobile/Makefile.boot
> +++ b/arch/arm/mach-shmobile/Makefile.boot
> @@ -16,7 +16,6 @@ loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
>  loadaddr-$(CONFIG_MACH_LAGER_REFERENCE) += 0x40008000
>  loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000
>  loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000
> -loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000
> 
>  __ZRELADDR	:= $(sort $(loadaddr-y))
>     zreladdr-y   += $(__ZRELADDR)
-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
  2013-11-26  9:33     ` Sergei Shtylyov
@ 2013-11-27  5:09       ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 01:33:30PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 26-11-2013 11:32, Simon Horman wrote:
> 
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> >  arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
> >  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> >diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> >index 4f9e3ec..e202c64 100644
> >--- a/arch/arm/mach-shmobile/board-marzen.c
> >+++ b/arch/arm/mach-shmobile/board-marzen.c
> >@@ -19,35 +19,35 @@
> >   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> >   */
> >
> >-#include <linux/kernel.h>
> >+#include <asm/mach-types.h>
> >+#include <asm/mach/arch.h>
> >+#include <asm/traps.h>
> >+#include <linux/delay.h>
> >+#include <linux/dma-mapping.h>
> >  #include <linux/init.h>
> >  #include <linux/interrupt.h>
> >-#include <linux/irq.h>
> >-#include <linux/platform_device.h>
> >-#include <linux/delay.h>
> >  #include <linux/io.h>
> >+#include <linux/irq.h>
> >+#include <linux/kernel.h>
> >  #include <linux/leds.h>
> >-#include <linux/dma-mapping.h>
> >+#include <linux/mfd/tmio.h>
> >+#include <linux/mmc/host.h>
> >+#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/pinctrl/machine.h>
> >  #include <linux/platform_data/camera-rcar.h>
> >  #include <linux/platform_data/gpio-rcar.h>
> >  #include <linux/platform_data/rcar-du.h>
> >  #include <linux/platform_data/usb-rcar-phy.h>
> >+#include <linux/platform_device.h>
> >  #include <linux/regulator/fixed.h>
> >  #include <linux/regulator/machine.h>
> >  #include <linux/smsc911x.h>
> >-#include <linux/spi/spi.h>
> >  #include <linux/spi/sh_hspi.h>
> >-#include <linux/mmc/host.h>
> >-#include <linux/mmc/sh_mobile_sdhi.h>
> >-#include <linux/mfd/tmio.h>
> >-#include <media/soc_camera.h>
> >-#include <mach/r8a7779.h>
> >+#include <linux/spi/spi.h>
> >  #include <mach/common.h>
> >  #include <mach/irqs.h>
> >-#include <asm/mach-types.h>
> >-#include <asm/mach/arch.h>
> >-#include <asm/traps.h>
> >+#include <mach/r8a7779.h>
> >+#include <media/soc_camera.h>
> 
>    I thought it was a good idea to keep the #include's in the order
> of the most generic to most machine specific ones: <linux/*.h>
> first, then <asm/*.h>, then <mach/*.h>, only with empty lines
> between groups (which weren't used here) with each group kept
> sorted...

That sounds reasonable to me.
Laurent, do you have an opinion on this?

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

* [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
@ 2013-11-27  5:09       ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 01:33:30PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 26-11-2013 11:32, Simon Horman wrote:
> 
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> >  arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
> >  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> >diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> >index 4f9e3ec..e202c64 100644
> >--- a/arch/arm/mach-shmobile/board-marzen.c
> >+++ b/arch/arm/mach-shmobile/board-marzen.c
> >@@ -19,35 +19,35 @@
> >   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> >   */
> >
> >-#include <linux/kernel.h>
> >+#include <asm/mach-types.h>
> >+#include <asm/mach/arch.h>
> >+#include <asm/traps.h>
> >+#include <linux/delay.h>
> >+#include <linux/dma-mapping.h>
> >  #include <linux/init.h>
> >  #include <linux/interrupt.h>
> >-#include <linux/irq.h>
> >-#include <linux/platform_device.h>
> >-#include <linux/delay.h>
> >  #include <linux/io.h>
> >+#include <linux/irq.h>
> >+#include <linux/kernel.h>
> >  #include <linux/leds.h>
> >-#include <linux/dma-mapping.h>
> >+#include <linux/mfd/tmio.h>
> >+#include <linux/mmc/host.h>
> >+#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/pinctrl/machine.h>
> >  #include <linux/platform_data/camera-rcar.h>
> >  #include <linux/platform_data/gpio-rcar.h>
> >  #include <linux/platform_data/rcar-du.h>
> >  #include <linux/platform_data/usb-rcar-phy.h>
> >+#include <linux/platform_device.h>
> >  #include <linux/regulator/fixed.h>
> >  #include <linux/regulator/machine.h>
> >  #include <linux/smsc911x.h>
> >-#include <linux/spi/spi.h>
> >  #include <linux/spi/sh_hspi.h>
> >-#include <linux/mmc/host.h>
> >-#include <linux/mmc/sh_mobile_sdhi.h>
> >-#include <linux/mfd/tmio.h>
> >-#include <media/soc_camera.h>
> >-#include <mach/r8a7779.h>
> >+#include <linux/spi/spi.h>
> >  #include <mach/common.h>
> >  #include <mach/irqs.h>
> >-#include <asm/mach-types.h>
> >-#include <asm/mach/arch.h>
> >-#include <asm/traps.h>
> >+#include <mach/r8a7779.h>
> >+#include <media/soc_camera.h>
> 
>    I thought it was a good idea to keep the #include's in the order
> of the most generic to most machine specific ones: <linux/*.h>
> first, then <asm/*.h>, then <mach/*.h>, only with empty lines
> between groups (which weren't used here) with each group kept
> sorted...

That sounds reasonable to me.
Laurent, do you have an opinion on this?

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

* Re: [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support
  2013-11-26 14:36     ` Laurent Pinchart
@ 2013-11-27  5:13       ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:36:02PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:04 Simon Horman wrote:
> > Add MSTP clock support for the r8a7779 SoC
> > 
> > The only change required appears to be to note a new
> > compatibility string in the bindings.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> > b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt index
> > 126b17e..f0a4b83 100644
> > --- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> > +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> > @@ -12,6 +12,7 @@ Required Properties:
> >    - compatible: Must be one of the following
> >      - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
> >      - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2) MSTP gate clocks
> > +    - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
> 
> Alphabetical order ? :-)

Sure, I'll fix that up.

> 
> >      - "renesas,cpg-mstp-clock" for generic MSTP gate clocks
> >    - reg: Base address and length of the memory resource used by the MSTP
> >      clocks
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support
@ 2013-11-27  5:13       ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:36:02PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:04 Simon Horman wrote:
> > Add MSTP clock support for the r8a7779 SoC
> > 
> > The only change required appears to be to note a new
> > compatibility string in the bindings.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> > b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt index
> > 126b17e..f0a4b83 100644
> > --- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> > +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> > @@ -12,6 +12,7 @@ Required Properties:
> >    - compatible: Must be one of the following
> >      - "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
> >      - "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2) MSTP gate clocks
> > +    - "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
> 
> Alphabetical order ? :-)

Sure, I'll fix that up.

> 
> >      - "renesas,cpg-mstp-clock" for generic MSTP gate clocks
> >    - reg: Base address and length of the memory resource used by the MSTP
> >      clocks
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
  2013-11-26 14:43     ` Laurent Pinchart
@ 2013-11-27  5:16       ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:43:26PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:05 Simon Horman wrote:
> > Add macros usable by device tree sources to reference r8a7779 clocks by
> > index.
> > 
> > Based on work for the r8a7790 and r8a7791 SoCs by Laurent Pinchart.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  include/dt-bindings/clock/r8a7779-clock.h | 61 ++++++++++++++++++++++++++++
> >  1 file changed, 61 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..b05fa8b
> > --- /dev/null
> > +++ b/include/dt-bindings/clock/r8a7779-clock.h
> > @@ -0,0 +1,61 @@
> > +/*
> > + * 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_OUT		6
> > +
> > +/* MSTP 0 */
> > +#define R8A7779_CLK_HSPI0	7
> > +#define R8A7779_CLK_HSPI1	7
> > +#define R8A7779_CLK_HSPI2	7
> 
> I would create a single clock named R8A7779_CLK_HSPI and reference it from the 
> 3 HSPI instances.

Sure, will do.

> 
> > +#define R8A7779_CLK_TMU0	16
> > +#define R8A7779_CLK_TMU1	16
> > +#define R8A7779_CLK_TMU2	16
> 
> Indices for TMU1 and TMU2 should be 15 and 14.

Thanks, I will fix that.


> 
> Shouldn't you add the HSCIF clocks ?
> 
> > +#define R8A7779_CLK_SCIF6	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_EHCI0	0
> > +#define R8A7779_CLK_OHCI0	0
> > +#define R8A7779_CLK_EHCI1	1
> > +#define R8A7779_CLK_OHCI1	1
> 
> What about naming those USB01 and USB2 instead ?

Sure, sounds good.

> 
> > +#define R8A7779_CLK_DU		3
> > +#define R8A7779_CLK_VIN2	8
> > +#define R8A7779_CLK_VIN1	9
> > +#define R8A7779_CLK_VIN0	10
> 
> Could you add the ethernet clock as well ? We'll need it soon.

Will do.

> > +#define R8A7779_CLK_SATA	15
> > +#define R8A7779_CLK_VIN3	20
> > +
> > +/* MSTP 3 */
> 
> Could you please add the MMC0 and MMC1 clocks as well ?

Will do.

> > +#define R8A7779_CLK_SDHI3	20
> > +#define R8A7779_CLK_SDHI2	21
> > +#define R8A7779_CLK_SDHI1	22
> > +#define R8A7779_CLK_SDHI0	23
> > +
> > +
> > +#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
> -- 
> Regards,
> 
> Laurent Pinchart
> 

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

* [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources
@ 2013-11-27  5:16       ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:43:26PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:05 Simon Horman wrote:
> > Add macros usable by device tree sources to reference r8a7779 clocks by
> > index.
> > 
> > Based on work for the r8a7790 and r8a7791 SoCs by Laurent Pinchart.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  include/dt-bindings/clock/r8a7779-clock.h | 61 ++++++++++++++++++++++++++++
> >  1 file changed, 61 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..b05fa8b
> > --- /dev/null
> > +++ b/include/dt-bindings/clock/r8a7779-clock.h
> > @@ -0,0 +1,61 @@
> > +/*
> > + * 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_OUT		6
> > +
> > +/* MSTP 0 */
> > +#define R8A7779_CLK_HSPI0	7
> > +#define R8A7779_CLK_HSPI1	7
> > +#define R8A7779_CLK_HSPI2	7
> 
> I would create a single clock named R8A7779_CLK_HSPI and reference it from the 
> 3 HSPI instances.

Sure, will do.

> 
> > +#define R8A7779_CLK_TMU0	16
> > +#define R8A7779_CLK_TMU1	16
> > +#define R8A7779_CLK_TMU2	16
> 
> Indices for TMU1 and TMU2 should be 15 and 14.

Thanks, I will fix that.


> 
> Shouldn't you add the HSCIF clocks ?
> 
> > +#define R8A7779_CLK_SCIF6	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_EHCI0	0
> > +#define R8A7779_CLK_OHCI0	0
> > +#define R8A7779_CLK_EHCI1	1
> > +#define R8A7779_CLK_OHCI1	1
> 
> What about naming those USB01 and USB2 instead ?

Sure, sounds good.

> 
> > +#define R8A7779_CLK_DU		3
> > +#define R8A7779_CLK_VIN2	8
> > +#define R8A7779_CLK_VIN1	9
> > +#define R8A7779_CLK_VIN0	10
> 
> Could you add the ethernet clock as well ? We'll need it soon.

Will do.

> > +#define R8A7779_CLK_SATA	15
> > +#define R8A7779_CLK_VIN3	20
> > +
> > +/* MSTP 3 */
> 
> Could you please add the MMC0 and MMC1 clocks as well ?

Will do.

> > +#define R8A7779_CLK_SDHI3	20
> > +#define R8A7779_CLK_SDHI2	21
> > +#define R8A7779_CLK_SDHI1	22
> > +#define R8A7779_CLK_SDHI0	23
> > +
> > +
> > +#endif /* __DT_BINDINGS_CLOCK_R8A7779_H__ */
> -- 
> Regards,
> 
> Laurent Pinchart
> 

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

* Re: [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks
  2013-11-26 14:50     ` Laurent Pinchart
@ 2013-11-27  5:17       ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:50:16PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:07 Simon Horman wrote:
> > Reference clocks using a "clocks" property in all nodes corresponding to
> > devices that require a clock.
> 
> There's a sata node in your latest devel branch that you're missing.

Thanks, I must have made this patch using an older version
of the devel branch. I'll fix this up.

> > Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
> > index d524b3f..623dd39 100644
> > --- a/arch/arm/boot/dts/r8a7779.dtsi
> > +++ b/arch/arm/boot/dts/r8a7779.dtsi
> > @@ -160,6 +160,7 @@
> >  		reg = <0xffc70000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -170,6 +171,7 @@
> >  		reg = <0xffc71000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -180,6 +182,7 @@
> >  		reg = <0xffc72000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -190,6 +193,7 @@
> >  		reg = <0xffc73000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -215,6 +219,7 @@
> >  		reg = <0xffe4c000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> > @@ -225,6 +230,7 @@
> >  		reg = <0xffe4d000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> > @@ -235,6 +241,7 @@
> >  		reg = <0xffe4e000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> > @@ -245,6 +252,7 @@
> >  		reg = <0xffe4f000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> -- 
> Regards,
> 
> Laurent Pinchart
> 

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

* [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks
@ 2013-11-27  5:17       ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:50:16PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:07 Simon Horman wrote:
> > Reference clocks using a "clocks" property in all nodes corresponding to
> > devices that require a clock.
> 
> There's a sata node in your latest devel branch that you're missing.

Thanks, I must have made this patch using an older version
of the devel branch. I'll fix this up.

> > Based on work by Laurent Pinchart for the r8a7790 and r8a7791 SoCs.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
> > index d524b3f..623dd39 100644
> > --- a/arch/arm/boot/dts/r8a7779.dtsi
> > +++ b/arch/arm/boot/dts/r8a7779.dtsi
> > @@ -160,6 +160,7 @@
> >  		reg = <0xffc70000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C0>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -170,6 +171,7 @@
> >  		reg = <0xffc71000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C1>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -180,6 +182,7 @@
> >  		reg = <0xffc72000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C2>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -190,6 +193,7 @@
> >  		reg = <0xffc73000 0x1000>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp0_clks R8A7779_CLK_I2C3>;
> >  		status = "disabled";
> >  	};
> > 
> > @@ -215,6 +219,7 @@
> >  		reg = <0xffe4c000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> > @@ -225,6 +230,7 @@
> >  		reg = <0xffe4d000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> > @@ -235,6 +241,7 @@
> >  		reg = <0xffe4e000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> > @@ -245,6 +252,7 @@
> >  		reg = <0xffe4f000 0x100>;
> >  		interrupt-parent = <&gic>;
> >  		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
> > +		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
> >  		cap-sd-highspeed;
> >  		cap-sdio-irq;
> >  		status = "disabled";
> -- 
> Regards,
> 
> Laurent Pinchart
> 

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

* Re: [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-26 14:52     ` Laurent Pinchart
@ 2013-11-27  5:17       ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:52:54PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:17 Simon Horman wrote:
> > 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.
> 
> You should then modify it to remove the #ifdef CONFIG_COMMON_CLK conditional 
> compilation.

Thanks, will do.

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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-27  5:17       ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-27  5:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 03:52:54PM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Tuesday 26 November 2013 16:32:17 Simon Horman wrote:
> > 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.
> 
> You should then modify it to remove the #ifdef CONFIG_COMMON_CLK conditional 
> compilation.

Thanks, will do.

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

* Re: [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-26  7:32   ` Simon Horman
@ 2013-11-27  8:51     ` Magnus Damm
  -1 siblings, 0 replies; 68+ messages in thread
From: Magnus Damm @ 2013-11-27  8:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 4:32 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> 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>
>
> ---
> v2
> * Correct changelog to refer to marzen instead of koelsch
> * Do not add typo to Makefile

I think we need to discuss _when_ to do this in more detail. I know
this follows the same style as Laurent's patches, but I don't think
we're ready to flip the switch yet. I propose that we let DT reference
coexist with multiplatform and non-multiplatform cases for a while to
make testing easier and give time to migrate.

Cheers,

/ magnus

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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-27  8:51     ` Magnus Damm
  0 siblings, 0 replies; 68+ messages in thread
From: Magnus Damm @ 2013-11-27  8:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 26, 2013 at 4:32 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> 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>
>
> ---
> v2
> * Correct changelog to refer to marzen instead of koelsch
> * Do not add typo to Makefile

I think we need to discuss _when_ to do this in more detail. I know
this follows the same style as Laurent's patches, but I don't think
we're ready to flip the switch yet. I propose that we let DT reference
coexist with multiplatform and non-multiplatform cases for a while to
make testing easier and give time to migrate.

Cheers,

/ magnus

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

* Re: [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
  2013-11-27  5:09       ` Simon Horman
@ 2013-11-27 10:20         ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-27 10:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Wednesday 27 November 2013 14:09:58 Simon Horman wrote:
> On Tue, Nov 26, 2013 at 01:33:30PM +0400, Sergei Shtylyov wrote:
> > On 26-11-2013 11:32, Simon Horman wrote:
> > > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > >---
> > >
> > >  arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
> > >  1 file changed, 14 insertions(+), 14 deletions(-)
> > >
> > >diff --git a/arch/arm/mach-shmobile/board-marzen.c
> > >b/arch/arm/mach-shmobile/board-marzen.c index 4f9e3ec..e202c64 100644
> > >--- a/arch/arm/mach-shmobile/board-marzen.c
> > >+++ b/arch/arm/mach-shmobile/board-marzen.c
> > >@@ -19,35 +19,35 @@
> > >   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 
> > >   02110-1301  USA */
> > >
> > >-#include <linux/kernel.h>
> > >+#include <asm/mach-types.h>
> > >+#include <asm/mach/arch.h>
> > >+#include <asm/traps.h>
> > >+#include <linux/delay.h>
> > >+#include <linux/dma-mapping.h>
> > > #include <linux/init.h>
> > > #include <linux/interrupt.h>
> > >-#include <linux/irq.h>
> > >-#include <linux/platform_device.h>
> > >-#include <linux/delay.h>
> > > #include <linux/io.h>
> > >+#include <linux/irq.h>
> > >+#include <linux/kernel.h>
> > > #include <linux/leds.h>
> > >-#include <linux/dma-mapping.h>
> > >+#include <linux/mfd/tmio.h>
> > >+#include <linux/mmc/host.h>
> > >+#include <linux/mmc/sh_mobile_sdhi.h>
> > > #include <linux/pinctrl/machine.h>
> > > #include <linux/platform_data/camera-rcar.h>
> > > #include <linux/platform_data/gpio-rcar.h>
> > > #include <linux/platform_data/rcar-du.h>
> > > #include <linux/platform_data/usb-rcar-phy.h>
> > >+#include <linux/platform_device.h>
> > > #include <linux/regulator/fixed.h>
> > > #include <linux/regulator/machine.h>
> > > #include <linux/smsc911x.h>
> > >-#include <linux/spi/spi.h>
> > > #include <linux/spi/sh_hspi.h>
> > >-#include <linux/mmc/host.h>
> > >-#include <linux/mmc/sh_mobile_sdhi.h>
> > >-#include <linux/mfd/tmio.h>
> > >-#include <media/soc_camera.h>
> > >-#include <mach/r8a7779.h>
> > >+#include <linux/spi/spi.h>
> > > #include <mach/common.h>
> > > #include <mach/irqs.h>
> > >-#include <asm/mach-types.h>
> > >-#include <asm/mach/arch.h>
> > >-#include <asm/traps.h>
> > >+#include <mach/r8a7779.h>
> > >+#include <media/soc_camera.h>
> > >
> >    I thought it was a good idea to keep the #include's in the order
> > 
> > of the most generic to most machine specific ones: <linux/*.h>
> > first, then <asm/*.h>, then <mach/*.h>, only with empty lines
> > between groups (which weren't used here) with each group kept
> > sorted...
> 
> That sounds reasonable to me.
> Laurent, do you have an opinion on this?

That's fine with me.

-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically
@ 2013-11-27 10:20         ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-27 10:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Wednesday 27 November 2013 14:09:58 Simon Horman wrote:
> On Tue, Nov 26, 2013 at 01:33:30PM +0400, Sergei Shtylyov wrote:
> > On 26-11-2013 11:32, Simon Horman wrote:
> > > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > >---
> > >
> > >  arch/arm/mach-shmobile/board-marzen.c | 28 ++++++++++++++--------------
> > >  1 file changed, 14 insertions(+), 14 deletions(-)
> > >
> > >diff --git a/arch/arm/mach-shmobile/board-marzen.c
> > >b/arch/arm/mach-shmobile/board-marzen.c index 4f9e3ec..e202c64 100644
> > >--- a/arch/arm/mach-shmobile/board-marzen.c
> > >+++ b/arch/arm/mach-shmobile/board-marzen.c
> > >@@ -19,35 +19,35 @@
> > >   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 
> > >   02110-1301  USA */
> > >
> > >-#include <linux/kernel.h>
> > >+#include <asm/mach-types.h>
> > >+#include <asm/mach/arch.h>
> > >+#include <asm/traps.h>
> > >+#include <linux/delay.h>
> > >+#include <linux/dma-mapping.h>
> > > #include <linux/init.h>
> > > #include <linux/interrupt.h>
> > >-#include <linux/irq.h>
> > >-#include <linux/platform_device.h>
> > >-#include <linux/delay.h>
> > > #include <linux/io.h>
> > >+#include <linux/irq.h>
> > >+#include <linux/kernel.h>
> > > #include <linux/leds.h>
> > >-#include <linux/dma-mapping.h>
> > >+#include <linux/mfd/tmio.h>
> > >+#include <linux/mmc/host.h>
> > >+#include <linux/mmc/sh_mobile_sdhi.h>
> > > #include <linux/pinctrl/machine.h>
> > > #include <linux/platform_data/camera-rcar.h>
> > > #include <linux/platform_data/gpio-rcar.h>
> > > #include <linux/platform_data/rcar-du.h>
> > > #include <linux/platform_data/usb-rcar-phy.h>
> > >+#include <linux/platform_device.h>
> > > #include <linux/regulator/fixed.h>
> > > #include <linux/regulator/machine.h>
> > > #include <linux/smsc911x.h>
> > >-#include <linux/spi/spi.h>
> > > #include <linux/spi/sh_hspi.h>
> > >-#include <linux/mmc/host.h>
> > >-#include <linux/mmc/sh_mobile_sdhi.h>
> > >-#include <linux/mfd/tmio.h>
> > >-#include <media/soc_camera.h>
> > >-#include <mach/r8a7779.h>
> > >+#include <linux/spi/spi.h>
> > > #include <mach/common.h>
> > > #include <mach/irqs.h>
> > >-#include <asm/mach-types.h>
> > >-#include <asm/mach/arch.h>
> > >-#include <asm/traps.h>
> > >+#include <mach/r8a7779.h>
> > >+#include <media/soc_camera.h>
> > >
> >    I thought it was a good idea to keep the #include's in the order
> > 
> > of the most generic to most machine specific ones: <linux/*.h>
> > first, then <asm/*.h>, then <mach/*.h>, only with empty lines
> > between groups (which weren't used here) with each group kept
> > sorted...
> 
> That sounds reasonable to me.
> Laurent, do you have an opinion on this?

That's fine with me.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-27  8:51     ` Magnus Damm
@ 2013-11-27 11:29       ` Laurent Pinchart
  -1 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-27 11:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Magnus,

On Wednesday 27 November 2013 17:51:16 Magnus Damm wrote:
> On Tue, Nov 26, 2013 at 4:32 PM, Simon Horman wrote:
> > 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>
> > 
> > ---
> > v2
> > * Correct changelog to refer to marzen instead of koelsch
> > * Do not add typo to Makefile
> 
> I think we need to discuss _when_ to do this in more detail. I know
> this follows the same style as Laurent's patches, but I don't think
> we're ready to flip the switch yet. I propose that we let DT reference
> coexist with multiplatform and non-multiplatform cases for a while to
> make testing easier and give time to migrate.

I understand your point, but as I've stated in a private e-mail, I believe 
that having three platforms (DT reference with and without multiplatform, and 
legacy) for each board is a step backward. It will be error-prone and time 
consuming.

-- 
Regards,

Laurent Pinchart


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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-27 11:29       ` Laurent Pinchart
  0 siblings, 0 replies; 68+ messages in thread
From: Laurent Pinchart @ 2013-11-27 11:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Magnus,

On Wednesday 27 November 2013 17:51:16 Magnus Damm wrote:
> On Tue, Nov 26, 2013 at 4:32 PM, Simon Horman wrote:
> > 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>
> > 
> > ---
> > v2
> > * Correct changelog to refer to marzen instead of koelsch
> > * Do not add typo to Makefile
> 
> I think we need to discuss _when_ to do this in more detail. I know
> this follows the same style as Laurent's patches, but I don't think
> we're ready to flip the switch yet. I propose that we let DT reference
> coexist with multiplatform and non-multiplatform cases for a while to
> make testing easier and give time to migrate.

I understand your point, but as I've stated in a private e-mail, I believe 
that having three platforms (DT reference with and without multiplatform, and 
legacy) for each board is a step backward. It will be error-prone and time 
consuming.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
  2013-11-27  8:51     ` Magnus Damm
@ 2013-11-28  2:41       ` Simon Horman
  -1 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-28  2:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 27, 2013 at 05:51:16PM +0900, Magnus Damm wrote:
> On Tue, Nov 26, 2013 at 4:32 PM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > 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>
> >
> > ---
> > v2
> > * Correct changelog to refer to marzen instead of koelsch
> > * Do not add typo to Makefile
> 
> I think we need to discuss _when_ to do this in more detail. I know
> this follows the same style as Laurent's patches, but I don't think
> we're ready to flip the switch yet. I propose that we let DT reference
> coexist with multiplatform and non-multiplatform cases for a while to
> make testing easier and give time to migrate.

Yes, I agree this needs to be discussed.

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

* [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support
@ 2013-11-28  2:41       ` Simon Horman
  0 siblings, 0 replies; 68+ messages in thread
From: Simon Horman @ 2013-11-28  2:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 27, 2013 at 05:51:16PM +0900, Magnus Damm wrote:
> On Tue, Nov 26, 2013 at 4:32 PM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > 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>
> >
> > ---
> > v2
> > * Correct changelog to refer to marzen instead of koelsch
> > * Do not add typo to Makefile
> 
> I think we need to discuss _when_ to do this in more detail. I know
> this follows the same style as Laurent's patches, but I don't think
> we're ready to flip the switch yet. I propose that we let DT reference
> coexist with multiplatform and non-multiplatform cases for a while to
> make testing easier and give time to migrate.

Yes, I agree this needs to be discussed.

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

end of thread, other threads:[~2013-11-28  2:41 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26  7:32 [PATCH RFC v2 00/17] ARM: shmobile: r8a7779, marzen: multiplatform Simon Horman
2013-11-26  7:32 ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 01/17] clk: shmobile: r8a7779: Add clocks support Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26 14:35   ` Laurent Pinchart
2013-11-26 14:35     ` Laurent Pinchart
2013-11-26  7:32 ` [PATCH RFC v2 02/17] clk: shmobile: r8a7779: Add MSTP clock support Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26 14:36   ` Laurent Pinchart
2013-11-26 14:36     ` Laurent Pinchart
2013-11-27  5:13     ` Simon Horman
2013-11-27  5:13       ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 03/17] ARM: shmobile: r8a7779: Add clock index macros for DT sources Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26 14:43   ` Laurent Pinchart
2013-11-26 14:43     ` Laurent Pinchart
2013-11-27  5:16     ` Simon Horman
2013-11-27  5:16       ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 04/17] ARM: shmobile: r8a7779: Add clocks Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26 14:48   ` Laurent Pinchart
2013-11-26 14:48     ` Laurent Pinchart
2013-11-26  7:32 ` [PATCH RFC v2 05/17] ARM: shmobile: r8a7779: Reference clocks Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26 14:50   ` Laurent Pinchart
2013-11-26 14:50     ` Laurent Pinchart
2013-11-27  5:17     ` Simon Horman
2013-11-27  5:17       ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 06/17] ARM: shmobile: Sync Marzen DTS with Marzen reference DTS Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 07/17] ARM: shmobile: r8a7779: Sort headers alphabetically Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  9:33   ` Sergei Shtylyov
2013-11-26  9:33     ` Sergei Shtylyov
2013-11-27  5:09     ` Simon Horman
2013-11-27  5:09       ` Simon Horman
2013-11-27 10:20       ` Laurent Pinchart
2013-11-27 10:20         ` Laurent Pinchart
2013-11-26  7:32 ` [PATCH RFC v2 08/17] ARM: shmobile: r8a7779: Add helper to read mode pins Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 09/17] ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 10/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into b Simon Horman
2013-11-26  7:32   ` [PATCH RFC v2 10/17] ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 11/17] ARM: shmobile: r8a7779: Do not include sh_clk.h in r8a7779.h Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 12/17] ARM: shmobile: r8a7779: Initial multiplatform support Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 13/17] ARM: shmobile: marzen-reference: Initialize CPG device Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 14/17] ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and CMT Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 15/17] ARM: shmobile: Remove non-multiplatform Marzen reference support Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26 14:52   ` Laurent Pinchart
2013-11-26 14:52     ` Laurent Pinchart
2013-11-27  5:17     ` Simon Horman
2013-11-27  5:17       ` Simon Horman
2013-11-27  8:51   ` Magnus Damm
2013-11-27  8:51     ` Magnus Damm
2013-11-27 11:29     ` Laurent Pinchart
2013-11-27 11:29       ` Laurent Pinchart
2013-11-28  2:41     ` Simon Horman
2013-11-28  2:41       ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 16/17] ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Simon Horman
2013-11-26  7:32   ` Simon Horman
2013-11-26  7:32 ` [PATCH RFC v2 17/17] ARM: shmobile: Remove Marzen reference DTS Simon Horman
2013-11-26  7:32   ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.