diff options
Diffstat (limited to 'arch/arm/mach-sunxi')
-rw-r--r-- | arch/arm/mach-sunxi/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/mach-sunxi/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-sunxi/Makefile.boot | 1 | ||||
-rw-r--r-- | arch/arm/mach-sunxi/sunxi.c | 60 | ||||
-rw-r--r-- | arch/arm/mach-sunxi/sunxi.h | 20 |
5 files changed, 91 insertions, 0 deletions
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig new file mode 100644 index 000000000000..3fdd0085e306 --- /dev/null +++ b/arch/arm/mach-sunxi/Kconfig | |||
@@ -0,0 +1,9 @@ | |||
1 | config ARCH_SUNXI | ||
2 | bool "Allwinner A1X SOCs" if ARCH_MULTI_V7 | ||
3 | select CLKSRC_MMIO | ||
4 | select COMMON_CLK | ||
5 | select GENERIC_CLOCKEVENTS | ||
6 | select GENERIC_IRQ_CHIP | ||
7 | select PINCTRL | ||
8 | select SPARSE_IRQ | ||
9 | select SUNXI_TIMER | ||
diff --git a/arch/arm/mach-sunxi/Makefile b/arch/arm/mach-sunxi/Makefile new file mode 100644 index 000000000000..93bebfc3ff9f --- /dev/null +++ b/arch/arm/mach-sunxi/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-$(CONFIG_ARCH_SUNXI) += sunxi.o | |||
diff --git a/arch/arm/mach-sunxi/Makefile.boot b/arch/arm/mach-sunxi/Makefile.boot new file mode 100644 index 000000000000..46d4cf0841c0 --- /dev/null +++ b/arch/arm/mach-sunxi/Makefile.boot | |||
@@ -0,0 +1 @@ | |||
zreladdr-$(CONFIG_ARCH_SUNXI) += 0x40008000 | |||
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c new file mode 100644 index 000000000000..8f42df8af1da --- /dev/null +++ b/arch/arm/mach-sunxi/sunxi.c | |||
@@ -0,0 +1,60 @@ | |||
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,sun5i", | ||
50 | NULL, | ||
51 | }; | ||
52 | |||
53 | DT_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, | ||
60 | MACHINE_END | ||
diff --git a/arch/arm/mach-sunxi/sunxi.h b/arch/arm/mach-sunxi/sunxi.h new file mode 100644 index 000000000000..33b58712adea --- /dev/null +++ b/arch/arm/mach-sunxi/sunxi.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Generic definitions for Allwinner SunXi 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 | #ifndef __MACH_SUNXI_H | ||
14 | #define __MACH_SUNXI_H | ||
15 | |||
16 | #define SUNXI_REGS_PHYS_BASE 0x01c00000 | ||
17 | #define SUNXI_REGS_VIRT_BASE IOMEM(0xf1c00000) | ||
18 | #define SUNXI_REGS_SIZE (SZ_2M + SZ_1M) | ||
19 | |||
20 | #endif /* __MACH_SUNXI_H */ | ||