diff options
author | Wang Dongsheng <dongsheng.wang@freescale.com> | 2013-12-17 03:17:00 -0500 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-01-07 20:39:48 -0500 |
commit | 202e059ce34d5c5e3ff8a542866c280d575ccb17 (patch) | |
tree | 60ee3dd035e0889cd1bb5e7b57879331fc5d11aa | |
parent | 71a6fa17e1526d3f26f4711cc55d339f96c49a95 (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.S | 21 |
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 |
65 | 1: | 84 | 1: |
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 |
133 | 1: | 153 | 1: |
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 |