ARM: sunxi: Add basic support for Allwinner A1x SoCs
[deliverable/linux.git] / arch / arm / mach-sunxi / sunxi.c
CommitLineData
3b52634f
MR
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
29static 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
38void __init sunxi_map_io(void)
39{
40 iotable_init(sunxi_io_desc, ARRAY_SIZE(sunxi_io_desc));
41}
42
43static void __init sunxi_dt_init(void)
44{
45 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
46}
47
48static const char * const sunxi_board_dt_compat[] = {
49 "allwinner,sun5i",
50 NULL,
51};
52
53DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
54 .init_machine = sunxi_dt_init,
55 .map_io = sunxi_map_io,
56 .init_irq = sunxi_init_irq,
57 .handle_irq = sunxi_handle_irq,
58 .timer = &sunxi_timer,
59 .dt_compat = sunxi_board_dt_compat,
60MACHINE_END
This page took 0.041329 seconds and 5 git commands to generate.