All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: Adam Ford <aford173@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>,
	sbabic@denx.de, u-boot@lists.denx.de,
	 Fabio Estevam <festevam@denx.de>
Subject: Re: [PATCH 3/3] arm: dts: imx8mp: Sync with Linux 6.3
Date: Tue, 30 May 2023 11:40:13 -0700	[thread overview]
Message-ID: <CAJ+vNU2jo6GEMgDqqN0fVgy2sYpdH6CydZ56cv_cx-no5zaXmw@mail.gmail.com> (raw)
In-Reply-To: <CAHCN7x+SRDzuMJOb4nQyjyBWY14g3SWoepLC1p39F=f8QSvvqA@mail.gmail.com>

On Tue, May 30, 2023 at 10:28 AM Adam Ford <aford173@gmail.com> wrote:
>
> On Tue, May 30, 2023 at 12:23 PM Tim Harvey <tharvey@gateworks.com> wrote:
> >
> > On Mon, May 29, 2023 at 10:45 AM Adam Ford <aford173@gmail.com> wrote:
> > >
> > > On Wed, May 24, 2023 at 9:02 PM Fabio Estevam <festevam@gmail.com> wrote:
> > > >
> > > > Hi Tim,
> > > >
> > > > On Fri, May 19, 2023 at 8:00 PM Tim Harvey <tharvey@gateworks.com> wrote:
> > > >
> > > > > Fabio,
> > >
> > > + Marek
> > > I am adding Marek since he did the HSIO power domain driver.
> > >
> > > > >
> > > > > There's more to be done here also. With this patch, and with the
> > > > > spba-bus added to u-boot.dtsi, if you try to enable usb (usb start)
> > > > > you get:
> > > > > starting USB...
> > > > > Bus usb@38200000:
> > > > > Enable clock-controller@30380000 failed
> > > > > probe failed, error -2
> > > > > No working controllers found
> > > >
> > > > Does this help?
> > >
> > > A bit.  I finally got some time to try to troubleshoot USB on my 8MP.
> > >
> > > >
> > > > --- a/drivers/clk/imx/clk-imx8mp.c
> > > > +++ b/drivers/clk/imx/clk-imx8mp.c
> > > > @@ -337,8 +337,8 @@ static int imx8mp_clk_probe(struct udevice *dev)
> > > >         clk_dm(IMX8MP_CLK_UART2_ROOT, imx_clk_gate4("uart2_root_clk",
> > > > "uart2", base + 0x44a0, 0));
> > > >         clk_dm(IMX8MP_CLK_UART3_ROOT, imx_clk_gate4("uart3_root_clk",
> > > > "uart3", base + 0x44b0, 0));
> > > >         clk_dm(IMX8MP_CLK_UART4_ROOT, imx_clk_gate4("uart4_root_clk",
> > > > "uart4", base + 0x44c0, 0));
> > > > -       clk_dm(IMX8MP_CLK_USB_ROOT, imx_clk_gate4("usb_root_clk",
> > > > "usb_core_ref", base + 0x44d0, 0));
> > > > -       clk_dm(IMX8MP_CLK_USB_PHY_ROOT,
> > >
> > > IMX8MP_CLK_USB_PHY_ROOT is also referenced in the device tree, so I
> > > don't think we can delete it. I had  keep IMX8MP_CLK_USB_ROOT, and
> > > IMX8MP_CLK_USB_PHY_ROOT while also adding IMX8MP_CLK_USB_SUSP.
> > >
> > > > imx_clk_gate4("usb_phy_root_clk", "usb_phy_ref", base + 0x44f0, 0));
> > > > +       clk_dm(IMX8MP_CLK_USB_ROOT, imx_clk_gate4("usb_root_clk",
> > > > "hsio_axi", base + 0x44d0, 0));
> > > > +       clk_dm(IMX8MP_CLK_USB_SUSP, imx_clk_gate4("usb_suspend_clk",
> > > > "osc_32k", base + 0x44d0, 0));
> > > >         clk_dm(IMX8MP_CLK_USDHC1_ROOT,
> > > > imx_clk_gate4("usdhc1_root_clk", "usdhc1", base + 0x4510, 0));
> > > >         clk_dm(IMX8MP_CLK_USDHC2_ROOT,
> > > > imx_clk_gate4("usdhc2_root_clk", "usdhc2", base + 0x4520, 0));
> > > >         clk_dm(IMX8MP_CLK_WDOG1_ROOT, imx_clk_gate4("wdog1_root_clk",
> > > > "wdog", base + 0x4530, 0));
> > >
> > > At this point, the missing clock errors go away, but it hangs.  I
> > > updated my 8MP USB clocks based on the latest Linux kernel so my
> > > clocks looks like:
> > >
> > > clk_dm(IMX8MP_CLK_USB_ROOT, imx_clk_gate2("usb_root_clk", "hsio_axi",
> > > base + 0x44d0, 0));
> > > clk_dm(IMX8MP_CLK_USB_SUSP, imx_clk_gate2("usb_suspend_clk",
> > > "clock-osc-24m", base + 0x44d0, 0));
> > > clk_dm(IMX8MP_CLK_USB_PHY_ROOT, imx_clk_gate4("usb_phy_root_clk",
> > > "usb_phy_ref", base + 0x44f0, 0));
> > >
> > > The linux kernel uses gate2 for USB_ROOT and USB_SUSP while gate4 is
> > > used for IMX8MP_CLK_USB_PHY_ROOT.  I didn't verify this against the
> > > reference manual.
> > >
> > > With some debugging enabled, it looks to me like it might be
> > > power-domain related, but I am not 100% certain.
> > > When I start the USB, it appears to go through some clocks, and start
> > > one power domain, but I think we have a power-domain chain where one
> > > power domain starts another.  I saw a patch on another thread for
> > > enabling parent power-domains, but it didn't seem to help me.
> > >
> > > u-boot=> usb start
> > > starting USB...
> > > Bus usb@38200000: ofnode_read_prop: maximum-speed: <not found>
> > > ofnode_read_prop: dr_mode: host
> > > dev_power_domain_on usb@32f10108
> > > ofnode_read_prop: assigned-clock-rates: <not found>
> > > Looking for clock-controller@30380000
> > > Looking for clock-controller@30380000
> > >    - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
> > >    - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
> > > Looking for clock-controller@30380000
> > > Looking for clock-controller@30380000
> > >    - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
> > >    - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
> > > ofnode_read_prop: dr_mode: host
> > >
> > > <hang>
> > >
> > > I added some debug code to the imx8mp_hsiomix_on in HSIOmix power
> > > domain driver, and it doesn't appear to be getting called, yet
> > > dev_power_domain_on usb@32f10108 should be invoking it.
> > >
> > > I am not positive it's a power domain issue, that's my first guess.
> > >
> > >
> > > Tim - have you had any success?
> > >
> >
> > Adam,
> >
> > No success here yet but I don't have any time to work on it for at
> > least another week.
>
> No worries. I'll try to spend some more time this week, and keep you
> informed of any progress.  I'd like to see the USB working too.
>

