ARM: shmobile: kzm9g: Reference DT implementation
[linux-2.6.git] / arch / arm / mach-shmobile / board-kzm9g-reference.c
blobcaba1bb62f84f9947f6bb54147726b024353a4c3
1 /*
2 * KZM-A9-GT board support - Reference Device Tree Implementation
4 * Copyright (C) 2012 Horms Solutions Ltd.
6 * Based on board-kzm9g.c
7 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <linux/delay.h>
24 #include <linux/gpio.h>
25 #include <linux/io.h>
26 #include <linux/irq.h>
27 #include <linux/irqchip.h>
28 #include <linux/input.h>
29 #include <linux/of_platform.h>
30 #include <linux/pinctrl/machine.h>
31 #include <mach/sh73a0.h>
32 #include <mach/common.h>
33 #include <asm/hardware/cache-l2x0.h>
34 #include <asm/mach-types.h>
35 #include <asm/mach/arch.h>
37 static const struct pinctrl_map kzm_pinctrl_map[] = {
38 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
39 "i2c3_1", "i2c3"),
40 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
41 "scifa4_data", "scifa4"),
42 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
43 "scifa4_ctrl", "scifa4"),
46 static void __init kzm_init(void)
48 sh73a0_add_standard_devices_dt();
49 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
51 #ifdef CONFIG_CACHE_L2X0
52 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
53 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
54 #endif
57 static void kzm9g_restart(char mode, const char *cmd)
59 #define RESCNT2 IOMEM(0xe6188020)
60 /* Do soft power on reset */
61 writel((1 << 31), RESCNT2);
64 static const char *kzm9g_boards_compat_dt[] __initdata = {
65 "renesas,kzm9g-reference",
66 NULL,
69 /* Please note that the clock initialisation shcheme used in
70 * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
71 * does not work with SMP as there is a yet to be resolved lock-up in
72 * workqueue initialisation.
74 * CONFIG_SMP should be disabled when using this code.
76 DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
77 .smp = smp_ops(sh73a0_smp_ops),
78 .map_io = sh73a0_map_io,
79 .init_early = sh73a0_init_delay,
80 .nr_irqs = NR_IRQS_LEGACY,
81 .init_irq = irqchip_init,
82 .init_machine = kzm_init,
83 .init_late = shmobile_init_late,
84 .init_time = shmobile_timer_init,
85 .restart = kzm9g_restart,
86 .dt_compat = kzm9g_boards_compat_dt,
87 MACHINE_END