From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] usb: dwc2: Add support for v3 snpsid value
Date: Wed, 13 May 2015 22:05:11 +0200 [thread overview]
Message-ID: <201505132205.11787.marex@denx.de> (raw)
In-Reply-To: <20150513110001.GA19605@griffinp-ThinkPad-X1-Carbon-2nd>
On Wednesday, May 13, 2015 at 01:00:01 PM, Peter Griffin wrote:
> Hi Marek,
>
> On Tue, 12 May 2015, Marek Vasut wrote:
> > On Tuesday, May 12, 2015 at 03:38:27 PM, Peter Griffin wrote:
> > > This has been tested to the extent that I can enumerate
> > > a asix usb networking adapter and boot a kernel over usb
> > > on the 96boards hikey u-boot port I'm currently doing.
> > >
> > > Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> > > ---
> > >
> > > drivers/usb/host/dwc2.c | 3 ++-
> > > drivers/usb/host/dwc2.h | 1 +
> > > 2 files changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> > > index e8142ac..19a6007 100644
> > > --- a/drivers/usb/host/dwc2.c
> > > +++ b/drivers/usb/host/dwc2.c
> > > @@ -1015,7 +1015,8 @@ int usb_lowlevel_init(int index, enum
> > > usb_init_type init, void **controller) snpsid = readl(®s->gsnpsid);
> > >
> > > printf("Core Release: %x.%03x\n", snpsid >> 12 & 0xf, snpsid &
> > > 0xfff);
> > >
> > > - if ((snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_2xx) {
> > > + if ((snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_2xx &&
> > > + (snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_3xx) {
> >
> > Isn't this then a DWC3 controller instead ?
>
> No I don't believe so. dwc3 is a usb3 controller with different register
> set AFAIK.
>
> I believe this piece of code is replicating what the Linux
> driver does here: -
>
> http://lxr.free-electrons.com/source/drivers/usb/dwc2/core.c#L2664
>
> Also see here for the various different sub core revisions within 2.xx and
> 3.xx which are supported by the dwc2 Linux driver
> http://lxr.free-electrons.com/source/drivers/usb/dwc2/core.h#L625.
>
> This also matches up with the available datasheet here
> https://github.com/96boards/documentation/blob/master/hikey/
> Hi6220V100_Multi-Mode_Application_Processor_Function_Description.pdf on
> page 219 which states it is a USB2 OTG controller, but near the bottom of
> the page also tates: -
>
> "The USB core used in Hi6220 is build from Synopsys IP(3.00a).".
>
> I just checked through the DWC_otg_databook.odf, and these revision numbers
> also match up with the "Revision History" changes in the document. So it
> all ties together.
>
> It is worth highlighting at this point that not bailing here (along with
> setting up the appropriate clocks to the IP) was enough for me to get a
> DWC2 core rev 3.00a enumerating a ASIX networking adapter and tftp a
> kernel into DDR. However there maybe some other changes required to
> "fully" support the 3.00a hardware version. There is of course the problem
> I mentioned in the cover letter regarding enumerating mass storage devices
> which may or may not be related to this.
>
> Although a quick grep of the Linux driver only gets three hits
>
> git grep DWC2_CORE_REV_3_00a
> core.h:#define DWC2_CORE_REV_3_00a 0x4f54300a
> core_intr.c: if (hsotg->hw_params.snpsid >= DWC2_CORE_REV_3_00a)
> hcd.c: if (hsotg->hw_params.snpsid >= DWC2_CORE_REV_3_00a) {
>
> Neither of which seem relevant to the mass storage device problem (one adds
> a delay in the irq handler, and the other sets a bit when freeing the hcd.
Ooh, I see. Thank you for the extensive explanation!
I picked this patch for u-boot-usb, so feel free to submit any improvements
for the 3.xx core as you cook them. Thanks!
next prev parent reply other threads:[~2015-05-13 20:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1431437912-18988-1-git-send-email-peter.griffin@linaro.org>
[not found] ` <1431437912-18988-2-git-send-email-peter.griffin@linaro.org>
2015-05-12 18:30 ` [U-Boot] [PATCH 1/6] usb: dwc2: Add support for v3 snpsid value Marek Vasut
2015-05-13 11:00 ` Peter Griffin
2015-05-13 20:05 ` Marek Vasut [this message]
[not found] ` <1431437912-18988-3-git-send-email-peter.griffin@linaro.org>
2015-05-12 18:36 ` [U-Boot] [PATCH 2/6] dm: gpio: hi6220: Add a hi6220 GPIO driver model driver Marek Vasut
2015-05-12 19:08 ` Tom Rini
2015-05-13 12:00 ` Peter Griffin
2015-05-13 20:01 ` Marek Vasut
[not found] ` <1431437912-18988-6-git-send-email-peter.griffin@linaro.org>
2015-05-12 18:39 ` [U-Boot] [PATCH 5/6] mmc: hi6220_dw_mmc: Add hi6220 glue code for dw_mmc controller Marek Vasut
2015-05-13 12:10 ` Peter Griffin
2015-05-12 13:25 [U-Boot] [PATCH 0/6] Add support for hi6220 SoC and HiKey 96boards CE board Peter Griffin
2015-05-12 13:25 ` [U-Boot] [PATCH 1/6] usb: dwc2: Add support for v3 snpsid value Peter Griffin
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=201505132205.11787.marex@denx.de \
--to=marex@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox