Changeset 167c7b3 in mainline
- Timestamp:
- 2012-11-21T11:20:04Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a6d91b
- Parents:
- 17be8c2
- Location:
- uspace/drv/infrastructure/rootamdm37x
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/infrastructure/rootamdm37x/prm/clock_control.h
r17be8c2 r167c7b3 27 27 */ 28 28 29 /** @addtogroup amdm37xdrv clockcontrolprm29 /** @addtogroup amdm37xdrvprm 30 30 * @{ 31 31 */ -
uspace/drv/infrastructure/rootamdm37x/prm/usbhost.h
r17be8c2 r167c7b3 27 27 */ 28 28 29 /** @addtogroup amdm37xdrv clockcontrolprm29 /** @addtogroup amdm37xdrvprm 30 30 * @{ 31 31 */ -
uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c
r17be8c2 r167c7b3 56 56 57 57 #include "prm/clock_control.h" 58 #include "prm/global_reg.h" 58 59 59 60 #define NAME "rootamdm37x" … … 71 72 struct { 72 73 clock_control_prm_regs_t *clocks; 74 global_reg_prm_regs_t *global; 73 75 } prm; 74 76 } amdm37x_t; … … 112 114 ret = pio_enable((void*)CLOCK_CONTROL_PRM_BASE_ADDRESS, 113 115 CLOCK_CONTROL_PRM_SIZE, (void**)&device->prm.clocks); 116 if (ret != EOK) 117 return ret; 118 119 ret = pio_enable((void*)GLOBAL_REG_PRM_BASE_ADDRESS, 120 GLOBAL_REG_PRM_SIZE, (void**)&device->prm.global); 114 121 if (ret != EOK) 115 122 return ret; … … 134 141 pio_trace_enable(device->uhh, AMDM37x_UHH_SIZE, log, (void*)AMDM37x_UHH_BASE_ADDRESS); 135 142 pio_trace_enable(device->prm.clocks, CLOCK_CONTROL_PRM_SIZE, log, (void*)CLOCK_CONTROL_PRM_BASE_ADDRESS); 143 pio_trace_enable(device->prm.global, GLOBAL_REG_PRM_SIZE, log, (void*)GLOBAL_REG_PRM_BASE_ADDRESS); 136 144 } 137 145 return EOK; … … 151 159 /* Get SYS_CLK value, it is used as reference clock by all DPLLs, 152 160 * NFI who sets this or why it is set to specific value. */ 153 const unsigned base_clk = pio_read_32(&device->prm.clocks->clksel)161 const unsigned osc_clk = pio_read_32(&device->prm.clocks->clksel) 154 162 & CLOCK_CONTROL_PRM_CLKSEL_SYS_CLKIN_MASK; 155 const unsigned base_freq = sys_clk_freq_kHz(base_clk); 156 ddf_msg(LVL_DEBUG, "Base frequency: %d.%dMhz", 163 const unsigned clk_reg = pio_read_32(&device->prm.global->clksrc_ctrl); 164 const unsigned base_freq = sys_clk_freq_kHz(osc_clk) 165 / GLOBAL_REG_PRM_CLKSRC_CTRL_SYSCLKDIV_GET(clk_reg); 166 ddf_msg(LVL_NOTE, "Base frequency: %d.%dMhz", 157 167 base_freq / 1000, base_freq % 1000); 158 168
Note:
See TracChangeset
for help on using the changeset viewer.