diff options
author | Magnus Damm <damm@opensource.se> | 2013-03-27 11:49:34 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-04-01 22:02:19 -0400 |
commit | 0468b2d6b6ae71699c22e67701e23d6ca8ff3046 (patch) | |
tree | 884b797637b1796c8769917904756ee58c635e36 | |
parent | 60e3a566897dcdd8621464ff46f4537903c2255a (diff) |
ARM: shmobile: Initial r8a7790 SoC support
Add initial support for the r8a7790 SoC including:
- Single Cortex-A15 CPU Core
- GIC
- Architecture timer
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>
-rw-r--r-- | arch/arm/boot/dts/r8a7790.dtsi | 54 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7790.c | 61 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7790.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7790.c | 51 |
6 files changed, 181 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi new file mode 100644 index 000000000000..1c58ffb6cccf --- /dev/null +++ b/arch/arm/boot/dts/r8a7790.dtsi | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Device Tree Source for the r8a7790 SoC | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | /include/ "skeleton.dtsi" | ||
12 | |||
13 | / { | ||
14 | compatible = "renesas,r8a7790"; | ||
15 | interrupt-parent = <&gic>; | ||
16 | |||
17 | cpus { | ||
18 | #address-cells = <1>; | ||
19 | #size-cells = <0>; | ||
20 | |||
21 | cpu0: cpu@0 { | ||
22 | device_type = "cpu"; | ||
23 | compatible = "arm,cortex-a15"; | ||
24 | reg = <0>; | ||
25 | clock-frequency = <1300000000>; | ||
26 | }; | ||
27 | }; | ||
28 | |||
29 | gic: interrupt-controller@f1001000 { | ||
30 | compatible = "arm,cortex-a15-gic"; | ||
31 | #interrupt-cells = <3>; | ||
32 | #address-cells = <0>; | ||
33 | interrupt-controller; | ||
34 | reg = <0xf1001000 0x1000>, | ||
35 | <0xf1002000 0x1000>, | ||
36 | <0xf1004000 0x2000>, | ||
37 | <0xf1006000 0x2000>; | ||
38 | interrupts = <1 9 0xf04>; | ||
39 | |||
40 | gic-cpuif@4 { | ||
41 | compatible = "arm,gic-cpuif"; | ||
42 | cpuif-id = <4>; | ||
43 | cpu = <&cpu0>; | ||
44 | }; | ||
45 | }; | ||
46 | |||
47 | timer { | ||
48 | compatible = "arm,armv7-timer"; | ||
49 | interrupts = <1 13 0xf08>, | ||
50 | <1 14 0xf08>, | ||
51 | <1 11 0xf08>, | ||
52 | <1 10 0xf08>; | ||
53 | }; | ||
54 | }; | ||
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index d569c34b1c86..749dfb4c63c0 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -51,6 +51,13 @@ config ARCH_R8A7779 | |||
51 | select USB_ARCH_HAS_OHCI | 51 | select USB_ARCH_HAS_OHCI |
52 | select RENESAS_INTC_IRQPIN | 52 | select RENESAS_INTC_IRQPIN |
53 | 53 | ||
54 | config ARCH_R8A7790 | ||
55 | bool "R-Car H2 (R8A77900)" | ||
56 | select ARM_GIC | ||
57 | select CPU_V7 | ||
58 | select ARM_ARCH_TIMER | ||
59 | select SH_CLK_CPG | ||
60 | |||
54 | config ARCH_EMEV2 | 61 | config ARCH_EMEV2 |
55 | bool "Emma Mobile EV2" | 62 | bool "Emma Mobile EV2" |
56 | select ARCH_WANT_OPTIONAL_GPIOLIB | 63 | select ARCH_WANT_OPTIONAL_GPIOLIB |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 2d42de46db8d..709b9b421f93 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o clock-r8a73a4.o | |||
12 | obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o | 12 | obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o |
13 | obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o clock-r8a7778.o | 13 | obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o clock-r8a7778.o |
14 | obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o | 14 | obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o |
15 | obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o clock-r8a7790.o | ||
15 | obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o | 16 | obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o |
16 | 17 | ||
17 | # SMP objects | 18 | # SMP objects |
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c new file mode 100644 index 000000000000..6869798effa3 --- /dev/null +++ b/arch/arm/mach-shmobile/clock-r8a7790.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * r8a7790 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 0x1000 | ||
29 | |||
30 | static struct clk_mapping cpg_mapping = { | ||
31 | .phys = CPG_BASE, | ||
32 | .len = CPG_LEN, | ||
33 | }; | ||
34 | |||
35 | static struct clk *main_clks[] = { | ||
36 | }; | ||
37 | |||
38 | enum { MSTP_NR }; | ||
39 | static struct clk mstp_clks[MSTP_NR] = { | ||
40 | }; | ||
41 | |||
42 | static struct clk_lookup lookups[] = { | ||
43 | }; | ||
44 | |||
45 | void __init r8a7790_clock_init(void) | ||
46 | { | ||
47 | int k, ret = 0; | ||
48 | |||
49 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) | ||
50 | ret = clk_register(main_clks[k]); | ||
51 | |||
52 | if (!ret) | ||
53 | ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); | ||
54 | |||
55 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
56 | |||
57 | if (!ret) | ||
58 | shmobile_clk_init(); | ||
59 | else | ||
60 | panic("failed to setup r8a7790 clocks\n"); | ||
61 | } | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h new file mode 100644 index 000000000000..f38ded61285f --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __ASM_R8A7790_H__ | ||
2 | #define __ASM_R8A7790_H__ | ||
3 | |||
4 | void r8a7790_add_standard_devices(void); | ||
5 | void r8a7790_clock_init(void); | ||
6 | |||
7 | #endif /* __ASM_R8A7790_H__ */ | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c new file mode 100644 index 000000000000..af432ba11020 --- /dev/null +++ b/arch/arm/mach-shmobile/setup-r8a7790.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * r8a7790 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 | |||
21 | #include <linux/irq.h> | ||
22 | #include <linux/irqchip.h> | ||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/of_platform.h> | ||
25 | #include <mach/common.h> | ||
26 | #include <mach/irqs.h> | ||
27 | #include <mach/r8a7790.h> | ||
28 | #include <asm/mach/arch.h> | ||
29 | |||
30 | void __init r8a7790_add_standard_devices(void) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | #ifdef CONFIG_USE_OF | ||
35 | void __init r8a7790_add_standard_devices_dt(void) | ||
36 | { | ||
37 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
38 | } | ||
39 | |||
40 | static const char *r8a7790_boards_compat_dt[] __initdata = { | ||
41 | "renesas,r8a7790", | ||
42 | NULL, | ||
43 | }; | ||
44 | |||
45 | DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)") | ||
46 | .init_irq = irqchip_init, | ||
47 | .init_machine = r8a7790_add_standard_devices_dt, | ||
48 | .init_time = shmobile_timer_init, | ||
49 | .dt_compat = r8a7790_boards_compat_dt, | ||
50 | MACHINE_END | ||
51 | #endif /* CONFIG_USE_OF */ | ||