Changes in / [f3386d7:a940f1d] in mainline
- Files:
-
- 2 deleted
- 8 edited
-
boot/arch/arm32/src/asm.S (modified) (1 diff)
-
boot/arch/arm32/src/main.c (modified) (5 diffs)
-
kernel/arch/arm32/include/arch/asm.h (modified) (3 diffs)
-
kernel/arch/arm32/include/arch/mm/page_armv4.h (modified) (4 diffs)
-
kernel/arch/arm32/include/arch/mm/page_armv6.h (modified) (2 diffs)
-
kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c (modified) (3 diffs)
-
kernel/arch/arm32/src/mm/tlb.c (modified) (4 diffs)
-
kernel/genarch/include/genarch/drivers/amdm37x/gpt.h (modified) (5 diffs)
-
kernel/genarch/include/genarch/drivers/amdm37x_uart/amdm37x_uart.h (deleted)
-
kernel/genarch/include/genarch/fb/logo-196x66.h (deleted)
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/arm32/src/asm.S
rf3386d7 ra940f1d 71 71 mrc p15, 0, r4, c1, c0, 0 72 72 bic r4, r4, #(1 << CP15_C1_DC) 73 #ifndef PROCESSOR_ARCH_armv7_a74 73 bic r4, r4, #(1 << CP15_C1_IC) 75 74 bic r4, r4, #(1 << CP15_C1_BP) 76 #endif77 75 mcr p15, 0, r4, c1, c0, 0 78 76 -
boot/arch/arm32/src/main.c
rf3386d7 ra940f1d 63 63 { 64 64 const uintptr_t addr = (uintptr_t)address; 65 /* DCIMVAC - invalidate by address to the point of coherence */ 65 66 for (uintptr_t a = addr; a < addr + size; a += 4) { 66 /* DCIMVAC - invalidate by address to the point of coherence */67 67 asm volatile ("mcr p15, 0, %[a], c7, c6, 1\n" :: [a]"r"(a) : ); 68 68 } … … 72 72 { 73 73 const uintptr_t addr = (uintptr_t)address; 74 /* DCCMVAC - clean by address to the point of coherence */ 74 75 for (uintptr_t a = addr; a < addr + size; a += 4) { 75 /* DCCMVAC - clean by address to the point of coherence */76 76 asm volatile ("mcr p15, 0, %[a], c7, c10, 1\n" :: [a]"r"(a) : ); 77 77 } … … 82 82 void bootstrap(void) 83 83 { 84 /* Make sure we run in memory code when caches are enabled,84 /* Make sure we run in memory code when caches are enabled, 85 85 * make sure we read memory data too. This part is ARMv7 specific as 86 86 * ARMv7 no longer invalidates caches on restart. … … 105 105 components[i].start, components[i].name, components[i].inflated, 106 106 components[i].size); 107 /* Make sure there is no cache garbage in read locations */108 107 invalidate_dcache(components[i].start, components[i].size); 109 108 } … … 149 148 halt(); 150 149 } 151 /* Make sure data are in the memory, ICache will need them */152 150 clean_dcache_poc(dest[i - 1], components[i - 1].inflated); 153 151 } -
kernel/arch/arm32/include/arch/asm.h
rf3386d7 ra940f1d 38 38 39 39 #include <typedefs.h> 40 #include <arch/cp15.h>41 40 #include <arch/stack.h> 42 41 #include <config.h> … … 52 51 * chapter 2.3.8 p.2-22 (52 in the PDF) 53 52 * 54 * @note Although CP15WFI (mcr p15, 0, R0, c7, c0, 4) is defined in ARM55 * Architecture reference manual for armv4/5, CP15 implementation is mandatory56 * only forarmv6+.53 * @note Although mcr p15, 0, R0, c7, c0, 4 is defined in ARM Architecture 54 * reference manual for armv4/5 CP15 implementation is mandatory only for 55 * armv6+. 57 56 */ 58 57 NO_TRACE static inline void cpu_sleep(void) … … 61 60 asm volatile ( "wfe" ); 62 61 #elif defined(PROCESSOR_ARCH_armv6) | defined(PROCESSOR_arm926ej_s) | defined(PROCESSOR_arm920t) 63 WFI_write(0);62 asm volatile ( "mcr p15, 0, R0, c7, c0, 4" ); 64 63 #endif 65 64 } -
kernel/arch/arm32/include/arch/mm/page_armv4.h
rf3386d7 ra940f1d 41 41 #error "Do not include arch specific page.h directly use generic page.h instead" 42 42 #endif 43 44 #include <arch/cp15.h>45 43 46 44 /* Macros for querying the last-level PTE entries. */ … … 130 128 NO_TRACE static inline void set_ptl0_addr(pte_t *pt) 131 129 { 132 TTBR0_write((uint32_t)pt); 130 asm volatile ( 131 "mcr p15, 0, %[pt], c2, c0, 0\n" 132 :: [pt] "r" (pt) 133 ); 133 134 } 134 135 … … 222 223 223 224 /* default access permission */ 224 p->access_permission_0 = p->access_permission_1 = 225 p->access_permission_0 = p->access_permission_1 = 225 226 p->access_permission_2 = p->access_permission_3 = 226 227 PTE_AP_USER_NO_KERNEL_RW; … … 228 229 if (flags & PAGE_USER) { 229 230 if (flags & PAGE_READ) { 230 p->access_permission_0 = p->access_permission_1 = 231 p->access_permission_2 = p->access_permission_3 = 231 p->access_permission_0 = p->access_permission_1 = 232 p->access_permission_2 = p->access_permission_3 = 232 233 PTE_AP_USER_RO_KERNEL_RW; 233 234 } 234 235 if (flags & PAGE_WRITE) { 235 p->access_permission_0 = p->access_permission_1 = 236 p->access_permission_2 = p->access_permission_3 = 237 PTE_AP_USER_RW_KERNEL_RW; 236 p->access_permission_0 = p->access_permission_1 = 237 p->access_permission_2 = p->access_permission_3 = 238 PTE_AP_USER_RW_KERNEL_RW; 238 239 } 239 240 } -
kernel/arch/arm32/include/arch/mm/page_armv6.h
rf3386d7 ra940f1d 40 40 #error "Do not include arch specific page.h directly use generic page.h instead" 41 41 #endif 42 43 #include <arch/cp15.h>44 42 45 43 /* Macros for querying the last-level PTE entries. */ … … 134 132 NO_TRACE static inline void set_ptl0_addr(pte_t *pt) 135 133 { 136 TTBR0_write((uint32_t)pt); 134 asm volatile ( 135 "mcr p15, 0, %[pt], c2, c0, 0\n" 136 :: [pt] "r" (pt) 137 ); 137 138 } 138 139 -
kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c
rf3386d7 ra940f1d 85 85 static void bb_timer_irq_handler(irq_t *irq) 86 86 { 87 amdm37x_gpt_irq_ack(&beagleboard.timer);88 89 87 /* 90 88 * We are holding a lock which prevents preemption. 91 89 * Release the lock, call clock() and reacquire the lock again. 92 90 */ 91 amdm37x_gpt_irq_ack(&beagleboard.timer); 93 92 spinlock_unlock(&irq->lock); 94 93 clock(); … … 148 147 { 149 148 const unsigned inum = amdm37x_irc_inum_get(beagleboard.irc_addr); 149 amdm37x_irc_irq_ack(beagleboard.irc_addr); 150 150 151 151 irq_t *irq = irq_dispatch_and_lock(inum); … … 159 159 CPU->id, inum); 160 160 } 161 /** amdm37x manual ch. 12.5.2 (p. 2428) places irc ack at the end162 * of ISR. DO this to avoid strange behavior. */163 amdm37x_irc_irq_ack(beagleboard.irc_addr);164 161 } 165 162 -
kernel/arch/arm32/src/mm/tlb.c
rf3386d7 ra940f1d 37 37 #include <arch/mm/asid.h> 38 38 #include <arch/asm.h> 39 #include <arch/cp15.h>40 39 #include <typedefs.h> 41 40 #include <arch/mm/page.h> … … 47 46 void tlb_invalidate_all(void) 48 47 { 49 TLBIALL_write(0); 48 asm volatile ( 49 "eor r1, r1\n" 50 "mcr p15, 0, r1, c8, c7, 0\n" 51 ::: "r1" 52 ); 50 53 } 51 54 … … 57 60 { 58 61 tlb_invalidate_all(); 59 // TODO: why not TLBIASID_write(asid) ?60 62 } 61 63 … … 63 65 * 64 66 * @param page Virtual adress of the page 65 */ 67 */ 66 68 static inline void invalidate_page(uintptr_t page) 67 69 { 68 TLBIMVA_write(page); 69 //TODO: What about TLBIMVAA? 70 asm volatile ( 71 "mcr p15, 0, %[page], c8, c7, 1\n" 72 :: [page] "r" (page) 73 ); 70 74 } 71 75 -
kernel/genarch/include/genarch/drivers/amdm37x/gpt.h
rf3386d7 ra940f1d 39 39 #include <typedefs.h> 40 40 #include <mm/km.h> 41 #include <time/clock.h>42 41 43 42 /* AMDM37x TRM p. 2740 */ … … 129 128 #define AMDM37x_GPT_TCLR_CE_FLAG (1 << 6) 130 129 #define AMDM37x_GPT_TCLR_SCPWM (1 << 7) 131 #define AMDM37x_GPT_TCLR_TCM_MASK (0x3 << 8) 132 #define AMDM37x_GPT_TCLR_TCM_NO_CAPTURE (0x0 << 8) 133 #define AMDM37x_GPT_TCLR_TCM_RAISE_CAPTURE (0x1 << 8) 134 #define AMDM37x_GPT_TCLR_TCM_FALL_CAPTURE (0x2 << 8) 135 #define AMDM37x_GPT_TCLR_TCM_BOTH_CAPTURE (0x3 << 8) 136 #define AMDM37x_GPT_TCLR_TRG_MASK (0x3 << 10) 137 #define AMDM37x_GPT_TCLR_TRG_NO (0x0 << 10) 138 #define AMDM37x_GPT_TCLR_TRG_OVERFLOW (0x1 << 10) 139 #define AMDM37x_GPT_TCLR_TRG_OVERMATCH (0x2 << 10) 130 #define AMDM37x_GPT_TCLR_TCM_MASK (0x3) 131 #define AMDM37x_GPT_TCLR_TCM_SHIFT (8) 132 #define AMDM37x_GPT_TCLR_TRG_MASK (0x3) 133 #define AMDM37x_GPT_TCLR_TRG_SHIFT (10) 140 134 #define AMDM37x_GPT_TCLR_PT_FLAG (1 << 12) 141 135 #define AMDM37x_GPT_TCLR_CAPT_MODE_FLAG (1 << 13) … … 215 209 timer->regs = (void*) km_map(ioregs, iosize, PAGE_NOT_CACHEABLE); 216 210 217 /* Reset the timer */218 timer->regs->tiocp_cfg |= AMDM37x_GPT_TIOCP_CFG_SOFTRESET_FLAG;219 220 while (timer->regs->tistat & AMDM37x_GPT_TISTAT_RESET_DONE_FLAG);221 222 211 /* Set autoreload */ 223 timer->regs->tclr |= AMDM37x_GPT_TCLR_AR_FLAG;212 timer->regs->tclr = AMDM37x_GPT_TCLR_AR_FLAG; 224 213 225 214 timer->special_available = ( … … 227 216 (ioregs == AMDM37x_GPT2_BASE_ADDRESS) || 228 217 (ioregs == AMDM37x_GPT10_BASE_ADDRESS)); 229 /* Select reload value */230 218 timer->regs->tldr = 0xffffffff - (32768 / hz) + 1; 231 /* Set current counter value */232 219 timer->regs->tccr = 0xffffffff - (32768 / hz) + 1; 233 234 220 if (timer->special_available) { 235 /* Set values according to formula (manual p. 2733) */221 /* Set values for according to formula (manual p. 2733) */ 236 222 /* Use temporary variables for easier debugging */ 237 223 const uint32_t tpir = 238 224 ((32768 / hz + 1) * 1000000) - (32768000L * (1000 / hz)); 239 225 const uint32_t tnir = 240 ((32768 / hz) * 1000000) - (32768000 L* (1000 / hz));226 ((32768 / hz) * 1000000) - (32768000 * (1000 / hz)); 241 227 timer->regs->tpir = tpir; 242 228 timer->regs->tnir = tnir; … … 255 241 } 256 242 257 static inline boolamdm37x_gpt_irq_ack(amdm37x_gpt_t* timer)243 static inline void amdm37x_gpt_irq_ack(amdm37x_gpt_t* timer) 258 244 { 259 245 ASSERT(timer); 260 246 ASSERT(timer->regs); 261 247 /* Clear all pending interrupts */ 262 const uint32_t tisr = timer->regs->tisr; 263 timer->regs->tisr = tisr; 264 return tisr != 0; 248 timer->regs->tisr = timer->regs->tisr; 265 249 } 266 250
Note:
See TracChangeset
for help on using the changeset viewer.
