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

Eric Nelson eric at nelint.com
Tue Sep 5 13:49:27 UTC 2017


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.

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.

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

... A comment to that effect is probably in order though.

Please advise,


Eric


More information about the U-Boot mailing list