All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 06/11] board: ti: dra7xx-evm: turn on USB clocks in late init stage
Date: Thu, 12 Apr 2018 10:41:15 +0200	[thread overview]
Message-ID: <1523522480-10819-7-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1523522480-10819-1-git-send-email-jjhiblot@ti.com>

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>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 board/ti/dra7xx/evm.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 06f061c..c1e1b8e 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -647,6 +647,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
@@ -686,6 +699,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 at 48880000"))
+		enable_usb_clocks(0);
+	if (device_okay("/ocp/omap_dwc3_2 at 488c0000"))
+		enable_usb_clocks(1);
+#endif
 	return 0;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2018-04-12  8:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  8:41 [U-Boot] [PATCH v4 00/11] Add support for DM_USB for TI's DRA7 EVMs and AM57 EVMs platforms Jean-Jacques Hiblot
2018-04-12  8:41 ` [U-Boot] [PATCH v4 01/11] usb: dwc3-of-simple: Fix dependencies Jean-Jacques Hiblot
2018-04-12  8:47   ` Marek Vasut
2018-04-12  8:41 ` [U-Boot] [PATCH v4 02/11] usb: dwc3-of-simple: Add support for DRA7/AM57 platforms Jean-Jacques Hiblot
2018-04-12  8:47   ` Marek Vasut
2018-04-12  8:41 ` [U-Boot] [PATCH v4 03/11] syscon: dm: Add a new method to get a regmap from DTS Jean-Jacques Hiblot
2018-05-04 21:38   ` Simon Glass
2018-04-12  8:41 ` [U-Boot] [PATCH v4 04/11] phy: ti-pip3-phy: Add support for USB3 PHY Jean-Jacques Hiblot
2018-04-12  8:41 ` [U-Boot] [PATCH v4 05/11] phy: Add a new driver for OMAP's USB2 PHYs Jean-Jacques Hiblot
2018-04-12  8:41 ` Jean-Jacques Hiblot [this message]
2018-04-12  8:41 ` [U-Boot] [PATCH v4 07/11] board; ti: am57xx: turn on USB clocks Jean-Jacques Hiblot
2018-04-12  8:41 ` [U-Boot] [PATCH v4 08/11] dts: dra7x: make ocp2scp@4a080000 compatible with simple-bus Jean-Jacques Hiblot
2018-04-12  8:41 ` [U-Boot] [PATCH v4 09/11] dts: dra7x: Disable USB1 on all evms Jean-Jacques Hiblot
2018-04-12  8:41 ` [U-Boot] [PATCH v4 10/11] configs: enable OMAP_USB2_PHY for all DRA7 platforms Jean-Jacques Hiblot
2018-04-12  8:41 ` [U-Boot] [PATCH v4 11/11] configs: am57xx_evm: Enable DM_USB and dependencies Jean-Jacques Hiblot
2018-04-12  8:48 ` [U-Boot] [PATCH v4 00/11] Add support for DM_USB for TI's DRA7 EVMs and AM57 EVMs platforms Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1523522480-10819-7-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.