aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2013-01-28 21:40:18 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-03-18 08:27:02 -0400
commit73d6a69e3b3ae168fcb8d797e427c1b5fe132a40 (patch)
tree5392a4af0462f3c25cb0ed0da54636dd8e4c054b
parentb3425eb9df0a57f0b4ce0ad66831028f6ffe1615 (diff)
ARM: shmobile: marzen: Reference DT implementation
Provide alternate board code for the marzen to demonstrate how DT may be used given the current state of driver device tree support. This is intended to act as a reference for mach-shmobile developers. Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/r8a7779-marzen-reference.dts47
-rw-r--r--arch/arm/mach-shmobile/Kconfig13
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/board-marzen-reference.c75
5 files changed, 137 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c6255884cbb..7965b9ad99d9 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -136,6 +136,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
136 ccu9540.dtb 136 ccu9540.dtb
137dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ 137dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
138 r8a7740-armadillo800eva.dtb \ 138 r8a7740-armadillo800eva.dtb \
139 r8a7779-marzen-reference.dtb \
139 sh73a0-kzm9g.dtb \ 140 sh73a0-kzm9g.dtb \
140 sh7372-mackerel.dtb 141 sh7372-mackerel.dtb
141dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \ 142dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
new file mode 100644
index 000000000000..72be4c87cfb5
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
@@ -0,0 +1,47 @@
1/*
2 * Reference Device Tree Source for the Marzen board
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Simon Horman
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/dts-v1/;
13/include/ "r8a7779.dtsi"
14
15/ {
16 model = "marzen";
17 compatible = "renesas,marzen-reference", "renesas,r8a7779";
18
19 chosen {
20 bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on";
21 };
22
23 memory {
24 device_type = "memory";
25 reg = <0x60000000 0x40000000>;
26 };
27
28 fixedregulator3v3: fixedregulator@0 {
29 compatible = "regulator-fixed";
30 regulator-name = "fixed-3.3V";
31 regulator-min-microvolt = <3300000>;
32 regulator-max-microvolt = <3300000>;
33 regulator-boot-on;
34 regulator-always-on;
35 };
36
37 lan0@18000000 {
38 compatible = "smsc,lan9220", "smsc,lan9115";
39 reg = <0x18000000 0x100>;
40 phy-mode = "mii";
41 interrupt-parent = <&gic>;
42 interrupts = <0 28 0x4>;
43 reg-io-width = <4>;
44 vddvario-supply = <&fixedregulator3v3>;
45 vdd33a-supply = <&fixedregulator3v3>;
46 };
47};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 9255546e7bf6..b15d4ffcd9a2 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -102,6 +102,19 @@ config MACH_MARZEN
102 select ARCH_REQUIRE_GPIOLIB 102 select ARCH_REQUIRE_GPIOLIB
103 select REGULATOR_FIXED_VOLTAGE if REGULATOR 103 select REGULATOR_FIXED_VOLTAGE if REGULATOR
104 104
105config MACH_MARZEN_REFERENCE
106 bool "MARZEN board - Reference Device Tree Implementation"
107 depends on ARCH_R8A7779
108 select ARCH_REQUIRE_GPIOLIB
109 select REGULATOR_FIXED_VOLTAGE if REGULATOR
110 select USE_OF
111 ---help---
112 Use reference implementation of Marzen board support
113 which makes use of device tree at the expense
114 of not supporting a number of devices.
115
116 This is intended to aid developers
117
105config MACH_KZM9D 118config MACH_KZM9D
106 bool "KZM9D board" 119 bool "KZM9D board"
107 depends on ARCH_EMEV2 120 depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index b646ff4d742a..3705d4f7096b 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
38obj-$(CONFIG_MACH_KOTA2) += board-kota2.o 38obj-$(CONFIG_MACH_KOTA2) += board-kota2.o
39obj-$(CONFIG_MACH_BONITO) += board-bonito.o 39obj-$(CONFIG_MACH_BONITO) += board-bonito.o
40obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 40obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
41obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
41obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o 42obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
42obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o 43obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
43obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o 44obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
new file mode 100644
index 000000000000..480d882e42c7
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -0,0 +1,75 @@
1/*
2 * marzen board support - Reference DT implementation
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 * Copyright (C) 2013 Simon Horman
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include <linux/pinctrl/machine.h>
23#include <mach/r8a7779.h>
24#include <mach/common.h>
25#include <mach/irqs.h>
26#include <asm/irq.h>
27#include <asm/mach/arch.h>
28
29static const struct pinctrl_map marzen_pinctrl_map[] = {
30 /* SCIF2 (CN18: DEBUG0) */
31 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779",
32 "scif2_data_c", "scif2"),
33 /* SCIF4 (CN19: DEBUG1) */
34 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779",
35 "scif4_data", "scif4"),
36 /* SDHI0 */
37 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
38 "sdhi0_data4", "sdhi0"),
39 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
40 "sdhi0_ctrl", "sdhi0"),
41 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
42 "sdhi0_cd", "sdhi0"),
43 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
44 "sdhi0_wp", "sdhi0"),
45 /* SMSC */
46 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
47 "intc_irq1_b", "intc"),
48 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
49 "lbsc_ex_cs0", "lbsc"),
50};
51
52static void __init marzen_init(void)
53{
54 pinctrl_register_mappings(marzen_pinctrl_map,
55 ARRAY_SIZE(marzen_pinctrl_map));
56 r8a7779_pinmux_init();
57
58 r8a7779_add_standard_devices_dt();
59}
60
61static const char *marzen_boards_compat_dt[] __initdata = {
62 "renesas,marzen-reference",
63 NULL,
64};
65
66DT_MACHINE_START(MARZEN, "marzen")
67 .smp = smp_ops(r8a7779_smp_ops),
68 .map_io = r8a7779_map_io,
69 .init_early = r8a7779_init_delay,
70 .nr_irqs = NR_IRQS_LEGACY,
71 .init_irq = r8a7779_init_irq_dt,
72 .init_machine = marzen_init,
73 .init_time = shmobile_timer_init,
74 .dt_compat = marzen_boards_compat_dt,
75MACHINE_END