linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support
@ 2013-09-18 20:11 Magnus Damm
  2013-09-18 20:11 ` [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support Magnus Damm
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Magnus Damm @ 2013-09-18 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

ARM: shmobile: Initial r7s72100 SoC and Genmai board support

[PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support
[PATCH 02/03] ARM: shmobile: r7s72100 SCIF support
[PATCH 03/03] ARM: shmobile: Genmai support

This series adds initial support for r7s72100 and Genmai. The SoC
is known as r7s72100 which is based on a single core Cortex-A9
and makes use of SCIF for serial. Many other on-chip I/O devices
are available, and support for those will be added by incremental
feature patches.

This initial SoC and board support is providing limited DT-only
support and a very basic C-version of board support. In the future
improved PINCTRL and common clock framework support will be added.

Implemented in same style as r8a7790 and r8a7791.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Written against renesas.git tag renesas-devel-20130906

 arch/arm/boot/dts/Makefile                     |    1 
 arch/arm/boot/dts/r7s72100-genmai.dts          |   31 +++
 arch/arm/boot/dts/r7s72100.dtsi                |   36 ++++
 arch/arm/mach-shmobile/Kconfig                 |   11 +
 arch/arm/mach-shmobile/Makefile                |    3 
 arch/arm/mach-shmobile/Makefile.boot           |    1 
 arch/arm/mach-shmobile/board-genmai.c          |   43 +++++
 arch/arm/mach-shmobile/clock-r7s72100.c        |  202 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/r7s72100.h |    8 
 arch/arm/mach-shmobile/setup-r7s72100.c        |   88 ++++++++++
 10 files changed, 424 insertions(+)


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

* [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support
  2013-09-18 20:11 [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Magnus Damm
@ 2013-09-18 20:11 ` Magnus Damm
  2013-10-03  4:10   ` Simon Horman
  2013-09-18 20:11 ` [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support Magnus Damm
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Magnus Damm @ 2013-09-18 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add initial support for the r7272100 SoC including:
 - Single Cortex-A9 CPU Core
 - GIC

No static virtual mappings are used, all the components
make use of ioremap(). DT_MACHINE_START is still wrapped
in CONFIG_USE_OF to match other mach-shmobile code.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/boot/dts/r7s72100.dtsi                |   36 ++++
 arch/arm/mach-shmobile/Kconfig                 |    6 
 arch/arm/mach-shmobile/Makefile                |    2 
 arch/arm/mach-shmobile/clock-r7s72100.c        |  194 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/r7s72100.h |    7 
 arch/arm/mach-shmobile/setup-r7s72100.c        |   43 +++++
 6 files changed, 288 insertions(+)

--- /dev/null
+++ work/arch/arm/boot/dts/r7s72100.dtsi	2013-09-19 03:07:43.000000000 +0900
@@ -0,0 +1,36 @@
+/*
+ * Device Tree Source for the r7s72100 SoC
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/ {
+	compatible = "renesas,r7s72100";
+	interrupt-parent = <&gic>;
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <0>;
+		};
+	};
+
+	gic: interrupt-controller@e8201000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0xe8201000 0x1000>,
+			<0xe8202000 0x1000>;
+	};
+};
--- 0001/arch/arm/mach-shmobile/Kconfig
+++ work/arch/arm/mach-shmobile/Kconfig	2013-09-18 10:39:56.000000000 +0900
@@ -113,6 +113,12 @@ config ARCH_EMEV2
 	select ARM_GIC
 	select CPU_V7
 
+config ARCH_R7S72100
+	bool "RZ/A1H (R7S72100)"
+	select ARM_GIC
+	select CPU_V7
+	select SH_CLK_CPG
+
 comment "SH-Mobile Board Type"
 
 config MACH_APE6EVM
--- 0001/arch/arm/mach-shmobile/Makefile
+++ work/arch/arm/mach-shmobile/Makefile	2013-09-18 10:39:56.000000000 +0900
@@ -17,6 +17,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= setup-r8a7
 obj-$(CONFIG_ARCH_R8A7790)	+= setup-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791)	+= setup-r8a7791.o
 obj-$(CONFIG_ARCH_EMEV2)	+= setup-emev2.o
+obj-$(CONFIG_ARCH_R7S72100)	+= setup-r7s72100.o
 
 # Clock objects
 ifndef CONFIG_COMMON_CLK
@@ -30,6 +31,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= clock-r8a7
 obj-$(CONFIG_ARCH_R8A7790)	+= clock-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791)	+= clock-r8a7791.o
 obj-$(CONFIG_ARCH_EMEV2)	+= clock-emev2.o
+obj-$(CONFIG_ARCH_R7S72100)	+= clock-r7s72100.o
 endif
 
 # SMP objects
--- /dev/null
+++ work/arch/arm/mach-shmobile/clock-r7s72100.c	2013-09-19 03:06:00.000000000 +0900
@@ -0,0 +1,194 @@
+/*
+ * r7a72100 clock framework support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2012  Phil Edworthy
+ * Copyright (C) 2011  Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/sh_clk.h>
+#include <linux/clkdev.h>
+#include <mach/common.h>
+#include <mach/r7s72100.h>
+
+/* registers */
+#define FRQCR		0xfcfe0010
+#define FRQCR2		0xfcfe0014
+#define STBCR3		0xfcfe0420
+#define STBCR4		0xfcfe0424
+
+#define PLL_RATE 30
+
+static struct clk_mapping cpg_mapping = {
+	.phys	= 0xfcfe0000,
+	.len	= 0x1000,
+};
+
+/* Fixed 32 KHz root clock for RTC */
+static struct clk r_clk = {
+	.rate           = 32768,
+};
+
+/*
+ * Default rate for the root input clock, reset this with clk_set_rate()
+ * from the platform code.
+ */
+static struct clk extal_clk = {
+	.rate		= 13330000,
+	.mapping	= &cpg_mapping,
+};
+
+static unsigned long pll_recalc(struct clk *clk)
+{
+	return clk->parent->rate * PLL_RATE;
+}
+
+static struct sh_clk_ops pll_clk_ops = {
+	.recalc		= pll_recalc,
+};
+
+static struct clk pll_clk = {
+	.ops		= &pll_clk_ops,
+	.parent		= &extal_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+static unsigned long bus_recalc(struct clk *clk)
+{
+	return clk->parent->rate * 2 / 3;
+}
+
+static struct sh_clk_ops bus_clk_ops = {
+	.recalc		= bus_recalc,
+};
+
+static struct clk bus_clk = {
+	.ops		= &bus_clk_ops,
+	.parent		= &pll_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+static unsigned long peripheral0_recalc(struct clk *clk)
+{
+	return clk->parent->rate / 12;
+}
+
+static struct sh_clk_ops peripheral0_clk_ops = {
+	.recalc		= peripheral0_recalc,
+};
+
+static struct clk peripheral0_clk = {
+	.ops		= &peripheral0_clk_ops,
+	.parent		= &pll_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+static unsigned long peripheral1_recalc(struct clk *clk)
+{
+	return clk->parent->rate / 6;
+}
+
+static struct sh_clk_ops peripheral1_clk_ops = {
+	.recalc		= peripheral1_recalc,
+};
+
+static struct clk peripheral1_clk = {
+	.ops		= &peripheral1_clk_ops,
+	.parent		= &pll_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+struct clk *main_clks[] = {
+	&r_clk,
+	&extal_clk,
+	&pll_clk,
+	&bus_clk,
+	&peripheral0_clk,
+	&peripheral1_clk,
+};
+
+static int div2[] = { 1, 3, 0, 3 }; /* 1, 2/3, reserve, 1/3 */
+static int multipliers[] = { 1, 2, 1, 1 };
+
+static struct clk_div_mult_table div4_div_mult_table = {
+	.divisors = div2,
+	.nr_divisors = ARRAY_SIZE(div2),
+	.multipliers = multipliers,
+	.nr_multipliers = ARRAY_SIZE(multipliers),
+};
+
+static struct clk_div4_table div4_table = {
+	.div_mult_table = &div4_div_mult_table,
+};
+
+enum { DIV4_I,
+	DIV4_NR };
+
+#define DIV4(_reg, _bit, _mask, _flags) \
+	SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
+
+/* The mask field specifies the div2 entries that are valid */
+struct clk div4_clks[DIV4_NR] = {
+	[DIV4_I]  = DIV4(FRQCR, 8, 0xB, CLK_ENABLE_REG_16BIT
+					| CLK_ENABLE_ON_INIT),
+};
+
+enum { MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
+	MSTP33,	MSTP_NR };
+
+static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
+	[MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
+	[MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
+	[MSTP44] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 4, 0), /* SCIF3 */
+	[MSTP43] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 3, 0), /* SCIF4 */
+	[MSTP42] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 2, 0), /* SCIF5 */
+	[MSTP41] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 1, 0), /* SCIF6 */
+	[MSTP40] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 0, 0), /* SCIF7 */
+	[MSTP33] = SH_CLK_MSTP8(&peripheral0_clk, STBCR3, 3, 0), /* MTU2 */
+};
+
+static struct clk_lookup lookups[] = {
+	/* main clocks */
+	CLKDEV_CON_ID("rclk", &r_clk),
+	CLKDEV_CON_ID("extal", &extal_clk),
+	CLKDEV_CON_ID("pll_clk", &pll_clk),
+	CLKDEV_CON_ID("peripheral_clk", &peripheral1_clk),
+
+	/* DIV4 clocks */
+	CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
+
+	/* MSTP clocks */
+};
+
+void __init r7s72100_clock_init(void)
+{
+	int k, ret = 0;
+
+	for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
+		ret = clk_register(main_clks[k]);
+
+	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+
+	if (!ret)
+		ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
+
+	if (!ret)
+		ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
+
+	if (!ret)
+		shmobile_clk_init();
+	else
+		panic("failed to setup rza1 clocks\n");
+}
--- /dev/null
+++ work/arch/arm/mach-shmobile/include/mach/r7s72100.h	2013-09-19 03:10:08.000000000 +0900
@@ -0,0 +1,7 @@
+#ifndef __ASM_R7S72100_H__
+#define __ASM_R7S72100_H__
+
+void r7s72100_clock_init(void);
+void r7s72100_init_early(void);
+
+#endif /* __ASM_R7S72100_H__ */
--- /dev/null
+++ work/arch/arm/mach-shmobile/setup-r7s72100.c	2013-09-19 03:10:08.000000000 +0900
@@ -0,0 +1,43 @@
+/*
+ * r7s72100 processor support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+#include <mach/common.h>
+#include <mach/r7s72100.h>
+#include <asm/mach/arch.h>
+
+void __init r7s72100_init_early(void)
+{
+	shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */
+}
+
+#ifdef CONFIG_USE_OF
+static const char *r7s72100_boards_compat_dt[] __initdata = {
+	"renesas,r7s72100",
+	NULL,
+};
+
+DT_MACHINE_START(R7S72100_DT, "Generic R7S72100 (Flattened Device Tree)")
+	.init_early	= r7s72100_init_early,
+	.dt_compat	= r7s72100_boards_compat_dt,
+MACHINE_END
+#endif /* CONFIG_USE_OF */

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

