Changes in boot/arch/arm32/src/mm.c [df334ca:5e761f3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/mm.c
rdf334ca r5e761f3 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 40 50 /** Check if caching can be enabled for a given memory section. 41 51 * … … 56 66 else 57 67 return 1; 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; 68 #else 69 return 0; 62 70 #endif 63 return 0;64 71 } 65 72 … … 103 110 init_ptl0_section(&boot_pt[page], page); 104 111 105 /*106 * Create 1:1 virtual-physical mapping in kernel space107 * (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_beagleboardxm114 init_ptl0_section(&boot_pt[page], page - split_page);115 #else116 init_ptl0_section(&boot_pt[page], page);117 #endif118 119 112 asm volatile ( 120 113 "mcr p15, 0, %[pt], c2, c0, 0\n" … … 132 125 "ldr r0, =0x55555555\n" 133 126 "mcr p15, 0, r0, c3, c0, 0\n" 134 127 135 128 /* Current settings */ 136 129 "mrc p15, 0, r0, c1, c0, 0\n" 137 130 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" 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 144 "orr r0, r0, r1\n" 145 146 /* Flush the TLB */ 147 "mcr p15, 0, r0, c8, c7, 0\n" 143 148 144 "orr r0, r0, r1\n" 145 146 /* Store settings */ 149 /* Store settings, enable the MMU */ 147 150 "mcr p15, 0, r0, c1, c0, 0\n" 148 151 ::: "r0", "r1" … … 152 155 /** Start the MMU - initialize page table and enable paging. */ 153 156 void mmu_start() { 157 disable_paging(); 154 158 init_boot_pt(); 155 159 enable_paging();
Note:
See TracChangeset
for help on using the changeset viewer.