diff options
-rw-r--r-- | Documentation/devicetree/bindings/arm/axxia.txt | 12 | ||||
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-axxia/Kconfig | 16 | ||||
-rw-r--r-- | arch/arm/mach-axxia/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-axxia/axxia.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-axxia/platsmp.c | 89 | ||||
-rw-r--r-- | include/dt-bindings/clock/lsi,axm5516-clks.h | 36 |
8 files changed, 187 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/arm/axxia.txt b/Documentation/devicetree/bindings/arm/axxia.txt new file mode 100644 index 000000000000..7b4ef9c07696 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/axxia.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | Axxia AXM55xx device tree bindings | ||
2 | |||
3 | Boards using the AXM55xx SoC need to have the following properties: | ||
4 | |||
5 | Required root node property: | ||
6 | |||
7 | - compatible = "lsi,axm5516" | ||
8 | |||
9 | Boards: | ||
10 | |||
11 | LSI AXM5516 Validation board (Amarillo) | ||
12 | compatible = "lsi,axm5516-amarillo", "lsi,axm5516" | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ab438cb5af55..1f8651a3a16e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -950,6 +950,8 @@ source "arch/arm/mach-mvebu/Kconfig" | |||
950 | 950 | ||
951 | source "arch/arm/mach-at91/Kconfig" | 951 | source "arch/arm/mach-at91/Kconfig" |
952 | 952 | ||
953 | source "arch/arm/mach-axxia/Kconfig" | ||
954 | |||
953 | source "arch/arm/mach-bcm/Kconfig" | 955 | source "arch/arm/mach-bcm/Kconfig" |
954 | 956 | ||
955 | source "arch/arm/mach-berlin/Kconfig" | 957 | source "arch/arm/mach-berlin/Kconfig" |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 41c1931f0155..6721fab13734 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -138,10 +138,12 @@ endif | |||
138 | textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000 | 138 | textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000 |
139 | textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 | 139 | textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 |
140 | textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 | 140 | textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 |
141 | textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 | ||
141 | 142 | ||
142 | # Machine directory name. This list is sorted alphanumerically | 143 | # Machine directory name. This list is sorted alphanumerically |
143 | # by CONFIG_* macro name. | 144 | # by CONFIG_* macro name. |
144 | machine-$(CONFIG_ARCH_AT91) += at91 | 145 | machine-$(CONFIG_ARCH_AT91) += at91 |
146 | machine-$(CONFIG_ARCH_AXXIA) += axxia | ||
145 | machine-$(CONFIG_ARCH_BCM) += bcm | 147 | machine-$(CONFIG_ARCH_BCM) += bcm |
146 | machine-$(CONFIG_ARCH_BERLIN) += berlin | 148 | machine-$(CONFIG_ARCH_BERLIN) += berlin |
147 | machine-$(CONFIG_ARCH_CLPS711X) += clps711x | 149 | machine-$(CONFIG_ARCH_CLPS711X) += clps711x |
diff --git a/arch/arm/mach-axxia/Kconfig b/arch/arm/mach-axxia/Kconfig new file mode 100644 index 000000000000..8be7e0ae1922 --- /dev/null +++ b/arch/arm/mach-axxia/Kconfig | |||
@@ -0,0 +1,16 @@ | |||
1 | config ARCH_AXXIA | ||
2 | bool "LSI Axxia platforms" if (ARCH_MULTI_V7 && ARM_LPAE) | ||
3 | select ARCH_DMA_ADDR_T_64BIT | ||
4 | select ARM_AMBA | ||
5 | select ARM_GIC | ||
6 | select ARM_TIMER_SP804 | ||
7 | select HAVE_ARM_ARCH_TIMER | ||
8 | select MFD_SYSCON | ||
9 | select MIGHT_HAVE_PCI | ||
10 | select PCI_DOMAINS if PCI | ||
11 | select ZONE_DMA | ||
12 | help | ||
13 | This enables support for the LSI Axxia devices. | ||
14 | |||
15 | The LSI Axxia platforms require a Flattened Device Tree to be passed | ||
16 | to the kernel. | ||
diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile new file mode 100644 index 000000000000..ec4f68b460c6 --- /dev/null +++ b/arch/arm/mach-axxia/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-y += axxia.o | ||
2 | obj-$(CONFIG_SMP) += platsmp.o | ||
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c new file mode 100644 index 000000000000..19e5a1d95397 --- /dev/null +++ b/arch/arm/mach-axxia/axxia.c | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Support for the LSI Axxia SoC devices based on ARM cores. | ||
3 | * | ||
4 | * Copyright (C) 2012 LSI | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
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. | ||
15 | */ | ||
16 | #include <linux/init.h> | ||
17 | #include <asm/mach/arch.h> | ||
18 | |||
19 | static const char *axxia_dt_match[] __initconst = { | ||
20 | "lsi,axm5516", | ||
21 | "lsi,axm5516-sim", | ||
22 | "lsi,axm5516-emu", | ||
23 | NULL | ||
24 | }; | ||
25 | |||
26 | DT_MACHINE_START(AXXIA_DT, "LSI Axxia AXM55XX") | ||
27 | .dt_compat = axxia_dt_match, | ||
28 | MACHINE_END | ||
diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c new file mode 100644 index 000000000000..959d4df3d2b6 --- /dev/null +++ b/arch/arm/mach-axxia/platsmp.c | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-axxia/platsmp.c | ||
3 | * | ||
4 | * Copyright (C) 2012 LSI Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/io.h> | ||
13 | #include <linux/smp.h> | ||
14 | #include <linux/of.h> | ||
15 | #include <linux/of_address.h> | ||
16 | #include <asm/cacheflush.h> | ||
17 | |||
18 | /* Syscon register offsets for releasing cores from reset */ | ||
19 | #define SC_CRIT_WRITE_KEY 0x1000 | ||
20 | #define SC_RST_CPU_HOLD 0x1010 | ||
21 | |||
22 | /* | ||
23 | * Write the kernel entry point for secondary CPUs to the specified address | ||
24 | */ | ||
25 | static void write_release_addr(u32 release_phys) | ||
26 | { | ||
27 | u32 *virt = (u32 *) phys_to_virt(release_phys); | ||
28 | writel_relaxed(virt_to_phys(secondary_startup), virt); | ||
29 | /* Make sure this store is visible to other CPUs */ | ||
30 | smp_wmb(); | ||
31 | __cpuc_flush_dcache_area(virt, sizeof(u32)); | ||
32 | } | ||
33 | |||
34 | static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
35 | { | ||
36 | struct device_node *syscon_np; | ||
37 | void __iomem *syscon; | ||
38 | u32 tmp; | ||
39 | |||
40 | syscon_np = of_find_compatible_node(NULL, NULL, "lsi,axxia-syscon"); | ||
41 | if (!syscon_np) | ||
42 | return -ENOENT; | ||
43 | |||
44 | syscon = of_iomap(syscon_np, 0); | ||
45 | if (!syscon) | ||
46 | return -ENOMEM; | ||
47 | |||
48 | tmp = readl(syscon + SC_RST_CPU_HOLD); | ||
49 | writel(0xab, syscon + SC_CRIT_WRITE_KEY); | ||
50 | tmp &= ~(1 << cpu); | ||
51 | writel(tmp, syscon + SC_RST_CPU_HOLD); | ||
52 | |||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | static void __init axxia_smp_prepare_cpus(unsigned int max_cpus) | ||
57 | { | ||
58 | int cpu_count = 0; | ||
59 | int cpu; | ||
60 | |||
61 | /* | ||
62 | * Initialise the present map, which describes the set of CPUs actually | ||
63 | * populated at the present time. | ||
64 | */ | ||
65 | for_each_possible_cpu(cpu) { | ||
66 | struct device_node *np; | ||
67 | u32 release_phys; | ||
68 | |||
69 | np = of_get_cpu_node(cpu, NULL); | ||
70 | if (!np) | ||
71 | continue; | ||
72 | if (of_property_read_u32(np, "cpu-release-addr", &release_phys)) | ||
73 | continue; | ||
74 | |||
75 | if (cpu_count < max_cpus) { | ||
76 | set_cpu_present(cpu, true); | ||
77 | cpu_count++; | ||
78 | } | ||
79 | |||
80 | if (release_phys != 0) | ||
81 | write_release_addr(release_phys); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | static struct smp_operations axxia_smp_ops __initdata = { | ||
86 | .smp_prepare_cpus = axxia_smp_prepare_cpus, | ||
87 | .smp_boot_secondary = axxia_boot_secondary, | ||
88 | }; | ||
89 | CPU_METHOD_OF_DECLARE(axxia_smp, "lsi,syscon-release", &axxia_smp_ops); | ||
diff --git a/include/dt-bindings/clock/lsi,axm5516-clks.h b/include/dt-bindings/clock/lsi,axm5516-clks.h new file mode 100644 index 000000000000..beb41ace5dd6 --- /dev/null +++ b/include/dt-bindings/clock/lsi,axm5516-clks.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 LSI Corporation | ||
3 | * | ||
4 | * This software is licensed under the terms of the GNU General Public | ||
5 | * License version 2, as published by the Free Software Foundation, and | ||
6 | * may be copied, distributed, and modified under those terms. | ||
7 | */ | ||
8 | |||
9 | #ifndef _DT_BINDINGS_CLK_AXM5516_H | ||
10 | #define _DT_BINDINGS_CLK_AXM5516_H | ||
11 | |||
12 | #define AXXIA_CLK_FAB_PLL 0 | ||
13 | #define AXXIA_CLK_CPU_PLL 1 | ||
14 | #define AXXIA_CLK_SYS_PLL 2 | ||
15 | #define AXXIA_CLK_SM0_PLL 3 | ||
16 | #define AXXIA_CLK_SM1_PLL 4 | ||
17 | #define AXXIA_CLK_FAB_DIV 5 | ||
18 | #define AXXIA_CLK_SYS_DIV 6 | ||
19 | #define AXXIA_CLK_NRCP_DIV 7 | ||
20 | #define AXXIA_CLK_CPU0_DIV 8 | ||
21 | #define AXXIA_CLK_CPU1_DIV 9 | ||
22 | #define AXXIA_CLK_CPU2_DIV 10 | ||
23 | #define AXXIA_CLK_CPU3_DIV 11 | ||
24 | #define AXXIA_CLK_PER_DIV 12 | ||
25 | #define AXXIA_CLK_MMC_DIV 13 | ||
26 | #define AXXIA_CLK_FAB 14 | ||
27 | #define AXXIA_CLK_SYS 15 | ||
28 | #define AXXIA_CLK_NRCP 16 | ||
29 | #define AXXIA_CLK_CPU0 17 | ||
30 | #define AXXIA_CLK_CPU1 18 | ||
31 | #define AXXIA_CLK_CPU2 19 | ||
32 | #define AXXIA_CLK_CPU3 20 | ||
33 | #define AXXIA_CLK_PER 21 | ||
34 | #define AXXIA_CLK_MMC 22 | ||
35 | |||
36 | #endif | ||