Changeset 9c56996 in mainline for kernel/genarch/src/drivers/am335x/timer.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.