aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@free-electrons.com>2014-04-14 11:10:10 -0400
committerJason Cooper <jason@lakedaemon.net>2014-05-08 12:18:56 -0400
commitf713c7e7421d6945c977c8d8813e8089f925de41 (patch)
tree3895c2af9593f7700057fd4ed7f1f2553e20ae16 /arch/arm
parent1a6bfbc339b6a2b59a8f88fa494fe70073cdb85a (diff)
ARM: mvebu: Allow to power down L2 cache controller in idle mode
This commit adds a function which adjusts the PMSU configuration to automatically power down the L2 and coherency fabric when we enter a certain idle state. This feature is part of the Power Management Service Unit of the Armada 370 and Armada XP SoCs. Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Link: https://lkml.kernel.org/r/1397488214-20685-8-git-send-email-gregory.clement@free-electrons.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mvebu/pmsu.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c
index a8796b832e2e..7ccf14a065b1 100644
--- a/arch/arm/mach-mvebu/pmsu.c
+++ b/arch/arm/mach-mvebu/pmsu.c
@@ -33,7 +33,12 @@ static void __iomem *pmsu_mp_base;
33#define PMSU_BASE_OFFSET 0x100 33#define PMSU_BASE_OFFSET 0x100
34#define PMSU_REG_SIZE 0x1000 34#define PMSU_REG_SIZE 0x1000
35 35
36#define PMSU_BOOT_ADDR_REDIRECT_OFFSET(cpu) ((cpu * 0x100) + 0x124) 36/* PMSU MP registers */
37#define PMSU_BOOT_ADDR_REDIRECT_OFFSET(cpu) ((cpu * 0x100) + 0x124)
38
39/* PMSU fabric registers */
40#define L2C_NFABRIC_PM_CTL 0x4
41#define L2C_NFABRIC_PM_CTL_PWR_DOWN BIT(20)
37 42
38static struct of_device_id of_pmsu_table[] = { 43static struct of_device_id of_pmsu_table[] = {
39 { .compatible = "marvell,armada-370-pmsu", }, 44 { .compatible = "marvell,armada-370-pmsu", },
@@ -92,4 +97,17 @@ static int __init armada_370_xp_pmsu_init(void)
92 return ret; 97 return ret;
93} 98}
94 99
100static void armada_370_xp_pmsu_enable_l2_powerdown_onidle(void)
101{
102 u32 reg;
103
104 if (pmsu_mp_base == NULL)
105 return;
106
107 /* Enable L2 & Fabric powerdown in Deep-Idle mode - Fabric */
108 reg = readl(pmsu_mp_base + L2C_NFABRIC_PM_CTL);
109 reg |= L2C_NFABRIC_PM_CTL_PWR_DOWN;
110 writel(reg, pmsu_mp_base + L2C_NFABRIC_PM_CTL);
111}
112
95early_initcall(armada_370_xp_pmsu_init); 113early_initcall(armada_370_xp_pmsu_init);