[U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB has been initialized

Stefano Babic sbabic at denx.de
Tue Sep 5 13:57:53 UTC 2017


Hi Eric,

On 05/09/2017 15:49, Eric Nelson wrote:
> Hi Stefano,
> 
> On 09/05/2017 04:16 AM, Stefano Babic wrote:
>> Hi Stefan,
>> On 05/09/2017 03:21, Stefan Agner wrote:
>>> From: Stefan Agner <stefan.agner at toradex.com>
>>>
>>> This macro allows to detect whether the boot ROM initialized USB
>>> already (serial downloader). This is helpful to reliably detect
>>> if the system has been recovered via USB serial downloader.
>>>
>>> Signed-off-by: Stefan Agner <stefan.agner at toradex.com>
>>> Acked-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
>>> ---
>>> Hi Stefano,
>>>
>>> I noted already in my initial post that detection of serial
>>> downloader mode is somewhat brittle:
>>> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html
>>>
>>> This came up quite fast now also for other boards:
>>> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html
>>>
>>> We use this patches since quite some time. Also NXP uses this
>>> detection method to start their mfgr tools...
>>
>> Then it seems to be an "undocumented feature" rather a hack.
>>
> 
> This patch only detects that the OTG PHY is active, so it's
> not really a hack.
> 

Agree.

> The next patch uses this to infer how it happened (booted using
> SDP), and since I don't think there's another way for that to
> happen, it also seems to be reasonable.

Right. It is absolutely reasonable.

> 
> Can you think of another way that the OTG PHY could be alive
> when the code is hit in SPL?

No, I can't - nothing that makes sense ;-)

> 
> ... A comment to that effect is probably in order though.
> 
> Please advise,

Regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list