aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2012-11-08 06:40:16 -0500
committerMaxime Ripard <maxime.ripard@free-electrons.com>2012-11-16 15:56:51 -0500
commit3b52634f0b7adaaf2b29569025287b938b7c71a6 (patch)
tree1388d7153ffbe0848496ee9dd21859c39b4b47b9 /arch/arm
parentafd24e146826cec0f46929263a0c874406a19cd8 (diff)
ARM: sunxi: Add basic support for Allwinner A1x SoCs
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/mach-sunxi/Kconfig9
-rw-r--r--arch/arm/mach-sunxi/Makefile1
-rw-r--r--arch/arm/mach-sunxi/Makefile.boot1
-rw-r--r--arch/arm/mach-sunxi/sunxi.c60
-rw-r--r--arch/arm/mach-sunxi/sunxi.h20
7 files changed, 94 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ade7e924bef5..1abb573fef86 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1113,6 +1113,8 @@ source "arch/arm/mach-exynos/Kconfig"
1113 1113
1114source "arch/arm/mach-shmobile/Kconfig" 1114source "arch/arm/mach-shmobile/Kconfig"
1115 1115
1116source "arch/arm/mach-sunxi/Kconfig"
1117
1116source "arch/arm/mach-prima2/Kconfig" 1118source "arch/arm/mach-prima2/Kconfig"
1117 1119
1118source "arch/arm/mach-tegra/Kconfig" 1120source "arch/arm/mach-tegra/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 5f914fca911b..363320ac9057 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -193,6 +193,7 @@ machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx
193machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx 193machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx
194machine-$(CONFIG_MACH_SPEAR600) += spear6xx 194machine-$(CONFIG_MACH_SPEAR600) += spear6xx
195machine-$(CONFIG_ARCH_ZYNQ) += zynq 195machine-$(CONFIG_ARCH_ZYNQ) += zynq
196machine-$(CONFIG_ARCH_SUNXI) += sunxi
196 197
197# Platform directory name. This list is sorted alphanumerically 198# Platform directory name. This list is sorted alphanumerically
198# by CONFIG_* macro name. 199# by CONFIG_* macro name.
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 @@
1config 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
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
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 */