Changeset 7c3fb9b in mainline for uspace/drv/platform/amdm37x/amdm37x.c
- Timestamp:
- 2018-05-17T08:29:01Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/amdm37x/amdm37x.c
rfac0ac7 r7c3fb9b 127 127 { 128 128 assert(device); 129 /* Get SYS_CLK value, it is used as reference clock by all DPLLs, 130 * NFI who sets this or why it is set to specific value. */ 129 /* 130 * Get SYS_CLK value, it is used as reference clock by all DPLLs, 131 * NFI who sets this or why it is set to specific value. 132 */ 131 133 const unsigned osc_clk = pio_read_32(&device->prm.clocks->clksel) & 132 134 CLOCK_CONTROL_PRM_CLKSEL_SYS_CLKIN_MASK; … … 138 140 139 141 140 /* DPLL1 provides MPU(CPU) clock. 142 /* 143 * DPLL1 provides MPU(CPU) clock. 141 144 * It uses SYS_CLK as reference clock and core clock (DPLL3) as 142 145 * high frequency bypass (MPU then runs on L3 interconnect freq). 143 * It should be setup by fw or u-boot.*/ 146 * It should be setup by fw or u-boot. 147 */ 144 148 mpu_cm_regs_t *mpu = device->cm.mpu; 145 149 … … 183 187 // TODO: Enable this (automatic MPU downclocking): 184 188 #if 0 185 /* Enable low power bypass mode, this will take effect the next lock or 186 * relock sequence. */ 189 /* 190 * Enable low power bypass mode, this will take effect the next lock or 191 * relock sequence. 192 */ 187 193 //TODO: We might need to force re-lock after enabling this 188 194 pio_set_32(&mpu->clken_pll, MPU_CM_CLKEN_PLL_EN_MPU_DPLL_LP_MODE_FLAG, 5); … … 191 197 #endif 192 198 193 /* DPLL2 provides IVA(video acceleration) clock. 199 /* 200 * DPLL2 provides IVA(video acceleration) clock. 194 201 * It uses SYS_CLK as reference clokc and core clock (DPLL3) as 195 202 * high frequency bypass (IVA runs on L3 freq). 196 203 */ 197 204 // TODO: We can probably turn this off entirely. IVA is left unused. 198 /* Enable low power bypass mode, this will take effect the next lock or 199 * relock sequence. */ 205 /* 206 * Enable low power bypass mode, this will take effect the next lock or 207 * relock sequence. 208 */ 200 209 //TODO: We might need to force re-lock after enabling this 201 210 pio_set_32(&device->cm.iva2->clken_pll, MPU_CM_CLKEN_PLL_EN_MPU_DPLL_LP_MODE_FLAG, 5); … … 203 212 pio_change_32(&device->cm.iva2->autoidle_pll, MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_ENABLED, MPU_CM_AUTOIDLE_PLL_AUTO_MPU_DPLL_MASK, 5); 204 213 205 /* DPLL3 provides tons of clocks: 214 /* 215 * DPLL3 provides tons of clocks: 206 216 * CORE_CLK, COREX2_CLK, DSS_TV_CLK, 12M_CLK, 48M_CLK, 96M_CLK, L3_ICLK, 207 217 * and L4_ICLK. It uses SYS_CLK as reference clock and low frequency … … 252 262 CLOCK_CONTROL_CM_AUTOIDLE_PLL_AUTO_CORE_DPLL_MASK, 5); 253 263 254 /* DPLL4 provides peripheral domain clocks: 264 /* 265 * DPLL4 provides peripheral domain clocks: 255 266 * CAM_MCLK, EMU_PER_ALWON_CLK, DSS1_ALWON_FCLK, and 96M_ALWON_FCLK. 256 267 * It uses SYS_CLK as reference clock and low frequency bypass. … … 263 274 CLOCK_CONTROL_CM_AUTOIDLE_PLL_AUTO_PERIPH_DPLL_MASK, 5); 264 275 265 /* DPLL5 provide peripheral domain clocks: 120M_FCLK. 276 /* 277 * DPLL5 provide peripheral domain clocks: 120M_FCLK. 266 278 * It uses SYS_CLK as reference clock and low frequency bypass. 267 279 * 120M clock is used by HS USB and USB TLL. … … 271 283 CLOCK_CONTROL_CM_CLKEN2_PLL_EN_PERIPH2_DPLL_MASK) != 272 284 CLOCK_CONTROL_CM_CLKEN2_PLL_EN_PERIPH2_DPLL_LOCK) { 273 /* Compute divisors and multiplier 274 * See AMDM37x TRM p. 300 for the formula */ 285 /* 286 * Compute divisors and multiplier 287 * See AMDM37x TRM p. 300 for the formula 288 */ 275 289 // TODO: base_freq does not have to be rounded to Mhz 276 290 // (that's why I used KHz as unit). … … 383 397 UHH_SYSCONFIG_SIDLE_MODE_SMART, UHH_SYSCONFIG_SIDLE_MODE_MASK, 5); 384 398 385 /* Set all ports to go through TLL(UTMI) 386 * Direct connection can only work in HS mode */ 399 /* 400 * Set all ports to go through TLL(UTMI) 401 * Direct connection can only work in HS mode 402 */ 387 403 pio_set_32(&device->uhh->hostconfig, 388 404 UHH_HOSTCONFIG_P1_ULPI_BYPASS_FLAG | … … 394 410 395 411 for (unsigned i = 0; i < 3; ++i) { 396 /* Serial mode is the only one capable of FS/LS operation. 412 /* 413 * Serial mode is the only one capable of FS/LS operation. 397 414 * Select FS/LS mode, no idea what the difference is 398 415 * one of bidirectional modes might be good choice 399 * 2 = 3pin bidi phy. */ 416 * 2 = 3pin bidi phy. 417 */ 400 418 pio_change_32(&device->tll->channel_conf[i], 401 419 TLL_CHANNEL_CONF_CHANMODE_UTMI_SERIAL_MODE |
Note:
See TracChangeset
for help on using the changeset viewer.