ARM: shmobile: bockw: add DT reference
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 24 Jul 2013 07:36:51 +0000 (00:36 -0700)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 26 Jul 2013 00:17:32 +0000 (09:17 +0900)
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>
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/r8a7778-bockw-reference.dts [new file with mode: 0644]
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/Makefile.boot
arch/arm/mach-shmobile/board-bockw-reference.c [new file with mode: 0644]
arch/arm/mach-shmobile/include/mach/r8a7778.h
arch/arm/mach-shmobile/setup-r8a7778.c

index 492a8077396a8ef7b1e3aae2c8c7f69b7382e338..e01d63f7bd95cb32ca137dc0fdf08888048b3f0b 100644 (file)
@@ -186,6 +186,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
        emev2-kzm9d-reference.dtb \
        r8a7740-armadillo800eva.dtb \
        r8a7778-bockw.dtb \
+       r8a7778-bockw-reference.dtb \
        r8a7740-armadillo800eva-reference.dtb \
        r8a7779-marzen-reference.dtb \
        r8a7790-lager.dtb \
diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
new file mode 100644 (file)
index 0000000..f5b8d77
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Reference Device Tree Source for the Bock-W board
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * based on r8a7779
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r8a7778.dtsi"
+
+/ {
+       model = "bockw";
+       compatible = "renesas,bockw-reference", "renesas,r8a7778";
+
+       chosen {
+               bootargs = "console=ttySC0,115200 ignore_loglevel";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x60000000 0x10000000>;
+       };
+};
index 05ea10310a8eacf216a19a05a28d08aa77d56c7e..9e07985866b73b7dc0f987016e8367203ce27237 100644 (file)
@@ -137,6 +137,20 @@ config MACH_BOCKW
        select RENESAS_INTC_IRQPIN
        select USE_OF
 
+config MACH_BOCKW_REFERENCE
+       bool "BOCK-W  - Reference Device Tree Implementation"
+       depends on ARCH_R8A7778
+       select ARCH_REQUIRE_GPIOLIB
+       select RENESAS_INTC_IRQPIN
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select USE_OF
+       ---help---
+          Use reference implementation of BockW board support
+          which makes use of device tree at the expense
+          of not supporting a number of devices.
+
+          This is intended to aid developers
+
 config MACH_MARZEN
        bool "MARZEN board"
        depends on ARCH_R8A7779
index 397bb36065e0c3185f0301ef409b9880651eb358..e401c737fb4ddd3b290c6dafa369778b8eb2fb87 100644 (file)
@@ -41,6 +41,7 @@ obj-$(CONFIG_MACH_APE6EVM_REFERENCE)  += board-ape6evm-reference.o
 obj-$(CONFIG_MACH_MACKEREL)    += board-mackerel.o
 obj-$(CONFIG_MACH_KOTA2)       += board-kota2.o
 obj-$(CONFIG_MACH_BOCKW)       += board-bockw.o
+obj-$(CONFIG_MACH_BOCKW_REFERENCE)     += board-bockw-reference.o
 obj-$(CONFIG_MACH_MARZEN)      += board-marzen.o
 obj-$(CONFIG_MACH_MARZEN_REFERENCE)    += board-marzen-reference.o
 obj-$(CONFIG_MACH_LAGER)       += board-lager.o
index 761d7b14bd206df56e838a38ac8107c8015b7df6..9c9b4412c60b3bcc8ace5a26ab3bc4fb5c5e57b1 100644 (file)
@@ -6,6 +6,7 @@ loadaddr-$(CONFIG_MACH_APE6EVM_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_ARMADILLO800EVA) += 0x40008000
 loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
+loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
 loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000
 loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
 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 (file)
index 0000000..24db8de
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Bock-W board support
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/of_platform.h>
+#include <linux/pinctrl/machine.h>
+#include <mach/common.h>
+#include <mach/r8a7778.h>
+#include <asm/mach/arch.h>
+
+/*
+ *     see board-bock.c for checking detail of dip-switch
+ */
+
+static const struct pinctrl_map bockw_pinctrl_map[] = {
+       /* SCIF0 */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
+                                 "scif0_data_a", "scif0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
+                                 "scif0_ctrl", "scif0"),
+};
+
+static void __init bockw_init(void)
+{
+       r8a7778_clock_init();
+
+       pinctrl_register_mappings(bockw_pinctrl_map,
+                                 ARRAY_SIZE(bockw_pinctrl_map));
+       r8a7778_pinmux_init();
+       r8a7778_add_dt_devices();
+
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *bockw_boards_compat_dt[] __initdata = {
+       "renesas,bockw-reference",
+       NULL,
+};
+
+DT_MACHINE_START(BOCKW_DT, "bockw")
+       .init_early     = r8a7778_init_delay,
+       .init_irq       = r8a7778_init_irq_dt,
+       .init_machine   = bockw_init,
+       .init_time      = shmobile_timer_init,
+       .dt_compat      = bockw_boards_compat_dt,
+MACHINE_END
index 9b561bf4229f95ef8ef07513a7ab4edd39f8bfd2..8d24f73d142fff11a9f1aebd2a22b16aacebdb74 100644 (file)
@@ -30,6 +30,7 @@ extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
 extern void r8a7778_add_i2c_device(int id);
 extern void r8a7778_add_hspi_device(int id);
 extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
+extern void r8a7778_add_dt_devices(void);
 
 extern void r8a7778_init_late(void);
 extern void r8a7778_init_delay(void);
index a3a2e37b03f3a20969e8e209c87fc9b1170f9487..9d4b6bf4245eeb6f261b7e5987c66d29308b4cb7 100644 (file)
@@ -333,7 +333,7 @@ void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info)
                info, sizeof(*info));
 }
 
-void __init r8a7778_add_standard_devices(void)
+void __init r8a7778_add_dt_devices(void)
 {
        int i;
 
@@ -357,6 +357,11 @@ void __init r8a7778_add_standard_devices(void)
        r8a7778_register_tmu(1);
 }
 
+void __init r8a7778_add_standard_devices(void)
+{
+       r8a7778_add_dt_devices();
+}
+
 void __init r8a7778_init_late(void)
 {
        phy = usb_get_phy(USB_PHY_TYPE_USB2);
This page took 0.042546 seconds and 5 git commands to generate.