All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>,
	Fabio Estevam <festevam@denx.de>, Stefano Babic <sbabic@denx.de>,
	U-Boot-Denx <u-boot@lists.denx.de>,
	Schrempf Frieder <frieder.schrempf@kontron.de>,
	 dl-uboot-imx <uboot-imx@nxp.com>
Subject: Re: [PATCH 1/8] imx8mm: Fix USB reg addresses for i.MX8MM
Date: Tue, 6 Jul 2021 09:11:17 -0700	[thread overview]
Message-ID: <CAJ+vNU3s0wNtcGMqM3AdgUw9qcPRkZ+tivA0iZfOzBvqyYrj7Q@mail.gmail.com> (raw)
In-Reply-To: <52050ae7-bc10-eeb1-3162-1aa8586042cb@denx.de>

On Sun, Jul 4, 2021 at 12:25 PM Marek Vasut <marex@denx.de> wrote:
>
> On 7/4/21 5:35 PM, Fabio Estevam wrote:
> > Hi Marek,
>
> Hi,
>
> > On Sat, Jul 3, 2021 at 10:04 PM Marek Vasut <marex@denx.de> wrote:
> >
> >>> Retrieving the USB base addresses from DT would be preferred, yes, but
> >>> the current code does not do that.
> >>
> >> I implemented exactly that in mx6_parse_dt_addrs() , see:
> >> 4dcfa3bcbcb ("usb: ehci-mx6: Parse USB PHY and MISC offsets from DT")
> >
> > We are talking about USB_BASE_ADDR, right?
>
> All of the addresses used by the driver, I am trying hard to get rid of
> all that hard-coding in the driver. They should be parsed out of DT.
>

Marek,

I agree with trying to get rid of all the hard-coding but not all of
us are using SPL_DM_USB. I'm not sure how to best tell who is not
using DM in the SPL. I know I ran into issues as I'm supporting a
family of boards with the same U-Boot and could not find a way to
switch dt's early in the SPL after I've detected via EEPROM what board
I have.

Tim

> > imx6/imx7/imxrt provide the USB_BASE_ADDR as define.
>
> That's only because they still need to be fully converted, someone needs
> to write the PHY driver for those. For MX8M, the NOP PHY driver is used.
>
> > If we remove the imx6 definition from arch/arm/include/asm/arch-mx6/imx-regs.h
> > the ehci-mx6: driver fails to build.
> >
> > I didn't want to change ehci-mx6 in this aspect, so that's why I used
> > Frieder's patch that passes
> > USB_BASE_ADDR via define for i.MX8MM too.
> >
> > Is this an acceptable solution?
>
> No, let's not do that, because that exactly un-does the attempt to get
> rid of these hard-coded addresses. Please parse the address out of DT.
> And if you run into something which might still need hard-coded
> addresses, please fix it.
>
> The ehci-mx6 is bad, let's not make it worse, lets fix it instead.
>
> >>> Without providing these defines:
> >>>
> >>> drivers/usb/host/ehci-mx6.c:254:62: error: ‘USB_BASE_ADDR’ undeclared
> >>> (first use in this function); did you mean ‘SRC_BASE_ADDR’?
> >>>     254 |  struct usbnc_regs *usbnc = (struct usbnc_regs
> >>> *)(uintptr_t)(USB_BASE_ADDR +
> >>
> >> I suspect you need CONFIG_PHY for mx8m .
> >
> > CONFIG_PHY is already selected by imx8mm_evk_defconfig.
>
> USBNC is iMX7 specific , so you cannot hit that error on iMX8M, there is
> #elif defined(CONFIG_MX7) around it.

  reply	other threads:[~2021-07-06 16:11 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 [this message]
2021-07-06 21:17               ` Marek Vasut
2021-07-07 17:37                 ` Simon Glass
2021-07-03 19:58 ` [PATCH 2/8] clock_imx8mm: Add enable_usboh3_clk() for i.MX8M Fabio Estevam
2021-08-06 12:12   ` 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=CAJ+vNU3s0wNtcGMqM3AdgUw9qcPRkZ+tivA0iZfOzBvqyYrj7Q@mail.gmail.com \
    --to=tharvey@gateworks.com \
    --cc=festevam@denx.de \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=marex@denx.de \
    --cc=sbabic@denx.de \
    --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.