Changeset ca62f86 in mainline for boot/arch/arm32/src/main.c
- Timestamp:
- 2013-09-09T17:52:40Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f7bb6d1
- Parents:
- 6ad185d (diff), a1ecb88 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/main.c
r6ad185d rca62f86 53 53 extern void *bdata_end; 54 54 55 56 static inline void invalidate_icache(void)57 {58 /* ICIALLU Invalidate entire ICache */59 asm volatile ("mov r0, #0\n" "mcr p15, 0, r0, c7, c5, 0\n" ::: "r0" );60 }61 62 static inline void invalidate_dcache(void *address, size_t size)63 {64 const uintptr_t addr = (uintptr_t)address;65 /* DCIMVAC - invalidate by address to the point of coherence */66 for (uintptr_t a = addr; a < addr + size; a += 4) {67 asm volatile ("mcr p15, 0, %[a], c7, c6, 1\n" :: [a]"r"(a) : );68 }69 }70 71 55 static inline void clean_dcache_poc(void *address, size_t size) 72 56 { 73 57 const uintptr_t addr = (uintptr_t)address; 74 /* DCCMVAC - clean by address to the point of coherence */75 58 for (uintptr_t a = addr; a < addr + size; a += 4) { 59 /* DCCMVAC - clean by address to the point of coherence */ 76 60 asm volatile ("mcr p15, 0, %[a], c7, c10, 1\n" :: [a]"r"(a) : ); 77 61 } … … 82 66 void bootstrap(void) 83 67 { 84 /* Make sure we run in memory code when caches are enabled,85 * make sure we read memory data too. This part is ARMv7 specific as86 * ARMv7 no longer invalidates caches on restart.87 * See chapter B2.2.2 of ARM Architecture Reference Manual p. B2-1263*/88 invalidate_icache();89 invalidate_dcache(&bdata_start, &bdata_end - &bdata_start);90 91 68 /* Enable MMU and caches */ 92 69 mmu_start(); … … 105 82 components[i].start, components[i].name, components[i].inflated, 106 83 components[i].size); 107 invalidate_dcache(components[i].start, components[i].size);108 84 } 109 85 … … 148 124 halt(); 149 125 } 126 /* Make sure data are in the memory, ICache will need them */ 150 127 clean_dcache_poc(dest[i - 1], components[i - 1].inflated); 151 128 }
Note:
See TracChangeset
for help on using the changeset viewer.