Changeset 9c56996 in mainline
- Timestamp:
- 2013-02-14T21:22:17Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63b2be8
- Parents:
- c0948aaa
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/mach/beaglebone/beaglebone.c
rc0948aaa r9c56996 98 98 AM335x_CTRL_MODULE_SIZE, PAGE_NOT_CACHEABLE); 99 99 100 ASSERT(bbone.irc_addr != NULL); 101 ASSERT(bbone.cm_per_addr != NULL); 102 ASSERT(bbone.cm_dpll_addr != NULL); 103 ASSERT(bbone.ctrl_module != NULL); 104 100 105 /* Initialize the interrupt controller */ 101 106 am335x_irc_init(bbone.irc_addr); … … 118 123 { 119 124 unsigned sysclk_freq; 125 int rc; 120 126 121 127 /* Initialize the IRQ */ … … 141 147 printf("system clock running at %u hz\n", sysclk_freq); 142 148 143 am335x_timer_init(&bbone.timer, DMTIMER2, HZ, sysclk_freq); 149 rc = am335x_timer_init(&bbone.timer, DMTIMER2, HZ, sysclk_freq); 150 if (rc != EOK) { 151 printf("Timer initialization failed\n"); 152 return; 153 } 144 154 /* Enable the interrupt */ 145 155 am335x_irc_enable(bbone.irc_addr, AM335x_DMTIMER2_IRQ); -
kernel/genarch/include/drivers/am335x/timer.h
rc0948aaa r9c56996 85 85 } am335x_timer_t; 86 86 87 extern voidam335x_timer_init(am335x_timer_t *timer, am335x_timer_id_t id,87 extern int am335x_timer_init(am335x_timer_t *timer, am335x_timer_id_t id, 88 88 unsigned hz, unsigned srcclk_hz); 89 89 extern void am335x_timer_intr_ack(am335x_timer_t *timer); -
kernel/genarch/src/drivers/am335x/timer.c
rc0948aaa r9c56996 52 52 static const timer_regs_mmap_t regs_map[TIMERS_MAX] = { 53 53 { .base = AM335x_DMTIMER0_BASE_ADDRESS, .size = AM335x_DMTIMER0_SIZE }, 54 {0, 0}, 54 {0, 0}, /* DMTIMER1 is not supported by this driver */ 55 55 { .base = AM335x_DMTIMER2_BASE_ADDRESS, .size = AM335x_DMTIMER2_SIZE }, 56 56 { .base = AM335x_DMTIMER3_BASE_ADDRESS, .size = AM335x_DMTIMER3_SIZE }, … … 83 83 } 84 84 85 void 85 int 86 86 am335x_timer_init(am335x_timer_t *timer, am335x_timer_id_t id, unsigned hz, 87 87 unsigned srcclk_hz) … … 91 91 92 92 ASSERT(id < TIMERS_MAX); 93 ASSERT(timer != NULL); 93 94 94 95 if (id == DMTIMER1_1MS) 95 return ; /* Not supported yet */96 return ENOTSUP; /* Not supported yet */ 96 97 97 98 base_addr = regs_map[id].base; … … 99 100 100 101 timer->regs = (void *) km_map(base_addr, size, PAGE_NOT_CACHEABLE); 102 ASSERT(timer->regs != NULL); 103 101 104 timer->id = id; 102 105 … … 130 133 write_register_posted(timer, REG_TCRR, count); 131 134 write_register_posted(timer, REG_TLDR, count); 135 136 return EOK; 132 137 } 133 138
Note:
See TracChangeset
for help on using the changeset viewer.