提交 1d47ddf7 编写于 作者: W Wang Dongsheng 提交者: Scott Wood

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: NWang Dongsheng <dongsheng.wang@freescale.com>
Signed-off-by: NScott Wood <scottwood@freescale.com>
上级 202e059c
...@@ -53,6 +53,25 @@ _GLOBAL(__e500_dcache_setup) ...@@ -53,6 +53,25 @@ _GLOBAL(__e500_dcache_setup)
isync isync
blr blr
/*
* FIXME - we haven't yet done testing to determine a reasonable default
* value for PW20_WAIT_IDLE_BIT.
*/
#define PW20_WAIT_IDLE_BIT 50 /* 1ms, TB frequency is 41.66MHZ */
_GLOBAL(setup_pw20_idle)
mfspr r3, SPRN_PWRMGTCR0
/* Set PW20_WAIT bit, enable pw20 state*/
ori r3, r3, PWRMGTCR0_PW20_WAIT
li r11, PW20_WAIT_IDLE_BIT
/* Set Automatic PW20 Core Idle Count */
rlwimi r3, r11, PWRMGTCR0_PW20_ENT_SHIFT, PWRMGTCR0_PW20_ENT
mtspr SPRN_PWRMGTCR0, r3
blr
/* /*
* FIXME - we haven't yet done testing to determine a reasonable default * FIXME - we haven't yet done testing to determine a reasonable default
* value for AV_WAIT_IDLE_BIT. * value for AV_WAIT_IDLE_BIT.
...@@ -83,6 +102,7 @@ _GLOBAL(__setup_cpu_e6500) ...@@ -83,6 +102,7 @@ _GLOBAL(__setup_cpu_e6500)
bl .setup_lrat_ivor bl .setup_lrat_ivor
1: 1:
#endif #endif
bl setup_pw20_idle
bl setup_altivec_idle bl setup_altivec_idle
bl __setup_cpu_e5500 bl __setup_cpu_e5500
mtlr r6 mtlr r6
...@@ -151,6 +171,7 @@ _GLOBAL(__restore_cpu_e6500) ...@@ -151,6 +171,7 @@ _GLOBAL(__restore_cpu_e6500)
beq 1f beq 1f
bl .setup_lrat_ivor bl .setup_lrat_ivor
1: 1:
bl .setup_pw20_idle
bl .setup_altivec_idle bl .setup_altivec_idle
bl __restore_cpu_e5500 bl __restore_cpu_e5500
mtlr r5 mtlr r5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册