- Timestamp:
- 2015-11-02T20:54:19Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d8513177
- Parents:
- 3feeab2 (diff), 5265eea4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- boot/arch/arm32/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/asm.S
r3feeab2 rff381a7 75 75 bic r4, r4, #(1 << CP15_C1_DC) 76 76 77 # Disable I-cache and Branch epredictors.77 # Disable I-cache and Branch predictors. 78 78 bic r4, r4, #(1 << CP15_C1_IC) 79 #ifdef PROCESSOR_ARCH_armv6 79 80 bic r4, r4, #(1 << CP15_C1_BP) 81 #endif 80 82 81 83 mcr p15, 0, r4, c1, c0, 0 82 84 #endif 83 84 85 85 86 # Wait for the operations to complete86 # Wait for the operations to complete 87 87 #ifdef PROCESSOR_ARCH_armv7_a 88 88 dsb 89 89 #else 90 # cp15 dsb, r4 is ignored (should be zero)90 # cp15 dsb, r4 is ignored (should be zero) 91 91 mov r4, #0 92 92 mcr p15, 0, r4, c7, c10, 4 … … 98 98 nop 99 99 100 # Wait for the operations to complete100 # Wait for the operations to complete 101 101 #ifdef PROCESSOR_ARCH_armv7_a 102 102 isb 103 103 nop 104 #el se104 #elif defined(PROCESSOR_ARCH_armv6) 105 105 # cp15 isb 106 106 mcr p15, 0, r4, c7, c5, 4 -
boot/arch/arm32/src/main.c
r3feeab2 rff381a7 47 47 #include <errno.h> 48 48 #include <inflate.h> 49 #include <arch/cp15.h> 49 50 50 51 #define TOP2ADDR(top) (((void *) PA2KA(BOOT_OFFSET)) + (top)) … … 55 56 static inline void clean_dcache_poc(void *address, size_t size) 56 57 { 57 const uintptr_t addr = (uintptr_t)address; 58 for (uintptr_t a = addr; a < addr + size; a += 4) { 59 /* DCCMVAC - clean by address to the point of coherence */ 60 asm volatile ("mcr p15, 0, %[a], c7, c10, 1\n" :: [a]"r"(a) : ); 58 const uintptr_t addr = (uintptr_t) address; 59 60 #if !defined(PROCESSOR_ARCH_armv7_a) 61 bool sep; 62 if (MIDR_read() != CTR_read()) { 63 sep = (CTR_read() & CTR_SEP_FLAG) == CTR_SEP_FLAG; 64 } else { 65 printf("Unknown cache type.\n"); 66 halt(); 67 } 68 #endif 69 70 for (uintptr_t a = ALIGN_DOWN(addr, CP15_C7_MVA_ALIGN); a < addr + size; 71 a += CP15_C7_MVA_ALIGN) { 72 #if defined(PROCESSOR_ARCH_armv7_a) 73 DCCMVAC_write(a); 74 #else 75 if (sep) 76 DCCMVA_write(a); 77 else 78 CCMVA_write(a); 79 #endif 61 80 } 62 81 } -
boot/arch/arm32/src/mm.c
r3feeab2 rff381a7 143 143 pte->should_be_zero_1 = 0; 144 144 pte->access_permission_0 = PTE_AP_USER_NO_KERNEL_RW; 145 #if def PROCESSOR_ARCH_armv7_a145 #if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a) 146 146 /* 147 147 * Keeps this setting in sync with memory type attributes in: … … 152 152 pte->tex = section_cacheable(frame) ? 5 : 0; 153 153 pte->cacheable = section_cacheable(frame) ? 0 : 0; 154 pte->bufferable = section_cacheable(frame) ? 1 : 0;154 pte->bufferable = section_cacheable(frame) ? 1 : 1; 155 155 #else 156 pte->bufferable = 1;156 pte->bufferable = section_cacheable(frame); 157 157 pte->cacheable = section_cacheable(frame); 158 158 pte->tex = 0; … … 189 189 */ 190 190 uint32_t val = (uint32_t)boot_pt & TTBR_ADDR_MASK; 191 #if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a) 192 // FIXME: TTBR_RGN_WBWA_CACHE is unpredictable on ARMv6 191 193 val |= TTBR_RGN_WBWA_CACHE | TTBR_C_FLAG; 194 #endif 192 195 TTBR0_write(val); 193 196 }
Note:
See TracChangeset
for help on using the changeset viewer.