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 v6 06/11] board; ti: am57xx: turn on USB clocks
Date: Fri, 25 May 2018 15:51:49 +0200	[thread overview]
Message-ID: <1527256314-31951-7-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1527256314-31951-1-git-send-email-jjhiblot@ti.com>

From: Vignesh R <vigneshr@ti.com>

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

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- am57xx boards: when DM_USB is used, turn on the required USB clocks

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

diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index fd9d207..828a36c 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 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-05-25 13:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 13:51 [U-Boot] [PATCH v6 00/11] Add support for DM_USB and DM_USB_DEV for TI's DRA7 EVMs and AM57 EVMs platforms Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 01/11] syscon: dm: Add a new method to get a regmap from DTS Jean-Jacques Hiblot
2018-05-27  0:53   ` Simon Glass
2018-05-25 13:51 ` [U-Boot] [PATCH v6 02/11] phy: ti-pip3-phy: Add support for USB3 PHY Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 03/11] phy: Add a new driver for OMAP's USB2 PHYs Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 04/11] dwc3-generic: Add support for the TI DWC3 glue Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 05/11] board: ti: dra7xx-evm: turn on USB clocks in late init stage Jean-Jacques Hiblot
2018-05-25 13:51 ` Jean-Jacques Hiblot [this message]
2018-05-25 13:51 ` [U-Boot] [PATCH v6 07/11] dts: dra7x: make ocp2scp@4a080000 compatible with simple-bus Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 08/11] configs: enable DM_USB and DM_USB_DEV for all DRA7 platforms Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 09/11] configs: am57xx_evm: Enable DM_USB and DM_USB_DEV Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 10/11] board: ti: dra7-evm: remove USB platform code Jean-Jacques Hiblot
2018-05-25 13:51 ` [U-Boot] [PATCH v6 11/11] board: ti: am57xx: " Jean-Jacques Hiblot

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=1527256314-31951-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.