Adam,

Thanks for keeping me in the loop. For my boards I also need to add
vbus regulator enable to the dwc controller (which I've worked on a
bit but have not submitted anything yet) and eventually gpio dual-role
based detect/configure as well (which I have not worked on and
currently just force dr-mode to host in a u-boot.dtsi file to deal
with).

Best Regards,

Tim

  reply	other threads:[~2023-05-30 18:40 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 18:08 [PATCH 1/3] arm: dts: imx8mm: Sync with Linux 6.3 Fabio Estevam
2023-04-27 18:08 ` [PATCH 2/3] arm: dts: imx8mn: " Fabio Estevam
2023-04-27 19:21   ` Adam Ford
2023-05-03 16:12   ` Tim Harvey
2023-07-14  0:42     ` Tim Harvey
2023-04-27 18:08 ` [PATCH 3/3] arm: dts: imx8mp: " Fabio Estevam
2023-04-27 19:22   ` Adam Ford
2023-05-03 16:11   ` Tim Harvey
2023-05-19 22:19     ` Tim Harvey
2023-05-19 22:26       ` Adam Ford
2023-05-19 22:31         ` Tim Harvey
2023-05-19 22:33           ` Tim Harvey
2023-05-19 22:35             ` Adam Ford
2023-05-19 23:00               ` Tim Harvey
2023-05-22 20:48                 ` Fabio Estevam
2023-05-22 20:52                   ` Adam Ford
2023-05-25  2:02                 ` Fabio Estevam
2023-05-29 17:45                   ` Adam Ford
2023-05-30 17:23                     ` Tim Harvey
2023-05-30 17:28                       ` Adam Ford
2023-05-30 18:40                         ` Tim Harvey [this message]
2023-05-30 22:34                           ` Adam Ford
2023-05-30 23:13                             ` Fabio Estevam
2023-05-22  6:49         ` Rasmus Villemoes
2023-04-27 18:56 ` [PATCH 1/3] arm: dts: imx8mm: " Tim Harvey
2023-04-27 19:11   ` Fabio Estevam
2023-04-27 19:14     ` Tim Harvey
2023-04-27 19:19       ` Tim Harvey
2023-04-27 19:26         ` Fabio Estevam
2023-04-27 19:44           ` Tim Harvey
2023-04-27 19:49             ` Fabio Estevam
2023-04-27 22:25               ` Tim Harvey
2023-04-28 11:57                 ` Adam Ford
2023-04-28 15:27                   ` Tim Harvey
2023-04-28 15:32                     ` Adam Ford
2023-04-28 15:48                       ` Tim Harvey
2023-04-28 16:26                         ` Fabio Estevam
2023-04-28 16:44                           ` Adam Ford
2023-04-28 17:59                             ` Tim Harvey
2023-04-28 18:19                               ` Fabio Estevam
2023-05-03 16:11                                 ` Tim Harvey
2023-07-14  0:42                                   ` Tim Harvey
2023-07-14  5:17                                     ` Stefano Babic
2023-10-17 19:21                                       ` Tim Harvey
2023-10-17 20:28                                         ` Stefano Babic
2023-10-18  8:04                                           ` Stefano Babic
2023-04-27 19:23 ` Adam Ford

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=CAJ+vNU2jo6GEMgDqqN0fVgy2sYpdH6CydZ56cv_cx-no5zaXmw@mail.gmail.com \
    --to=tharvey@gateworks.com \
    --cc=aford173@gmail.com \
    --cc=festevam@denx.de \
    --cc=festevam@gmail.com \
    --cc=sbabic@denx.de \
    --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.