diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-07-24 03:36:51 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-07-25 20:17:32 -0400 |
commit | cfa66a81621d0e85ac03c0de25adc7edd7f2649e (patch) | |
tree | bc992bbf405e4af3b8bed55843aa7ced8de0e6fd /arch/arm/mach-shmobile | |
parent | 466f302e076236a4796079681ca2a2f34a5792a3 (diff) |
ARM: shmobile: bockw: add DT reference
This patch adds a sample DT-based Bock-W "reference" implementation.
The use of platform-specific C-code should be avoided
with this configuration as much as possible.
This patch adds new r8a7778_add_dt_devices() which was same stance
of r8a7790_add_dt_devices()
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 14 | ||||
-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-bockw-reference.c | 62 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7778.c | 7 |
6 files changed, 85 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 05ea10310a8e..9e07985866b7 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -137,6 +137,20 @@ config MACH_BOCKW | |||
137 | select RENESAS_INTC_IRQPIN | 137 | select RENESAS_INTC_IRQPIN |
138 | select USE_OF | 138 | select USE_OF |
139 | 139 | ||
140 | config MACH_BOCKW_REFERENCE | ||
141 | bool "BOCK-W - Reference Device Tree Implementation" | ||
142 | depends on ARCH_R8A7778 | ||
143 | select ARCH_REQUIRE_GPIOLIB | ||
144 | select RENESAS_INTC_IRQPIN | ||
145 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
146 | select USE_OF | ||
147 | ---help--- | ||
148 | Use reference implementation of BockW board support | ||
149 | which makes use of device tree at the expense | ||
150 | of not supporting a number of devices. | ||
151 | |||
152 | This is intended to aid developers | ||
153 | |||
140 | config MACH_MARZEN | 154 | config MACH_MARZEN |
141 | bool "MARZEN board" | 155 | bool "MARZEN board" |
142 | depends on ARCH_R8A7779 | 156 | depends on ARCH_R8A7779 |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 397bb36065e0..e401c737fb4d 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -41,6 +41,7 @@ obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o | |||
41 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o | 41 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o |
42 | obj-$(CONFIG_MACH_KOTA2) += board-kota2.o | 42 | obj-$(CONFIG_MACH_KOTA2) += board-kota2.o |
43 | obj-$(CONFIG_MACH_BOCKW) += board-bockw.o | 43 | obj-$(CONFIG_MACH_BOCKW) += board-bockw.o |
44 | obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o | ||
44 | obj-$(CONFIG_MACH_MARZEN) += board-marzen.o | 45 | obj-$(CONFIG_MACH_MARZEN) += board-marzen.o |
45 | obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o | 46 | obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o |
46 | obj-$(CONFIG_MACH_LAGER) += board-lager.o | 47 | obj-$(CONFIG_MACH_LAGER) += board-lager.o |
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot index 761d7b14bd20..9c9b4412c60b 100644 --- a/arch/arm/mach-shmobile/Makefile.boot +++ b/arch/arm/mach-shmobile/Makefile.boot | |||
@@ -6,6 +6,7 @@ loadaddr-$(CONFIG_MACH_APE6EVM_REFERENCE) += 0x40008000 | |||
6 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 | 6 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000 |
7 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000 | 7 | loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000 |
8 | loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 | 8 | loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 |
9 | loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000 | ||
9 | loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000 | 10 | loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000 |
10 | loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000 | 11 | loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000 |
11 | loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000 | 12 | loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000 |
diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c new file mode 100644 index 000000000000..24db8de73cae --- /dev/null +++ b/arch/arm/mach-shmobile/board-bockw-reference.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Bock-W board support | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
5 | * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
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/of_platform.h> | ||
22 | #include <linux/pinctrl/machine.h> | ||
23 | #include <mach/common.h> | ||
24 | #include <mach/r8a7778.h> | ||
25 | #include <asm/mach/arch.h> | ||
26 | |||
27 | /* | ||
28 | * see board-bock.c for checking detail of dip-switch | ||
29 | */ | ||
30 | |||
31 | static const struct pinctrl_map bockw_pinctrl_map[] = { | ||
32 | /* SCIF0 */ | ||
33 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", | ||
34 | "scif0_data_a", "scif0"), | ||
35 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", | ||
36 | "scif0_ctrl", "scif0"), | ||
37 | }; | ||
38 | |||
39 | static void __init bockw_init(void) | ||
40 | { | ||
41 | r8a7778_clock_init(); | ||
42 | |||
43 | pinctrl_register_mappings(bockw_pinctrl_map, | ||
44 | ARRAY_SIZE(bockw_pinctrl_map)); | ||
45 | r8a7778_pinmux_init(); | ||
46 | r8a7778_add_dt_devices(); | ||
47 | |||
48 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
49 | } | ||
50 | |||
51 | static const char *bockw_boards_compat_dt[] __initdata = { | ||
52 | "renesas,bockw-reference", | ||
53 | NULL, | ||
54 | }; | ||
55 | |||
56 | DT_MACHINE_START(BOCKW_DT, "bockw") | ||
57 | .init_early = r8a7778_init_delay, | ||
58 | .init_irq = r8a7778_init_irq_dt, | ||
59 | .init_machine = bockw_init, | ||
60 | .init_time = shmobile_timer_init, | ||
61 | .dt_compat = bockw_boards_compat_dt, | ||
62 | MACHINE_END | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index 9b561bf4229f..8d24f73d142f 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h | |||
@@ -30,6 +30,7 @@ extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata); | |||
30 | extern void r8a7778_add_i2c_device(int id); | 30 | extern void r8a7778_add_i2c_device(int id); |
31 | extern void r8a7778_add_hspi_device(int id); | 31 | extern void r8a7778_add_hspi_device(int id); |
32 | extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info); | 32 | extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info); |
33 | extern void r8a7778_add_dt_devices(void); | ||
33 | 34 | ||
34 | extern void r8a7778_init_late(void); | 35 | extern void r8a7778_init_late(void); |
35 | extern void r8a7778_init_delay(void); | 36 | extern void r8a7778_init_delay(void); |
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index a3a2e37b03f3..9d4b6bf4245e 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c | |||
@@ -333,7 +333,7 @@ void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info) | |||
333 | info, sizeof(*info)); | 333 | info, sizeof(*info)); |
334 | } | 334 | } |
335 | 335 | ||
336 | void __init r8a7778_add_standard_devices(void) | 336 | void __init r8a7778_add_dt_devices(void) |
337 | { | 337 | { |
338 | int i; | 338 | int i; |
339 | 339 | ||
@@ -357,6 +357,11 @@ void __init r8a7778_add_standard_devices(void) | |||
357 | r8a7778_register_tmu(1); | 357 | r8a7778_register_tmu(1); |
358 | } | 358 | } |
359 | 359 | ||
360 | void __init r8a7778_add_standard_devices(void) | ||
361 | { | ||
362 | r8a7778_add_dt_devices(); | ||
363 | } | ||
364 | |||
360 | void __init r8a7778_init_late(void) | 365 | void __init r8a7778_init_late(void) |
361 | { | 366 | { |
362 | phy = usb_get_phy(USB_PHY_TYPE_USB2); | 367 | phy = usb_get_phy(USB_PHY_TYPE_USB2); |