Changeset 46a6a5d in mainline
- Timestamp:
- 2012-12-30T21:17:39Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a4afc8d
- Parents:
- 876160ca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/cpu/cpu.c
r876160ca r46a6a5d 98 98 void cpu_arch_init(void) 99 99 { 100 #if defined(PROCESSOR_ARCH_armv7_a) | defined(PROCESSOR_ARCH_armv6)101 100 uint32_t control_reg = 0; 102 101 asm volatile ( … … 109 108 /* Turn off accessed flag, RAZ/WI prior to armv7 */ 110 109 control_reg &= ~(CP15_R1_ACCESS_FLAG_EN | CP15_R1_HW_ACCESS_FLAG_EN); 110 /* Enable branch prediction RAZ/WI if not supported */ 111 control_reg |= CP15_R1_BRANCH_PREDICT_EN; 112 113 /* Unaligned access is supported on armv6+ */ 114 #if defined(PROCESSOR_ARCH_armv7_a) | defined(PROCESSOR_ARCH_armv6) 111 115 /* Enable unaligned access, RAZ/WI prior to armv6 112 116 * switchable on armv6, RAO/WI writes on armv7, … … 124 128 * ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition 125 129 * B3.11.1 (p. 1383) 126 * ICache coherency is elaborate on in barrier.h.127 * We are safe to turn these on.130 * We are safe to turn this on. For arm v6 see ch L.6.2 (p. 2469) 131 * L2 Cache for armv7 was enabled in boot code. 128 132 */ 129 control_reg |= CP15_R1_CACHE_EN | CP15_R1_INST_CACHE_EN; 133 control_reg |= CP15_R1_CACHE_EN; 134 #endif 135 #ifdef PROCESSOR_cortex_a8 136 /* ICache coherency is elaborate on in barrier.h. 137 * Cortex-A8 implements IVIPT extension. 138 * Cortex-A8 TRM ch. 7.2.6 p. 7-4 (PDF 245) */ 139 control_reg |= CP15_R1_INST_CACHE_EN; 140 #endif 130 141 131 /* Enable branch prediction */132 control_reg |= CP15_R1_BRANCH_PREDICT_EN;133 142 asm volatile ( 134 143 "mcr p15, 0, %[control_reg], c1, c0" 135 144 :: [control_reg] "r" (control_reg) 136 145 ); 137 #endif138 146 #ifdef CONFIG_FPU 139 147 fpu_setup();
Note:
See TracChangeset
for help on using the changeset viewer.