aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Dongsheng <dongsheng.wang@freescale.com>2013-12-17 03:17:00 -0500
committerScott Wood <scottwood@freescale.com>2014-01-07 20:39:48 -0500
commit202e059ce34d5c5e3ff8a542866c280d575ccb17 (patch)
tree60ee3dd035e0889cd1bb5e7b57879331fc5d11aa
parent71a6fa17e1526d3f26f4711cc55d339f96c49a95 (diff)
powerpc/85xx: add hardware automatically enter altivec idle state
Each core's AltiVec unit may be placed into a power savings mode by turning off power to the unit. Core hardware will automatically power down the AltiVec unit after no AltiVec instructions have executed in N cycles. The AltiVec power-control is triggered by hardware. Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r--arch/powerpc/kernel/cpu_setup_fsl_booke.S21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
index fa6862db8a02..26c09db2ec20 100644
--- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -53,6 +53,25 @@ _GLOBAL(__e500_dcache_setup)
53 isync 53 isync
54 blr 54 blr
55 55
56/*
57 * FIXME - we haven't yet done testing to determine a reasonable default
58 * value for AV_WAIT_IDLE_BIT.
59 */
60#define AV_WAIT_IDLE_BIT 50 /* 1ms, TB frequency is 41.66MHZ */
61_GLOBAL(setup_altivec_idle)
62 mfspr r3, SPRN_PWRMGTCR0
63
64 /* Enable Altivec Idle */
65 oris r3, r3, PWRMGTCR0_AV_IDLE_PD_EN@h
66 li r11, AV_WAIT_IDLE_BIT
67
68 /* Set Automatic AltiVec Idle Count */
69 rlwimi r3, r11, PWRMGTCR0_AV_IDLE_CNT_SHIFT, PWRMGTCR0_AV_IDLE_CNT
70
71 mtspr SPRN_PWRMGTCR0, r3
72
73 blr
74
56_GLOBAL(__setup_cpu_e6500) 75_GLOBAL(__setup_cpu_e6500)
57 mflr r6 76 mflr r6
58#ifdef CONFIG_PPC64 77#ifdef CONFIG_PPC64
@@ -64,6 +83,7 @@ _GLOBAL(__setup_cpu_e6500)
64 bl .setup_lrat_ivor 83 bl .setup_lrat_ivor
651: 841:
66#endif 85#endif
86 bl setup_altivec_idle
67 bl __setup_cpu_e5500 87 bl __setup_cpu_e5500
68 mtlr r6 88 mtlr r6
69 blr 89 blr
@@ -131,6 +151,7 @@ _GLOBAL(__restore_cpu_e6500)
131 beq 1f 151 beq 1f
132 bl .setup_lrat_ivor 152 bl .setup_lrat_ivor
1331: 1531:
154 bl .setup_altivec_idle
134 bl __restore_cpu_e5500 155 bl __restore_cpu_e5500
135 mtlr r5 156 mtlr r5
136 blr 157 blr