Changes in / [17cc8f4f:e1a27be] in mainline
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/include/mm.h
r17cc8f4f re1a27be 47 47 /** Describe "section" page table entry (one-level paging with 1 MB sized pages). */ 48 48 #define PTE_DESCRIPTOR_SECTION 0x02 49 /** Shift of memory address in section descriptor */50 #define PTE_SECTION_SHIFT 2051 49 52 50 /** Page table access rights: user - no access, kernel - read/write. */ 53 51 #define PTE_AP_USER_NO_KERNEL_RW 0x01 54 55 /** Start of memory mapped I/O area for GTA02 */56 #define GTA02_IOMEM_START 0x4800000057 /** End of memory mapped I/O area for GTA02 */58 #define GTA02_IOMEM_END 0x6000000059 52 60 53 /* Page table level 0 entry - "section" format is used -
boot/arch/arm32/src/asm.S
r17cc8f4f re1a27be 60 60 # before passing control to the copied code. 61 61 # 62 63 #if defined(MACHINE_gta02)64 65 #define CP15_C1_IC 1266 #define CP15_C1_DC 267 #define CP15_C7_SEG_SHIFT 568 #define CP15_C7_SEG_SIZE 369 #define CP15_C7_IDX_SHIFT 2670 71 # Disable I-cache and D-cache before the kernel is started.72 mrc p15, 0, r4, c1, c0, 073 bic r4, r4, #(1 << CP15_C1_DC)74 bic r4, r4, #(1 << CP15_C1_IC)75 mcr p15, 0, r4, c1, c0, 076 77 # Now clean D-cache to guarantee coherency between I-cache and D-cache.78 79 # D-cache clean and invalidate procedure.80 # See ARM920T TRM pages 2-17, 4-17.81 82 # Initialize segment83 mov r4, #084 # Initialize index85 1: mov r5, #086 2: orr r6, r4, r587 # Clean and invalidate a single line88 mcr p15, 0, r6, c7, c10, 289 # Increment index90 add r5, r5, #(1 << CP15_C7_IDX_SHIFT)91 cmp r5, #092 bne 2b93 # Increment segment94 add r4, #(1 << CP15_C7_SEG_SHIFT)95 tst r4, #(1 << (CP15_C7_SEG_SHIFT + CP15_C7_SEG_SIZE))96 beq 1b97 #endif98 99 62 mov pc, r0 -
boot/arch/arm32/src/mm.c
r17cc8f4f re1a27be 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 #else59 return 0;60 #endif61 }62 63 40 /** Initialize "section" page table entry. 64 41 * … … 78 55 pte->descriptor_type = PTE_DESCRIPTOR_SECTION; 79 56 pte->bufferable = 1; 80 pte->cacheable = section_cacheable(frame);57 pte->cacheable = 0; 81 58 pte->xn = 0; 82 59 pte->domain = 0; … … 146 123 "ldr r1, =0x00000005\n" 147 124 #else 148 #ifdef MACHINE_gta02149 /* Mask to enable paging (bit 0),150 D-cache (bit 2), I-cache (bit 12) */151 "ldr r1, =0x00001005\n"152 #else153 125 /* Mask to enable paging */ 154 126 "ldr r1, =0x00000001\n" 155 #endif156 127 #endif 157 128 "orr r0, r0, r1\n" -
kernel/arch/arm32/src/ras.c
r17cc8f4f re1a27be 67 67 void ras_check(unsigned int n, istate_t *istate) 68 68 { 69 bool restart_needed = false; 70 uintptr_t restart_pc = 0; 69 bool restart = false; 71 70 72 71 if (istate_from_uspace(istate)) { … … 74 73 if ((ras_page[RAS_START] < istate->pc) && 75 74 (ras_page[RAS_END] > istate->pc)) { 76 restart_needed = true; 77 restart_pc = ras_page[RAS_START]; 75 restart = true; 78 76 } 79 77 ras_page[RAS_START] = 0; … … 83 81 84 82 exc_dispatch(n, istate); 85 if (restart _needed)86 istate->pc = r estart_pc;83 if (restart) 84 istate->pc = ras_page[RAS_START]; 87 85 } 88 86
Note:
See TracChangeset
for help on using the changeset viewer.