aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJason Cooper <jason@lakedaemon.net>2013-01-31 12:38:48 -0500
committerJason Cooper <jason@lakedaemon.net>2013-01-31 12:38:48 -0500
commit222922189c0b3c6e3ba117ca6e964278c1e0ccc8 (patch)
tree273f1c7b096510f1236b3eca8293142c812eb1a1 /drivers
parentde7c007ff6bbabb87e0ac639848eb728e2234fa2 (diff)
parent9cfc94eb0f4843af5d1141a37d7b7ca5d3b27220 (diff)
Merge tag 'tags/drivers_for_v3.9' into mvebu/boards
mvebu drivers for v3.9 - use rtc-mv in mvebu armv7 SoCs - add pci-e hotplug for kirkwood Depends on: - tags/mvebu_fixes_for_v3.8-rc6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpuidle/Kconfig6
-rw-r--r--drivers/cpuidle/Makefile1
-rw-r--r--drivers/cpuidle/cpuidle-kirkwood.c106
-rw-r--r--drivers/rtc/Kconfig2
4 files changed, 114 insertions, 1 deletions
diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig
index c4cc27e5c8a5..071e2c3eec4f 100644
--- a/drivers/cpuidle/Kconfig
+++ b/drivers/cpuidle/Kconfig
@@ -39,4 +39,10 @@ config CPU_IDLE_CALXEDA
39 help 39 help
40 Select this to enable cpuidle on Calxeda processors. 40 Select this to enable cpuidle on Calxeda processors.
41 41
42config CPU_IDLE_KIRKWOOD
43 bool "CPU Idle Driver for Kirkwood processors"
44 depends on ARCH_KIRKWOOD
45 help
46 Select this to enable cpuidle on Kirkwood processors.
47
42endif 48endif
diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile
index 03ee87482c71..24c6e7d945ed 100644
--- a/drivers/cpuidle/Makefile
+++ b/drivers/cpuidle/Makefile
@@ -6,3 +6,4 @@ obj-y += cpuidle.o driver.o governor.o sysfs.o governors/
6obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o 6obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o
7 7
8obj-$(CONFIG_CPU_IDLE_CALXEDA) += cpuidle-calxeda.o 8obj-$(CONFIG_CPU_IDLE_CALXEDA) += cpuidle-calxeda.o
9obj-$(CONFIG_CPU_IDLE_KIRKWOOD) += cpuidle-kirkwood.o
diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c
new file mode 100644
index 000000000000..670aa1e55cd6
--- /dev/null
+++ b/drivers/cpuidle/cpuidle-kirkwood.c
@@ -0,0 +1,106 @@
1/*
2 * arch/arm/mach-kirkwood/cpuidle.c
3 *
4 * CPU idle Marvell Kirkwood SoCs
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 * The cpu idle uses wait-for-interrupt and DDR self refresh in order
11 * to implement two idle states -
12 * #1 wait-for-interrupt
13 * #2 wait-for-interrupt and DDR self refresh
14 */
15
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/init.h>
19#include <linux/platform_device.h>
20#include <linux/cpuidle.h>
21#include <linux/io.h>
22#include <linux/export.h>
23#include <asm/proc-fns.h>
24#include <asm/cpuidle.h>
25
26#define KIRKWOOD_MAX_STATES 2
27
28static void __iomem *ddr_operation_base;
29
30/* Actual code that puts the SoC in different idle states */
31static int kirkwood_enter_idle(struct cpuidle_device *dev,
32 struct cpuidle_driver *drv,
33 int index)
34{
35 writel(0x7, ddr_operation_base);
36 cpu_do_idle();
37
38 return index;
39}
40
41static struct cpuidle_driver kirkwood_idle_driver = {
42 .name = "kirkwood_idle",
43 .owner = THIS_MODULE,
44 .en_core_tk_irqen = 1,
45 .states[0] = ARM_CPUIDLE_WFI_STATE,
46 .states[1] = {
47 .enter = kirkwood_enter_idle,
48 .exit_latency = 10,
49 .target_residency = 100000,
50 .flags = CPUIDLE_FLAG_TIME_VALID,
51 .name = "DDR SR",
52 .desc = "WFI and DDR Self Refresh",
53 },
54 .state_count = KIRKWOOD_MAX_STATES,
55};
56static struct cpuidle_device *device;
57
58static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
59
60/* Initialize CPU idle by registering the idle states */
61static int kirkwood_cpuidle_probe(struct platform_device *pdev)
62{
63 struct resource *res;
64
65 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
66 if (res == NULL)
67 return -EINVAL;
68
69 ddr_operation_base = devm_request_and_ioremap(&pdev->dev, res);
70 if (!ddr_operation_base)
71 return -EADDRNOTAVAIL;
72
73 device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
74 device->state_count = KIRKWOOD_MAX_STATES;
75
76 cpuidle_register_driver(&kirkwood_idle_driver);
77 if (cpuidle_register_device(device)) {
78 pr_err("kirkwood_init_cpuidle: Failed registering\n");
79 return -EIO;
80 }
81 return 0;
82}
83
84int kirkwood_cpuidle_remove(struct platform_device *pdev)
85{
86 cpuidle_unregister_device(device);
87 cpuidle_unregister_driver(&kirkwood_idle_driver);
88
89 return 0;
90}
91
92static struct platform_driver kirkwood_cpuidle_driver = {
93 .probe = kirkwood_cpuidle_probe,
94 .remove = kirkwood_cpuidle_remove,
95 .driver = {
96 .name = "kirkwood_cpuidle",
97 .owner = THIS_MODULE,
98 },
99};
100
101module_platform_driver(kirkwood_cpuidle_driver);
102
103MODULE_AUTHOR("Andrew Lunn <andrew@lunn.ch>");
104MODULE_DESCRIPTION("Kirkwood cpu idle driver");
105MODULE_LICENSE("GPL v2");
106MODULE_ALIAS("platform:kirkwood-cpuidle");
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 923a9da9c829..20354b43932e 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1023,7 +1023,7 @@ config RTC_DRV_TX4939
1023 1023
1024config RTC_DRV_MV 1024config RTC_DRV_MV
1025 tristate "Marvell SoC RTC" 1025 tristate "Marvell SoC RTC"
1026 depends on ARCH_KIRKWOOD || ARCH_DOVE 1026 depends on ARCH_KIRKWOOD || ARCH_DOVE || ARCH_MVEBU
1027 help 1027 help
1028 If you say yes here you will get support for the in-chip RTC 1028 If you say yes here you will get support for the in-chip RTC
1029 that can be found in some of Marvell's SoC devices, such as 1029 that can be found in some of Marvell's SoC devices, such as