aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-highbank/sysregs.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-highbank/sysregs.h')
-rw-r--r--arch/arm/mach-highbank/sysregs.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-highbank/sysregs.h b/arch/arm/mach-highbank/sysregs.h
index 0e913389f445..e13e8ea7c6cb 100644
--- a/arch/arm/mach-highbank/sysregs.h
+++ b/arch/arm/mach-highbank/sysregs.h
@@ -17,6 +17,10 @@
17#define _MACH_HIGHBANK__SYSREGS_H_ 17#define _MACH_HIGHBANK__SYSREGS_H_
18 18
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/smp.h>
21#include <asm/smp_plat.h>
22#include <asm/smp_scu.h>
23#include "core.h"
20 24
21extern void __iomem *sregs_base; 25extern void __iomem *sregs_base;
22 26
@@ -29,24 +33,39 @@ extern void __iomem *sregs_base;
29#define HB_PWR_HARD_RESET 2 33#define HB_PWR_HARD_RESET 2
30#define HB_PWR_SHUTDOWN 3 34#define HB_PWR_SHUTDOWN 3
31 35
36#define SREG_CPU_PWR_CTRL(c) (0x200 + ((c) * 4))
37
38static inline void highbank_set_core_pwr(void)
39{
40 int cpu = cpu_logical_map(smp_processor_id());
41 if (scu_base_addr)
42 scu_power_mode(scu_base_addr, SCU_PM_POWEROFF);
43 else
44 writel_relaxed(1, sregs_base + SREG_CPU_PWR_CTRL(cpu));
45}
46
32static inline void hignbank_set_pwr_suspend(void) 47static inline void hignbank_set_pwr_suspend(void)
33{ 48{
34 writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ); 49 writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
50 highbank_set_core_pwr();
35} 51}
36 52
37static inline void hignbank_set_pwr_shutdown(void) 53static inline void hignbank_set_pwr_shutdown(void)
38{ 54{
39 writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ); 55 writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
56 highbank_set_core_pwr();
40} 57}
41 58
42static inline void hignbank_set_pwr_soft_reset(void) 59static inline void hignbank_set_pwr_soft_reset(void)
43{ 60{
44 writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ); 61 writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
62 highbank_set_core_pwr();
45} 63}
46 64
47static inline void hignbank_set_pwr_hard_reset(void) 65static inline void hignbank_set_pwr_hard_reset(void)
48{ 66{
49 writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ); 67 writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
68 highbank_set_core_pwr();
50} 69}
51 70
52#endif 71#endif