4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
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/kernel.h>
22 #include <linux/init.h>
23 #include <linux/interrupt.h>
24 #include <linux/irq.h>
25 #include <linux/platform_device.h>
26 #include <linux/delay.h>
28 #include <linux/dma-mapping.h>
29 #include <mach/hardware.h>
30 #include <mach/r8a7779.h>
31 #include <mach/common.h>
32 #include <asm/mach-types.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/time.h>
36 #include <asm/hardware/gic.h>
37 #include <asm/traps.h>
39 static struct platform_device *marzen_devices[] __initdata = {
42 static struct map_desc marzen_io_desc[] __initdata = {
43 /* 2M entity map for 0xf0000000 (MPCORE) */
45 .virtual = 0xf0000000,
46 .pfn = __phys_to_pfn(0xf0000000),
48 .type = MT_DEVICE_NONSHARED
50 /* 16M entity map for 0xfexxxxxx (DMAC-S/HPBREG/INTC2/LRAM/DBSC) */
52 .virtual = 0xfe000000,
53 .pfn = __phys_to_pfn(0xfe000000),
55 .type = MT_DEVICE_NONSHARED
59 static void __init marzen_map_io(void)
61 iotable_init(marzen_io_desc, ARRAY_SIZE(marzen_io_desc));
64 static void __init marzen_init_early(void)
66 r8a7779_add_early_devices();
68 /* Early serial console setup is not included here due to
69 * memory map collisions. The SCIF serial ports in r8a7779
70 * are difficult to entity map 1:1 due to collision with the
71 * virtual memory range used by the coherent DMA code on ARM.
73 * Anyone wanting to debug early can remove UPF_IOREMAP from
74 * the sh-sci serial console platform data, adjust mapbase
75 * to a static M:N virt:phys mapping that needs to be added to
76 * the mappings passed with iotable_init() above.
78 * Then add a call to shmobile_setup_console() from this function.
80 * As a final step pass earlyprint=sh-sci.2,115200 on the kernel
85 static void __init marzen_init(void)
87 r8a7779_add_standard_devices();
88 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
91 static void __init marzen_timer_init(void)
94 shmobile_timer.init();
98 struct sys_timer marzen_timer = {
99 .init = marzen_timer_init,
102 MACHINE_START(MARZEN, "marzen")
103 .map_io = marzen_map_io,
104 .init_early = marzen_init_early,
105 .nr_irqs = NR_IRQS_LEGACY,
106 .init_irq = r8a7779_init_irq,
107 .handle_irq = shmobile_handle_irq_gic,
108 .init_machine = marzen_init,
109 .timer = &marzen_timer,