* [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support
  2013-09-18 20:11 [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Magnus Damm
  2013-09-18 20:11 ` [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support Magnus Damm
@ 2013-09-18 20:11 ` Magnus Damm
  2013-10-03  4:11   ` Simon Horman
  2013-09-18 20:11 ` [PATCH 03/03] ARM: shmobile: Genmai support Magnus Damm
  2013-09-25  4:39 ` [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Simon Horman
  3 siblings, 1 reply; 10+ messages in thread
From: Magnus Damm @ 2013-09-18 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Add SCIF serial port support to the r7s72100 SoC by
adding platform devices for SCIF0 -> SCIF7 together with
clock bindings. DT device description is excluded at
this point since such bindings are still under
development.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/clock-r7s72100.c        |    8 ++++
 arch/arm/mach-shmobile/include/mach/r7s72100.h |    1 
 arch/arm/mach-shmobile/setup-r7s72100.c        |   45 ++++++++++++++++++++++++
 3 files changed, 54 insertions(+)

--- 0002/arch/arm/mach-shmobile/clock-r7s72100.c
+++ work/arch/arm/mach-shmobile/clock-r7s72100.c	2013-09-19 03:47:24.000000000 +0900
@@ -170,6 +170,14 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
 
 	/* MSTP clocks */
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP46]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP45]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.3", &mstp_clks[MSTP44]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP43]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
+	CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
 };
 
 void __init r7s72100_clock_init(void)
--- 0002/arch/arm/mach-shmobile/include/mach/r7s72100.h
+++ work/arch/arm/mach-shmobile/include/mach/r7s72100.h	2013-09-19 03:47:24.000000000 +0900
@@ -1,6 +1,7 @@
 #ifndef __ASM_R7S72100_H__
 #define __ASM_R7S72100_H__
 
+void r7s72100_add_dt_devices(void);
 void r7s72100_clock_init(void);
 void r7s72100_init_early(void);
 
--- 0002/arch/arm/mach-shmobile/setup-r7s72100.c
+++ work/arch/arm/mach-shmobile/setup-r7s72100.c	2013-09-19 04:11:07.000000000 +0900
@@ -21,10 +21,55 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
+#include <linux/serial_sci.h>
 #include <mach/common.h>
+#include <mach/irqs.h>
 #include <mach/r7s72100.h>
 #include <asm/mach/arch.h>
 
+#define SCIF_DATA(index, baseaddr, irq)					\
+[index] = {								\
+	.type		= PORT_SCIF,					\
+	.regtype	= SCIx_SH2_SCIF_FIFODATA_REGTYPE,		\
+	.flags		= UPF_BOOT_AUTOCONF | UPF_IOREMAP,		\
+	.scbrr_algo_id	= SCBRR_ALGO_2,					\
+	.scscr		= SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |	\
+			  SCSCR_REIE,					\
+	.mapbase	= baseaddr,					\
+	.irqs		= { irq + 1, irq + 2, irq + 3, irq },		\
+}
+
+enum { SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7 };
+
+static const struct plat_sci_port scif[] __initconst = {
+	SCIF_DATA(SCIF0, 0xe8007000, gic_iid(221)), /* SCIF0 */
+	SCIF_DATA(SCIF1, 0xe8007800, gic_iid(225)), /* SCIF1 */
+	SCIF_DATA(SCIF2, 0xe8008000, gic_iid(229)), /* SCIF2 */
+	SCIF_DATA(SCIF3, 0xe8008800, gic_iid(233)), /* SCIF3 */
+	SCIF_DATA(SCIF4, 0xe8009000, gic_iid(237)), /* SCIF4 */
+	SCIF_DATA(SCIF5, 0xe8009800, gic_iid(241)), /* SCIF5 */
+	SCIF_DATA(SCIF6, 0xe800a000, gic_iid(245)), /* SCIF6 */
+	SCIF_DATA(SCIF7, 0xe800a800, gic_iid(249)), /* SCIF7 */
+};
+
+static inline void r7s72100_register_scif(int idx)
+{
+	platform_device_register_data(&platform_bus, "sh-sci", idx, &scif[idx],
+				      sizeof(struct plat_sci_port));
+}
+
+void __init r7s72100_add_dt_devices(void)
+{
+	r7s72100_register_scif(SCIF0);
+	r7s72100_register_scif(SCIF1);
+	r7s72100_register_scif(SCIF2);
+	r7s72100_register_scif(SCIF3);
+	r7s72100_register_scif(SCIF4);
+	r7s72100_register_scif(SCIF5);
+	r7s72100_register_scif(SCIF6);
+	r7s72100_register_scif(SCIF7);
+}
+
 void __init r7s72100_init_early(void)
 {
 	shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */

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

* [PATCH 03/03] ARM: shmobile: Genmai support
  2013-09-18 20:11 [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Magnus Damm
  2013-09-18 20:11 ` [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support Magnus Damm
  2013-09-18 20:11 ` [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support Magnus Damm
@ 2013-09-18 20:11 ` Magnus Damm
  2013-10-03  4:19   ` Simon Horman
  2013-09-25  4:39 ` [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Simon Horman
  3 siblings, 1 reply; 10+ messages in thread
From: Magnus Damm @ 2013-09-18 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

Genmai base board support making use of 128 MiB of memory,
the r7s7211 SoC with the SCIF2 serial port and CA9 core.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/boot/dts/Makefile            |    1 
 arch/arm/boot/dts/r7s72100-genmai.dts |   31 +++++++++++++++++++++++
 arch/arm/mach-shmobile/Kconfig        |    5 +++
 arch/arm/mach-shmobile/Makefile       |    1 
 arch/arm/mach-shmobile/Makefile.boot  |    1 
 arch/arm/mach-shmobile/board-genmai.c |   43 +++++++++++++++++++++++++++++++++
 6 files changed, 82 insertions(+)

--- 0001/arch/arm/boot/dts/Makefile
+++ work/arch/arm/boot/dts/Makefile	2013-09-19 03:47:59.000000000 +0900
@@ -184,6 +184,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
 dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	emev2-kzm9d-reference.dtb \
+	r7s72100-genmai.dtb \
 	r8a7740-armadillo800eva.dtb \
 	r8a7778-bockw.dtb \
 	r8a7778-bockw-reference.dtb \
--- /dev/null
+++ work/arch/arm/boot/dts/r7s72100-genmai.dts	2013-09-19 03:47:59.000000000 +0900
@@ -0,0 +1,31 @@
+/*
+ * Device Tree Source for the Genmai board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r7s72100.dtsi"
+
+/ {
+	model = "Genmai";
+	compatible = "renesas,genmai", "renesas,r7s72100";
+
+	chosen {
+		bootargs = "console=ttySC2,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x08000000 0x08000000>;
+	};
+
+	lbsc {
+		#address-cells = <1>;
+		#size-cells = <1>;
+	};
+};
--- 0002/arch/arm/mach-shmobile/Kconfig
+++ work/arch/arm/mach-shmobile/Kconfig	2013-09-19 03:47:59.000000000 +0900
@@ -189,6 +189,11 @@ config MACH_BOCKW_REFERENCE
 
 	   This is intended to aid developers
 
+config MACH_GENMAI
+	bool "Genmai board"
+	depends on ARCH_R7S72100
+	select USE_OF
+
 config MACH_MARZEN
 	bool "MARZEN board"
 	depends on ARCH_R8A7779
--- 0002/arch/arm/mach-shmobile/Makefile
+++ work/arch/arm/mach-shmobile/Makefile	2013-09-19 03:47:59.000000000 +0900
@@ -58,6 +58,7 @@ obj-$(CONFIG_MACH_APE6EVM_REFERENCE)	+ obj-$(CONFIG_MACH_MACKEREL)	+= board-mackerel.o
 obj-$(CONFIG_MACH_BOCKW)	+= board-bockw.o
 obj-$(CONFIG_MACH_BOCKW_REFERENCE)	+= board-bockw-reference.o
+obj-$(CONFIG_MACH_GENMAI)	+= board-genmai.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
 obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_LAGER)	+= board-lager.o
--- 0001/arch/arm/mach-shmobile/Makefile.boot
+++ work/arch/arm/mach-shmobile/Makefile.boot	2013-09-19 03:47:59.000000000 +0900
@@ -6,6 +6,7 @@ loadaddr-$(CONFIG_MACH_ARMADILLO800EVA)
 loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
 loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
+loadaddr-$(CONFIG_MACH_GENMAI) += 0x8008000
 loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000
 loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
 loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000
--- /dev/null
+++ work/arch/arm/mach-shmobile/board-genmai.c	2013-09-19 03:47:59.000000000 +0900
@@ -0,0 +1,43 @@
+/*
+ * Genmai board support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <mach/common.h>
+#include <mach/r7s72100.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+static void __init genmai_add_standard_devices(void)
+{
+	r7s72100_clock_init();
+	r7s72100_add_dt_devices();
+}
+
+static const char * const genmai_boards_compat_dt[] __initconst = {
+	"renesas,genmai",
+	NULL,
+};
+
+DT_MACHINE_START(GENMAI_DT, "genmai")
+	.init_early	= r7s72100_init_early,
+	.init_machine	= genmai_add_standard_devices,
+	.dt_compat	= genmai_boards_compat_dt,
+MACHINE_END

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

* Re: [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support
  2013-09-18 20:11 [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Magnus Damm
                   ` (2 preceding siblings ...)
  2013-09-18 20:11 ` [PATCH 03/03] ARM: shmobile: Genmai support Magnus Damm
@ 2013-09-25  4:39 ` Simon Horman
  2013-10-02  6:07   ` Magnus Damm
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2013-09-25  4:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 19, 2013 at 05:11:01AM +0900, Magnus Damm wrote:
> ARM: shmobile: Initial r7s72100 SoC and Genmai board support
> 
> [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support
> [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support
> [PATCH 03/03] ARM: shmobile: Genmai support
> 
> This series adds initial support for r7s72100 and Genmai. The SoC
> is known as r7s72100 which is based on a single core Cortex-A9
> and makes use of SCIF for serial. Many other on-chip I/O devices
> are available, and support for those will be added by incremental
> feature patches.
> 
> This initial SoC and board support is providing limited DT-only
> support and a very basic C-version of board support. In the future
> improved PINCTRL and common clock framework support will be added.
> 
> Implemented in same style as r8a7790 and r8a7791.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>

Hi Magnus,

please provide a defconfig if you would like this series merged.
Otherwise this seems reasonable to me.

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

* Re: [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support
  2013-09-25  4:39 ` [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Simon Horman
@ 2013-10-02  6:07   ` Magnus Damm
  2013-10-02  8:02     ` Simon Horman
  0 siblings, 1 reply; 10+ messages in thread
From: Magnus Damm @ 2013-10-02  6:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Wed, Sep 25, 2013 at 1:39 PM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Sep 19, 2013 at 05:11:01AM +0900, Magnus Damm wrote:
>> ARM: shmobile: Initial r7s72100 SoC and Genmai board support
>>
>> [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support
>> [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support
>> [PATCH 03/03] ARM: shmobile: Genmai support
>>
>> This series adds initial support for r7s72100 and Genmai. The SoC
>> is known as r7s72100 which is based on a single core Cortex-A9
>> and makes use of SCIF for serial. Many other on-chip I/O devices
>> are available, and support for those will be added by incremental
>> feature patches.
>>
>> This initial SoC and board support is providing limited DT-only
>> support and a very basic C-version of board support. In the future
>> improved PINCTRL and common clock framework support will be added.
>>
>> Implemented in same style as r8a7790 and r8a7791.
>>
>> Signed-off-by: Magnus Damm <damm@opensource.se>
>
> Hi Magnus,
>
> please provide a defconfig if you would like this series merged.
> Otherwise this seems reasonable to me.

Thanks, yes, I'd like to see this series merged.

Please use the recently posted defconfig in:

[PATCH] ARM: shmobile: Genmai defconfig

Cheers,

/ magnus

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

* Re: [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support
  2013-10-02  6:07   ` Magnus Damm
@ 2013-10-02  8:02     ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-10-02  8:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 02, 2013 at 03:07:41PM +0900, Magnus Damm wrote:
> Hi Simon,
> 
> On Wed, Sep 25, 2013 at 1:39 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Sep 19, 2013 at 05:11:01AM +0900, Magnus Damm wrote:
> >> ARM: shmobile: Initial r7s72100 SoC and Genmai board support
> >>
> >> [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support
> >> [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support
> >> [PATCH 03/03] ARM: shmobile: Genmai support
> >>
> >> This series adds initial support for r7s72100 and Genmai. The SoC
> >> is known as r7s72100 which is based on a single core Cortex-A9
> >> and makes use of SCIF for serial. Many other on-chip I/O devices
> >> are available, and support for those will be added by incremental
> >> feature patches.
> >>
> >> This initial SoC and board support is providing limited DT-only
> >> support and a very basic C-version of board support. In the future
> >> improved PINCTRL and common clock framework support will be added.
> >>
> >> Implemented in same style as r8a7790 and r8a7791.
> >>
> >> Signed-off-by: Magnus Damm <damm@opensource.se>
> >
> > Hi Magnus,
> >
> > please provide a defconfig if you would like this series merged.
> > Otherwise this seems reasonable to me.
> 
> Thanks, yes, I'd like to see this series merged.
> 
> Please use the recently posted defconfig in:
> 
> [PATCH] ARM: shmobile: Genmai defconfig

Thanks, I see it.

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

* Re: [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support
  2013-09-18 20:11 ` [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support Magnus Damm
@ 2013-10-03  4:10   ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-10-03  4:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 19, 2013 at 05:11:11AM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add initial support for the r7272100 SoC including:
>  - Single Cortex-A9 CPU Core
>  - GIC
> 
> No static virtual mappings are used, all the components
> make use of ioremap(). DT_MACHINE_START is still wrapped
> in CONFIG_USE_OF to match other mach-shmobile code.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  arch/arm/boot/dts/r7s72100.dtsi                |   36 ++++

In future please consider adding the DTSI file in a separate patch.

>  arch/arm/mach-shmobile/Kconfig                 |    6 
>  arch/arm/mach-shmobile/Makefile                |    2 
>  arch/arm/mach-shmobile/clock-r7s72100.c        |  194 ++++++++++++++++++++++++
>  arch/arm/mach-shmobile/include/mach/r7s72100.h |    7 
>  arch/arm/mach-shmobile/setup-r7s72100.c        |   43 +++++
>  6 files changed, 288 insertions(+)

Thanks, I have queued this up in the soc3 branch.
It should make it into v3.13 but if not I'll rename the branch
soc after rebasing it on v3.13-rcX which will then be targeted at v3.14.

There was some fuzz when applying the Makefile portion of the patch.
I have queued up the following, please check that it is correct.

From: Magnus Damm <damm@opensource.se>

ARM: shmobile: Initial r7s72100 SoC support

Add initial support for the r7272100 SoC including:
 - Single Cortex-A9 CPU Core
 - GIC

No static virtual mappings are used, all the components
make use of ioremap(). DT_MACHINE_START is still wrapped
in CONFIG_USE_OF to match other mach-shmobile code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/boot/dts/r7s72100.dtsi                |  36 +++++
 arch/arm/mach-shmobile/Kconfig                 |   6 +
 arch/arm/mach-shmobile/Makefile                |   2 +
 arch/arm/mach-shmobile/clock-r7s72100.c        | 194 +++++++++++++++++++++++++
 arch/arm/mach-shmobile/include/mach/r7s72100.h |   7 +
 arch/arm/mach-shmobile/setup-r7s72100.c        |  43 ++++++
 6 files changed, 288 insertions(+)
 create mode 100644 arch/arm/boot/dts/r7s72100.dtsi
 create mode 100644 arch/arm/mach-shmobile/clock-r7s72100.c
 create mode 100644 arch/arm/mach-shmobile/include/mach/r7s72100.h
 create mode 100644 arch/arm/mach-shmobile/setup-r7s72100.c

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
new file mode 100644
index 0000000..46b82aa
--- /dev/null
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -0,0 +1,36 @@
+/*
+ * Device Tree Source for the r7s72100 SoC
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/ {
+	compatible = "renesas,r7s72100";
+	interrupt-parent = <&gic>;
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <0>;
+		};
+	};
+
+	gic: interrupt-controller@e8201000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0xe8201000 0x1000>,
+			<0xe8202000 0x1000>;
+	};
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index b452405..5dd5f9f 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -113,6 +113,12 @@ config ARCH_EMEV2
 	select ARM_GIC
 	select CPU_V7
 
+config ARCH_R7S72100
+	bool "RZ/A1H (R7S72100)"
+	select ARM_GIC
+	select CPU_V7
+	select SH_CLK_CPG
+
 comment "SH-Mobile Board Type"
 
 config MACH_APE6EVM
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 3c37e82..95e48d1 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_ARCH_R8A7790)	+= setup-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7790)	+= setup-r8a7790.o setup-rcar-gen2.o
 obj-$(CONFIG_ARCH_R8A7791)	+= setup-r8a7791.o setup-rcar-gen2.o
 obj-$(CONFIG_ARCH_EMEV2)	+= setup-emev2.o
+obj-$(CONFIG_ARCH_R7S72100)	+= setup-r7s72100.o
 
 # Clock objects
 ifndef CONFIG_COMMON_CLK
@@ -31,6 +32,7 @@ obj-$(CONFIG_ARCH_R8A7779)	+= clock-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790)	+= clock-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791)	+= clock-r8a7791.o
 obj-$(CONFIG_ARCH_EMEV2)	+= clock-emev2.o
+obj-$(CONFIG_ARCH_R7S72100)	+= clock-r7s72100.o
 endif
 
 # SMP objects
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
new file mode 100644
index 0000000..1e71094
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -0,0 +1,194 @@
+/*
+ * r7a72100 clock framework support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2012  Phil Edworthy
+ * Copyright (C) 2011  Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/sh_clk.h>
+#include <linux/clkdev.h>
+#include <mach/common.h>
+#include <mach/r7s72100.h>
+
+/* registers */
+#define FRQCR		0xfcfe0010
+#define FRQCR2		0xfcfe0014
+#define STBCR3		0xfcfe0420
+#define STBCR4		0xfcfe0424
+
+#define PLL_RATE 30
+
+static struct clk_mapping cpg_mapping = {
+	.phys	= 0xfcfe0000,
+	.len	= 0x1000,
+};
+
+/* Fixed 32 KHz root clock for RTC */
+static struct clk r_clk = {
+	.rate           = 32768,
+};
+
+/*
+ * Default rate for the root input clock, reset this with clk_set_rate()
+ * from the platform code.
+ */
+static struct clk extal_clk = {
+	.rate		= 13330000,
+	.mapping	= &cpg_mapping,
+};
+
+static unsigned long pll_recalc(struct clk *clk)
+{
+	return clk->parent->rate * PLL_RATE;
+}
+
+static struct sh_clk_ops pll_clk_ops = {
+	.recalc		= pll_recalc,
+};
+
+static struct clk pll_clk = {
+	.ops		= &pll_clk_ops,
+	.parent		= &extal_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+static unsigned long bus_recalc(struct clk *clk)
+{
+	return clk->parent->rate * 2 / 3;
+}
+
+static struct sh_clk_ops bus_clk_ops = {
+	.recalc		= bus_recalc,
+};
+
+static struct clk bus_clk = {
+	.ops		= &bus_clk_ops,
+	.parent		= &pll_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+static unsigned long peripheral0_recalc(struct clk *clk)
+{
+	return clk->parent->rate / 12;
+}
+
+static struct sh_clk_ops peripheral0_clk_ops = {
+	.recalc		= peripheral0_recalc,
+};
+
+static struct clk peripheral0_clk = {
+	.ops		= &peripheral0_clk_ops,
+	.parent		= &pll_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+static unsigned long peripheral1_recalc(struct clk *clk)
+{
+	return clk->parent->rate / 6;
+}
+
+static struct sh_clk_ops peripheral1_clk_ops = {
+	.recalc		= peripheral1_recalc,
+};
+
+static struct clk peripheral1_clk = {
+	.ops		= &peripheral1_clk_ops,
+	.parent		= &pll_clk,
+	.flags		= CLK_ENABLE_ON_INIT,
+};
+
+struct clk *main_clks[] = {
+	&r_clk,
+	&extal_clk,
+	&pll_clk,
+	&bus_clk,
+	&peripheral0_clk,
+	&peripheral1_clk,
+};
+
+static int div2[] = { 1, 3, 0, 3 }; /* 1, 2/3, reserve, 1/3 */
+static int multipliers[] = { 1, 2, 1, 1 };
+
+static struct clk_div_mult_table div4_div_mult_table = {
+	.divisors = div2,
+	.nr_divisors = ARRAY_SIZE(div2),
+	.multipliers = multipliers,
+	.nr_multipliers = ARRAY_SIZE(multipliers),
+};
+
+static struct clk_div4_table div4_table = {
+	.div_mult_table = &div4_div_mult_table,
+};
+
+enum { DIV4_I,
+	DIV4_NR };
+
+#define DIV4(_reg, _bit, _mask, _flags) \
+	SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
+
+/* The mask field specifies the div2 entries that are valid */
+struct clk div4_clks[DIV4_NR] = {
+	[DIV4_I]  = DIV4(FRQCR, 8, 0xB, CLK_ENABLE_REG_16BIT
+					| CLK_ENABLE_ON_INIT),
+};
+
+enum { MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
+	MSTP33,	MSTP_NR };
+
+static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
+	[MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
+	[MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
+	[MSTP44] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 4, 0), /* SCIF3 */
+	[MSTP43] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 3, 0), /* SCIF4 */
+	[MSTP42] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 2, 0), /* SCIF5 */
+	[MSTP41] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 1, 0), /* SCIF6 */
+	[MSTP40] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 0, 0), /* SCIF7 */
+	[MSTP33] = SH_CLK_MSTP8(&peripheral0_clk, STBCR3, 3, 0), /* MTU2 */
+};
+
+static struct clk_lookup lookups[] = {
+	/* main clocks */
+	CLKDEV_CON_ID("rclk", &r_clk),
+	CLKDEV_CON_ID("extal", &extal_clk),
+	CLKDEV_CON_ID("pll_clk", &pll_clk),
+	CLKDEV_CON_ID("peripheral_clk", &peripheral1_clk),
+
+	/* DIV4 clocks */
+	CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
+
+	/* MSTP clocks */
+};
+
+void __init r7s72100_clock_init(void)
+{
+	int k, ret = 0;
+
+	for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
+		ret = clk_register(main_clks[k]);
+
+	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+
+	if (!ret)
+		ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
+
+	if (!ret)
+		ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
+
+	if (!ret)
+		shmobile_clk_init();
+	else
+		panic("failed to setup rza1 clocks\n");
+}
diff --git a/arch/arm/mach-shmobile/include/mach/r7s72100.h b/arch/arm/mach-shmobile/include/mach/r7s72100.h
new file mode 100644
index 0000000..f78062e
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/r7s72100.h
@@ -0,0 +1,7 @@
+#ifndef __ASM_R7S72100_H__
+#define __ASM_R7S72100_H__
+
+void r7s72100_clock_init(void);
+void r7s72100_init_early(void);
+
+#endif /* __ASM_R7S72100_H__ */
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
new file mode 100644
index 0000000..c1aded0
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -0,0 +1,43 @@
+/*
+ * r7s72100 processor support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+#include <mach/common.h>
+#include <mach/r7s72100.h>
+#include <asm/mach/arch.h>
+
+void __init r7s72100_init_early(void)
+{
+	shmobile_setup_delay(400, 1, 3); /* Cortex-A9 @ 400MHz */
+}
+
+#ifdef CONFIG_USE_OF
+static const char *r7s72100_boards_compat_dt[] __initdata = {
+	"renesas,r7s72100",
+	NULL,
+};
+
+DT_MACHINE_START(R7S72100_DT, "Generic R7S72100 (Flattened Device Tree)")
+	.init_early	= r7s72100_init_early,
+	.dt_compat	= r7s72100_boards_compat_dt,
+MACHINE_END
+#endif /* CONFIG_USE_OF */
-- 
1.8.4


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

* Re: [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support
  2013-09-18 20:11 ` [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support Magnus Damm
@ 2013-10-03  4:11   ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-10-03  4:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 19, 2013 at 05:11:20AM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add SCIF serial port support to the r7s72100 SoC by
> adding platform devices for SCIF0 -> SCIF7 together with
> clock bindings. DT device description is excluded at
> this point since such bindings are still under
> development.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>

Thanks, I have queued this up in the soc3 branch.
It should make it into v3.13 but if not I'll rename the branch
soc after rebasing it on v3.13-rcX which will then be targeted at v3.14.

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

* Re: [PATCH 03/03] ARM: shmobile: Genmai support
  2013-09-18 20:11 ` [PATCH 03/03] ARM: shmobile: Genmai support Magnus Damm
@ 2013-10-03  4:19   ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-10-03  4:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 19, 2013 at 05:11:29AM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Genmai base board support making use of 128 MiB of memory,
> the r7s7211 SoC with the SCIF2 serial port and CA9 core.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  arch/arm/boot/dts/Makefile            |    1 
>  arch/arm/boot/dts/r7s72100-genmai.dts |   31 +++++++++++++++++++++++

Please consider adding the dts file in a separate patch next time.

>  arch/arm/mach-shmobile/Kconfig        |    5 +++
>  arch/arm/mach-shmobile/Makefile       |    1 
>  arch/arm/mach-shmobile/Makefile.boot  |    1 
>  arch/arm/mach-shmobile/board-genmai.c |   43 +++++++++++++++++++++++++++++++++
>  6 files changed, 82 insertions(+)

Thanks, I have queued this up in the boards3 branch.
It should make it into v3.13 but if not I'll rename the branch
soc after rebasing it on v3.13-rcX which will then be targeted at v3.14.

The boards3 branch includes boards code previously queued up for v3.13
and a merge with soc changes previously queued up for v3.13. The reason
for the merge is to provide various build and run-time dependencies
including the r7s72100 SoC code which this board code uses.

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

end of thread, other threads:[~2013-10-03  4:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18 20:11 [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Magnus Damm
2013-09-18 20:11 ` [PATCH 01/03] ARM: shmobile: Initial r7s72100 SoC support Magnus Damm
2013-10-03  4:10   ` Simon Horman
2013-09-18 20:11 ` [PATCH 02/03] ARM: shmobile: r7s72100 SCIF support Magnus Damm
2013-10-03  4:11   ` Simon Horman
2013-09-18 20:11 ` [PATCH 03/03] ARM: shmobile: Genmai support Magnus Damm
2013-10-03  4:19   ` Simon Horman
2013-09-25  4:39 ` [PATCH 00/03] ARM: shmobile: Initial r7s72100 SoC and Genmai board support Simon Horman
2013-10-02  6:07   ` Magnus Damm
2013-10-02  8:02     ` Simon Horman

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