Changeset a35b458 in mainline for boot/arch/arm32/src
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- boot/arch/arm32/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/asm.S
r3061bc1 ra35b458 67 67 #ifndef PROCESSOR_ARCH_armv7_a 68 68 mrc p15, 0, r4, c1, c0, 0 69 69 70 70 # Disable D-cache before the kernel is started. 71 71 bic r4, r4, #(1 << CP15_C1_DC) … … 76 76 bic r4, r4, #(1 << CP15_C1_BP) 77 77 #endif 78 78 79 79 mcr p15, 0, r4, c1, c0, 0 80 80 #endif 81 81 82 82 # Wait for the operations to complete 83 83 #ifdef PROCESSOR_ARCH_armv7_a … … 88 88 mcr p15, 0, r4, c7, c10, 4 89 89 #endif 90 90 91 91 # Clean ICache and BPredictors, r4 ignored (SBZ) 92 92 mov r4, #0 -
boot/arch/arm32/src/main.c
r3061bc1 ra35b458 89 89 mmu_start(); 90 90 version_print(); 91 91 92 92 printf("Boot data: %p -> %p\n", &bdata_start, &bdata_end); 93 93 printf("\nMemory statistics\n"); … … 97 97 printf(" %p|%p: kernel entry point\n", 98 98 (void *) PA2KA(BOOT_OFFSET), (void *) BOOT_OFFSET); 99 99 100 100 for (size_t i = 0; i < COMPONENTS; i++) { 101 101 printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].addr, … … 103 103 components[i].size); 104 104 } 105 105 106 106 void *dest[COMPONENTS]; 107 107 size_t top = 0; … … 110 110 for (size_t i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) { 111 111 top = ALIGN_UP(top, PAGE_SIZE); 112 112 113 113 if (i > 0) { 114 114 bootinfo.tasks[bootinfo.cnt].addr = TOP2ADDR(top); 115 115 bootinfo.tasks[bootinfo.cnt].size = components[i].inflated; 116 116 117 117 str_cpy(bootinfo.tasks[bootinfo.cnt].name, 118 118 BOOTINFO_TASK_NAME_BUFLEN, components[i].name); 119 119 120 120 bootinfo.cnt++; 121 121 } 122 122 123 123 dest[i] = TOP2ADDR(top); 124 124 top += components[i].inflated; 125 125 cnt++; 126 126 } 127 127 128 128 printf("\nInflating components ... "); 129 129 130 130 for (size_t i = cnt; i > 0; i--) { 131 131 void *tail = components[i - 1].addr + components[i - 1].size; … … 135 135 halt(); 136 136 } 137 137 138 138 printf("%s ", components[i - 1].name); 139 139 140 140 int err = inflate(components[i - 1].addr, components[i - 1].size, 141 141 dest[i - 1], components[i - 1].inflated); … … 147 147 clean_dcache_poc(dest[i - 1], components[i - 1].inflated); 148 148 } 149 149 150 150 printf(".\n"); 151 151 152 152 /* Flush PT too. We need this if we disable caches later */ 153 153 clean_dcache_poc(boot_pt, PTL0_ENTRIES * PTL0_ENTRY_SIZE); 154 154 155 155 printf("Booting the kernel...\n"); 156 156 jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo); -
boot/arch/arm32/src/mm.c
r3061bc1 ra35b458 209 209 /* Current settings */ 210 210 "mrc p15, 0, r0, c1, c0, 0\n" 211 211 212 212 /* Enable ICache, DCache, BPredictors and MMU, 213 213 * we disable caches before jumping to kernel … … 221 221 "ldr r1, =0x00001805\n" 222 222 #endif 223 223 224 224 "orr r0, r0, r1\n" 225 225 … … 228 228 */ 229 229 "mcr p15, 0, r0, c8, c7, 0\n" 230 230 231 231 /* Store settings, enable the MMU */ 232 232 "mcr p15, 0, r0, c1, c0, 0\n"
Note:
See TracChangeset
for help on using the changeset viewer.