blob: add537c51b458b21abc709f9dae04d5ca48a469e [file] [log] [blame]
Simon Hormanb8b82b22012-11-22 00:34:25 +09001/*
2 * KZM-A9-GT board support - Reference Device Tree Implementation
3 *
4 * Copyright (C) 2012 Horms Solutions Ltd.
5 *
6 * Based on board-kzm9g.c
7 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
8 *
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.
12 *
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.
17 *
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
21 */
22
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>
36
37static 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"),
44};
45
46static void __init kzm_init(void)
47{
48 sh73a0_add_standard_devices_dt();
49 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
Guennadi Liakhovetski275cc1d2013-02-08 19:38:31 +010050 sh73a0_pinmux_init();
Simon Hormanb8b82b22012-11-22 00:34:25 +090051
52#ifdef CONFIG_CACHE_L2X0
53 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
54 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
55#endif
56}
57
58static void kzm9g_restart(char mode, const char *cmd)
59{
60#define RESCNT2 IOMEM(0xe6188020)
61 /* Do soft power on reset */
62 writel((1 << 31), RESCNT2);
63}
64
65static const char *kzm9g_boards_compat_dt[] __initdata = {
66 "renesas,kzm9g-reference",
67 NULL,
68};
69
70/* Please note that the clock initialisation shcheme used in
71 * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
72 * does not work with SMP as there is a yet to be resolved lock-up in
73 * workqueue initialisation.
74 *
75 * CONFIG_SMP should be disabled when using this code.
76 */
77DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
78 .smp = smp_ops(sh73a0_smp_ops),
79 .map_io = sh73a0_map_io,
80 .init_early = sh73a0_init_delay,
81 .nr_irqs = NR_IRQS_LEGACY,
82 .init_irq = irqchip_init,
83 .init_machine = kzm_init,
84 .init_late = shmobile_init_late,
85 .init_time = shmobile_timer_init,
86 .restart = kzm9g_restart,
87 .dt_compat = kzm9g_boards_compat_dt,
88MACHINE_END