diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-07-08 12:04:57 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-07-17 01:28:31 -0400 |
commit | 69f366615e950cb0d5af89da228796af5208ad8f (patch) | |
tree | ff947de88c7a28a89ebdd20325b6c4c55373a72b | |
parent | 81b9d5351fa96caad4accc6711bc1b9342927d4a (diff) |
ARM: shmobile: ape6evm: add DT reference
This patch adds a sample DT-based APE6EVM "reference" implementation. The
use of platform-specific C-code should be avoided with this configuration
as much as possible.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/boot/dts/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts | 33 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 11 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile.boot | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-ape6evm-reference.c | 71 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a73a4.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a73a4.c | 9 |
8 files changed, 126 insertions, 2 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index af19e38f8e97..6d79bde792b7 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -192,6 +192,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ | |||
192 | sh73a0-kzm9g.dtb \ | 192 | sh73a0-kzm9g.dtb \ |
193 | sh73a0-kzm9g-reference.dtb \ | 193 | sh73a0-kzm9g-reference.dtb \ |
194 | r8a73a4-ape6evm.dtb \ | 194 | r8a73a4-ape6evm.dtb \ |
195 | r8a73a4-ape6evm-reference.dtb \ | ||
195 | sh7372-mackerel.dtb | 196 | sh7372-mackerel.dtb |
196 | dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \ | 197 | dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \ |
197 | socfpga_vt.dtb | 198 | socfpga_vt.dtb |
diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts b/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts new file mode 100644 index 000000000000..3251f059c25b --- /dev/null +++ b/arch/arm/boot/dts/r8a73a4-ape6evm-reference.dts | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Device Tree Source for the APE6EVM board | ||
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 | /dts-v1/; | ||
12 | /include/ "r8a73a4.dtsi" | ||
13 | |||
14 | / { | ||
15 | model = "APE6EVM"; | ||
16 | compatible = "renesas,ape6evm-reference", "renesas,r8a73a4"; | ||
17 | |||
18 | chosen { | ||
19 | bootargs = "console=ttySC0,115200 ignore_loglevel"; | ||
20 | }; | ||
21 | |||
22 | memory@40000000 { | ||
23 | device_type = "memory"; | ||
24 | reg = <0 0x40000000 0 0x40000000>; | ||
25 | }; | ||
26 | |||
27 | lbsc { | ||
28 | compatible = "simple-bus"; | ||
29 | #address-cells = <1>; | ||
30 | #size-cells = <1>; | ||
31 | ranges = <0 0 0 0x80000000>; | ||
32 | }; | ||
33 | }; | ||
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index dd80f215feeb..ad28f91b5796 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -83,6 +83,17 @@ config MACH_APE6EVM | |||
83 | depends on ARCH_R8A73A4 | 83 | depends on ARCH_R8A73A4 |
84 | select USE_OF | 84 | select USE_OF |
85 | 85 | ||
86 | config MACH_APE6EVM_REFERENCE | ||
87 | bool "APE6EVM board - Reference Device Tree Implementation" | ||
88 | depends on ARCH_R8A73A4 | ||
89 | select USE_OF | ||
90 | ---help--- | ||
91 | Use reference implementation of APE6EVM board support | ||
92 | which makes a greater use of device tree at the expense | ||
93 | of not supporting a number of devices. | ||
94 | |||
95 | This is intended to aid developers | ||
96 | |||
86 | config MACH_MACKEREL | 97 | config MACH_MACKEREL |
87 | bool "mackerel board" | 98 | bool "mackerel board" |
88 | depends on ARCH_SH7372 | 99 | depends on ARCH_SH7372 |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index e8d0a2c904a0..26a578420796 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -37,6 +37,7 @@ obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o | |||
37 | # Board objects | 37 | # Board objects |
38 | obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o | 38 | obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o |
39 | obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o | 39 | obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o |
40 | obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o | ||
40 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o | 41 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o |
41 | obj-$(CONFIG_MACH_KOTA2) += board-kota2.o | 42 | obj-$(CONFIG_MACH_KOTA2) += board-kota2.o |
42 | obj-$(CONFIG_MACH_BOCKW) += board-bockw.o | 43 | obj-$(CONFIG_MACH_BOCKW) += board-bockw.o |
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot index 7785c52b5cfd..c938b58f6407 100644 --- a/arch/arm/mach-shmobile/Makefile.boot +++ b/arch/arm/mach-shmobile/Makefile.boot | |||
@@ -2,6 +2,7 @@ | |||
2 | loadaddr-y := | 2 | loadaddr-y := |
3 | loadaddr-$(CONFIG_MACH_AG5EVM) += 0x40008000 | 3 | loadaddr-$(CONFIG_MACH_AG5EVM) += 0x40008000 |
4 | loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000 | 4 | loadaddr-$(CONFIG_MACH_APE6EVM) += 0x40008000 |
5 | loadaddr-$(CONFIG_MACH_APE6EVM_REFERENCE) += 0x40008000 | ||
5 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 | 6 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 |
6 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000 | 7 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000 |
7 | loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 | 8 | loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 |
diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c new file mode 100644 index 000000000000..c828874947ba --- /dev/null +++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * APE6EVM board 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/gpio.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/of_platform.h> | ||
24 | #include <linux/pinctrl/machine.h> | ||
25 | #include <linux/sh_clk.h> | ||
26 | #include <mach/common.h> | ||
27 | #include <mach/r8a73a4.h> | ||
28 | #include <asm/mach-types.h> | ||
29 | #include <asm/mach/arch.h> | ||
30 | |||
31 | static const struct pinctrl_map ape6evm_pinctrl_map[] = { | ||
32 | /* SCIFA0 console */ | ||
33 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", | ||
34 | "scifa0_data", "scifa0"), | ||
35 | }; | ||
36 | |||
37 | static void __init ape6evm_add_standard_devices(void) | ||
38 | { | ||
39 | |||
40 | struct clk *parent; | ||
41 | struct clk *mp; | ||
42 | |||
43 | r8a73a4_clock_init(); | ||
44 | |||
45 | /* MP clock parent = extal2 */ | ||
46 | parent = clk_get(NULL, "extal2"); | ||
47 | mp = clk_get(NULL, "mp"); | ||
48 | BUG_ON(IS_ERR(parent) || IS_ERR(mp)); | ||
49 | |||
50 | clk_set_parent(mp, parent); | ||
51 | clk_put(parent); | ||
52 | clk_put(mp); | ||
53 | |||
54 | pinctrl_register_mappings(ape6evm_pinctrl_map, | ||
55 | ARRAY_SIZE(ape6evm_pinctrl_map)); | ||
56 | r8a73a4_pinmux_init(); | ||
57 | r8a73a4_add_dt_devices(); | ||
58 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
59 | } | ||
60 | |||
61 | static const char *ape6evm_boards_compat_dt[] __initdata = { | ||
62 | "renesas,ape6evm-reference", | ||
63 | NULL, | ||
64 | }; | ||
65 | |||
66 | DT_MACHINE_START(APE6EVM_DT, "ape6evm") | ||
67 | .init_early = r8a73a4_init_delay, | ||
68 | .init_time = shmobile_timer_init, | ||
69 | .init_machine = ape6evm_add_standard_devices, | ||
70 | .dt_compat = ape6evm_boards_compat_dt, | ||
71 | MACHINE_END | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a73a4.h b/arch/arm/mach-shmobile/include/mach/r8a73a4.h index 144a85e29245..f3a9b702da56 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a73a4.h +++ b/arch/arm/mach-shmobile/include/mach/r8a73a4.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ASM_R8A73A4_H__ | 2 | #define __ASM_R8A73A4_H__ |
3 | 3 | ||
4 | void r8a73a4_add_standard_devices(void); | 4 | void r8a73a4_add_standard_devices(void); |
5 | void r8a73a4_add_dt_devices(void); | ||
5 | void r8a73a4_clock_init(void); | 6 | void r8a73a4_clock_init(void); |
6 | void r8a73a4_pinmux_init(void); | 7 | void r8a73a4_pinmux_init(void); |
7 | void r8a73a4_init_delay(void); | 8 | void r8a73a4_init_delay(void); |
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c index d533bd23865c..630ea4eb5472 100644 --- a/arch/arm/mach-shmobile/setup-r8a73a4.c +++ b/arch/arm/mach-shmobile/setup-r8a73a4.c | |||
@@ -188,7 +188,7 @@ static struct resource cmt10_resources[] = { | |||
188 | &cmt##idx##_platform_data, \ | 188 | &cmt##idx##_platform_data, \ |
189 | sizeof(struct sh_timer_config)) | 189 | sizeof(struct sh_timer_config)) |
190 | 190 | ||
191 | void __init r8a73a4_add_standard_devices(void) | 191 | void __init r8a73a4_add_dt_devices(void) |
192 | { | 192 | { |
193 | r8a73a4_register_scif(SCIFA0); | 193 | r8a73a4_register_scif(SCIFA0); |
194 | r8a73a4_register_scif(SCIFA1); | 194 | r8a73a4_register_scif(SCIFA1); |
@@ -196,10 +196,15 @@ void __init r8a73a4_add_standard_devices(void) | |||
196 | r8a73a4_register_scif(SCIFB1); | 196 | r8a73a4_register_scif(SCIFB1); |
197 | r8a73a4_register_scif(SCIFB2); | 197 | r8a73a4_register_scif(SCIFB2); |
198 | r8a73a4_register_scif(SCIFB3); | 198 | r8a73a4_register_scif(SCIFB3); |
199 | r8a7790_register_cmt(10); | ||
200 | } | ||
201 | |||
202 | void __init r8a73a4_add_standard_devices(void) | ||
203 | { | ||
204 | r8a73a4_add_dt_devices(); | ||
199 | r8a73a4_register_irqc(0); | 205 | r8a73a4_register_irqc(0); |
200 | r8a73a4_register_irqc(1); | 206 | r8a73a4_register_irqc(1); |
201 | r8a73a4_register_thermal(); | 207 | r8a73a4_register_thermal(); |
202 | r8a7790_register_cmt(10); | ||
203 | } | 208 | } |
204 | 209 | ||
205 | void __init r8a73a4_init_delay(void) | 210 | void __init r8a73a4_init_delay(void) |