Changeset 0f66886 in mainline
- Timestamp:
- 2013-02-13T20:19:29Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 06c4609
- Parents:
- 4c754f6
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/mach/beaglebone/beaglebone.c
r4c754f6 r0f66886 117 117 static void bbone_timer_irq_start(void) 118 118 { 119 unsigned sysclk_freq; 120 119 121 /* Initialize the IRQ */ 120 122 static irq_t timer_irq; … … 132 134 CLK_SRC_M_OSC); 133 135 /* Initialize the DMTIMER2 */ 134 am335x_timer_init(&bbone.timer, DMTIMER2, HZ, 135 am335x_ctrl_module_clock_freq_get(bbone.ctrl_module)); 136 if (am335x_ctrl_module_clock_freq_get(bbone.ctrl_module, 137 &sysclk_freq) != EOK) { 138 printf("Cannot get the system clock frequency!\n"); 139 return; 140 } 141 142 am335x_timer_init(&bbone.timer, DMTIMER2, HZ, sysclk_freq); 136 143 /* Enable the interrupt */ 137 144 am335x_irc_enable(bbone.irc_addr, AM335x_DMTIMER2_IRQ); -
kernel/genarch/include/drivers/am335x/ctrl_module.h
r4c754f6 r0f66886 37 37 #define _KERN_AM335X_CTRL_MODULE_H_ 38 38 39 #include <errno.h> 39 40 #include <typedefs.h> 40 41 #include "ctrl_module_regs.h" … … 45 46 typedef ioport32_t am335x_ctrl_module_t; 46 47 47 static unsigned am335x_ctrl_module_clock_freq_get(am335x_ctrl_module_t *base) 48 static int 49 am335x_ctrl_module_clock_freq_get(am335x_ctrl_module_t *base, unsigned *freq) 48 50 { 49 51 unsigned const control_status = *AM335x_CTRL_MODULE_REG_ADDR(base, 50 CONTROL_S YSCONFIG);52 CONTROL_STATUS); 51 53 unsigned const sysboot1 = (control_status >> 22) & 0x03; 52 54 53 55 switch (sysboot1) { 54 56 default: 57 return EOK; 55 58 case 0: 56 return19200000; /* 19.2 Mhz */59 *freq = 19200000; /* 19.2 Mhz */ 57 60 case 1: 58 return24000000; /* 24 Mhz */61 *freq = 24000000; /* 24 Mhz */ 59 62 case 2: 60 return25000000; /* 25 Mhz */63 *freq = 25000000; /* 25 Mhz */ 61 64 case 3: 62 return26000000; /* 26 Mhz */65 *freq = 26000000; /* 26 Mhz */ 63 66 } 67 68 return EINVAL; 64 69 } 65 70
Note:
See TracChangeset
for help on using the changeset viewer.