4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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.
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.
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
21 #include <linux/of_platform.h>
22 #include <mach/common.h>
23 #include <mach/r8a7778.h>
24 #include <asm/mach/arch.h>
27 * see board-bock.c for checking detail of dip-switch
30 static const struct pinctrl_map bockw_pinctrl_map[] = {
32 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
33 "scif0_data_a", "scif0"),
34 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
35 "scif0_ctrl", "scif0"),
38 #define FPGA 0x18200000
40 #define COMCTLR 0x101c
42 #define PFC 0xfffc0000
44 static void __init bockw_init(void)
50 r8a7778_init_irq_extpin_dt(1);
52 pinctrl_register_mappings(bockw_pinctrl_map,
53 ARRAY_SIZE(bockw_pinctrl_map));
54 r8a7778_pinmux_init();
55 r8a7778_add_dt_devices();
57 fpga = ioremap_nocache(FPGA, SZ_1M);
62 * IRQ0/1 is cascaded interrupt from FPGA.
63 * it should be cared in the future
64 * Now, it is assuming IRQ0 was used only from SMSC.
66 u16 val = ioread16(fpga + IRQ0MR);
67 val &= ~(1 << 4); /* enable SMSC911x */
68 iowrite16(val, fpga + IRQ0MR);
73 pfc = ioremap_nocache(PFC, 0x200);
78 * SDHI CD/WP pin needs pull-up
80 iowrite32(ioread32(pfc + PUPR4) | (3 << 26), pfc + PUPR4);
84 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
87 static const char *bockw_boards_compat_dt[] __initdata = {
88 "renesas,bockw-reference",
92 DT_MACHINE_START(BOCKW_DT, "bockw")
93 .init_early = r8a7778_init_delay,
94 .init_irq = r8a7778_init_irq_dt,
95 .init_machine = bockw_init,
96 .dt_compat = bockw_boards_compat_dt,