aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Dongsheng <dongsheng.wang@freescale.com>2013-12-17 03:17:01 -0500
committerScott Wood <scottwood@freescale.com>2014-01-07 20:40:28 -0500
commit1d47ddf7c3725e889763b1fffa70a04e1061940b (patch)
treeab109ea6d4c9f052c6515b1b0c40659076a4d1f3
parent202e059ce34d5c5e3ff8a542866c280d575ccb17 (diff)
powerpc/85xx: add hardware automatically enter pw20 state
Using hardware features make core automatically enter PW20 state. Set a TB count to hardware, the effective count begins when PW10 is entered. When the effective period has expired, the core will proceed from PW10 to PW20 if no exit conditions have occurred during the period. 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 26c09db2ec20..cc2d8962e090 100644
--- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -55,6 +55,25 @@ _GLOBAL(__e500_dcache_setup)
55 55
56/* 56/*
57 * FIXME - we haven't yet done testing to determine a reasonable default 57 * FIXME - we haven't yet done testing to determine a reasonable default
58 * value for PW20_WAIT_IDLE_BIT.
59 */
60#define PW20_WAIT_IDLE_BIT 50 /* 1ms, TB frequency is 41.66MHZ */
61_GLOBAL(setup_pw20_idle)
62 mfspr r3, SPRN_PWRMGTCR0
63
64 /* Set PW20_WAIT bit, enable pw20 state*/
65 ori r3, r3, PWRMGTCR0_PW20_WAIT
66 li r11, PW20_WAIT_IDLE_BIT
67
68 /* Set Automatic PW20 Core Idle Count */
69 rlwimi r3, r11, PWRMGTCR0_PW20_ENT_SHIFT, PWRMGTCR0_PW20_ENT
70
71 mtspr SPRN_PWRMGTCR0, r3
72
73 blr
74
75/*
76 * FIXME - we haven't yet done testing to determine a reasonable default
58 * value for AV_WAIT_IDLE_BIT. 77 * value for AV_WAIT_IDLE_BIT.
59 */ 78 */
60#define AV_WAIT_IDLE_BIT 50 /* 1ms, TB frequency is 41.66MHZ */ 79#define AV_WAIT_IDLE_BIT 50 /* 1ms, TB frequency is 41.66MHZ */
@@ -83,6 +102,7 @@ _GLOBAL(__setup_cpu_e6500)
83 bl .setup_lrat_ivor 102 bl .setup_lrat_ivor
841: 1031:
85#endif 104#endif
105 bl setup_pw20_idle
86 bl setup_altivec_idle 106 bl setup_altivec_idle
87 bl __setup_cpu_e5500 107 bl __setup_cpu_e5500
88 mtlr r6 108 mtlr r6
@@ -151,6 +171,7 @@ _GLOBAL(__restore_cpu_e6500)
151 beq 1f 171 beq 1f
152 bl .setup_lrat_ivor 172 bl .setup_lrat_ivor
1531: 1731:
174 bl .setup_pw20_idle
154 bl .setup_altivec_idle 175 bl .setup_altivec_idle
155 bl __restore_cpu_e5500 176 bl __restore_cpu_e5500
156 mtlr r5 177 mtlr r5