13d4d96cbc85dacefc5db283594e16fc613e0ec8
[deliverable/linux.git] / arch / arm / mach-sunxi / sunxi.c
1 /*
2 * Device Tree support for Allwinner A1X SoCs
3 *
4 * Copyright (C) 2012 Maxime Ripard
5 *
6 * Maxime Ripard <maxime.ripard@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/of_irq.h>
16 #include <linux/of_platform.h>
17 #include <linux/io.h>
18 #include <linux/sunxi_timer.h>
19
20 #include <linux/irqchip/sunxi.h>
21
22 #include <asm/hardware/vic.h>
23
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26
27 #include "sunxi.h"
28
29 static struct map_desc sunxi_io_desc[] __initdata = {
30 {
31 .virtual = (unsigned long) SUNXI_REGS_VIRT_BASE,
32 .pfn = __phys_to_pfn(SUNXI_REGS_PHYS_BASE),
33 .length = SUNXI_REGS_SIZE,
34 .type = MT_DEVICE,
35 },
36 };
37
38 void __init sunxi_map_io(void)
39 {
40 iotable_init(sunxi_io_desc, ARRAY_SIZE(sunxi_io_desc));
41 }
42
43 static void __init sunxi_dt_init(void)
44 {
45 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
46 }
47
48 static const char * const sunxi_board_dt_compat[] = {
49 "allwinner,sun4i",
50 "allwinner,sun5i",
51 NULL,
52 };
53
54 DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
55 .init_machine = sunxi_dt_init,
56 .map_io = sunxi_map_io,
57 .init_irq = sunxi_init_irq,
58 .handle_irq = sunxi_handle_irq,
59 .timer = &sunxi_timer,
60 .dt_compat = sunxi_board_dt_compat,
61 MACHINE_END
This page took 0.031495 seconds and 4 git commands to generate.