Changes in boot/arch/arm32/src/mm.c [df334ca:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/mm.c
rdf334ca r9d58539 38 38 #include <arch/mm.h> 39 39 40 /** Check if caching can be enabled for a given memory section.41 *42 * Memory areas used for I/O are excluded from caching.43 * At the moment caching is enabled only on GTA02.44 *45 * @param section The section number.46 *47 * @return 1 if the given section can be mapped as cacheable, 0 otherwise.48 */49 static inline int section_cacheable(pfn_t section)50 {51 #ifdef MACHINE_gta0252 unsigned long address = section << PTE_SECTION_SHIFT;53 54 if (address >= GTA02_IOMEM_START && address < GTA02_IOMEM_END)55 return 0;56 else57 return 1;58 #elif defined MACHINE_beagleboardxm59 const unsigned long address = section << PTE_SECTION_SHIFT;60 if (address >= BBXM_RAM_START && address < BBXM_RAM_END)61 return 1;62 #endif63 return 0;64 }65 66 40 /** Initialize "section" page table entry. 67 41 * … … 80 54 { 81 55 pte->descriptor_type = PTE_DESCRIPTOR_SECTION; 82 pte->bufferable = 1;83 pte->cacheable = section_cacheable(frame);84 pte-> xn= 0;56 pte->bufferable = 0; 57 pte->cacheable = 0; 58 pte->impl_specific = 0; 85 59 pte->domain = 0; 86 60 pte->should_be_zero_1 = 0; 87 pte->access_permission_0 = PTE_AP_USER_NO_KERNEL_RW; 88 pte->tex = 0; 89 pte->access_permission_1 = 0; 90 pte->non_global = 0; 61 pte->access_permission = PTE_AP_USER_NO_KERNEL_RW; 91 62 pte->should_be_zero_2 = 0; 92 pte->non_secure = 0;93 63 pte->section_base_addr = frame; 94 64 } … … 97 67 static void init_boot_pt(void) 98 68 { 99 const pfn_t split_page = PTL0_ENTRIES; 69 pfn_t split_page = 0x800; 70 100 71 /* Create 1:1 virtual-physical mapping (in lower 2 GB). */ 101 72 pfn_t page; … … 107 78 * (upper 2 GB), physical addresses start from 0. 108 79 */ 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 80 for (page = split_page; page < PTL0_ENTRIES; page++) 113 #ifndef MACHINE_beagleboardxm114 81 init_ptl0_section(&boot_pt[page], page - split_page); 115 #else116 init_ptl0_section(&boot_pt[page], page);117 #endif118 82 119 83 asm volatile ( … … 131 95 /* Behave as a client of domains */ 132 96 "ldr r0, =0x55555555\n" 133 "mcr p15, 0, r0, c3, c0, 0\n" 97 "mcr p15, 0, r0, c3, c0, 0\n" 134 98 135 99 /* Current settings */ 136 100 "mrc p15, 0, r0, c1, c0, 0\n" 137 101 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 102 /* Mask to enable paging */ 103 "ldr r1, =0x00000001\n" 144 104 "orr r0, r0, r1\n" 145 105
Note:
See TracChangeset
for help on using the changeset viewer.