summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-11-29 10:57:41 +0100
committerMarek Vasut <marex@denx.de>2018-12-07 16:31:46 +0100
commit24e261b39cc7d1abf3b03f5a554423cc1d27a986 (patch)
tree588ef994657ac063e87101e90979df3544cc54fe /board
parentd66e54ac8084f892bf9a43f3242b5e2bf9a686ed (diff)
board: ti: dra7xx-evm: turn on USB clocks in late init stage
For USB ports that use the Driver Model, turn on the clocks during the late init stage. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board')
-rw-r--r--board/ti/dra7xx/evm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index bbe54450ae..b46bda2579 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -646,6 +646,19 @@ int dram_init_banksize(void)
return 0;
}
+#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)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
@@ -685,6 +698,12 @@ int board_late_init(void)
if (board_is_dra71x_evm())
palmas_i2c_write_u8(LP873X_I2C_SLAVE_ADDR, 0x9, 0x7);
#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;
}