Changes in boot/arch/arm32/src/mm.c [9d58539:df334ca] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/mm.c
r9d58539 rdf334ca 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_gta02 52 unsigned long address = section << PTE_SECTION_SHIFT; 53 54 if (address >= GTA02_IOMEM_START && address < GTA02_IOMEM_END) 55 return 0; 56 else 57 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; 62 #endif 63 return 0; 64 } 65 40 66 /** Initialize "section" page table entry. 41 67 * … … 54 80 { 55 81 pte->descriptor_type = PTE_DESCRIPTOR_SECTION; 56 pte->bufferable = 0;57 pte->cacheable = 0;58 pte-> impl_specific= 0;82 pte->bufferable = 1; 83 pte->cacheable = section_cacheable(frame); 84 pte->xn = 0; 59 85 pte->domain = 0; 60 86 pte->should_be_zero_1 = 0; 61 pte->access_permission = PTE_AP_USER_NO_KERNEL_RW; 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; 62 91 pte->should_be_zero_2 = 0; 92 pte->non_secure = 0; 63 93 pte->section_base_addr = frame; 64 94 } … … 67 97 static void init_boot_pt(void) 68 98 { 69 pfn_t split_page = 0x800; 70 99 const pfn_t split_page = PTL0_ENTRIES; 71 100 /* Create 1:1 virtual-physical mapping (in lower 2 GB). */ 72 101 pfn_t page; … … 78 107 * (upper 2 GB), physical addresses start from 0. 79 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. */ 80 112 for (page = split_page; page < PTL0_ENTRIES; page++) 113 #ifndef MACHINE_beagleboardxm 81 114 init_ptl0_section(&boot_pt[page], page - split_page); 115 #else 116 init_ptl0_section(&boot_pt[page], page); 117 #endif 82 118 83 119 asm volatile ( … … 95 131 /* Behave as a client of domains */ 96 132 "ldr r0, =0x55555555\n" 97 "mcr p15, 0, r0, c3, c0, 0\n" 133 "mcr p15, 0, r0, c3, c0, 0\n" 98 134 99 135 /* Current settings */ 100 136 "mrc p15, 0, r0, c1, c0, 0\n" 101 137 102 /* Mask to enable paging */ 103 "ldr r1, =0x00000001\n" 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 104 144 "orr r0, r0, r1\n" 105 145
Note:
See TracChangeset
for help on using the changeset viewer.