aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/r8a73a4.dtsi55
-rw-r--r--arch/arm/mach-shmobile/Kconfig7
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/clock-r8a73a4.c91
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a73a4.h7
-rw-r--r--arch/arm/mach-shmobile/setup-r8a73a4.c50
6 files changed, 211 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi
new file mode 100644
index 000000000000..72c58c172e9d
--- /dev/null
+++ b/arch/arm/boot/dts/r8a73a4.dtsi
@@ -0,0 +1,55 @@
1/*
2 * Device Tree Source for the r8a73a4 SoC
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12/include/ "skeleton.dtsi"
13
14/ {
15 compatible = "renesas,r8a73a4";
16 interrupt-parent = <&gic>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 cpu0: cpu@0 {
23 device_type = "cpu";
24 compatible = "arm,cortex-a15";
25 reg = <0>;
26 clock-frequency = <1500000000>;
27 };
28 };
29
30 gic: interrupt-controller@f1001000 {
31 compatible = "arm,cortex-a15-gic";
32 #interrupt-cells = <3>;
33 #address-cells = <0>;
34 interrupt-controller;
35 reg = <0xf1001000 0x1000>,
36 <0xf1002000 0x1000>,
37 <0xf1004000 0x2000>,
38 <0xf1006000 0x2000>;
39 interrupts = <1 9 0xf04>;
40
41 gic-cpuif@4 {
42 compatible = "arm,gic-cpuif";
43 cpuif-id = <4>;
44 cpu = <&cpu0>;
45 };
46 };
47
48 timer {
49 compatible = "arm,armv7-timer";
50 interrupts = <1 13 0xf08>,
51 <1 14 0xf08>,
52 <1 11 0xf08>,
53 <1 10 0xf08>;
54 };
55};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 75d413c004b6..663d27b39880 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -18,6 +18,13 @@ config ARCH_SH73A0
18 select SH_CLK_CPG 18 select SH_CLK_CPG
19 select RENESAS_INTC_IRQPIN 19 select RENESAS_INTC_IRQPIN
20 20
21config ARCH_R8A73A4
22 bool "R-Mobile APE6 (R8A73A40)"
23 select ARM_GIC
24 select CPU_V7
25 select ARM_ARCH_TIMER
26 select SH_CLK_CPG
27
21config ARCH_R8A7740 28config ARCH_R8A7740
22 bool "R-Mobile A1 (R8A77400)" 29 bool "R-Mobile A1 (R8A77400)"
23 select ARCH_WANT_OPTIONAL_GPIOLIB 30 select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index b646ff4d742a..c5a43ef7cebf 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -8,6 +8,7 @@ obj-y := timer.o console.o clock.o
8# CPU objects 8# CPU objects
9obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o 9obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
10obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o 10obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
11obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o clock-r8a73a4.o
11obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o 12obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o
12obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o 13obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o
13obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o 14obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o
diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c
new file mode 100644
index 000000000000..15d479dbb132
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-r8a73a4.c
@@ -0,0 +1,91 @@
1/*
2 * r8a73a4 clock framework support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/init.h>
21#include <linux/io.h>
22#include <linux/kernel.h>
23#include <linux/sh_clk.h>
24#include <linux/clkdev.h>
25#include <mach/common.h>
26
27#define CPG_BASE 0xe6150000
28#define CPG_LEN 0x270
29
30#define MPCKCR 0xe6150080
31
32static struct clk_mapping cpg_mapping = {
33 .phys = CPG_BASE,
34 .len = CPG_LEN,
35};
36
37static struct clk extalr_clk = {
38 .rate = 32768,
39 .mapping = &cpg_mapping,
40};
41
42static struct clk extal1_clk = {
43 .rate = 26000000,
44 .mapping = &cpg_mapping,
45};
46
47static struct clk extal2_clk = {
48 .rate = 48000000,
49 .mapping = &cpg_mapping,
50};
51
52static struct clk *main_clks[] = {
53 &extalr_clk,
54 &extal1_clk,
55 &extal2_clk,
56};
57
58enum { MSTP_NR };
59static struct clk mstp_clks[MSTP_NR] = {
60};
61
62static struct clk_lookup lookups[] = {
63};
64
65void __init r8a73a4_clock_init(void)
66{
67 void __iomem *cpg_base, *reg;
68 int k, ret = 0;
69
70 /* fix MPCLK to EXTAL2 for now.
71 * this is needed until more detailed clock topology is supported
72 */
73 cpg_base = ioremap_nocache(CPG_BASE, CPG_LEN);
74 BUG_ON(!cpg_base);
75 reg = cpg_base + (MPCKCR - CPG_BASE);
76 iowrite32(ioread32(reg) | 1 << 7 | 0x0c, reg); /* set CKSEL */
77 iounmap(cpg_base);
78
79 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
80 ret = clk_register(main_clks[k]);
81
82 if (!ret)
83 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
84
85 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
86
87 if (!ret)
88 shmobile_clk_init();
89 else
90 panic("failed to setup r8a73a4 clocks\n");
91}
diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
new file mode 100644
index 000000000000..6db3495479d8
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/r8a73a4.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_R8A73A4_H__
2#define __ASM_R8A73A4_H__
3
4void r8a73a4_add_standard_devices(void);
5void r8a73a4_clock_init(void);
6
7#endif /* __ASM_R8A73A4_H__ */
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
new file mode 100644
index 000000000000..69156bce76f7
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -0,0 +1,50 @@
1/*
2 * r8a73a4 processor support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/irq.h>
21#include <linux/irqchip.h>
22#include <linux/kernel.h>
23#include <linux/of_platform.h>
24#include <mach/common.h>
25#include <mach/irqs.h>
26#include <mach/r8a73a4.h>
27#include <asm/mach/arch.h>
28
29void __init r8a73a4_add_standard_devices(void)
30{
31}
32
33#ifdef CONFIG_USE_OF
34void __init r8a73a4_add_standard_devices_dt(void)
35{
36 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
37}
38
39static const char *r8a73a4_boards_compat_dt[] __initdata = {
40 "renesas,r8a73a4",
41 NULL,
42};
43
44DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)")
45 .init_irq = irqchip_init,
46 .init_machine = r8a73a4_add_standard_devices_dt,
47 .init_time = shmobile_timer_init,
48 .dt_compat = r8a73a4_boards_compat_dt,
49MACHINE_END
50#endif /* CONFIG_USE_OF */