From: Stefano Babic Date: Tue, 5 Sep 2017 15:57:53 +0200 Subject: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB has been initialized In-Reply-To: References: <20170905012144.4833-1-stefan@agner.ch> <57a8b816-529a-22d3-c981-37468b58244b@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >>> >>> 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 >>> Acked-by: Marcel Ziswiler >>> --- >>> 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 at 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 =====================================================================