diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-05 17:19:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-05 17:19:54 -0400 |
commit | ff050ad12c551233e546506409c89eb2f640d9f3 (patch) | |
tree | 8ae29fece122a91cbd6160fb2ca34c0ea82c3df9 /arch/arm/mach-mvebu | |
parent | dfc25e4503aef6b82a1de4a0fbe19aafa8648fbe (diff) | |
parent | 9233087dc468f75bdeb7830c694c09dc74be88c4 (diff) |
Merge tag 'soc-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC specific changes from Arnd Bergmann:
"Lots of changes specific to one of the SoC families. Some that stick
out are:
- mach-qcom gains new features, most importantly SMP support for the
newer chips (Stephen Boyd, Rohit Vaswani)
- mvebu gains support for three new SoCs: Armada 375, 380 and 385
(Thomas Petazzoni and Free-electrons team)
- SMP support for Rockchips (Heiko Stübner)
- Lots of i.MX changes (Shawn Guo)
- Added support for BCM5301x SoC (Hauke Mehrtens)
- Multiplatform support for Marvell Kirkwood and Dove (Andrew Lunn
and Sebastian Hesselbarth doing the final part of a long journey)
- Unify davinci platforms and remove obsolete ones (Sekhar Nori, Arnd
Bergmann)"
* tag 'soc-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (126 commits)
ARM: sunxi: Select HAVE_ARM_ARCH_TIMER
ARM: cache-tauros2: remove ARMv6 code
ARM: mvebu: don't select CONFIG_NEON
ARM: davinci: fix DT booting with default defconfig
ARM: configs: bcm_defconfig: enable bcm590xx regulator support
ARM: davinci: remove tnetv107x support
MAINTAINERS: Update ARM STi maintainers
ARM: restrict BCM_KONA_UART to ARCH_BCM_MOBILE
ARM: bcm21664: Add board support.
ARM: sunxi: Add the new watchog compatibles to the reboot code
ARM: enable ARM_HAS_SG_CHAIN for multiplatform
ARM: davinci: remove da8xx_omapl_defconfig
ARM: davinci: da8xx: fix multiple watchdog device registration
ARM: davinci: add da8xx specific configs to davinci_all_defconfig
ARM: davinci: enable da8xx build concurrently with older devices
ARM: BCM5301X: workaround suppress fault
ARM: BCM5301X: add early debugging support
ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
ARM: mach-bcm: Remove GENERIC_TIME
ARM: shmobile: APMU: Fix warnings due to improper printk formats
...
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r-- | arch/arm/mach-mvebu/Kconfig | 79 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/Makefile | 8 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/board-t5325.c | 41 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/board-v7.c (renamed from arch/arm/mach-mvebu/armada-370-xp.c) | 58 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/board.h | 22 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/dove.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/kirkwood-pm.c | 76 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/kirkwood-pm.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/kirkwood.c | 199 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/kirkwood.h | 22 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/mvebu-soc-id.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/system-controller.c | 14 |
12 files changed, 568 insertions, 17 deletions
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index ca004aceaf8e..3f73eecbcfb0 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 GENERIC_IRQ_CHIP | 5 | select GENERIC_IRQ_CHIP |
@@ -15,32 +15,95 @@ config ARCH_MVEBU | |||
15 | 15 | ||
16 | if ARCH_MVEBU | 16 | if ARCH_MVEBU |
17 | 17 | ||
18 | menu "Marvell SOC with device tree" | 18 | menu "Marvell EBU SoC variants" |
19 | 19 | ||
20 | config MACH_ARMADA_370_XP | 20 | config MACH_MVEBU_V7 |
21 | bool | 21 | bool |
22 | select ARMADA_370_XP_TIMER | 22 | select ARMADA_370_XP_TIMER |
23 | select CACHE_L2X0 | 23 | select CACHE_L2X0 |
24 | select CPU_PJ4B | ||
25 | 24 | ||
26 | config MACH_ARMADA_370 | 25 | config MACH_ARMADA_370 |
27 | bool "Marvell Armada 370 boards" | 26 | bool "Marvell Armada 370 boards" if ARCH_MULTI_V7 |
28 | select ARMADA_370_CLK | 27 | select ARMADA_370_CLK |
29 | select MACH_ARMADA_370_XP | 28 | select CPU_PJ4B |
29 | select MACH_MVEBU_V7 | ||
30 | select PINCTRL_ARMADA_370 | 30 | select PINCTRL_ARMADA_370 |
31 | help | 31 | help |
32 | Say 'Y' here if you want your kernel to support boards based | 32 | Say 'Y' here if you want your kernel to support boards based |
33 | on the Marvell Armada 370 SoC with device tree. | 33 | on the Marvell Armada 370 SoC with device tree. |
34 | 34 | ||
35 | config MACH_ARMADA_375 | ||
36 | bool "Marvell Armada 375 boards" if ARCH_MULTI_V7 | ||
37 | select ARM_ERRATA_720789 | ||
38 | select ARM_ERRATA_753970 | ||
39 | select ARM_GIC | ||
40 | select ARMADA_375_CLK | ||
41 | select CPU_V7 | ||
42 | select MACH_MVEBU_V7 | ||
43 | select PINCTRL_ARMADA_375 | ||
44 | help | ||
45 | Say 'Y' here if you want your kernel to support boards based | ||
46 | on the Marvell Armada 375 SoC with device tree. | ||
47 | |||
48 | config MACH_ARMADA_38X | ||
49 | bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7 | ||
50 | select ARM_ERRATA_720789 | ||
51 | select ARM_ERRATA_753970 | ||
52 | select ARM_GIC | ||
53 | select ARMADA_38X_CLK | ||
54 | select CPU_V7 | ||
55 | select MACH_MVEBU_V7 | ||
56 | select PINCTRL_ARMADA_38X | ||
57 | help | ||
58 | Say 'Y' here if you want your kernel to support boards based | ||
59 | on the Marvell Armada 380/385 SoC with device tree. | ||
60 | |||
35 | config MACH_ARMADA_XP | 61 | config MACH_ARMADA_XP |
36 | bool "Marvell Armada XP boards" | 62 | bool "Marvell Armada XP boards" if ARCH_MULTI_V7 |
37 | select ARMADA_XP_CLK | 63 | select ARMADA_XP_CLK |
38 | select MACH_ARMADA_370_XP | 64 | select CPU_PJ4B |
65 | select MACH_MVEBU_V7 | ||
39 | select PINCTRL_ARMADA_XP | 66 | select PINCTRL_ARMADA_XP |
40 | help | 67 | help |
41 | Say 'Y' here if you want your kernel to support boards based | 68 | Say 'Y' here if you want your kernel to support boards based |
42 | on the Marvell Armada XP SoC with device tree. | 69 | on the Marvell Armada XP SoC with device tree. |
43 | 70 | ||
71 | config MACH_DOVE | ||
72 | bool "Marvell Dove boards" if ARCH_MULTI_V7 | ||
73 | select CACHE_L2X0 | ||
74 | select CPU_PJ4 | ||
75 | select DOVE_CLK | ||
76 | select ORION_IRQCHIP | ||
77 | select ORION_TIMER | ||
78 | select PINCTRL_DOVE | ||
79 | help | ||
80 | Say 'Y' here if you want your kernel to support the | ||
81 | Marvell Dove using flattened device tree. | ||
82 | |||
83 | config MACH_KIRKWOOD | ||
84 | bool "Marvell Kirkwood boards" if ARCH_MULTI_V5 | ||
85 | select ARCH_HAS_CPUFREQ | ||
86 | select ARCH_REQUIRE_GPIOLIB | ||
87 | select CPU_FEROCEON | ||
88 | select KIRKWOOD_CLK | ||
89 | select OF_IRQ | ||
90 | select ORION_IRQCHIP | ||
91 | select ORION_TIMER | ||
92 | select PCI | ||
93 | select PCI_QUIRKS | ||
94 | select PINCTRL_KIRKWOOD | ||
95 | select USE_OF | ||
96 | help | ||
97 | Say 'Y' here if you want your kernel to support boards based | ||
98 | on the Marvell Kirkwood device tree. | ||
99 | |||
100 | config MACH_T5325 | ||
101 | bool "HP T5325 thin client" | ||
102 | depends on MACH_KIRKWOOD | ||
103 | help | ||
104 | Say 'Y' here if you want your kernel to support the | ||
105 | HP T5325 Thin client | ||
106 | |||
44 | endmenu | 107 | endmenu |
45 | 108 | ||
46 | endif | 109 | endif |
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index d99846103bbb..a63e43b6b451 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -3,7 +3,11 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ | |||
3 | 3 | ||
4 | AFLAGS_coherency_ll.o := -Wa,-march=armv7-a | 4 | AFLAGS_coherency_ll.o := -Wa,-march=armv7-a |
5 | 5 | ||
6 | obj-y += coherency.o coherency_ll.o pmsu.o 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 | ||
9 | obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o | ||
8 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 10 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
9 | 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 a57cb36d52af..333fca8fdc41 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/board-v7.c | |||
@@ -32,7 +32,28 @@ | |||
32 | #include "coherency.h" | 32 | #include "coherency.h" |
33 | #include "mvebu-soc-id.h" | 33 | #include "mvebu-soc-id.h" |
34 | 34 | ||
35 | static void __init armada_370_xp_timer_and_clk_init(void) | 35 | /* |
36 | * Early versions of Armada 375 SoC have a bug where the BootROM | ||
37 | * leaves an external data abort pending. The kernel is hit by this | ||
38 | * data abort as soon as it enters userspace, because it unmasks the | ||
39 | * data aborts at this moment. We register a custom abort handler | ||
40 | * below to ignore the first data abort to work around this | ||
41 | * problem. | ||
42 | */ | ||
43 | static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr, | ||
44 | struct pt_regs *regs) | ||
45 | { | ||
46 | static int ignore_first; | ||
47 | |||
48 | if (!ignore_first && fsr == 0x1406) { | ||
49 | ignore_first = 1; | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | return 1; | ||
54 | } | ||
55 | |||
56 | static void __init mvebu_timer_and_clk_init(void) | ||
36 | { | 57 | { |
37 | of_clk_init(NULL); | 58 | of_clk_init(NULL); |
38 | clocksource_of_init(); | 59 | clocksource_of_init(); |
@@ -41,6 +62,10 @@ static void __init armada_370_xp_timer_and_clk_init(void) | |||
41 | #ifdef CONFIG_CACHE_L2X0 | 62 | #ifdef CONFIG_CACHE_L2X0 |
42 | l2x0_of_init(0, ~0UL); | 63 | l2x0_of_init(0, ~0UL); |
43 | #endif | 64 | #endif |
65 | |||
66 | if (of_machine_is_compatible("marvell,armada375")) | ||
67 | hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, | ||
68 | "imprecise external abort"); | ||
44 | } | 69 | } |
45 | 70 | ||
46 | static void __init i2c_quirk(void) | 71 | static void __init i2c_quirk(void) |
@@ -71,7 +96,7 @@ static void __init i2c_quirk(void) | |||
71 | return; | 96 | return; |
72 | } | 97 | } |
73 | 98 | ||
74 | static void __init armada_370_xp_dt_init(void) | 99 | static void __init mvebu_dt_init(void) |
75 | { | 100 | { |
76 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) | 101 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) |
77 | i2c_quirk(); | 102 | i2c_quirk(); |
@@ -83,10 +108,33 @@ static const char * const armada_370_xp_dt_compat[] = { | |||
83 | NULL, | 108 | NULL, |
84 | }; | 109 | }; |
85 | 110 | ||
86 | DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") | 111 | DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)") |
87 | .smp = smp_ops(armada_xp_smp_ops), | 112 | .smp = smp_ops(armada_xp_smp_ops), |
88 | .init_machine = armada_370_xp_dt_init, | 113 | .init_machine = mvebu_dt_init, |
89 | .init_time = armada_370_xp_timer_and_clk_init, | 114 | .init_time = mvebu_timer_and_clk_init, |
90 | .restart = mvebu_restart, | 115 | .restart = mvebu_restart, |
91 | .dt_compat = armada_370_xp_dt_compat, | 116 | .dt_compat = armada_370_xp_dt_compat, |
92 | MACHINE_END | 117 | MACHINE_END |
118 | |||
119 | static const char * const armada_375_dt_compat[] = { | ||
120 | "marvell,armada375", | ||
121 | NULL, | ||
122 | }; | ||
123 | |||
124 | DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)") | ||
125 | .init_time = mvebu_timer_and_clk_init, | ||
126 | .restart = mvebu_restart, | ||
127 | .dt_compat = armada_375_dt_compat, | ||
128 | MACHINE_END | ||
129 | |||
130 | static const char * const armada_38x_dt_compat[] = { | ||
131 | "marvell,armada380", | ||
132 | "marvell,armada385", | ||
133 | NULL, | ||
134 | }; | ||
135 | |||
136 | DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") | ||
137 | .init_time = mvebu_timer_and_clk_init, | ||
138 | .restart = mvebu_restart, | ||
139 | .dt_compat = armada_38x_dt_compat, | ||
140 | 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-mvebu/dove.c b/arch/arm/mach-mvebu/dove.c new file mode 100644 index 000000000000..5e5a43624237 --- /dev/null +++ b/arch/arm/mach-mvebu/dove.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mvebu/dove.c | ||
3 | * | ||
4 | * Marvell Dove 88AP510 System On Chip FDT Board | ||
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/init.h> | ||
12 | #include <linux/mbus.h> | ||
13 | #include <linux/of.h> | ||
14 | #include <linux/of_platform.h> | ||
15 | #include <asm/hardware/cache-tauros2.h> | ||
16 | #include <asm/mach/arch.h> | ||
17 | #include "common.h" | ||
18 | |||
19 | static void __init dove_init(void) | ||
20 | { | ||
21 | pr_info("Dove 88AP510 SoC\n"); | ||
22 | |||
23 | #ifdef CONFIG_CACHE_TAUROS2 | ||
24 | tauros2_init(0); | ||
25 | #endif | ||
26 | BUG_ON(mvebu_mbus_dt_init()); | ||
27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
28 | } | ||
29 | |||
30 | static const char * const dove_dt_compat[] = { | ||
31 | "marvell,dove", | ||
32 | NULL | ||
33 | }; | ||
34 | |||
35 | DT_MACHINE_START(DOVE_DT, "Marvell Dove") | ||
36 | .init_machine = dove_init, | ||
37 | .restart = mvebu_restart, | ||
38 | .dt_compat = dove_dt_compat, | ||
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 e6e300afe836..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, |
@@ -61,6 +68,9 @@ static const struct of_device_id of_system_controller_table[] = { | |||
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 | }; |