mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] clk: imx8mp: add USB suspend clock
@ 2023-02-02 12:05 Lucas Stach
  2023-02-03  7:55 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2023-02-02 12:05 UTC (permalink / raw)
  To: barebox

Linux added another USB clock to properly describe the controller root
and suspend clocks. As new DTs are using this clock to keep the shared
gate enabled, access to the USB controller will hang Barebox without
support for this clock.

Fixes: 0d682a2997a8 ("dts: update to v6.2-rc5")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/clk/imx/clk-imx8mp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
index a1611be1833e..40578c2a4bd6 100644
--- a/drivers/clk/imx/clk-imx8mp.c
+++ b/drivers/clk/imx/clk-imx8mp.c
@@ -665,7 +665,8 @@ static int imx8mp_clocks_init(struct device_node *ccm_np)
 	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
 	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
 	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
-	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "osc_32k", ccm_base + 0x44d0, 0);
+	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
+	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0);
 	hws[IMX8MP_CLK_USB_PHY_ROOT] = imx_clk_hw_gate4("usb_phy_root_clk", "usb_phy_ref", ccm_base + 0x44f0, 0);
 	hws[IMX8MP_CLK_USDHC1_ROOT] = imx_clk_hw_gate4("usdhc1_root_clk", "usdhc1", ccm_base + 0x4510, 0);
 	hws[IMX8MP_CLK_USDHC2_ROOT] = imx_clk_hw_gate4("usdhc2_root_clk", "usdhc2", ccm_base + 0x4520, 0);
-- 
2.39.1




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: imx8mp: add USB suspend clock
  2023-02-02 12:05 [PATCH] clk: imx8mp: add USB suspend clock Lucas Stach
@ 2023-02-03  7:55 ` Sascha Hauer
  2023-02-03  9:07   ` Lucas Stach
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2023-02-03  7:55 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Thu, Feb 02, 2023 at 01:05:24PM +0100, Lucas Stach wrote:
> Linux added another USB clock to properly describe the controller root
> and suspend clocks. As new DTs are using this clock to keep the shared
> gate enabled, access to the USB controller will hang Barebox without
> support for this clock.
> 
> Fixes: 0d682a2997a8 ("dts: update to v6.2-rc5")
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/clk/imx/clk-imx8mp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> index a1611be1833e..40578c2a4bd6 100644
> --- a/drivers/clk/imx/clk-imx8mp.c
> +++ b/drivers/clk/imx/clk-imx8mp.c
> @@ -665,7 +665,8 @@ static int imx8mp_clocks_init(struct device_node *ccm_np)
>  	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
>  	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
>  	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
> -	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "osc_32k", ccm_base + 0x44d0, 0);
> +	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
> +	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0);

Do old dts files work with this change? In other words, can I apply this
directly to master or do I have to squash this change into the commit
that changes imx8mp.dtsi to use this clock?

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: imx8mp: add USB suspend clock
  2023-02-03  7:55 ` Sascha Hauer
@ 2023-02-03  9:07   ` Lucas Stach
  2023-02-06  7:41     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas Stach @ 2023-02-03  9:07 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Am Freitag, dem 03.02.2023 um 08:55 +0100 schrieb Sascha Hauer:
> On Thu, Feb 02, 2023 at 01:05:24PM +0100, Lucas Stach wrote:
> > Linux added another USB clock to properly describe the controller root
> > and suspend clocks. As new DTs are using this clock to keep the shared
> > gate enabled, access to the USB controller will hang Barebox without
> > support for this clock.
> > 
> > Fixes: 0d682a2997a8 ("dts: update to v6.2-rc5")
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> >  drivers/clk/imx/clk-imx8mp.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> > index a1611be1833e..40578c2a4bd6 100644
> > --- a/drivers/clk/imx/clk-imx8mp.c
> > +++ b/drivers/clk/imx/clk-imx8mp.c
> > @@ -665,7 +665,8 @@ static int imx8mp_clocks_init(struct device_node *ccm_np)
> >  	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
> >  	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
> >  	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
> > -	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "osc_32k", ccm_base + 0x44d0, 0);
> > +	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
> > +	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0);
> 
> Do old dts files work with this change? In other words, can I apply this
> directly to master or do I have to squash this change into the commit
> that changes imx8mp.dtsi to use this clock?
> 
As the old clock ID is still supported from the clock driver after this
change and operates the same gate, it should be fine to apply this
patch to master.

Regards,
Lucas



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] clk: imx8mp: add USB suspend clock
  2023-02-03  9:07   ` Lucas Stach
@ 2023-02-06  7:41     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2023-02-06  7:41 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Fri, Feb 03, 2023 at 10:07:22AM +0100, Lucas Stach wrote:
> Am Freitag, dem 03.02.2023 um 08:55 +0100 schrieb Sascha Hauer:
> > On Thu, Feb 02, 2023 at 01:05:24PM +0100, Lucas Stach wrote:
> > > Linux added another USB clock to properly describe the controller root
> > > and suspend clocks. As new DTs are using this clock to keep the shared
> > > gate enabled, access to the USB controller will hang Barebox without
> > > support for this clock.
> > > 
> > > Fixes: 0d682a2997a8 ("dts: update to v6.2-rc5")
> > > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > > ---
> > >  drivers/clk/imx/clk-imx8mp.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> > > index a1611be1833e..40578c2a4bd6 100644
> > > --- a/drivers/clk/imx/clk-imx8mp.c
> > > +++ b/drivers/clk/imx/clk-imx8mp.c
> > > @@ -665,7 +665,8 @@ static int imx8mp_clocks_init(struct device_node *ccm_np)
> > >  	hws[IMX8MP_CLK_UART2_ROOT] = imx_clk_hw_gate4("uart2_root_clk", "uart2", ccm_base + 0x44a0, 0);
> > >  	hws[IMX8MP_CLK_UART3_ROOT] = imx_clk_hw_gate4("uart3_root_clk", "uart3", ccm_base + 0x44b0, 0);
> > >  	hws[IMX8MP_CLK_UART4_ROOT] = imx_clk_hw_gate4("uart4_root_clk", "uart4", ccm_base + 0x44c0, 0);
> > > -	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate4("usb_root_clk", "osc_32k", ccm_base + 0x44d0, 0);
> > > +	hws[IMX8MP_CLK_USB_ROOT] = imx_clk_hw_gate2_shared2("usb_root_clk", "hsio_axi", ccm_base + 0x44d0, 0);
> > > +	hws[IMX8MP_CLK_USB_SUSP] = imx_clk_hw_gate2_shared2("usb_suspend_clk", "osc_32k", ccm_base + 0x44d0, 0);
> > 
> > Do old dts files work with this change? In other words, can I apply this
> > directly to master or do I have to squash this change into the commit
> > that changes imx8mp.dtsi to use this clock?
> > 
> As the old clock ID is still supported from the clock driver after this
> change and operates the same gate, it should be fine to apply this
> patch to master.

Ok, just did that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-06  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 12:05 [PATCH] clk: imx8mp: add USB suspend clock Lucas Stach
2023-02-03  7:55 ` Sascha Hauer
2023-02-03  9:07   ` Lucas Stach
2023-02-06  7:41     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox