linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3
       [not found] <87hakhrpmn.wl%kuninori.morimoto.gx@renesas.com>
@ 2013-03-21  9:59 ` Kuninori Morimoto
  2013-03-21 10:01   ` [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support Kuninori Morimoto
                     ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Kuninori Morimoto @ 2013-03-21  9:59 UTC (permalink / raw)
  To: linux-arm-kernel


Hi Simon, Magnus, Arnd

These are v3 patch set of R8A7778 R-Car M1 SoC/board support
This SoC/board support have limited DT only.
(TMU/SCIF can't use DT at this point)

I will work for external IRQ and SMSC support
if these are accepted.

These patches are based on simon/next branch

Kuninori Morimoto (3):
      ARM: shmobile: add R8A7778 basis support
      ARM: shmobile: r8a7778 SCIF support
      ARM: shmobile: add R-Car M1A Bock-W platform support

 arch/arm/boot/dts/Makefile                    |    1 +
 arch/arm/boot/dts/r8a7778-bockw.dts           |   32 ++++
 arch/arm/boot/dts/r8a7778.dtsi                |   35 +++++
 arch/arm/configs/bockw_defconfig              |   66 +++++++++
 arch/arm/mach-shmobile/Kconfig                |   12 ++
 arch/arm/mach-shmobile/Makefile               |    2 +
 arch/arm/mach-shmobile/board-bockw.c          |   43 ++++++
 arch/arm/mach-shmobile/clock-r8a7778.c        |  104 +++++++++++++
 arch/arm/mach-shmobile/include/mach/r8a7778.h |   28 ++++
 arch/arm/mach-shmobile/setup-r8a7778.c        |  193 +++++++++++++++++++++++++
 10 files changed, 516 insertions(+)

This is my command for DT uImage

PC> make bockw_defconfig
PC> make menuconfig
PC> make zImage
PC> make dtbs
PC> duImage r8a7778-bockw-reference
PC> cp arch/sh/boot/duImage ${PATH}

---- duImage --------------------------------
#! /bin/sh

# create zImage + dtb = dzImage
cat arch/arm/boot/zImage arch/arm/boot/dts/${1}.dtb > arch/arm/boot/dzImage

# create duImage
DUIMAGE=`cut -f 3- -d ' ' < arch/arm/boot/.uImage.cmd | sed -e "s/zImage/dzImage/" | sed -e "s/uImage/duImage/"`
${DUIMAGE}%
----------------------------------------------

Best regards
---
Kuninori Morimoto

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

* [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support
  2013-03-21  9:59 ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Kuninori Morimoto
@ 2013-03-21 10:01   ` Kuninori Morimoto
  2013-03-27 10:46     ` Simon Horman
  2013-03-21 10:02   ` [PATCH 2/3 v3] ARM: shmobile: r8a7778 SCIF support Kuninori Morimoto
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Kuninori Morimoto @ 2013-03-21 10:01 UTC (permalink / raw)
  To: linux-arm-kernel

Add initial support for the R8A7778 R-Car M1A SoC.
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.

It is based on v1.0 datasheet

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - it used platform_device_register_full()
 - removed r8a7778_clock_init() from setup-r8a7778.c
 - cleanup code

 arch/arm/boot/dts/r8a7778.dtsi                |   35 ++++++
 arch/arm/mach-shmobile/Kconfig                |    6 +
 arch/arm/mach-shmobile/Makefile               |    1 +
 arch/arm/mach-shmobile/clock-r8a7778.c        |   91 ++++++++++++++
 arch/arm/mach-shmobile/include/mach/r8a7778.h |   28 +++++
 arch/arm/mach-shmobile/setup-r8a7778.c        |  167 +++++++++++++++++++++++++
 6 files changed, 328 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7778.dtsi
 create mode 100644 arch/arm/mach-shmobile/clock-r8a7778.c
 create mode 100644 arch/arm/mach-shmobile/include/mach/r8a7778.h
 create mode 100644 arch/arm/mach-shmobile/setup-r8a7778.c

diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
new file mode 100644
index 0000000..4743735
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -0,0 +1,35 @@
+/*
+ * Device Tree Source for Renesas r8a7778
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * based on r8a7779
+ *
+ * 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.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "renesas,r8a7778";
+
+	cpus {
+		cpu at 0 {
+			compatible = "arm,cortex-a9";
+		};
+	};
+
+	gic: interrupt-controller at fe438000 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		reg = <0xfe438000 0x1000>,
+		      <0xfe430000 0x100>;
+	};
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index eb3a7ff..aa273a5 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -24,6 +24,12 @@ config ARCH_R8A7740
 	select CPU_V7
 	select SH_CLK_CPG
 
+config ARCH_R8A7778
+	bool "R-Car M1 (R8A77780)"
+	select CPU_V7
+	select SH_CLK_CPG
+	select ARM_GIC
+
 config ARCH_R8A7779
 	bool "R-Car H1 (R8A77790)"
 	select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index c621edf..0f50a3c 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -9,6 +9,7 @@ obj-y				:= timer.o console.o clock.o
 obj-$(CONFIG_ARCH_SH7372)	+= setup-sh7372.o clock-sh7372.o intc-sh7372.o
 obj-$(CONFIG_ARCH_SH73A0)	+= setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
 obj-$(CONFIG_ARCH_R8A7740)	+= setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o
+obj-$(CONFIG_ARCH_R8A7778)	+= setup-r8a7778.o clock-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779)	+= setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o
 obj-$(CONFIG_ARCH_EMEV2)	+= setup-emev2.o clock-emev2.o
 
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
new file mode 100644
index 0000000..387e3b7
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -0,0 +1,91 @@
+/*
+ * r8a7778 clock framework support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * based on r8a7779
+ *
+ * Copyright (C) 2011  Renesas Solutions Corp.
+ * 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; either 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/io.h>
+#include <linux/sh_clk.h>
+#include <linux/clkdev.h>
+#include <mach/common.h>
+
+#define MSTPCR0		IOMEM(0xffc80030)
+#define MSTPCR1		IOMEM(0xffc80034)
+#define MSTPCR3		IOMEM(0xffc8003c)
+#define MSTPSR1		IOMEM(0xffc80044)
+#define MSTPSR4		IOMEM(0xffc80048)
+#define MSTPSR6		IOMEM(0xffc8004c)
+#define MSTPCR4		IOMEM(0xffc80050)
+#define MSTPCR5		IOMEM(0xffc80054)
+#define MSTPCR6		IOMEM(0xffc80058)
+
+/* ioremap() through clock mapping mandatory to avoid
+ * collision with ARM coherent DMA virtual memory range.
+ */
+
+static struct clk_mapping cpg_mapping = {
+	.phys	= 0xffc80000,
+	.len	= 0x80,
+};
+
+static struct clk clkp = {
+	.rate   = 62500000, /* FIXME: shortcut */
+	.flags  = CLK_ENABLE_ON_INIT,
+	.mapping = &cpg_mapping,
+};
+
+static struct clk *main_clks[] = {
+	&clkp,
+};
+
+enum {
+	MSTP016, MSTP015,
+	MSTP_NR };
+
+static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP016] = SH_CLK_MSTP32(&clkp, MSTPCR0, 16, 0), /* TMU0 */
+	[MSTP015] = SH_CLK_MSTP32(&clkp, MSTPCR0, 15, 0), /* TMU1 */
+};
+
+static struct clk_lookup lookups[] = {
+	/* MSTP32 clocks */
+	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
+	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
+};
+
+void __init r8a7778_clock_init(void)
+{
+	int k, ret = 0;
+
+	for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
+		ret = clk_register(main_clks[k]);
+
+	if (!ret)
+		ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
+
+	clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+
+	if (!ret)
+		shmobile_clk_init();
+	else
+		panic("failed to setup r8a7778 clocks\n");
+}
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
new file mode 100644
index 0000000..a755dca
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * 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
+ */
+#ifndef __ASM_R8A7778_H__
+#define __ASM_R8A7778_H__
+
+extern void r8a7778_add_standard_devices(void);
+extern void r8a7778_add_standard_devices_dt(void);
+extern void r8a7778_init_delay(void);
+extern void r8a7778_init_irq(void);
+extern void r8a7778_init_irq_dt(void);
+extern void r8a7778_clock_init(void);
+
+#endif /* __ASM_R8A7778_H__ */
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
new file mode 100644
index 0000000..811ccf3
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -0,0 +1,167 @@
+/*
+ * r8a7778 processor support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * 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/io.h>
+#include <linux/irqchip/arm-gic.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/irqchip.h>
+#include <linux/sh_timer.h>
+#include <mach/irqs.h>
+#include <mach/r8a7778.h>
+#include <mach/common.h>
+#include <asm/mach/arch.h>
+#include <asm/hardware/cache-l2x0.h>
+
+/* TMU */
+static struct resource sh_tmu0_resources[] = {
+	DEFINE_RES_MEM(0xffd80008, 12),
+	DEFINE_RES_IRQ(gic_iid(0x40)),
+};
+
+static struct sh_timer_config sh_tmu0_platform_data = {
+	.name			= "TMU00",
+	.channel_offset		= 0x4,
+	.timer_bit		= 0,
+	.clockevent_rating	= 200,
+};
+
+static struct resource sh_tmu1_resources[] = {
+	DEFINE_RES_MEM(0xffd80014, 12),
+	DEFINE_RES_IRQ(gic_iid(0x41)),
+};
+
+static struct sh_timer_config sh_tmu1_platform_data = {
+	.name			= "TMU01",
+	.channel_offset		= 0x10,
+	.timer_bit		= 1,
+	.clocksource_rating	= 200,
+};
+
+#define PLATFORM_INFO(n, i)					\
+{								\
+	.parent		= &platform_bus,			\
+	.name		= #n,					\
+	.id		= i,					\
+	.res		= n ## i ## _resources,			\
+	.num_res	= ARRAY_SIZE(n ## i ##_resources),	\
+	.data		= &n ## i ##_platform_data,		\
+	.size_data	= sizeof(n ## i ## _platform_data),	\
+}
+
+struct platform_device_info platform_devinfo[] = {
+	PLATFORM_INFO(sh_tmu, 0),
+	PLATFORM_INFO(sh_tmu, 1),
+};
+
+void __init r8a7778_add_standard_devices(void)
+{
+	int i;
+
+#ifdef CONFIG_CACHE_L2X0
+	void __iomem *base = ioremap_nocache(0xf0100000, 0x1000);
+	if (base) {
+		/*
+		 * Early BRESP enable, Shared attribute override enable, 64K*16way
+		 * don't call iounmap(base)
+		 */
+		l2x0_init(base, 0x40470000, 0x82000fff);
+	}
+#endif
+
+	for (i = 0; i < ARRAY_SIZE(platform_devinfo); i++)
+		platform_device_register_full(&platform_devinfo[i]);
+}
+
+#define INT2SMSKCR0	0x82288 /* 0xfe782288 */
+#define INT2SMSKCR1	0x8228c /* 0xfe78228c */
+
+#define INT2NTSR0	0x00018 /* 0xfe700018 */
+#define INT2NTSR1	0x0002c /* 0xfe70002c */
+static void __init r8a7778_init_irq_common(void)
+{
+	void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000);
+
+	BUG_ON(!base);
+
+	/* route all interrupts to ARM */
+	__raw_writel(0x73ffffff, base + INT2NTSR0);
+	__raw_writel(0xffffffff, base + INT2NTSR1);
+
+	/* unmask all known interrupts in INTCS2 */
+	__raw_writel(0x08330773, base + INT2SMSKCR0);
+	__raw_writel(0x00311110, base + INT2SMSKCR1);
+
+	iounmap(base);
+}
+
+void __init r8a7778_init_irq(void)
+{
+	void __iomem *gic_dist_base;
+	void __iomem *gic_cpu_base;
+
+	gic_dist_base = ioremap_nocache(0xfe438000, PAGE_SIZE);
+	gic_cpu_base  = ioremap_nocache(0xfe430000, PAGE_SIZE);
+	BUG_ON(!gic_dist_base || !gic_cpu_base);
+
+	/* use GIC to handle interrupts */
+	gic_init(0, 29, gic_dist_base, gic_cpu_base);
+
+	r8a7778_init_irq_common();
+}
+
+void __init r8a7778_init_delay(void)
+{
+	shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
+}
+
+#ifdef CONFIG_USE_OF
+void __init r8a7778_init_irq_dt(void)
+{
+	irqchip_init();
+	r8a7778_init_irq_common();
+}
+
+static const struct of_dev_auxdata r8a7778_auxdata_lookup[] __initconst = {
+	{},
+};
+
+void __init r8a7778_add_standard_devices_dt(void)
+{
+	of_platform_populate(NULL, of_default_bus_match_table,
+			     r8a7778_auxdata_lookup, NULL);
+}
+
+static const char *r8a7778_compat_dt[] __initdata = {
+	"renesas,r8a7778",
+	NULL,
+};
+
+DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
+	.init_early	= r8a7778_init_delay,
+	.init_irq	= r8a7778_init_irq_dt,
+	.init_machine	= r8a7778_add_standard_devices_dt,
+	.init_time	= shmobile_timer_init,
+	.dt_compat	= r8a7778_compat_dt,
+MACHINE_END
+
+#endif /* CONFIG_USE_OF */
-- 
1.7.9.5

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

* [PATCH 2/3 v3] ARM: shmobile: r8a7778 SCIF support
  2013-03-21  9:59 ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Kuninori Morimoto
  2013-03-21 10:01   ` [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support Kuninori Morimoto
@ 2013-03-21 10:02   ` Kuninori Morimoto
  2013-03-27 10:46     ` Simon Horman
  2013-03-21 10:03   ` [PATCH 3/3 v3] ARM: shmobile: add R-Car M1A Bock-W platform support Kuninori Morimoto
  2013-03-21 10:41   ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Simon Horman
  3 siblings, 1 reply; 10+ messages in thread
From: Kuninori Morimoto @ 2013-03-21 10:02 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - it used platform_device_register_data()

 arch/arm/mach-shmobile/clock-r8a7778.c |   13 +++++++++++++
 arch/arm/mach-shmobile/setup-r8a7778.c |   26 ++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 387e3b7..f1277f4 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -58,16 +58,29 @@ static struct clk *main_clks[] = {
 };
 
 enum {
+	MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
 	MSTP016, MSTP015,
 	MSTP_NR };
 
 static struct clk mstp_clks[MSTP_NR] = {
+	[MSTP026] = SH_CLK_MSTP32(&clkp, MSTPCR0, 26, 0), /* SCIF0 */
+	[MSTP025] = SH_CLK_MSTP32(&clkp, MSTPCR0, 25, 0), /* SCIF1 */
+	[MSTP024] = SH_CLK_MSTP32(&clkp, MSTPCR0, 24, 0), /* SCIF2 */
+	[MSTP023] = SH_CLK_MSTP32(&clkp, MSTPCR0, 23, 0), /* SCIF3 */
+	[MSTP022] = SH_CLK_MSTP32(&clkp, MSTPCR0, 22, 0), /* SCIF4 */
+	[MSTP021] = SH_CLK_MSTP32(&clkp, MSTPCR0, 21, 0), /* SCIF5 */
 	[MSTP016] = SH_CLK_MSTP32(&clkp, MSTPCR0, 16, 0), /* TMU0 */
 	[MSTP015] = SH_CLK_MSTP32(&clkp, MSTPCR0, 15, 0), /* TMU1 */
 };
 
 static struct clk_lookup lookups[] = {
 	/* MSTP32 clocks */
+	CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
+	CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
+	CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
+	CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
+	CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
+	CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
 	CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
 	CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
 };
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 811ccf3..01c62be 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -25,6 +25,7 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/irqchip.h>
+#include <linux/serial_sci.h>
 #include <linux/sh_timer.h>
 #include <mach/irqs.h>
 #include <mach/r8a7778.h>
@@ -32,6 +33,26 @@
 #include <asm/mach/arch.h>
 #include <asm/hardware/cache-l2x0.h>
 
+/* SCIF */
+#define SCIF_INFO(baseaddr, irq)				\
+{								\
+	.mapbase	= baseaddr,				\
+	.flags		= UPF_BOOT_AUTOCONF | UPF_IOREMAP,	\
+	.scscr		= SCSCR_RE | SCSCR_TE | SCSCR_CKE1,	\
+	.scbrr_algo_id	= SCBRR_ALGO_2,				\
+	.type		= PORT_SCIF,				\
+	.irqs		= SCIx_IRQ_MUXED(irq),			\
+}
+
+static struct plat_sci_port scif_platform_data[] = {
+	SCIF_INFO(0xffe40000, gic_iid(0x66)),
+	SCIF_INFO(0xffe41000, gic_iid(0x67)),
+	SCIF_INFO(0xffe42000, gic_iid(0x68)),
+	SCIF_INFO(0xffe43000, gic_iid(0x69)),
+	SCIF_INFO(0xffe44000, gic_iid(0x6a)),
+	SCIF_INFO(0xffe45000, gic_iid(0x6b)),
+};
+
 /* TMU */
 static struct resource sh_tmu0_resources[] = {
 	DEFINE_RES_MEM(0xffd80008, 12),
@@ -88,6 +109,11 @@ void __init r8a7778_add_standard_devices(void)
 	}
 #endif
 
+	for (i = 0; i < ARRAY_SIZE(scif_platform_data); i++)
+		platform_device_register_data(&platform_bus, "sh-sci", i,
+					      &scif_platform_data[i],
+					      sizeof(struct plat_sci_port));
+
 	for (i = 0; i < ARRAY_SIZE(platform_devinfo); i++)
 		platform_device_register_full(&platform_devinfo[i]);
 }
-- 
1.7.9.5

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

* [PATCH 3/3 v3] ARM: shmobile: add R-Car M1A Bock-W platform support
  2013-03-21  9:59 ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Kuninori Morimoto
  2013-03-21 10:01   ` [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support Kuninori Morimoto
  2013-03-21 10:02   ` [PATCH 2/3 v3] ARM: shmobile: r8a7778 SCIF support Kuninori Morimoto
@ 2013-03-21 10:03   ` Kuninori Morimoto
  2013-03-27 10:47     ` Simon Horman
  2013-03-21 10:41   ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Simon Horman
  3 siblings, 1 reply; 10+ messages in thread
From: Kuninori Morimoto @ 2013-03-21 10:03 UTC (permalink / raw)
  To: linux-arm-kernel

Add basic Bock-W board support

More devices will be added on top of this patch after
PICNTRL and clock framework are in better shape.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - fixup compatible name
 - r8a7778_clock_init() is called from board code

 arch/arm/boot/dts/Makefile           |    1 +
 arch/arm/boot/dts/r8a7778-bockw.dts  |   32 +++++++++++++++++
 arch/arm/configs/bockw_defconfig     |   66 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-shmobile/Kconfig       |    6 ++++
 arch/arm/mach-shmobile/Makefile      |    1 +
 arch/arm/mach-shmobile/board-bockw.c |   43 ++++++++++++++++++++++
 6 files changed, 149 insertions(+)
 create mode 100644 arch/arm/boot/dts/r8a7778-bockw.dts
 create mode 100644 arch/arm/configs/bockw_defconfig
 create mode 100644 arch/arm/mach-shmobile/board-bockw.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index ee9fbe4..363fa507 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -136,6 +136,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
 	ccu9540.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
+	r8a7778-bockw.dtb \
 	r8a7779-marzen-reference.dtb \
 	sh73a0-kzm9g.dtb \
 	sh73a0-kzm9g-reference.dtb \
diff --git a/arch/arm/boot/dts/r8a7778-bockw.dts b/arch/arm/boot/dts/r8a7778-bockw.dts
new file mode 100644
index 0000000..735c964
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7778-bockw.dts
@@ -0,0 +1,32 @@
+/*
+ * Reference Device Tree Source for the Bock-W board
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * based on r8a7779
+ *
+ * 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/ "r8a7778.dtsi"
+
+/ {
+	model = "bockw";
+	compatible = "renesas,bockw", "renesas,r8a7778";
+
+	chosen {
+		bootargs = "console=ttySC0,115200 ignore_loglevel";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x60000000 0x10000000>;
+	};
+};
diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig
new file mode 100644
index 0000000..6037705
--- /dev/null
+++ b/arch/arm/configs/bockw_defconfig
@@ -0,0 +1,66 @@
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_KERNEL_LZMA=y
+CONFIG_NO_HZ=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_EMBEDDED=y
+CONFIG_SLAB=y
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_SHMOBILE=y
+CONFIG_ARCH_R8A7778=y
+CONFIG_MACH_BOCKW=y
+CONFIG_MEMORY_START=0x60000000
+CONFIG_MEMORY_SIZE=0x10000000
+CONFIG_SHMOBILE_TIMER_HZ=1024
+# CONFIG_SH_TIMER_CMT is not set
+# CONFIG_EM_TIMER_STI is not set
+CONFIG_ARM_ERRATA_430973=y
+CONFIG_ARM_ERRATA_458693=y
+CONFIG_ARM_ERRATA_460075=y
+CONFIG_ARM_ERRATA_743622=y
+CONFIG_ARM_ERRATA_754322=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_HIGHMEM=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_CMDLINE="console=ttySC0,115200 ignore_loglevel"
+CONFIG_CMDLINE_FORCE=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_SUSPEND is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_SH_SCI=y
+CONFIG_SERIAL_SH_SCI_NR_UARTS=6
+CONFIG_SERIAL_SH_SCI_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_UIO=y
+CONFIG_UIO_PDRV_GENIRQ=y
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY_USER is not set
+CONFIG_TMPFS=y
+# CONFIG_MISC_FILESYSTEMS is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_FTRACE is not set
+# CONFIG_ARM_UNWIND is not set
+CONFIG_KEYS=y
+CONFIG_CRYPTO=y
+CONFIG_AVERAGE=y
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index aa273a5..e5cd4d8 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -104,6 +104,12 @@ config MACH_ARMADILLO800EVA
 	select SND_SOC_WM8978 if SND_SIMPLE_CARD
 	select USE_OF
 
+config MACH_BOCKW
+	bool "BOCK-W platform"
+	depends on ARCH_R8A7778
+	select ARCH_REQUIRE_GPIOLIB
+	select USE_OF
+
 config MACH_MARZEN
 	bool "MARZEN board"
 	depends on ARCH_R8A7779
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 0f50a3c..b6cf0f4 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_MACH_AG5EVM)	+= board-ag5evm.o
 obj-$(CONFIG_MACH_MACKEREL)	+= board-mackerel.o
 obj-$(CONFIG_MACH_KOTA2)	+= board-kota2.o
 obj-$(CONFIG_MACH_BONITO)	+= board-bonito.o
+obj-$(CONFIG_MACH_BOCKW)	+= board-bockw.o
 obj-$(CONFIG_MACH_MARZEN)	+= board-marzen.o
 obj-$(CONFIG_MACH_MARZEN_REFERENCE)	+= board-marzen-reference.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)	+= board-armadillo800eva.o
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
new file mode 100644
index 0000000..56ab56e
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -0,0 +1,43 @@
+/*
+ * Bock-W board support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * 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/platform_device.h>
+#include <mach/common.h>
+#include <mach/r8a7778.h>
+#include <asm/mach/arch.h>
+
+static void __init bockw_init(void)
+{
+	r8a7778_clock_init();
+	r8a7778_add_standard_devices();
+}
+
+static const char *bockw_boards_compat_dt[] __initdata = {
+	"renesas,bockw",
+	NULL,
+};
+
+DT_MACHINE_START(BOCKW_DT, "bockw")
+	.init_early	= r8a7778_init_delay,
+	.init_irq	= r8a7778_init_irq_dt,
+	.init_machine	= bockw_init,
+	.init_time	= shmobile_timer_init,
+	.dt_compat	= bockw_boards_compat_dt,
+MACHINE_END
-- 
1.7.9.5

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

* [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3
  2013-03-21  9:59 ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Kuninori Morimoto
                     ` (2 preceding siblings ...)
  2013-03-21 10:03   ` [PATCH 3/3 v3] ARM: shmobile: add R-Car M1A Bock-W platform support Kuninori Morimoto
@ 2013-03-21 10:41   ` Simon Horman
  2013-03-26 14:19     ` Magnus Damm
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2013-03-21 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 06:59:20PM +0900, Kuninori Morimoto wrote:
> 
> Hi Simon, Magnus, Arnd
> 
> These are v3 patch set of R8A7778 R-Car M1 SoC/board support
> This SoC/board support have limited DT only.
> (TMU/SCIF can't use DT at this point)
> 
> I will work for external IRQ and SMSC support
> if these are accepted.
> 
> These patches are based on simon/next branch

Good choice :^)

I have no objections to these changes at this point
but I would appreciate an ack from Magnus before applying them.

> Kuninori Morimoto (3):
>       ARM: shmobile: add R8A7778 basis support
>       ARM: shmobile: r8a7778 SCIF support
>       ARM: shmobile: add R-Car M1A Bock-W platform support
> 
>  arch/arm/boot/dts/Makefile                    |    1 +
>  arch/arm/boot/dts/r8a7778-bockw.dts           |   32 ++++
>  arch/arm/boot/dts/r8a7778.dtsi                |   35 +++++
>  arch/arm/configs/bockw_defconfig              |   66 +++++++++
>  arch/arm/mach-shmobile/Kconfig                |   12 ++
>  arch/arm/mach-shmobile/Makefile               |    2 +
>  arch/arm/mach-shmobile/board-bockw.c          |   43 ++++++
>  arch/arm/mach-shmobile/clock-r8a7778.c        |  104 +++++++++++++
>  arch/arm/mach-shmobile/include/mach/r8a7778.h |   28 ++++
>  arch/arm/mach-shmobile/setup-r8a7778.c        |  193 +++++++++++++++++++++++++
>  10 files changed, 516 insertions(+)
> 
> This is my command for DT uImage
> 
> PC> make bockw_defconfig
> PC> make menuconfig
> PC> make zImage
> PC> make dtbs
> PC> duImage r8a7778-bockw-reference
> PC> cp arch/sh/boot/duImage ${PATH}
> 
> ---- duImage --------------------------------
> #! /bin/sh
> 
> # create zImage + dtb = dzImage
> cat arch/arm/boot/zImage arch/arm/boot/dts/${1}.dtb > arch/arm/boot/dzImage
> 
> # create duImage
> DUIMAGE=`cut -f 3- -d ' ' < arch/arm/boot/.uImage.cmd | sed -e "s/zImage/dzImage/" | sed -e "s/uImage/duImage/"`
> ${DUIMAGE}%
> ----------------------------------------------
> 
> Best regards
> ---
> Kuninori Morimoto
> --
> 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] 10+ messages in thread

* [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3
  2013-03-21 10:41   ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Simon Horman
@ 2013-03-26 14:19     ` Magnus Damm
  2013-03-27  4:49       ` Simon Horman
  0 siblings, 1 reply; 10+ messages in thread
From: Magnus Damm @ 2013-03-26 14:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon, Morimoto-san,

On Thu, Mar 21, 2013 at 7:41 PM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Mar 21, 2013 at 06:59:20PM +0900, Kuninori Morimoto wrote:
>>
>> Hi Simon, Magnus, Arnd
>>
>> These are v3 patch set of R8A7778 R-Car M1 SoC/board support
>> This SoC/board support have limited DT only.
>> (TMU/SCIF can't use DT at this point)
>>
>> I will work for external IRQ and SMSC support
>> if these are accepted.
>>
>> These patches are based on simon/next branch
>
> Good choice :^)
>
> I have no objections to these changes at this point
> but I would appreciate an ack from Magnus before applying them.

I've looked through this series and they look good to me.

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

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

* [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3
  2013-03-26 14:19     ` Magnus Damm
@ 2013-03-27  4:49       ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-03-27  4:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 26, 2013 at 11:19:05PM +0900, Magnus Damm wrote:
> Hi Simon, Morimoto-san,
> 
> On Thu, Mar 21, 2013 at 7:41 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Mar 21, 2013 at 06:59:20PM +0900, Kuninori Morimoto wrote:
> >>
> >> Hi Simon, Magnus, Arnd
> >>
> >> These are v3 patch set of R8A7778 R-Car M1 SoC/board support
> >> This SoC/board support have limited DT only.
> >> (TMU/SCIF can't use DT at this point)
> >>
> >> I will work for external IRQ and SMSC support
> >> if these are accepted.
> >>
> >> These patches are based on simon/next branch
> >
> > Good choice :^)
> >
> > I have no objections to these changes at this point
> > but I would appreciate an ack from Magnus before applying them.
> 
> I've looked through this series and they look good to me.
> 
> Acked-by: Magnus Damm <damm@opensource.se>

Thanks, I will queue them up.

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

* [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support
  2013-03-21 10:01   ` [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support Kuninori Morimoto
@ 2013-03-27 10:46     ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-03-27 10:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 03:01:36AM -0700, Kuninori Morimoto wrote:
> Add initial support for the R8A7778 R-Car M1A SoC.
> 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.
> 
> It is based on v1.0 datasheet
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks, queued up for v3.10 in the soc branch.

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

* [PATCH 2/3 v3] ARM: shmobile: r8a7778 SCIF support
  2013-03-21 10:02   ` [PATCH 2/3 v3] ARM: shmobile: r8a7778 SCIF support Kuninori Morimoto
@ 2013-03-27 10:46     ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-03-27 10:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 03:02:38AM -0700, Kuninori Morimoto wrote:
> Add SCIF serial port support to the r8a7778 SoC by
> adding platform devices together with clock bindings.
> DT device description is excluded at this point since
> such bindings are still under development.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks, queued up for v3.10 in the soc branch. 

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

* [PATCH 3/3 v3] ARM: shmobile: add R-Car M1A Bock-W platform support
  2013-03-21 10:03   ` [PATCH 3/3 v3] ARM: shmobile: add R-Car M1A Bock-W platform support Kuninori Morimoto
@ 2013-03-27 10:47     ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-03-27 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 21, 2013 at 03:03:38AM -0700, Kuninori Morimoto wrote:
> Add basic Bock-W board support
> 
> More devices will be added on top of this patch after
> PICNTRL and clock framework are in better shape.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks, queued up for v3.10 in the boards branch. 

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87hakhrpmn.wl%kuninori.morimoto.gx@renesas.com>
2013-03-21  9:59 ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Kuninori Morimoto
2013-03-21 10:01   ` [PATCH 1/3 v3] ARM: shmobile: add R8A7778 basis support Kuninori Morimoto
2013-03-27 10:46     ` Simon Horman
2013-03-21 10:02   ` [PATCH 2/3 v3] ARM: shmobile: r8a7778 SCIF support Kuninori Morimoto
2013-03-27 10:46     ` Simon Horman
2013-03-21 10:03   ` [PATCH 3/3 v3] ARM: shmobile: add R-Car M1A Bock-W platform support Kuninori Morimoto
2013-03-27 10:47     ` Simon Horman
2013-03-21 10:41   ` [PATCH 0/3 v3] ARM: shmobile: add R8A7778 Bock-W board support v3 Simon Horman
2013-03-26 14:19     ` Magnus Damm
2013-03-27  4:49       ` 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).