diff options
author | Varun Sethi <Varun.Sethi@freescale.com> | 2012-07-09 08:55:31 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2012-09-12 15:57:08 -0400 |
commit | 7e0f4872a33c6da38e727cf42c939cc32294fce6 (patch) | |
tree | 265facd39925716670eb36263a48a4c8cd9d4d62 /arch/powerpc | |
parent | d0832a75075b1119635e0f48549e378040cf5e67 (diff) |
powepc/booke: Separate out E.HV check and ivor setup code.
Move the E.HV check and CPU_FTR_EMB_HV flag manipulation to the cpu setup
code. Create a separate routine for E.HV ivors setup.
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_fsl_booke.S | 29 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_fsl_booke.S | 18 |
2 files changed, 30 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S index 69fdd2322a66..a55d028aa0da 100644 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
17 | #include <asm/cputable.h> | 17 | #include <asm/cputable.h> |
18 | #include <asm/ppc_asm.h> | 18 | #include <asm/ppc_asm.h> |
19 | #include <asm/mmu-book3e.h> | ||
20 | #include <asm/asm-offsets.h> | ||
19 | 21 | ||
20 | _GLOBAL(__e500_icache_setup) | 22 | _GLOBAL(__e500_icache_setup) |
21 | mfspr r0, SPRN_L1CSR1 | 23 | mfspr r0, SPRN_L1CSR1 |
@@ -73,12 +75,33 @@ _GLOBAL(__setup_cpu_e500v2) | |||
73 | mtlr r4 | 75 | mtlr r4 |
74 | blr | 76 | blr |
75 | _GLOBAL(__setup_cpu_e500mc) | 77 | _GLOBAL(__setup_cpu_e500mc) |
76 | mr r5, r4 | 78 | mflr r5 |
77 | mflr r4 | ||
78 | bl __e500_icache_setup | 79 | bl __e500_icache_setup |
79 | bl __e500_dcache_setup | 80 | bl __e500_dcache_setup |
80 | bl __setup_e500mc_ivors | 81 | bl __setup_e500mc_ivors |
81 | mtlr r4 | 82 | /* |
83 | * We only want to touch IVOR38-41 if we're running on hardware | ||
84 | * that supports category E.HV. The architectural way to determine | ||
85 | * this is MMUCFG[LPIDSIZE]. | ||
86 | */ | ||
87 | mfspr r3, SPRN_MMUCFG | ||
88 | rlwinm. r3, r3, 0, MMUCFG_LPIDSIZE | ||
89 | beq 1f | ||
90 | bl __setup_ehv_ivors | ||
91 | b 2f | ||
92 | 1: | ||
93 | lwz r3, CPU_SPEC_FEATURES(r4) | ||
94 | /* We need this check as cpu_setup is also called for | ||
95 | * the secondary cores. So, if we have already cleared | ||
96 | * the feature on the primary core, avoid doing it on the | ||
97 | * secondary core. | ||
98 | */ | ||
99 | andis. r6, r3, CPU_FTR_EMB_HV@h | ||
100 | beq 2f | ||
101 | rlwinm r3, r3, 0, ~CPU_FTR_EMB_HV | ||
102 | stw r3, CPU_SPEC_FEATURES(r4) | ||
103 | 2: | ||
104 | mtlr r5 | ||
82 | blr | 105 | blr |
83 | #endif | 106 | #endif |
84 | /* Right now, restore and setup are the same thing */ | 107 | /* Right now, restore and setup are the same thing */ |
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index b221541d9861..6f62a737f607 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S | |||
@@ -895,15 +895,11 @@ _GLOBAL(__setup_e500mc_ivors) | |||
895 | mtspr SPRN_IVOR36,r3 | 895 | mtspr SPRN_IVOR36,r3 |
896 | li r3,CriticalDoorbell@l | 896 | li r3,CriticalDoorbell@l |
897 | mtspr SPRN_IVOR37,r3 | 897 | mtspr SPRN_IVOR37,r3 |
898 | sync | ||
899 | blr | ||
898 | 900 | ||
899 | /* | 901 | /* setup ehv ivors for */ |
900 | * We only want to touch IVOR38-41 if we're running on hardware | 902 | _GLOBAL(__setup_ehv_ivors) |
901 | * that supports category E.HV. The architectural way to determine | ||
902 | * this is MMUCFG[LPIDSIZE]. | ||
903 | */ | ||
904 | mfspr r3, SPRN_MMUCFG | ||
905 | andis. r3, r3, MMUCFG_LPIDSIZE@h | ||
906 | beq no_hv | ||
907 | li r3,GuestDoorbell@l | 903 | li r3,GuestDoorbell@l |
908 | mtspr SPRN_IVOR38,r3 | 904 | mtspr SPRN_IVOR38,r3 |
909 | li r3,CriticalGuestDoorbell@l | 905 | li r3,CriticalGuestDoorbell@l |
@@ -912,14 +908,8 @@ _GLOBAL(__setup_e500mc_ivors) | |||
912 | mtspr SPRN_IVOR40,r3 | 908 | mtspr SPRN_IVOR40,r3 |
913 | li r3,Ehvpriv@l | 909 | li r3,Ehvpriv@l |
914 | mtspr SPRN_IVOR41,r3 | 910 | mtspr SPRN_IVOR41,r3 |
915 | skip_hv_ivors: | ||
916 | sync | 911 | sync |
917 | blr | 912 | blr |
918 | no_hv: | ||
919 | lwz r3, CPU_SPEC_FEATURES(r5) | ||
920 | rlwinm r3, r3, 0, ~CPU_FTR_EMB_HV | ||
921 | stw r3, CPU_SPEC_FEATURES(r5) | ||
922 | b skip_hv_ivors | ||
923 | 913 | ||
924 | #ifdef CONFIG_SPE | 914 | #ifdef CONFIG_SPE |
925 | /* | 915 | /* |