aboutsummaryrefslogtreecommitdiff
path: root/board/ti/am57xx
diff options
context:
space:
mode:
authorVignesh R2018-11-29 10:57:42 +0100
committerMarek Vasut2018-12-07 16:31:46 +0100
commitc3cd5fc870ab4c89316c5caeb8f6f09088e44956 (patch)
treedb48776bbe42dad9b5d55a8f9f0927779111e1d2 /board/ti/am57xx
parent24e261b39cc7d1abf3b03f5a554423cc1d27a986 (diff)
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>
Diffstat (limited to 'board/ti/am57xx')
-rw-r--r--board/ti/am57xx/board.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 177a3246c3d..8c24d17123b 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -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;
}