Changeset e5e2d73 in mainline
- Timestamp:
- 2012-11-04T12:18:47Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 360823ca
- Parents:
- 57912af3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c
r57912af3 re5e2d73 112 112 } 113 113 114 static int usb_clocks(amdm37x_t *device, bool on) 115 { 114 /** Set DPLL3,4,5 to autoidle 115 * @param device Register map. 116 */ 117 static void dpll_autoidle(amdm37x_t *device) 118 { 119 assert(device); 116 120 /* Set DPLL3 to automatic */ 117 121 pio_change_32(&device->cm.clocks->autoidle_pll, … … 128 132 CLOCK_CONTROL_CM_AUTOIDLE2_PLL_AUTO_PERIPH2_DPLL_AUTOMATIC, 129 133 CLOCK_CONTROL_CM_AUTOIDLE2_PLL_AUTO_PERIPH2_DPLL_MASK, 5); 130 131 132 #ifdef DEBUG_CM 133 printf("DPLL5 could be on: %"PRIx32" %"PRIx32".\n", 134 pio_read_32((ioport32_t*)&device->cm.clocks->idlest_ckgen), 135 pio_read_32((ioport32_t*)&device->cm.clocks->idlest2_ckgen)); 136 #endif 137 134 } 135 136 /** Enable/disable function and interface clocks for USBTLL and USBHOST. 137 * @param device Register map. 138 * @param on True to swoitch clocks on. 139 */ 140 static void usb_clocks_enable(amdm37x_t *device, bool on) 141 { 138 142 if (on) { 139 143 /* Enable interface and function clock for USB TLL */ … … 168 172 CORE_CM_FCLKEN3_EN_USBTLL_FLAG, 5); 169 173 } 170 171 return EOK;172 174 } 173 175 … … 179 181 static int usb_tll_init(amdm37x_t *device) 180 182 { 181 182 183 /* Reset USB TLL */ 183 184 pio_set_32(&device->tll->sysconfig, TLL_SYSCONFIG_SOFTRESET_FLAG, 5); … … 340 341 } 341 342 342 ret = usb_clocks(device, true); 343 if (ret != EOK) { 344 ddf_msg(LVL_FATAL, "Failed to enable USB HC clocks!.\n"); 345 return ret; 346 } 347 343 /* Set dplls to automatic */ 344 dpll_autoidle(device); 345 346 /* Enable function and interface clocks */ 347 usb_clocks_enable(device, true); 348 349 /* Init TLL */ 348 350 ret = usb_tll_init(device); 349 351 if (ret != EOK) { 350 352 ddf_msg(LVL_FATAL, "Failed to init USB TLL!.\n"); 351 usb_clocks (device, false);353 usb_clocks_enable(device, false); 352 354 return ret; 353 355 }
Note:
See TracChangeset
for help on using the changeset viewer.