Changes in boot/arch/arm32/src/mm.c [5e761f3:df334ca] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/mm.c
r5e761f3 rdf334ca 38 38 #include <arch/mm.h> 39 39 40 /** Disable the MMU */41 static void disable_paging(void)42 {43 asm volatile (44 "mrc p15, 0, r0, c1, c0, 0\n"45 "bic r0, r0, #1\n"46 "mcr p15, 0, r0, c1, c0, 0\n"47 );48 }49 50 40 /** Check if caching can be enabled for a given memory section. 51 41 * … … 66 56 else 67 57 return 1; 68 #else 58 #elif defined MACHINE_beagleboardxm 59 const unsigned long address = section << PTE_SECTION_SHIFT; 60 if (address >= BBXM_RAM_START && address < BBXM_RAM_END) 61 return 1; 62 #endif 69 63 return 0; 70 #endif71 64 } 72 65 … … 110 103 init_ptl0_section(&boot_pt[page], page); 111 104 105 /* 106 * Create 1:1 virtual-physical mapping in kernel space 107 * (upper 2 GB), physical addresses start from 0. 108 */ 109 /* BeagleBoard-xM (DM37x) memory starts at 2GB border, 110 * thus mapping only lower 2GB is not not enough. 111 * Map entire AS 1:1 instead and hope it works. */ 112 for (page = split_page; page < PTL0_ENTRIES; page++) 113 #ifndef MACHINE_beagleboardxm 114 init_ptl0_section(&boot_pt[page], page - split_page); 115 #else 116 init_ptl0_section(&boot_pt[page], page); 117 #endif 118 112 119 asm volatile ( 113 120 "mcr p15, 0, %[pt], c2, c0, 0\n" … … 125 132 "ldr r0, =0x55555555\n" 126 133 "mcr p15, 0, r0, c3, c0, 0\n" 127 134 128 135 /* Current settings */ 129 136 "mrc p15, 0, r0, c1, c0, 0\n" 130 137 131 #ifdef PROCESSOR_armv7_a 132 /* Mask to enable paging, caching */ 133 "ldr r1, =0x00000005\n" 134 #else 135 #ifdef MACHINE_gta02 136 /* Mask to enable paging (bit 0), 137 D-cache (bit 2), I-cache (bit 12) */ 138 "ldr r1, =0x00001005\n" 139 #else 140 /* Mask to enable paging */ 141 "ldr r1, =0x00000001\n" 142 #endif 143 #endif 138 /* Enable ICache, DCache, BPredictors and MMU, 139 * we disable caches before jumping to kernel 140 * so this is safe for all archs. 141 */ 142 "ldr r1, =0x00001805\n" 143 144 144 "orr r0, r0, r1\n" 145 146 /* Flush the TLB */147 "mcr p15, 0, r0, c8, c7, 0\n"148 145 149 /* Store settings , enable the MMU*/146 /* Store settings */ 150 147 "mcr p15, 0, r0, c1, c0, 0\n" 151 148 ::: "r0", "r1" … … 155 152 /** Start the MMU - initialize page table and enable paging. */ 156 153 void mmu_start() { 157 disable_paging();158 154 init_boot_pt(); 159 155 enable_paging();
Note:
See TracChangeset
for help on using the changeset viewer.