mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-29 02:21:31 +00:00
board; ti: am57xx: turn on USB clocks
Enable USB clocks in late init stage to support ports under DM_USB. Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
24e261b39c
commit
c3cd5fc870
1 changed files with 19 additions and 0 deletions
|
@ -675,6 +675,19 @@ out:
|
|||
return;
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL)
|
||||
static int device_okay(const char *path)
|
||||
{
|
||||
int node;
|
||||
|
||||
node = fdt_path_offset(gd->fdt_blob, path);
|
||||
if (node < 0)
|
||||
return 0;
|
||||
|
||||
return fdtdec_get_is_enabled(gd->fdt_blob, node);
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
setup_board_eeprom_env();
|
||||
|
@ -714,6 +727,12 @@ int board_late_init(void)
|
|||
board_ti_set_ethaddr(2);
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL)
|
||||
if (device_okay("/ocp/omap_dwc3_1@48880000"))
|
||||
enable_usb_clocks(0);
|
||||
if (device_okay("/ocp/omap_dwc3_2@488c0000"))
|
||||
enable_usb_clocks(1);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue