diff options
35 files changed, 834 insertions, 156 deletions
diff --git a/Documentation/arm/Marvell/README b/Documentation/arm/Marvell/README index 5a930c1528ad..963ec445e15a 100644 --- a/Documentation/arm/Marvell/README +++ b/Documentation/arm/Marvell/README | |||
@@ -83,14 +83,24 @@ EBU Armada family | |||
83 | 88F6710 | 83 | 88F6710 |
84 | 88F6707 | 84 | 88F6707 |
85 | 88F6W11 | 85 | 88F6W11 |
86 | Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf | ||
87 | |||
88 | Armada 375 Flavors: | ||
89 | 88F6720 | ||
90 | Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf | ||
91 | |||
92 | Armada 380/385 Flavors: | ||
93 | 88F6810 | ||
94 | 88F6820 | ||
95 | 88F6828 | ||
86 | 96 | ||
87 | Armada XP Flavors: | 97 | Armada XP Flavors: |
88 | MV78230 | 98 | MV78230 |
89 | MV78260 | 99 | MV78260 |
90 | MV78460 | 100 | MV78460 |
91 | NOTE: not to be confused with the non-SMP 78xx0 SoCs | 101 | NOTE: not to be confused with the non-SMP 78xx0 SoCs |
102 | Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf | ||
92 | 103 | ||
93 | Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf | ||
94 | No public datasheet available. | 104 | No public datasheet available. |
95 | 105 | ||
96 | Core: Sheeva ARMv7 compatible | 106 | Core: Sheeva ARMv7 compatible |
diff --git a/Documentation/devicetree/bindings/arm/armada-375.txt b/Documentation/devicetree/bindings/arm/armada-375.txt new file mode 100644 index 000000000000..867d0b80cb8f --- /dev/null +++ b/Documentation/devicetree/bindings/arm/armada-375.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | Marvell Armada 375 Platforms Device Tree Bindings | ||
2 | ------------------------------------------------- | ||
3 | |||
4 | Boards with a SoC of the Marvell Armada 375 family shall have the | ||
5 | following property: | ||
6 | |||
7 | Required root node property: | ||
8 | |||
9 | compatible: must contain "marvell,armada375" | ||
diff --git a/Documentation/devicetree/bindings/arm/armada-38x.txt b/Documentation/devicetree/bindings/arm/armada-38x.txt new file mode 100644 index 000000000000..11f2330a6554 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/armada-38x.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | Marvell Armada 38x Platforms Device Tree Bindings | ||
2 | ------------------------------------------------- | ||
3 | |||
4 | Boards with a SoC of the Marvell Armada 38x family shall have the | ||
5 | following property: | ||
6 | |||
7 | Required root node property: | ||
8 | |||
9 | - compatible: must contain either "marvell,armada380" or | ||
10 | "marvell,armada385" depending on the variant of the SoC being used. | ||
diff --git a/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt b/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt new file mode 100644 index 000000000000..0d244b999d10 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | * Marvell Feroceon Cache | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be either "marvell,feroceon-cache" or | ||
5 | "marvell,kirkwood-cache". | ||
6 | |||
7 | Optional properties: | ||
8 | - reg : Address of the L2 cache control register. Mandatory for | ||
9 | "marvell,kirkwood-cache", not used by "marvell,feroceon-cache" | ||
10 | |||
11 | |||
12 | Example: | ||
13 | l2: l2-cache@20128 { | ||
14 | compatible = "marvell,kirkwood-cache"; | ||
15 | reg = <0x20128 0x4>; | ||
16 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/mvebu-system-controller.txt b/Documentation/devicetree/bindings/arm/mvebu-system-controller.txt index 081c6a786c8a..d24ab2ebf8a7 100644 --- a/Documentation/devicetree/bindings/arm/mvebu-system-controller.txt +++ b/Documentation/devicetree/bindings/arm/mvebu-system-controller.txt | |||
@@ -1,12 +1,13 @@ | |||
1 | MVEBU System Controller | 1 | MVEBU System Controller |
2 | ----------------------- | 2 | ----------------------- |
3 | MVEBU (Marvell SOCs: Armada 370/XP, Dove, mv78xx0, Kirkwood, Orion5x) | 3 | MVEBU (Marvell SOCs: Armada 370/375/XP, Dove, mv78xx0, Kirkwood, Orion5x) |
4 | 4 | ||
5 | Required properties: | 5 | Required properties: |
6 | 6 | ||
7 | - compatible: one of: | 7 | - compatible: one of: |
8 | - "marvell,orion-system-controller" | 8 | - "marvell,orion-system-controller" |
9 | - "marvell,armada-370-xp-system-controller" | 9 | - "marvell,armada-370-xp-system-controller" |
10 | - "marvell,armada-375-system-controller" | ||
10 | - reg: Should contain system controller registers location and length. | 11 | - reg: Should contain system controller registers location and length. |
11 | 12 | ||
12 | Example: | 13 | Example: |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 224793cefa31..df9266d41b3b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -894,7 +894,7 @@ config ARCH_MULTI_V5 | |||
894 | bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" | 894 | bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" |
895 | depends on !ARCH_MULTI_V6_V7 | 895 | depends on !ARCH_MULTI_V6_V7 |
896 | select ARCH_MULTI_V4_V5 | 896 | select ARCH_MULTI_V4_V5 |
897 | select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \ | 897 | select CPU_ARM926T if !(CPU_ARM946E || CPU_ARM1020 || \ |
898 | CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ | 898 | CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ |
899 | CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) | 899 | CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) |
900 | 900 | ||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 489959dfe6d1..3d34936fb476 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -55,7 +55,7 @@ dtb-$(CONFIG_ARCH_BERLIN) += \ | |||
55 | berlin2cd-google-chromecast.dtb | 55 | berlin2cd-google-chromecast.dtb |
56 | dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \ | 56 | dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \ |
57 | da850-evm.dtb | 57 | da850-evm.dtb |
58 | dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \ | 58 | dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \ |
59 | dove-cubox.dtb \ | 59 | dove-cubox.dtb \ |
60 | dove-d2plug.dtb \ | 60 | dove-d2plug.dtb \ |
61 | dove-d3plug.dtb \ | 61 | dove-d3plug.dtb \ |
@@ -82,8 +82,8 @@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \ | |||
82 | ecx-2000.dtb | 82 | ecx-2000.dtb |
83 | dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ | 83 | dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ |
84 | integratorcp.dtb | 84 | integratorcp.dtb |
85 | dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb | 85 | kirkwood := \ |
86 | dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-b3.dtb \ | 86 | kirkwood-b3.dtb \ |
87 | kirkwood-cloudbox.dtb \ | 87 | kirkwood-cloudbox.dtb \ |
88 | kirkwood-db-88f6281.dtb \ | 88 | kirkwood-db-88f6281.dtb \ |
89 | kirkwood-db-88f6282.dtb \ | 89 | kirkwood-db-88f6282.dtb \ |
@@ -139,6 +139,9 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-b3.dtb \ | |||
139 | kirkwood-ts219-6282.dtb \ | 139 | kirkwood-ts219-6282.dtb \ |
140 | kirkwood-ts419-6281.dtb \ | 140 | kirkwood-ts419-6281.dtb \ |
141 | kirkwood-ts419-6282.dtb | 141 | kirkwood-ts419-6282.dtb |
142 | dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood) | ||
143 | dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood) | ||
144 | dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb | ||
142 | dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb | 145 | dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb |
143 | dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb | 146 | dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb |
144 | dtb-$(CONFIG_ARCH_MXC) += \ | 147 | dtb-$(CONFIG_ARCH_MXC) += \ |
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts index dc86429756d7..2cb0dc529165 100644 --- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts +++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | |||
@@ -122,4 +122,66 @@ | |||
122 | gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; | 122 | gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; |
123 | }; | 123 | }; |
124 | }; | 124 | }; |
125 | |||
126 | dsa@0 { | ||
127 | compatible = "marvell,dsa"; | ||
128 | #address-cells = <2>; | ||
129 | #size-cells = <0>; | ||
130 | |||
131 | dsa,ethernet = <ð0>; | ||
132 | dsa,mii-bus = <ðphy0>; | ||
133 | |||
134 | switch@0 { | ||
135 | #address-cells = <1>; | ||
136 | #size-cells = <0>; | ||
137 | reg = <0 0>; /* MDIO address 0, switch 0 in tree */ | ||
138 | |||
139 | port@0 { | ||
140 | reg = <0>; | ||
141 | label = "lan1"; | ||
142 | }; | ||
143 | |||
144 | port@1 { | ||
145 | reg = <1>; | ||
146 | label = "lan2"; | ||
147 | }; | ||
148 | |||
149 | port@2 { | ||
150 | reg = <2>; | ||
151 | label = "lan3"; | ||
152 | }; | ||
153 | |||
154 | port@3 { | ||
155 | reg = <3>; | ||
156 | label = "lan4"; | ||
157 | }; | ||
158 | |||
159 | port@4 { | ||
160 | reg = <4>; | ||
161 | label = "wan"; | ||
162 | }; | ||
163 | |||
164 | port@5 { | ||
165 | reg = <5>; | ||
166 | label = "cpu"; | ||
167 | }; | ||
168 | }; | ||
169 | }; | ||
170 | }; | ||
171 | |||
172 | &mdio { | ||
173 | status = "okay"; | ||
174 | |||
175 | ethphy0: ethernet-phy@ff { | ||
176 | reg = <0xff>; /* No phy attached */ | ||
177 | speed = <1000>; | ||
178 | duplex = <1>; | ||
179 | }; | ||
180 | }; | ||
181 | |||
182 | ð0 { | ||
183 | status = "okay"; | ||
184 | ethernet0-port@0 { | ||
185 | phy-handle = <ðphy0>; | ||
186 | }; | ||
125 | }; | 187 | }; |
diff --git a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h b/arch/arm/include/asm/hardware/cache-feroceon-l2.h index 06f982d55697..12e1588dc4f1 100644 --- a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h +++ b/arch/arm/include/asm/hardware/cache-feroceon-l2.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h | 2 | * arch/arm/include/asm/hardware/cache-feroceon-l2.h |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Marvell Semiconductor | 4 | * Copyright (C) 2008 Marvell Semiconductor |
5 | * | 5 | * |
@@ -9,3 +9,5 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | extern void __init feroceon_l2_init(int l2_wt_override); | 11 | extern void __init feroceon_l2_init(int l2_wt_override); |
12 | extern int __init feroceon_of_init(void); | ||
13 | |||
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig index 0bc7cdf8cf46..d8c439c89ea9 100644 --- a/arch/arm/mach-dove/Kconfig +++ b/arch/arm/mach-dove/Kconfig | |||
@@ -20,18 +20,6 @@ config MACH_CM_A510 | |||
20 | Say 'Y' here if you want your kernel to support the | 20 | Say 'Y' here if you want your kernel to support the |
21 | CompuLab CM-A510 Board. | 21 | CompuLab CM-A510 Board. |
22 | 22 | ||
23 | config MACH_DOVE_DT | ||
24 | bool "Marvell Dove Flattened Device Tree" | ||
25 | select DOVE_CLK | ||
26 | select ORION_IRQCHIP | ||
27 | select ORION_TIMER | ||
28 | select REGULATOR | ||
29 | select REGULATOR_FIXED_VOLTAGE | ||
30 | select USE_OF | ||
31 | help | ||
32 | Say 'Y' here if you want your kernel to support the | ||
33 | Marvell Dove using flattened device tree. | ||
34 | |||
35 | endmenu | 23 | endmenu |
36 | 24 | ||
37 | endif | 25 | endif |
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile index cbc5c0618788..b608a21919fb 100644 --- a/arch/arm/mach-dove/Makefile +++ b/arch/arm/mach-dove/Makefile | |||
@@ -2,5 +2,4 @@ obj-y += common.o | |||
2 | obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o | 2 | obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o |
3 | obj-$(CONFIG_PCI) += pcie.o | 3 | obj-$(CONFIG_PCI) += pcie.o |
4 | obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o | 4 | obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o |
5 | obj-$(CONFIG_MACH_DOVE_DT) += board-dt.o | ||
6 | obj-$(CONFIG_MACH_CM_A510) += cm-a510.o | 5 | obj-$(CONFIG_MACH_CM_A510) += cm-a510.o |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index fe8319ad3158..df4b26340ae4 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -106,13 +106,6 @@ config ARCH_KIRKWOOD_DT | |||
106 | Say 'Y' here if you want your kernel to support the | 106 | Say 'Y' here if you want your kernel to support the |
107 | Marvell Kirkwood using flattened device tree. | 107 | Marvell Kirkwood using flattened device tree. |
108 | 108 | ||
109 | config MACH_MV88F6281GTW_GE_DT | ||
110 | bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)" | ||
111 | depends on ARCH_KIRKWOOD_DT | ||
112 | help | ||
113 | Say 'Y' here if you want your kernel to support the | ||
114 | Marvell 88F6281 GTW GE Board (Flattened Device Tree). | ||
115 | |||
116 | endmenu | 109 | endmenu |
117 | 110 | ||
118 | endif | 111 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 144b51102939..3a72c5c6e747 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -1,5 +1,4 @@ | |||
1 | obj-y += common.o pcie.o | 1 | obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o common.o pcie.o |
2 | obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o | ||
3 | obj-$(CONFIG_PM) += pm.o | 2 | obj-$(CONFIG_PM) += pm.o |
4 | 3 | ||
5 | obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o | 4 | obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o |
@@ -13,4 +12,3 @@ obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o | |||
13 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o | 12 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o |
14 | 13 | ||
15 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o | 14 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o |
16 | obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o | ||
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 78188159484d..2801da49e2a3 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -19,11 +19,84 @@ | |||
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
21 | #include <linux/irqchip.h> | 21 | #include <linux/irqchip.h> |
22 | #include <linux/kexec.h> | 22 | #include <asm/hardware/cache-feroceon-l2.h> |
23 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
24 | #include <asm/mach/map.h> | ||
24 | #include <mach/bridge-regs.h> | 25 | #include <mach/bridge-regs.h> |
25 | #include <plat/common.h> | 26 | #include <plat/common.h> |
26 | #include "common.h" | 27 | #include <plat/pcie.h> |
28 | #include "pm.h" | ||
29 | |||
30 | static struct map_desc kirkwood_io_desc[] __initdata = { | ||
31 | { | ||
32 | .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE, | ||
33 | .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), | ||
34 | .length = KIRKWOOD_REGS_SIZE, | ||
35 | .type = MT_DEVICE, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | static void __init kirkwood_map_io(void) | ||
40 | { | ||
41 | iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc)); | ||
42 | } | ||
43 | |||
44 | static struct resource kirkwood_cpufreq_resources[] = { | ||
45 | [0] = { | ||
46 | .start = CPU_CONTROL_PHYS, | ||
47 | .end = CPU_CONTROL_PHYS + 3, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | static struct platform_device kirkwood_cpufreq_device = { | ||
53 | .name = "kirkwood-cpufreq", | ||
54 | .id = -1, | ||
55 | .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), | ||
56 | .resource = kirkwood_cpufreq_resources, | ||
57 | }; | ||
58 | |||
59 | static void __init kirkwood_cpufreq_init(void) | ||
60 | { | ||
61 | platform_device_register(&kirkwood_cpufreq_device); | ||
62 | } | ||
63 | |||
64 | static struct resource kirkwood_cpuidle_resource[] = { | ||
65 | { | ||
66 | .flags = IORESOURCE_MEM, | ||
67 | .start = DDR_OPERATION_BASE, | ||
68 | .end = DDR_OPERATION_BASE + 3, | ||
69 | }, | ||
70 | }; | ||
71 | |||
72 | static struct platform_device kirkwood_cpuidle = { | ||
73 | .name = "kirkwood_cpuidle", | ||
74 | .id = -1, | ||
75 | .resource = kirkwood_cpuidle_resource, | ||
76 | .num_resources = 1, | ||
77 | }; | ||
78 | |||
79 | static void __init kirkwood_cpuidle_init(void) | ||
80 | { | ||
81 | platform_device_register(&kirkwood_cpuidle); | ||
82 | } | ||
83 | |||
84 | /* Temporary here since mach-mvebu has a function we can use */ | ||
85 | static void kirkwood_restart(enum reboot_mode mode, const char *cmd) | ||
86 | { | ||
87 | /* | ||
88 | * Enable soft reset to assert RSTOUTn. | ||
89 | */ | ||
90 | writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK); | ||
91 | |||
92 | /* | ||
93 | * Assert soft reset. | ||
94 | */ | ||
95 | writel(SOFT_RESET, SYSTEM_SOFT_RESET); | ||
96 | |||
97 | while (1) | ||
98 | ; | ||
99 | } | ||
27 | 100 | ||
28 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 | 101 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 |
29 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 | 102 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 |
@@ -104,35 +177,35 @@ eth_fixup_skip: | |||
104 | } | 177 | } |
105 | } | 178 | } |
106 | 179 | ||
107 | static void __init kirkwood_dt_init(void) | 180 | /* |
181 | * Disable propagation of mbus errors to the CPU local bus, as this | ||
182 | * causes mbus errors (which can occur for example for PCI aborts) to | ||
183 | * throw CPU aborts, which we're not set up to deal with. | ||
184 | */ | ||
185 | static void __init kirkwood_disable_mbus_error_propagation(void) | ||
108 | { | 186 | { |
109 | pr_info("Kirkwood: %s.\n", kirkwood_id()); | 187 | void __iomem *cpu_config; |
110 | 188 | ||
111 | /* | 189 | cpu_config = ioremap(CPU_CONFIG_PHYS, 4); |
112 | * Disable propagation of mbus errors to the CPU local bus, | 190 | writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); |
113 | * as this causes mbus errors (which can occur for example | 191 | iounmap(cpu_config); |
114 | * for PCI aborts) to throw CPU aborts, which we're not set | 192 | } |
115 | * up to deal with. | ||
116 | */ | ||
117 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); | ||
118 | 193 | ||
119 | BUG_ON(mvebu_mbus_dt_init()); | 194 | static void __init kirkwood_dt_init(void) |
195 | { | ||
196 | kirkwood_disable_mbus_error_propagation(); | ||
120 | 197 | ||
121 | kirkwood_l2_init(); | 198 | BUG_ON(mvebu_mbus_dt_init()); |
122 | 199 | ||
200 | #ifdef CONFIG_CACHE_FEROCEON_L2 | ||
201 | feroceon_of_init(); | ||
202 | #endif | ||
123 | kirkwood_cpufreq_init(); | 203 | kirkwood_cpufreq_init(); |
124 | kirkwood_cpuidle_init(); | 204 | kirkwood_cpuidle_init(); |
125 | 205 | ||
126 | kirkwood_pm_init(); | 206 | kirkwood_pm_init(); |
127 | kirkwood_dt_eth_fixup(); | 207 | kirkwood_dt_eth_fixup(); |
128 | 208 | ||
129 | #ifdef CONFIG_KEXEC | ||
130 | kexec_reinit = kirkwood_enable_pcie; | ||
131 | #endif | ||
132 | |||
133 | if (of_machine_is_compatible("marvell,mv88f6281gtw-ge")) | ||
134 | mv88f6281gtw_ge_init(); | ||
135 | |||
136 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 209 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
137 | } | 210 | } |
138 | 211 | ||
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c deleted file mode 100644 index ee5eea678c11..000000000000 --- a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c | ||
3 | * | ||
4 | * Marvell 88F6281 GTW GE Board Setup | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/timer.h> | ||
16 | #include <linux/mv643xx_eth.h> | ||
17 | #include <linux/ethtool.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <net/dsa.h> | ||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <asm/mach/pci.h> | ||
23 | #include <mach/kirkwood.h> | ||
24 | #include "common.h" | ||
25 | |||
26 | static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = { | ||
27 | .phy_addr = MV643XX_ETH_PHY_NONE, | ||
28 | .speed = SPEED_1000, | ||
29 | .duplex = DUPLEX_FULL, | ||
30 | }; | ||
31 | |||
32 | static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = { | ||
33 | .port_names[0] = "lan1", | ||
34 | .port_names[1] = "lan2", | ||
35 | .port_names[2] = "lan3", | ||
36 | .port_names[3] = "lan4", | ||
37 | .port_names[4] = "wan", | ||
38 | .port_names[5] = "cpu", | ||
39 | }; | ||
40 | |||
41 | static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = { | ||
42 | .nr_chips = 1, | ||
43 | .chip = &mv88f6281gtw_ge_switch_chip_data, | ||
44 | }; | ||
45 | |||
46 | void __init mv88f6281gtw_ge_init(void) | ||
47 | { | ||
48 | kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data); | ||
49 | kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ); | ||
50 | } | ||
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index f3407a5db216..255f33a3903c 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -25,10 +25,10 @@ | |||
25 | #include <asm/page.h> | 25 | #include <asm/page.h> |
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | #include <asm/mach/time.h> | 27 | #include <asm/mach/time.h> |
28 | #include <asm/hardware/cache-feroceon-l2.h> | ||
28 | #include <mach/kirkwood.h> | 29 | #include <mach/kirkwood.h> |
29 | #include <mach/bridge-regs.h> | 30 | #include <mach/bridge-regs.h> |
30 | #include <linux/platform_data/asoc-kirkwood.h> | 31 | #include <linux/platform_data/asoc-kirkwood.h> |
31 | #include <plat/cache-feroceon-l2.h> | ||
32 | #include <linux/platform_data/mmc-mvsdio.h> | 32 | #include <linux/platform_data/mmc-mvsdio.h> |
33 | #include <linux/platform_data/mtd-orion_nand.h> | 33 | #include <linux/platform_data/mtd-orion_nand.h> |
34 | #include <linux/platform_data/usb-ehci-orion.h> | 34 | #include <linux/platform_data/usb-ehci-orion.h> |
@@ -36,6 +36,7 @@ | |||
36 | #include <plat/time.h> | 36 | #include <plat/time.h> |
37 | #include <linux/platform_data/dma-mv_xor.h> | 37 | #include <linux/platform_data/dma-mv_xor.h> |
38 | #include "common.h" | 38 | #include "common.h" |
39 | #include "pm.h" | ||
39 | 40 | ||
40 | /* These can go away once Kirkwood uses the mvebu-mbus DT binding */ | 41 | /* These can go away once Kirkwood uses the mvebu-mbus DT binding */ |
41 | #define KIRKWOOD_MBUS_NAND_TARGET 0x01 | 42 | #define KIRKWOOD_MBUS_NAND_TARGET 0x01 |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 05fd648df543..832a4e2ab8d7 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -58,19 +58,6 @@ void kirkwood_cpufreq_init(void); | |||
58 | void kirkwood_restart(enum reboot_mode, const char *); | 58 | void kirkwood_restart(enum reboot_mode, const char *); |
59 | void kirkwood_clk_init(void); | 59 | void kirkwood_clk_init(void); |
60 | 60 | ||
61 | #ifdef CONFIG_PM | ||
62 | void kirkwood_pm_init(void); | ||
63 | #else | ||
64 | static inline void kirkwood_pm_init(void) {}; | ||
65 | #endif | ||
66 | |||
67 | /* board init functions for boards not fully converted to fdt */ | ||
68 | #ifdef CONFIG_MACH_MV88F6281GTW_GE_DT | ||
69 | void mv88f6281gtw_ge_init(void); | ||
70 | #else | ||
71 | static inline void mv88f6281gtw_ge_init(void) {}; | ||
72 | #endif | ||
73 | |||
74 | /* early init functions not converted to fdt yet */ | 61 | /* early init functions not converted to fdt yet */ |
75 | char *kirkwood_id(void); | 62 | char *kirkwood_id(void); |
76 | void kirkwood_l2_init(void); | 63 | void kirkwood_l2_init(void); |
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h index 8b9d1c9ff199..6e5077e2ec26 100644 --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <mach/kirkwood.h> | 14 | #include <mach/kirkwood.h> |
15 | 15 | ||
16 | #define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) | 16 | #define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) |
17 | #define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100) | ||
17 | #define CPU_CONFIG_ERROR_PROP 0x00000004 | 18 | #define CPU_CONFIG_ERROR_PROP 0x00000004 |
18 | 19 | ||
19 | #define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) | 20 | #define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) |
@@ -79,5 +80,6 @@ | |||
79 | #define CGC_RESERVED (0x6 << 21) | 80 | #define CGC_RESERVED (0x6 << 21) |
80 | 81 | ||
81 | #define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) | 82 | #define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) |
83 | #define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118) | ||
82 | 84 | ||
83 | #endif | 85 | #endif |
diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c index c6ab8d9303a5..8e5e0329d04c 100644 --- a/arch/arm/mach-kirkwood/pm.c +++ b/arch/arm/mach-kirkwood/pm.c | |||
@@ -21,15 +21,16 @@ | |||
21 | #include "common.h" | 21 | #include "common.h" |
22 | 22 | ||
23 | static void __iomem *ddr_operation_base; | 23 | static void __iomem *ddr_operation_base; |
24 | static void __iomem *memory_pm_ctrl; | ||
24 | 25 | ||
25 | static void kirkwood_low_power(void) | 26 | static void kirkwood_low_power(void) |
26 | { | 27 | { |
27 | u32 mem_pm_ctrl; | 28 | u32 mem_pm_ctrl; |
28 | 29 | ||
29 | mem_pm_ctrl = readl(MEMORY_PM_CTRL); | 30 | mem_pm_ctrl = readl(memory_pm_ctrl); |
30 | 31 | ||
31 | /* Set peripherals to low-power mode */ | 32 | /* Set peripherals to low-power mode */ |
32 | writel_relaxed(~0, MEMORY_PM_CTRL); | 33 | writel_relaxed(~0, memory_pm_ctrl); |
33 | 34 | ||
34 | /* Set DDR in self-refresh */ | 35 | /* Set DDR in self-refresh */ |
35 | writel_relaxed(0x7, ddr_operation_base); | 36 | writel_relaxed(0x7, ddr_operation_base); |
@@ -41,7 +42,7 @@ static void kirkwood_low_power(void) | |||
41 | */ | 42 | */ |
42 | cpu_do_idle(); | 43 | cpu_do_idle(); |
43 | 44 | ||
44 | writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL); | 45 | writel_relaxed(mem_pm_ctrl, memory_pm_ctrl); |
45 | } | 46 | } |
46 | 47 | ||
47 | static int kirkwood_suspend_enter(suspend_state_t state) | 48 | static int kirkwood_suspend_enter(suspend_state_t state) |
@@ -69,5 +70,7 @@ static const struct platform_suspend_ops kirkwood_suspend_ops = { | |||
69 | void __init kirkwood_pm_init(void) | 70 | void __init kirkwood_pm_init(void) |
70 | { | 71 | { |
71 | ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); | 72 | ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); |
73 | memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4); | ||
74 | |||
72 | suspend_set_ops(&kirkwood_suspend_ops); | 75 | suspend_set_ops(&kirkwood_suspend_ops); |
73 | } | 76 | } |
diff --git a/arch/arm/mach-kirkwood/pm.h b/arch/arm/mach-kirkwood/pm.h new file mode 100644 index 000000000000..21e7530f368b --- /dev/null +++ b/arch/arm/mach-kirkwood/pm.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Power Management driver for Marvell Kirkwood SoCs | ||
3 | * | ||
4 | * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> | ||
5 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, | ||
9 | * version 2 of the License. | ||
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 | |||
17 | #ifndef __ARCH_KIRKWOOD_PM_H | ||
18 | #define __ARCH_KIRKWOOD_PM_H | ||
19 | |||
20 | #ifdef CONFIG_PM | ||
21 | void kirkwood_pm_init(void); | ||
22 | #else | ||
23 | static inline void kirkwood_pm_init(void) {}; | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 75062eff2494..e6ac679bece9 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -15,11 +15,11 @@ | |||
15 | #include <linux/ata_platform.h> | 15 | #include <linux/ata_platform.h> |
16 | #include <linux/clk-provider.h> | 16 | #include <linux/clk-provider.h> |
17 | #include <linux/ethtool.h> | 17 | #include <linux/ethtool.h> |
18 | #include <asm/hardware/cache-feroceon-l2.h> | ||
18 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
19 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
20 | #include <mach/mv78xx0.h> | 21 | #include <mach/mv78xx0.h> |
21 | #include <mach/bridge-regs.h> | 22 | #include <mach/bridge-regs.h> |
22 | #include <plat/cache-feroceon-l2.h> | ||
23 | #include <linux/platform_data/usb-ehci-orion.h> | 23 | #include <linux/platform_data/usb-ehci-orion.h> |
24 | #include <linux/platform_data/mtd-orion_nand.h> | 24 | #include <linux/platform_data/mtd-orion_nand.h> |
25 | #include <plat/time.h> | 25 | #include <plat/time.h> |
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 5e269d7263ce..4fecf5d41d8d 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | config ARCH_MVEBU | 1 | config ARCH_MVEBU |
2 | bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 | 2 | bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5) |
3 | select ARCH_SUPPORTS_BIG_ENDIAN | 3 | select ARCH_SUPPORTS_BIG_ENDIAN |
4 | select CLKSRC_MMIO | 4 | select CLKSRC_MMIO |
5 | select COMMON_CLK | 5 | select COMMON_CLK |
@@ -19,33 +19,98 @@ config ARCH_MVEBU | |||
19 | 19 | ||
20 | if ARCH_MVEBU | 20 | if ARCH_MVEBU |
21 | 21 | ||
22 | menu "Marvell SOC with device tree" | 22 | menu "Marvell EBU SoC variants" |
23 | 23 | ||
24 | config MACH_ARMADA_370_XP | 24 | config MACH_MVEBU_V7 |
25 | bool | 25 | bool |
26 | select ARMADA_370_XP_TIMER | 26 | select ARMADA_370_XP_TIMER |
27 | select HAVE_SMP | 27 | select HAVE_SMP |
28 | select CACHE_L2X0 | 28 | select CACHE_L2X0 |
29 | select CPU_PJ4B | ||
30 | 29 | ||
31 | config MACH_ARMADA_370 | 30 | config MACH_ARMADA_370 |
32 | bool "Marvell Armada 370 boards" | 31 | bool "Marvell Armada 370 boards" if ARCH_MULTI_V7 |
33 | select ARMADA_370_CLK | 32 | select ARMADA_370_CLK |
34 | select MACH_ARMADA_370_XP | 33 | select CPU_PJ4B |
34 | select MACH_MVEBU_V7 | ||
35 | select PINCTRL_ARMADA_370 | 35 | select PINCTRL_ARMADA_370 |
36 | help | 36 | help |
37 | Say 'Y' here if you want your kernel to support boards based | 37 | Say 'Y' here if you want your kernel to support boards based |
38 | on the Marvell Armada 370 SoC with device tree. | 38 | on the Marvell Armada 370 SoC with device tree. |
39 | 39 | ||
40 | config MACH_ARMADA_375 | ||
41 | bool "Marvell Armada 375 boards" if ARCH_MULTI_V7 | ||
42 | select ARM_ERRATA_720789 | ||
43 | select ARM_ERRATA_753970 | ||
44 | select ARM_GIC | ||
45 | select ARMADA_375_CLK | ||
46 | select CPU_V7 | ||
47 | select MACH_MVEBU_V7 | ||
48 | select NEON | ||
49 | select PINCTRL_ARMADA_375 | ||
50 | help | ||
51 | Say 'Y' here if you want your kernel to support boards based | ||
52 | on the Marvell Armada 375 SoC with device tree. | ||
53 | |||
54 | config MACH_ARMADA_38X | ||
55 | bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7 | ||
56 | select ARM_ERRATA_720789 | ||
57 | select ARM_ERRATA_753970 | ||
58 | select ARM_GIC | ||
59 | select ARMADA_38X_CLK | ||
60 | select CPU_V7 | ||
61 | select MACH_MVEBU_V7 | ||
62 | select NEON | ||
63 | select PINCTRL_ARMADA_38X | ||
64 | help | ||
65 | Say 'Y' here if you want your kernel to support boards based | ||
66 | on the Marvell Armada 380/385 SoC with device tree. | ||
67 | |||
40 | config MACH_ARMADA_XP | 68 | config MACH_ARMADA_XP |
41 | bool "Marvell Armada XP boards" | 69 | bool "Marvell Armada XP boards" if ARCH_MULTI_V7 |
42 | select ARMADA_XP_CLK | 70 | select ARMADA_XP_CLK |
43 | select MACH_ARMADA_370_XP | 71 | select CPU_PJ4B |
72 | select MACH_MVEBU_V7 | ||
44 | select PINCTRL_ARMADA_XP | 73 | select PINCTRL_ARMADA_XP |
45 | help | 74 | help |
46 | Say 'Y' here if you want your kernel to support boards based | 75 | Say 'Y' here if you want your kernel to support boards based |
47 | on the Marvell Armada XP SoC with device tree. | 76 | on the Marvell Armada XP SoC with device tree. |
48 | 77 | ||
78 | config MACH_DOVE | ||
79 | bool "Marvell Dove boards" if ARCH_MULTI_V7 | ||
80 | select CACHE_L2X0 | ||
81 | select CPU_PJ4 | ||
82 | select DOVE_CLK | ||
83 | select ORION_IRQCHIP | ||
84 | select ORION_TIMER | ||
85 | select PINCTRL_DOVE | ||
86 | help | ||
87 | Say 'Y' here if you want your kernel to support the | ||
88 | Marvell Dove using flattened device tree. | ||
89 | |||
90 | config MACH_KIRKWOOD | ||
91 | bool "Marvell Kirkwood boards" if ARCH_MULTI_V5 | ||
92 | select ARCH_HAS_CPUFREQ | ||
93 | select ARCH_REQUIRE_GPIOLIB | ||
94 | select CPU_FEROCEON | ||
95 | select KIRKWOOD_CLK | ||
96 | select OF_IRQ | ||
97 | select ORION_IRQCHIP | ||
98 | select ORION_TIMER | ||
99 | select PCI | ||
100 | select PCI_QUIRKS | ||
101 | select PINCTRL_KIRKWOOD | ||
102 | select USE_OF | ||
103 | help | ||
104 | Say 'Y' here if you want your kernel to support boards based | ||
105 | on the Marvell Kirkwood device tree. | ||
106 | |||
107 | config MACH_T5325 | ||
108 | bool "HP T5325 thin client" | ||
109 | depends on MACH_KIRKWOOD | ||
110 | help | ||
111 | Say 'Y' here if you want your kernel to support the | ||
112 | HP T5325 Thin client | ||
113 | |||
49 | endmenu | 114 | endmenu |
50 | 115 | ||
51 | endif | 116 | endif |
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 878aebe98dcc..a63e43b6b451 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -4,7 +4,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ | |||
4 | AFLAGS_coherency_ll.o := -Wa,-march=armv7-a | 4 | AFLAGS_coherency_ll.o := -Wa,-march=armv7-a |
5 | 5 | ||
6 | obj-y += system-controller.o mvebu-soc-id.o | 6 | obj-y += system-controller.o mvebu-soc-id.o |
7 | obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o | 7 | obj-$(CONFIG_MACH_MVEBU_V7) += board-v7.o |
8 | obj-$(CONFIG_MACH_DOVE) += dove.o | ||
8 | obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o | 9 | obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o |
9 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 10 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
10 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 11 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
12 | obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o | ||
13 | obj-$(CONFIG_MACH_T5325) += board-t5325.o | ||
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c new file mode 100644 index 000000000000..65ace6db9f28 --- /dev/null +++ b/arch/arm/mach-mvebu/board-t5325.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * HP T5325 Board Setup | ||
3 | * | ||
4 | * Copyright (C) 2014 | ||
5 | * | ||
6 | * Andrew Lunn <andrew@lunn.ch> | ||
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/i2c.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <sound/alc5623.h> | ||
18 | #include "board.h" | ||
19 | |||
20 | static struct platform_device hp_t5325_audio_device = { | ||
21 | .name = "t5325-audio", | ||
22 | .id = -1, | ||
23 | }; | ||
24 | |||
25 | static struct alc5623_platform_data alc5621_data = { | ||
26 | .add_ctrl = 0x3700, | ||
27 | .jack_det_ctrl = 0x4810, | ||
28 | }; | ||
29 | |||
30 | static struct i2c_board_info i2c_board_info[] __initdata = { | ||
31 | { | ||
32 | I2C_BOARD_INFO("alc5621", 0x1a), | ||
33 | .platform_data = &alc5621_data, | ||
34 | }, | ||
35 | }; | ||
36 | |||
37 | void __init t5325_init(void) | ||
38 | { | ||
39 | i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info)); | ||
40 | platform_device_register(&hp_t5325_audio_device); | ||
41 | } | ||
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/board-v7.c index f6c9d1d85c14..746134ecdfc2 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/board-v7.c | |||
@@ -31,12 +31,28 @@ | |||
31 | #include "coherency.h" | 31 | #include "coherency.h" |
32 | #include "mvebu-soc-id.h" | 32 | #include "mvebu-soc-id.h" |
33 | 33 | ||
34 | static void __init armada_370_xp_map_io(void) | 34 | /* |
35 | * Early versions of Armada 375 SoC have a bug where the BootROM | ||
36 | * leaves an external data abort pending. The kernel is hit by this | ||
37 | * data abort as soon as it enters userspace, because it unmasks the | ||
38 | * data aborts at this moment. We register a custom abort handler | ||
39 | * below to ignore the first data abort to work around this | ||
40 | * problem. | ||
41 | */ | ||
42 | static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr, | ||
43 | struct pt_regs *regs) | ||
35 | { | 44 | { |
36 | debug_ll_io_init(); | 45 | static int ignore_first; |
46 | |||
47 | if (!ignore_first && fsr == 0x1406) { | ||
48 | ignore_first = 1; | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | return 1; | ||
37 | } | 53 | } |
38 | 54 | ||
39 | static void __init armada_370_xp_timer_and_clk_init(void) | 55 | static void __init mvebu_timer_and_clk_init(void) |
40 | { | 56 | { |
41 | of_clk_init(NULL); | 57 | of_clk_init(NULL); |
42 | clocksource_of_init(); | 58 | clocksource_of_init(); |
@@ -45,6 +61,10 @@ static void __init armada_370_xp_timer_and_clk_init(void) | |||
45 | #ifdef CONFIG_CACHE_L2X0 | 61 | #ifdef CONFIG_CACHE_L2X0 |
46 | l2x0_of_init(0, ~0UL); | 62 | l2x0_of_init(0, ~0UL); |
47 | #endif | 63 | #endif |
64 | |||
65 | if (of_machine_is_compatible("marvell,armada375")) | ||
66 | hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, | ||
67 | "imprecise external abort"); | ||
48 | } | 68 | } |
49 | 69 | ||
50 | static void __init i2c_quirk(void) | 70 | static void __init i2c_quirk(void) |
@@ -75,7 +95,7 @@ static void __init i2c_quirk(void) | |||
75 | return; | 95 | return; |
76 | } | 96 | } |
77 | 97 | ||
78 | static void __init armada_370_xp_dt_init(void) | 98 | static void __init mvebu_dt_init(void) |
79 | { | 99 | { |
80 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) | 100 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) |
81 | i2c_quirk(); | 101 | i2c_quirk(); |
@@ -87,11 +107,33 @@ static const char * const armada_370_xp_dt_compat[] = { | |||
87 | NULL, | 107 | NULL, |
88 | }; | 108 | }; |
89 | 109 | ||
90 | DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") | 110 | DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)") |
91 | .smp = smp_ops(armada_xp_smp_ops), | 111 | .smp = smp_ops(armada_xp_smp_ops), |
92 | .init_machine = armada_370_xp_dt_init, | 112 | .init_machine = mvebu_dt_init, |
93 | .map_io = armada_370_xp_map_io, | 113 | .init_time = mvebu_timer_and_clk_init, |
94 | .init_time = armada_370_xp_timer_and_clk_init, | ||
95 | .restart = mvebu_restart, | 114 | .restart = mvebu_restart, |
96 | .dt_compat = armada_370_xp_dt_compat, | 115 | .dt_compat = armada_370_xp_dt_compat, |
97 | MACHINE_END | 116 | MACHINE_END |
117 | |||
118 | static const char * const armada_375_dt_compat[] = { | ||
119 | "marvell,armada375", | ||
120 | NULL, | ||
121 | }; | ||
122 | |||
123 | DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)") | ||
124 | .init_time = mvebu_timer_and_clk_init, | ||
125 | .restart = mvebu_restart, | ||
126 | .dt_compat = armada_375_dt_compat, | ||
127 | MACHINE_END | ||
128 | |||
129 | static const char * const armada_38x_dt_compat[] = { | ||
130 | "marvell,armada380", | ||
131 | "marvell,armada385", | ||
132 | NULL, | ||
133 | }; | ||
134 | |||
135 | DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") | ||
136 | .init_time = mvebu_timer_and_clk_init, | ||
137 | .restart = mvebu_restart, | ||
138 | .dt_compat = armada_38x_dt_compat, | ||
139 | MACHINE_END | ||
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h new file mode 100644 index 000000000000..de7f0a191394 --- /dev/null +++ b/arch/arm/mach-mvebu/board.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Board functions for Marvell System On Chip | ||
3 | * | ||
4 | * Copyright (C) 2014 | ||
5 | * | ||
6 | * Andrew Lunn <andrew@lunn.ch> | ||
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 __ARCH_MVEBU_BOARD_H | ||
14 | #define __ARCH_MVEBU_BOARD_H | ||
15 | |||
16 | #ifdef CONFIG_MACH_T5325 | ||
17 | void t5325_init(void); | ||
18 | #else | ||
19 | static inline void t5325_init(void) {}; | ||
20 | #endif | ||
21 | |||
22 | #endif | ||
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-mvebu/dove.c index 49fa9abd09da..5e5a43624237 100644 --- a/arch/arm/mach-dove/board-dt.c +++ b/arch/arm/mach-mvebu/dove.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-dove/board-dt.c | 2 | * arch/arm/mach-mvebu/dove.c |
3 | * | 3 | * |
4 | * Marvell Dove 88AP510 System On Chip FDT Board | 4 | * Marvell Dove 88AP510 System On Chip FDT Board |
5 | * | 5 | * |
@@ -9,17 +9,14 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/clk-provider.h> | 12 | #include <linux/mbus.h> |
13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
14 | #include <linux/of_platform.h> | 14 | #include <linux/of_platform.h> |
15 | #include <asm/hardware/cache-tauros2.h> | 15 | #include <asm/hardware/cache-tauros2.h> |
16 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
17 | #include <mach/dove.h> | ||
18 | #include <mach/pm.h> | ||
19 | #include <plat/common.h> | ||
20 | #include "common.h" | 17 | #include "common.h" |
21 | 18 | ||
22 | static void __init dove_dt_init(void) | 19 | static void __init dove_init(void) |
23 | { | 20 | { |
24 | pr_info("Dove 88AP510 SoC\n"); | 21 | pr_info("Dove 88AP510 SoC\n"); |
25 | 22 | ||
@@ -30,14 +27,13 @@ static void __init dove_dt_init(void) | |||
30 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
31 | } | 28 | } |
32 | 29 | ||
33 | static const char * const dove_dt_board_compat[] = { | 30 | static const char * const dove_dt_compat[] = { |
34 | "marvell,dove", | 31 | "marvell,dove", |
35 | NULL | 32 | NULL |
36 | }; | 33 | }; |
37 | 34 | ||
38 | DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") | 35 | DT_MACHINE_START(DOVE_DT, "Marvell Dove") |
39 | .map_io = dove_map_io, | 36 | .init_machine = dove_init, |
40 | .init_machine = dove_dt_init, | 37 | .restart = mvebu_restart, |
41 | .restart = dove_restart, | 38 | .dt_compat = dove_dt_compat, |
42 | .dt_compat = dove_dt_board_compat, | ||
43 | MACHINE_END | 39 | MACHINE_END |
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.c b/arch/arm/mach-mvebu/kirkwood-pm.c new file mode 100644 index 000000000000..cbb816f2120c --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood-pm.c | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * Power Management driver for Marvell Kirkwood SoCs | ||
3 | * | ||
4 | * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> | ||
5 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, | ||
9 | * version 2 of the License. | ||
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 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/suspend.h> | ||
19 | #include <linux/io.h> | ||
20 | #include "kirkwood.h" | ||
21 | |||
22 | static void __iomem *ddr_operation_base; | ||
23 | static void __iomem *memory_pm_ctrl; | ||
24 | |||
25 | static void kirkwood_low_power(void) | ||
26 | { | ||
27 | u32 mem_pm_ctrl; | ||
28 | |||
29 | mem_pm_ctrl = readl(memory_pm_ctrl); | ||
30 | |||
31 | /* Set peripherals to low-power mode */ | ||
32 | writel_relaxed(~0, memory_pm_ctrl); | ||
33 | |||
34 | /* Set DDR in self-refresh */ | ||
35 | writel_relaxed(0x7, ddr_operation_base); | ||
36 | |||
37 | /* | ||
38 | * Set CPU in wait-for-interrupt state. | ||
39 | * This disables the CPU core clocks, | ||
40 | * the array clocks, and also the L2 controller. | ||
41 | */ | ||
42 | cpu_do_idle(); | ||
43 | |||
44 | writel_relaxed(mem_pm_ctrl, memory_pm_ctrl); | ||
45 | } | ||
46 | |||
47 | static int kirkwood_suspend_enter(suspend_state_t state) | ||
48 | { | ||
49 | switch (state) { | ||
50 | case PM_SUSPEND_STANDBY: | ||
51 | kirkwood_low_power(); | ||
52 | break; | ||
53 | default: | ||
54 | return -EINVAL; | ||
55 | } | ||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static int kirkwood_pm_valid_standby(suspend_state_t state) | ||
60 | { | ||
61 | return state == PM_SUSPEND_STANDBY; | ||
62 | } | ||
63 | |||
64 | static const struct platform_suspend_ops kirkwood_suspend_ops = { | ||
65 | .enter = kirkwood_suspend_enter, | ||
66 | .valid = kirkwood_pm_valid_standby, | ||
67 | }; | ||
68 | |||
69 | int __init kirkwood_pm_init(void) | ||
70 | { | ||
71 | ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); | ||
72 | memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4); | ||
73 | |||
74 | suspend_set_ops(&kirkwood_suspend_ops); | ||
75 | return 0; | ||
76 | } | ||
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.h b/arch/arm/mach-mvebu/kirkwood-pm.h new file mode 100644 index 000000000000..21e7530f368b --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood-pm.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Power Management driver for Marvell Kirkwood SoCs | ||
3 | * | ||
4 | * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> | ||
5 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, | ||
9 | * version 2 of the License. | ||
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 | |||
17 | #ifndef __ARCH_KIRKWOOD_PM_H | ||
18 | #define __ARCH_KIRKWOOD_PM_H | ||
19 | |||
20 | #ifdef CONFIG_PM | ||
21 | void kirkwood_pm_init(void); | ||
22 | #else | ||
23 | static inline void kirkwood_pm_init(void) {}; | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c new file mode 100644 index 000000000000..120207fc36f1 --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood.c | |||
@@ -0,0 +1,199 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net> | ||
3 | * | ||
4 | * arch/arm/mach-mvebu/kirkwood.c | ||
5 | * | ||
6 | * Flattened Device Tree board initialization | ||
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/clk.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/mbus.h> | ||
17 | #include <linux/of.h> | ||
18 | #include <linux/of_address.h> | ||
19 | #include <linux/of_net.h> | ||
20 | #include <linux/of_platform.h> | ||
21 | #include <linux/slab.h> | ||
22 | #include <asm/hardware/cache-feroceon-l2.h> | ||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/map.h> | ||
25 | #include "kirkwood.h" | ||
26 | #include "kirkwood-pm.h" | ||
27 | #include "common.h" | ||
28 | #include "board.h" | ||
29 | |||
30 | static struct resource kirkwood_cpufreq_resources[] = { | ||
31 | [0] = { | ||
32 | .start = CPU_CONTROL_PHYS, | ||
33 | .end = CPU_CONTROL_PHYS + 3, | ||
34 | .flags = IORESOURCE_MEM, | ||
35 | }, | ||
36 | }; | ||
37 | |||
38 | static struct platform_device kirkwood_cpufreq_device = { | ||
39 | .name = "kirkwood-cpufreq", | ||
40 | .id = -1, | ||
41 | .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), | ||
42 | .resource = kirkwood_cpufreq_resources, | ||
43 | }; | ||
44 | |||
45 | static void __init kirkwood_cpufreq_init(void) | ||
46 | { | ||
47 | platform_device_register(&kirkwood_cpufreq_device); | ||
48 | } | ||
49 | |||
50 | static struct resource kirkwood_cpuidle_resource[] = { | ||
51 | { | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | .start = DDR_OPERATION_BASE, | ||
54 | .end = DDR_OPERATION_BASE + 3, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static struct platform_device kirkwood_cpuidle = { | ||
59 | .name = "kirkwood_cpuidle", | ||
60 | .id = -1, | ||
61 | .resource = kirkwood_cpuidle_resource, | ||
62 | .num_resources = 1, | ||
63 | }; | ||
64 | |||
65 | static void __init kirkwood_cpuidle_init(void) | ||
66 | { | ||
67 | platform_device_register(&kirkwood_cpuidle); | ||
68 | } | ||
69 | |||
70 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 | ||
71 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 | ||
72 | |||
73 | static void __init kirkwood_dt_eth_fixup(void) | ||
74 | { | ||
75 | struct device_node *np; | ||
76 | |||
77 | /* | ||
78 | * The ethernet interfaces forget the MAC address assigned by u-boot | ||
79 | * if the clocks are turned off. Usually, u-boot on kirkwood boards | ||
80 | * has no DT support to properly set local-mac-address property. | ||
81 | * As a workaround, we get the MAC address from mv643xx_eth registers | ||
82 | * and update the port device node if no valid MAC address is set. | ||
83 | */ | ||
84 | for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") { | ||
85 | struct device_node *pnp = of_get_parent(np); | ||
86 | struct clk *clk; | ||
87 | struct property *pmac; | ||
88 | void __iomem *io; | ||
89 | u8 *macaddr; | ||
90 | u32 reg; | ||
91 | |||
92 | if (!pnp) | ||
93 | continue; | ||
94 | |||
95 | /* skip disabled nodes or nodes with valid MAC address*/ | ||
96 | if (!of_device_is_available(pnp) || of_get_mac_address(np)) | ||
97 | goto eth_fixup_skip; | ||
98 | |||
99 | clk = of_clk_get(pnp, 0); | ||
100 | if (IS_ERR(clk)) | ||
101 | goto eth_fixup_skip; | ||
102 | |||
103 | io = of_iomap(pnp, 0); | ||
104 | if (!io) | ||
105 | goto eth_fixup_no_map; | ||
106 | |||
107 | /* ensure port clock is not gated to not hang CPU */ | ||
108 | clk_prepare_enable(clk); | ||
109 | |||
110 | /* store MAC address register contents in local-mac-address */ | ||
111 | pr_err(FW_INFO "%s: local-mac-address is not set\n", | ||
112 | np->full_name); | ||
113 | |||
114 | pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL); | ||
115 | if (!pmac) | ||
116 | goto eth_fixup_no_mem; | ||
117 | |||
118 | pmac->value = pmac + 1; | ||
119 | pmac->length = 6; | ||
120 | pmac->name = kstrdup("local-mac-address", GFP_KERNEL); | ||
121 | if (!pmac->name) { | ||
122 | kfree(pmac); | ||
123 | goto eth_fixup_no_mem; | ||
124 | } | ||
125 | |||
126 | macaddr = pmac->value; | ||
127 | reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH); | ||
128 | macaddr[0] = (reg >> 24) & 0xff; | ||
129 | macaddr[1] = (reg >> 16) & 0xff; | ||
130 | macaddr[2] = (reg >> 8) & 0xff; | ||
131 | macaddr[3] = reg & 0xff; | ||
132 | |||
133 | reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW); | ||
134 | macaddr[4] = (reg >> 8) & 0xff; | ||
135 | macaddr[5] = reg & 0xff; | ||
136 | |||
137 | of_update_property(np, pmac); | ||
138 | |||
139 | eth_fixup_no_mem: | ||
140 | iounmap(io); | ||
141 | clk_disable_unprepare(clk); | ||
142 | eth_fixup_no_map: | ||
143 | clk_put(clk); | ||
144 | eth_fixup_skip: | ||
145 | of_node_put(pnp); | ||
146 | } | ||
147 | } | ||
148 | |||
149 | /* | ||
150 | * Disable propagation of mbus errors to the CPU local bus, as this | ||
151 | * causes mbus errors (which can occur for example for PCI aborts) to | ||
152 | * throw CPU aborts, which we're not set up to deal with. | ||
153 | */ | ||
154 | void kirkwood_disable_mbus_error_propagation(void) | ||
155 | { | ||
156 | void __iomem *cpu_config; | ||
157 | |||
158 | cpu_config = ioremap(CPU_CONFIG_PHYS, 4); | ||
159 | writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); | ||
160 | } | ||
161 | |||
162 | static struct of_dev_auxdata auxdata[] __initdata = { | ||
163 | OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000, | ||
164 | "mvebu-audio", NULL), | ||
165 | { /* sentinel */ } | ||
166 | }; | ||
167 | |||
168 | static void __init kirkwood_dt_init(void) | ||
169 | { | ||
170 | kirkwood_disable_mbus_error_propagation(); | ||
171 | |||
172 | BUG_ON(mvebu_mbus_dt_init()); | ||
173 | |||
174 | #ifdef CONFIG_CACHE_FEROCEON_L2 | ||
175 | feroceon_of_init(); | ||
176 | #endif | ||
177 | kirkwood_cpufreq_init(); | ||
178 | kirkwood_cpuidle_init(); | ||
179 | |||
180 | kirkwood_pm_init(); | ||
181 | kirkwood_dt_eth_fixup(); | ||
182 | |||
183 | if (of_machine_is_compatible("hp,t5325")) | ||
184 | t5325_init(); | ||
185 | |||
186 | of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL); | ||
187 | } | ||
188 | |||
189 | static const char * const kirkwood_dt_board_compat[] = { | ||
190 | "marvell,kirkwood", | ||
191 | NULL | ||
192 | }; | ||
193 | |||
194 | DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") | ||
195 | /* Maintainer: Jason Cooper <jason@lakedaemon.net> */ | ||
196 | .init_machine = kirkwood_dt_init, | ||
197 | .restart = mvebu_restart, | ||
198 | .dt_compat = kirkwood_dt_board_compat, | ||
199 | MACHINE_END | ||
diff --git a/arch/arm/mach-mvebu/kirkwood.h b/arch/arm/mach-mvebu/kirkwood.h new file mode 100644 index 000000000000..89f3d1f51643 --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mvebu/kirkwood.h | ||
3 | * | ||
4 | * Generic definitions for Marvell Kirkwood SoC flavors: | ||
5 | * 88F6180, 88F6192 and 88F6281. | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public | ||
8 | * License version 2. This program is licensed "as is" without any | ||
9 | * warranty of any kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 | ||
13 | #define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000) | ||
14 | #define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000) | ||
15 | |||
16 | #define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418) | ||
17 | |||
18 | #define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100) | ||
19 | #define CPU_CONFIG_ERROR_PROP 0x00000004 | ||
20 | |||
21 | #define CPU_CONTROL_PHYS (BRIDGE_PHYS_BASE + 0x0104) | ||
22 | #define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x0118) | ||
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index f3b325f6cbd4..f3d4cf53f746 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c | |||
@@ -38,6 +38,7 @@ static bool is_id_valid; | |||
38 | static const struct of_device_id mvebu_pcie_of_match_table[] = { | 38 | static const struct of_device_id mvebu_pcie_of_match_table[] = { |
39 | { .compatible = "marvell,armada-xp-pcie", }, | 39 | { .compatible = "marvell,armada-xp-pcie", }, |
40 | { .compatible = "marvell,armada-370-pcie", }, | 40 | { .compatible = "marvell,armada-370-pcie", }, |
41 | { .compatible = "marvell,kirkwood-pcie" }, | ||
41 | {}, | 42 | {}, |
42 | }; | 43 | }; |
43 | 44 | ||
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c index a7fb89a5b5d9..614ba6832ff3 100644 --- a/arch/arm/mach-mvebu/system-controller.c +++ b/arch/arm/mach-mvebu/system-controller.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * System controller support for Armada 370 and XP platforms. | 2 | * System controller support for Armada 370, 375 and XP platforms. |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Marvell | 4 | * Copyright (C) 2012 Marvell |
5 | * | 5 | * |
@@ -11,7 +11,7 @@ | |||
11 | * License version 2. This program is licensed "as is" without any | 11 | * License version 2. This program is licensed "as is" without any |
12 | * warranty of any kind, whether express or implied. | 12 | * warranty of any kind, whether express or implied. |
13 | * | 13 | * |
14 | * The Armada 370 and Armada XP SoCs both have a range of | 14 | * The Armada 370, 375 and Armada XP SoCs have a range of |
15 | * miscellaneous registers, that do not belong to a particular device, | 15 | * miscellaneous registers, that do not belong to a particular device, |
16 | * but rather provide system-level features. This basic | 16 | * but rather provide system-level features. This basic |
17 | * system-controller driver provides a device tree binding for those | 17 | * system-controller driver provides a device tree binding for those |
@@ -47,6 +47,13 @@ static const struct mvebu_system_controller armada_370_xp_system_controller = { | |||
47 | .system_soft_reset = 0x1, | 47 | .system_soft_reset = 0x1, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const struct mvebu_system_controller armada_375_system_controller = { | ||
51 | .rstoutn_mask_offset = 0x54, | ||
52 | .system_soft_reset_offset = 0x58, | ||
53 | .rstoutn_mask_reset_out_en = 0x1, | ||
54 | .system_soft_reset = 0x1, | ||
55 | }; | ||
56 | |||
50 | static const struct mvebu_system_controller orion_system_controller = { | 57 | static const struct mvebu_system_controller orion_system_controller = { |
51 | .rstoutn_mask_offset = 0x108, | 58 | .rstoutn_mask_offset = 0x108, |
52 | .system_soft_reset_offset = 0x10c, | 59 | .system_soft_reset_offset = 0x10c, |
@@ -54,13 +61,16 @@ static const struct mvebu_system_controller orion_system_controller = { | |||
54 | .system_soft_reset = 0x1, | 61 | .system_soft_reset = 0x1, |
55 | }; | 62 | }; |
56 | 63 | ||
57 | static struct of_device_id of_system_controller_table[] = { | 64 | static const struct of_device_id of_system_controller_table[] = { |
58 | { | 65 | { |
59 | .compatible = "marvell,orion-system-controller", | 66 | .compatible = "marvell,orion-system-controller", |
60 | .data = (void *) &orion_system_controller, | 67 | .data = (void *) &orion_system_controller, |
61 | }, { | 68 | }, { |
62 | .compatible = "marvell,armada-370-xp-system-controller", | 69 | .compatible = "marvell,armada-370-xp-system-controller", |
63 | .data = (void *) &armada_370_xp_system_controller, | 70 | .data = (void *) &armada_370_xp_system_controller, |
71 | }, { | ||
72 | .compatible = "marvell,armada-375-system-controller", | ||
73 | .data = (void *) &armada_375_system_controller, | ||
64 | }, | 74 | }, |
65 | { /* end of list */ }, | 75 | { /* end of list */ }, |
66 | }; | 76 | }; |
@@ -90,13 +100,12 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd) | |||
90 | 100 | ||
91 | static int __init mvebu_system_controller_init(void) | 101 | static int __init mvebu_system_controller_init(void) |
92 | { | 102 | { |
103 | const struct of_device_id *match; | ||
93 | struct device_node *np; | 104 | struct device_node *np; |
94 | 105 | ||
95 | np = of_find_matching_node(NULL, of_system_controller_table); | 106 | np = of_find_matching_node_and_match(NULL, of_system_controller_table, |
107 | &match); | ||
96 | if (np) { | 108 | if (np) { |
97 | const struct of_device_id *match = | ||
98 | of_match_node(of_system_controller_table, np); | ||
99 | BUG_ON(!match); | ||
100 | system_controller_base = of_iomap(np, 0); | 109 | system_controller_base = of_iomap(np, 0); |
101 | mvebu_sc = (struct mvebu_system_controller *)match->data; | 110 | mvebu_sc = (struct mvebu_system_controller *)match->data; |
102 | of_node_put(np); | 111 | of_node_put(np); |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 1f8fed94c2a4..dccd7e177653 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -855,7 +855,7 @@ config OUTER_CACHE_SYNC | |||
855 | 855 | ||
856 | config CACHE_FEROCEON_L2 | 856 | config CACHE_FEROCEON_L2 |
857 | bool "Enable the Feroceon L2 cache controller" | 857 | bool "Enable the Feroceon L2 cache controller" |
858 | depends on ARCH_KIRKWOOD || ARCH_MV78XX0 | 858 | depends on ARCH_KIRKWOOD || ARCH_MV78XX0 || ARCH_MVEBU |
859 | default y | 859 | default y |
860 | select OUTER_CACHE | 860 | select OUTER_CACHE |
861 | help | 861 | help |
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index 48bc3c0a87ce..8dc1a2b5a8ed 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c | |||
@@ -13,10 +13,15 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/of.h> | ||
17 | #include <linux/of_address.h> | ||
16 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
19 | #include <linux/io.h> | ||
17 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
18 | #include <asm/cp15.h> | 21 | #include <asm/cp15.h> |
19 | #include <plat/cache-feroceon-l2.h> | 22 | #include <asm/hardware/cache-feroceon-l2.h> |
23 | |||
24 | #define L2_WRITETHROUGH_KIRKWOOD BIT(4) | ||
20 | 25 | ||
21 | /* | 26 | /* |
22 | * Low-level cache maintenance operations. | 27 | * Low-level cache maintenance operations. |
@@ -350,3 +355,41 @@ void __init feroceon_l2_init(int __l2_wt_override) | |||
350 | printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", | 355 | printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", |
351 | l2_wt_override ? ", in WT override mode" : ""); | 356 | l2_wt_override ? ", in WT override mode" : ""); |
352 | } | 357 | } |
358 | #ifdef CONFIG_OF | ||
359 | static const struct of_device_id feroceon_ids[] __initconst = { | ||
360 | { .compatible = "marvell,kirkwood-cache"}, | ||
361 | { .compatible = "marvell,feroceon-cache"}, | ||
362 | {} | ||
363 | }; | ||
364 | |||
365 | int __init feroceon_of_init(void) | ||
366 | { | ||
367 | struct device_node *node; | ||
368 | void __iomem *base; | ||
369 | bool l2_wt_override = false; | ||
370 | struct resource res; | ||
371 | |||
372 | #if defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH) | ||
373 | l2_wt_override = true; | ||
374 | #endif | ||
375 | |||
376 | node = of_find_matching_node(NULL, feroceon_ids); | ||
377 | if (node && of_device_is_compatible(node, "marvell,kirkwood-cache")) { | ||
378 | if (of_address_to_resource(node, 0, &res)) | ||
379 | return -ENODEV; | ||
380 | |||
381 | base = ioremap(res.start, resource_size(&res)); | ||
382 | if (!base) | ||
383 | return -ENOMEM; | ||
384 | |||
385 | if (l2_wt_override) | ||
386 | writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base); | ||
387 | else | ||
388 | writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base); | ||
389 | } | ||
390 | |||
391 | feroceon_l2_init(l2_wt_override); | ||
392 | |||
393 | return 0; | ||
394 | } | ||
395 | #endif | ||