All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@denx.de>
To: sbabic@denx.de
Cc: marex@denx.de, u-boot@lists.denx.de, frieder.schrempf@kontron.de,
	tharvey@gateworks.com, uboot-imx@nxp.com,
	Fabio Estevam <festevam@denx.de>
Subject: [PATCH 2/8] clock_imx8mm: Add enable_usboh3_clk() for i.MX8M
Date: Sat,  3 Jul 2021 16:58:31 -0300	[thread overview]
Message-ID: <20210703195837.28153-3-festevam@denx.de> (raw)
In-Reply-To: <20210703195837.28153-1-festevam@denx.de>

From: Frieder Schrempf <frieder.schrempf@kontron.de>

Currently we can't use DM_USB in SPL as the ci_udc driver is not
ported to DM yet.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 arch/arm/include/asm/arch-imx8m/clock.h |  1 +
 arch/arm/mach-imx/imx8m/clock_imx8mm.c  | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx8m/clock.h b/arch/arm/include/asm/arch-imx8m/clock.h
index 77d9428a188a..fcd111c918fd 100644
--- a/arch/arm/include/asm/arch-imx8m/clock.h
+++ b/arch/arm/include/asm/arch-imx8m/clock.h
@@ -276,3 +276,4 @@ int enable_i2c_clk(unsigned char enable, unsigned int i2c_num);
 int set_clk_enet(enum enet_freq type);
 int set_clk_eqos(enum enet_freq type);
 void hab_caam_clock_enable(unsigned char enable);
+void enable_usboh3_clk(unsigned char enable);
diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
index f8e4ec0d9052..dd40e2f1e772 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
@@ -277,6 +277,22 @@ int intpll_configure(enum pll_clocks pll, ulong freq)
 	return 0;
 }
 
+void enable_usboh3_clk(unsigned char enable)
+{
+	if (enable) {
+		clock_enable(CCGR_USB_MSCALE_PL301, 0);
+		/* 500M */
+		clock_set_target_val(USB_BUS_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1));
+		/* 100M */
+		clock_set_target_val(USB_CORE_REF_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1));
+		/* 100M */
+		clock_set_target_val(USB_PHY_REF_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1));
+		clock_enable(CCGR_USB_MSCALE_PL301, 1);
+	} else {
+		clock_enable(CCGR_USB_MSCALE_PL301, 0);
+	}
+}
+
 void init_uart_clk(u32 index)
 {
 	/*
-- 
2.25.1


  parent reply	other threads:[~2021-07-03 19:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 19:58 [PATCH 0/8] imx8mm: Add serial download support Fabio Estevam
2021-07-03 19:58 ` [PATCH 1/8] imx8mm: Fix USB reg addresses for i.MX8MM Fabio Estevam
2021-07-03 20:55   ` Marek Vasut
2021-07-03 21:38     ` Fabio Estevam
2021-07-04  1:04       ` Marek Vasut
2021-07-04 15:35         ` Fabio Estevam
2021-07-04 19:25           ` Marek Vasut
2021-07-06 16:11             ` Tim Harvey
2021-07-06 21:17               ` Marek Vasut
2021-07-07 17:37                 ` Simon Glass
2021-07-03 19:58 ` Fabio Estevam [this message]
2021-08-06 12:12   ` [PATCH 2/8] clock_imx8mm: Add enable_usboh3_clk() for i.MX8M Stefano Babic
2021-07-03 19:58 ` [PATCH 3/8] usb: ehci-mx6: move mode set/detect to probe Fabio Estevam
2021-07-03 19:58 ` [PATCH 4/8] usb: ehci-mx6: add IMX8MM and IMX8MN OTG support Fabio Estevam
2021-07-03 19:58 ` [PATCH 5/8] usb: ehci-mx6: Allow building SDP for imx8mm Fabio Estevam
2021-07-03 20:57   ` Marek Vasut
2021-07-03 21:39     ` Fabio Estevam
2022-03-27 21:02   ` Jaap Crezee
2022-03-27 21:43     ` Fabio Estevam
2022-03-28  7:17       ` Jaap Crezee
2022-03-28 10:26     ` Tommaso Merciai
2022-03-28 10:41       ` Jaap Crezee
2021-07-03 19:58 ` [PATCH 6/8] imx8mm_evk: Add an entry for USB boot Fabio Estevam
2021-07-03 19:58 ` [PATCH 7/8] imx8mm_evk: Add Serial Download Protocol support Fabio Estevam
2021-07-03 19:58 ` [PATCH 8/8] doc: imx8mm_evk: Add instructions for eMMC boot Fabio Estevam

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=20210703195837.28153-3-festevam@denx.de \
    --to=festevam@denx.de \
    --cc=frieder.schrempf@kontron.de \
    --cc=marex@denx.de \
    --cc=sbabic@denx.de \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /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.