From: Sascha Hauer <s.hauer@pengutronix.de>
To: Michael Grzeschik <mgr@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] imx{5,6}: reset otg port after usb-serial boot
Date: Mon, 27 Aug 2018 10:29:59 +0200 [thread overview]
Message-ID: <20180827082959.dbpkqm7kvofembrh@pengutronix.de> (raw)
In-Reply-To: <20180827081322.bgtjhamviu5p7byd@pengutronix.de>
On Mon, Aug 27, 2018 at 10:13:22AM +0200, Michael Grzeschik wrote:
> On Mon, Aug 27, 2018 at 09:52:24AM +0200, Sascha Hauer wrote:
> > On Mon, Aug 27, 2018 at 09:47:41AM +0200, Michael Grzeschik wrote:
> > > On Fri, Aug 24, 2018 at 05:18:02PM -0300, Fabio Estevam wrote:
> > > > Hi Michael,
> > > >
> > > > On Fri, Aug 24, 2018 at 4:55 PM, Michael Grzeschik <mgr@pengutronix.de> wrote:
> > > >
> > > > > I get that it is not safe to toggle bits if the clock is not
> > > > > there. We could check for the bootsource. Is it possible to
> > > > > ensure that we are started by imx-usb-loader?
> > > >
> > > > It is possible to determine if we have started via USB download mode.
> > > >
> > > > Check the is_boot_from_usb() implementation in U-Boot for a reference.
> > >
> > > Right, So it seems to be safe to reach for the phys registers on mx6.
> > >
> > > On mx5 and similar we have a nop phy and the only way to
> > > communicate with it is through usbmisc, which is also in the
> > > register space that leads to a hang if one clock is missing.
> > >
> > > I will search for another solutions on those SoCs.
> >
> > It's not necessary to ask for the bootsource. You just have to enable
> > the clocks necessary to access the USB registers. Or the other way
> > round: When the clocks are not enabled already, you could assume we have
> > not booted from USB.
>
> Right, I think enabling the clocks is a little bit more safe
> as we otherwise would need to ensure that nobody slips in
> a DCD that already ungates all clocks.
What could happen is that somebody *dis*abled the USB clocks in DCD. In
that case though the USB on the host will already be confused and we
already have lost - no need to do anything in that case.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2018-08-27 8:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-24 15:17 Michael Grzeschik
2018-08-24 16:27 ` Sam Ravnborg
2018-08-24 17:04 ` Sascha Hauer
2018-08-24 19:55 ` Michael Grzeschik
2018-08-24 20:18 ` Fabio Estevam
2018-08-27 7:47 ` Michael Grzeschik
2018-08-27 7:52 ` Sascha Hauer
2018-08-27 8:13 ` Michael Grzeschik
2018-08-27 8:17 ` Michael Grzeschik
2018-08-27 8:29 ` Sascha Hauer [this message]
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=20180827082959.dbpkqm7kvofembrh@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=mgr@pengutronix.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