Changes in kernel/arch/arm32/src/cpu/cpu.c [9b6e40b:65871bb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/cpu/cpu.c
r9b6e40b r65871bb 98 98 void cpu_arch_init(void) 99 99 { 100 /* Get rid of any boot code hiding in ICache 101 * This is safe without regards to ICache state. */ 102 memory_barrier(); 103 smc_coherence(); 104 100 #if defined(PROCESSOR_armv7_a) | defined(PROCESSOR_armv6) 105 101 uint32_t control_reg = 0; 106 102 asm volatile ( … … 109 105 ); 110 106 111 /* Turn off tex remap, RAZ /WIprior to armv7 */107 /* Turn off tex remap, RAZ ignores writes prior to armv7 */ 112 108 control_reg &= ~CP15_R1_TEX_REMAP_EN; 113 /* Turn off accessed flag, RAZ /WIprior to armv7 */109 /* Turn off accessed flag, RAZ ignores writes prior to armv7 */ 114 110 control_reg &= ~(CP15_R1_ACCESS_FLAG_EN | CP15_R1_HW_ACCESS_FLAG_EN); 115 /* Disable branch prediction RAZ/WI if not supported */ 116 control_reg &= ~CP15_R1_BRANCH_PREDICT_EN; 117 118 /* Unaligned access is supported on armv6+ */ 119 #if defined(PROCESSOR_ARCH_armv7_a) | defined(PROCESSOR_ARCH_armv6) 120 /* Enable unaligned access, RAZ/WI prior to armv6 121 * switchable on armv6, RAO/WI writes on armv7, 111 /* Enable unaligned access, RAZ ignores writes prior to armv6 112 * switchable on armv6, RAO ignores writes on armv7, 122 113 * see ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition 123 114 * L.3.1 (p. 2456) */ … … 133 124 * ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition 134 125 * B3.11.1 (p. 1383) 135 * We are safe to turn this on. For arm v6 see ch L.6.2 (p. 2469)136 * L2 Cache for armv7 was enabled in boot code.126 * ICache coherency is elaborate on in barrier.h. 127 * We are safe to turn these on. 137 128 */ 138 control_reg |= CP15_R1_CACHE_EN; 139 #endif 140 #ifdef PROCESSOR_cortex_a8 141 /* ICache coherency is elaborate on in barrier.h. 142 * Cortex-A8 implements IVIPT extension. 143 * Cortex-A8 TRM ch. 7.2.6 p. 7-4 (PDF 245) */ 144 control_reg |= CP15_R1_INST_CACHE_EN; 145 #endif 129 control_reg |= CP15_R1_CACHE_EN | CP15_R1_INST_CACHE_EN; 146 130 147 131 asm volatile ( … … 149 133 :: [control_reg] "r" (control_reg) 150 134 ); 135 #endif 151 136 #ifdef CONFIG_FPU 152 137 fpu_setup();
Note:
See TracChangeset
for help on using the changeset viewer.