[{"id":1762927,"web_url":"http://patchwork.ozlabs.org/comment/1762927/","msgid":"<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>","list_archive_url":null,"date":"2017-09-05T02:57:48","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":67231,"url":"http://patchwork.ozlabs.org/api/people/67231/","name":"Eric Nelson","email":"eric@nelint.com"},"content":"Hi Stefan,\n\nOn 09/04/2017 06:21 PM, Stefan Agner wrote:\n> From: Stefan Agner <stefan.agner@toradex.com>\n> \n> This macro allows to detect whether the boot ROM initialized USB\n> already (serial downloader). This is helpful to reliably detect\n> if the system has been recovered via USB serial downloader.\n> \n> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n> ---\n> Hi Stefano,\n> \n> I noted already in my initial post that detection of serial\n> downloader mode is somewhat brittle:\n> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n> \n> This came up quite fast now also for other boards:\n> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n> \n> We use this patches since quite some time. Also NXP uses this\n> detection method to start their mfgr tools... Altough a hack,\n> maybe we should still add it upstream?\n> \n> --\n> Stefan\n> \n> \n>   arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n>   1 file changed, 7 insertions(+)\n> \n> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\n> index 86e267087a..895ef4de83 100644\n> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h\n> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h\n> @@ -985,5 +985,12 @@ struct pwm_regs {\n>   \tu32\tpr;\n>   \tu32\tcnr;\n>   };\n\nIt seems as if you've already named a constant, so you might as well\n#define and use it (USBPH0_PWD or USB0_PWD).\n\nThe reference manual seems to call it RXPWDRX though.\n\n> +\n> +/*\n> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n> + * If boot from the other mode, USB0_PWD will keep reset value\n> + */\n> +#define\tis_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n> +\n>   #endif /* __ASSEMBLER__*/\n>   #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */\n> \nIf I'm reading your comment correctly, the RXPWDRX bit will be set (the\nPHY will be powered down) unless it was enabled by the Boot ROM.\n\nWon't this also be clear if you've run 'usb start' under U-Boot?\n\nPlease advise,\n\n\nEric","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tsecure) header.d=nelint.com header.i=@nelint.com header.b=\"YJ2jFfWW\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmWc96FqJz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 12:58:01 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 8033BC21EE6; Tue,  5 Sep 2017 02:57:55 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 82C74C21C41;\n\tTue,  5 Sep 2017 02:57:53 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 3B746C21C41; Tue,  5 Sep 2017 02:57:52 +0000 (UTC)","from mail-pg0-f43.google.com (mail-pg0-f43.google.com\n\t[74.125.83.43])\n\tby lists.denx.de (Postfix) with ESMTPS id 8FC3EC21C2B\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 02:57:51 +0000 (UTC)","by mail-pg0-f43.google.com with SMTP id m9so5777469pgd.3\n\tfor <u-boot@lists.denx.de>; Mon, 04 Sep 2017 19:57:51 -0700 (PDT)","from ?IPv6:2600:8800:1300:1c00:d1aa:5201:10a5:5347?\n\t([2600:8800:1300:1c00:d1aa:5201:10a5:5347])\n\tby smtp.gmail.com with ESMTPSA id\n\tj7sm12588564pfb.30.2017.09.04.19.57.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 04 Sep 2017 19:57:49 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nelint.com; s=google;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=Qfjm3evOjHBqU0+8BHvyqKmaFvBWinUJs1ckxSD0hGA=;\n\tb=YJ2jFfWWhbmLIeWsE9Z/3lPTbiYeB3nG7sNpBxoKiy7126WwV6SqTAsQZK10R4qRfx\n\t6BTAVk8XSThX0DMiPLvxc3n2ZdBG84i7p8a3ggU60HLybenHtumX4HdsvD9xpgujzdhk\n\tLN8xTuOPH9WYA6GD+9181jg1vC+G6VWFOj+to=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=Qfjm3evOjHBqU0+8BHvyqKmaFvBWinUJs1ckxSD0hGA=;\n\tb=qMN5zc9DEGWtE4GfNom6Oag5CUvp2frMacaNckXrEofiPkKSveLbJJZOMaP02uyYMD\n\tZuRhUfTjZVHg4PAkAjmUnaC6HKhYjBAVrgU+69079tNEIncYXiw5av2a2HV9jsjmgAr1\n\tYKXvZSFNSdQvFie9+yGvVudOfWBtoR4vVhcRaDuGj+JONHBDpuuvRoHePGYfihVvGNMp\n\tZfjXmoQP2AXITgKf2UQA9wu/PEH0x8tyaJyrG5BrW4GmOJujUoz3JD7g9LlJmAxFq7zo\n\tOj51f/DrRf8DZNQ6JwGFvfqaoqw9gk0g3WJI4mF9rbh4nW/rs6weMSL2TipwTOfexYVP\n\t0T1w==","X-Gm-Message-State":"AHPjjUjvcUTxwvsbwErIZ8k+kzpL/9rS5d3cVWwNJorFh2LnWX/d1F9B\n\tjDP7hqyJCeQqk0yn","X-Google-Smtp-Source":"ADKCNb60yod9A6RiJUyRzRC6qrwmU9rC4S5xMtjUppuUKkPeUao4bSzUrKmx6X9HucMuLz3B8tdbAA==","X-Received":"by 10.98.166.137 with SMTP id r9mr2370265pfl.86.1504580270095;\n\tMon, 04 Sep 2017 19:57:50 -0700 (PDT)","To":"Stefan Agner <stefan@agner.ch>, sbabic@denx.de, fabio.estevam@nxp.com","References":"<20170905012144.4833-1-stefan@agner.ch>","From":"Eric Nelson <eric@nelint.com>","Message-ID":"<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>","Date":"Mon, 4 Sep 2017 19:57:48 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170905012144.4833-1-stefan@agner.ch>","Content-Language":"en-US","Cc":"marex@denx.de, albert.u.boot@aribaud.net,\n\tStefan Agner <stefan.agner@toradex.com>, joel.esponde@honeywell.com, \n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tjagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1762958,"web_url":"http://patchwork.ozlabs.org/comment/1762958/","msgid":"<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","list_archive_url":null,"date":"2017-09-05T04:50:33","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":4137,"url":"http://patchwork.ozlabs.org/api/people/4137/","name":"Stefan Agner","email":"stefan@agner.ch"},"content":"On 2017-09-04 19:57, Eric Nelson wrote:\n> Hi Stefan,\n> \n> On 09/04/2017 06:21 PM, Stefan Agner wrote:\n>> From: Stefan Agner <stefan.agner@toradex.com>\n>>\n>> This macro allows to detect whether the boot ROM initialized USB\n>> already (serial downloader). This is helpful to reliably detect\n>> if the system has been recovered via USB serial downloader.\n>>\n>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n>> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n>> ---\n>> Hi Stefano,\n>>\n>> I noted already in my initial post that detection of serial\n>> downloader mode is somewhat brittle:\n>> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n>>\n>> This came up quite fast now also for other boards:\n>> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n>>\n>> We use this patches since quite some time. Also NXP uses this\n>> detection method to start their mfgr tools... Altough a hack,\n>> maybe we should still add it upstream?\n>>\n>> --\n>> Stefan\n>>\n>>\n>>   arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n>>   1 file changed, 7 insertions(+)\n>>\n>> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\n>> index 86e267087a..895ef4de83 100644\n>> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h\n>> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h\n>> @@ -985,5 +985,12 @@ struct pwm_regs {\n>>   \tu32\tpr;\n>>   \tu32\tcnr;\n>>   };\n> \n> It seems as if you've already named a constant, so you might as well\n> #define and use it (USBPH0_PWD or USB0_PWD).\n\nAgreed.\n\n> \n> The reference manual seems to call it RXPWDRX though.\n\nI guess taking the latest naming from the manual make sense. Will update\nin v2.\n\nBefore I send out v2, I'd like to know from Stefano whether he agrees\nwith the general direction of the patch.\n\n\n\n> \n>> +\n>> +/*\n>> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n>> + * If boot from the other mode, USB0_PWD will keep reset value\n>> + */\n>> +#define\tis_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n>> +\n>>   #endif /* __ASSEMBLER__*/\n>>   #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */\n>>\n> If I'm reading your comment correctly, the RXPWDRX bit will be set (the\n> PHY will be powered down) unless it was enabled by the Boot ROM.\n> \n> Won't this also be clear if you've run 'usb start' under U-Boot?\n\nYes, this only works before a USB initialization...\n\nThis should be fine for the use case I have in mind (see patch 2).\n\nNote this idea is borrowed from NXP downstream and seems to work here:\nhttp://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7/imx-regs.h?h=imx_v2016.03_4.1.15_2.0.0_ga#n1204\n\n--\nStefan","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=agner.ch header.i=@agner.ch header.b=\"ku+8IRnY\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmZ9X2CDvz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 14:53:36 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 0092FC21DA3; Tue,  5 Sep 2017 04:53:34 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 12A69C21C41;\n\tTue,  5 Sep 2017 04:53:32 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 32824C21C41; Tue,  5 Sep 2017 04:53:30 +0000 (UTC)","from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109])\n\tby lists.denx.de (Postfix) with ESMTPS id 159DFC21C2B\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 04:53:29 +0000 (UTC)","from webmail.kmu-office.ch (unknown [178.209.48.103])\n\tby mail.kmu-office.ch (Postfix) with ESMTPSA id 36C9D5C0EAD;\n\tTue,  5 Sep 2017 06:49:54 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_NONE, SPF_HELO_PASS,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","MIME-Version":"1.0","Date":"Mon, 04 Sep 2017 21:50:33 -0700","From":"Stefan Agner <stefan@agner.ch>","To":"Eric Nelson <eric@nelint.com>","In-Reply-To":"<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>","Message-ID":"<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","X-Sender":"stefan@agner.ch","User-Agent":"Roundcube Webmail/1.2.5","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim;\n\tt=1504586994; bh=Sq1wwjLkxd8pt8B+eyY7X4KbcIXM/eMSPy9IkqshYO4=;\n\th=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID;\n\tb=ku+8IRnYYAzpcNs3vA7ivk2yiXAa35LLCx98a4Myx7va2BRs6vaPYfONJ+4I4f7o9l0RAnZTRhh2jv/6ussZzn/EF+xCCYnDq8YIvW/qj7gSRsZLG6gF5EPkyBf2uTMn0bKPLtXsbZOyutMjv5+n+Evsc6qDGadXEW9Rh+sCIcE=","Cc":"marex@denx.de, albert.u.boot@aribaud.net, joel.esponde@honeywell.com,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tfabio.estevam@nxp.com, jagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763229,"web_url":"http://patchwork.ozlabs.org/comment/1763229/","msgid":"<CAOMZO5DV12OfH_5hsz16L6A3SXMtwE40_0-T5Q8A6Bib=ppFeA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-05T11:13:37","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":6978,"url":"http://patchwork.ozlabs.org/api/people/6978/","name":"Fabio Estevam","email":"festevam@gmail.com"},"content":"Hi Stefan,\n\nOn Mon, Sep 4, 2017 at 10:21 PM, Stefan Agner <stefan@agner.ch> wrote:\n> From: Stefan Agner <stefan.agner@toradex.com>\n>\n> This macro allows to detect whether the boot ROM initialized USB\n> already (serial downloader). This is helpful to reliably detect\n> if the system has been recovered via USB serial downloader.\n>\n> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n\nThis allows Serial Download Protocol to work on imx6q sabresd:\n\nTested-by: Fabio Estevam <fabio.estevam@nxp.com>\n\n> ---\n> Hi Stefano,\n>\n> I noted already in my initial post that detection of serial\n> downloader mode is somewhat brittle:\n> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n>\n> This came up quite fast now also for other boards:\n> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n>\n> We use this patches since quite some time. Also NXP uses this\n> detection method to start their mfgr tools... Altough a hack,\n> maybe we should still add it upstream?\n>\n> --\n> Stefan\n>\n>\n>  arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n>  1 file changed, 7 insertions(+)\n>\n> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\n> index 86e267087a..895ef4de83 100644\n> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h\n> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h\n> @@ -985,5 +985,12 @@ struct pwm_regs {\n>         u32     pr;\n>         u32     cnr;\n>  };\n> +\n> +/*\n> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n> + * If boot from the other mode, USB0_PWD will keep reset value\n> + */\n> +#define        is_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n\nMinor nit: imx-regs.h is better suited for storing register layout definitions.\n\nI think that arch/arm/include/asm/mach-imx/sys_proto.h  would be a\nmore appropriate location for this macro.\n\nAlso you could remove that tab between 'define' and the macro name.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"NbxO12fw\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmkcC2z5bz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 21:13:47 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 04EC1C21F26; Tue,  5 Sep 2017 11:13:43 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 174D7C21C8F;\n\tTue,  5 Sep 2017 11:13:41 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 8FD61C21C8F; Tue,  5 Sep 2017 11:13:39 +0000 (UTC)","from mail-oi0-f65.google.com (mail-oi0-f65.google.com\n\t[209.85.218.65])\n\tby lists.denx.de (Postfix) with ESMTPS id F35BBC21C54\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 11:13:38 +0000 (UTC)","by mail-oi0-f65.google.com with SMTP id h70so2098209oic.4\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 04:13:38 -0700 (PDT)","by 10.157.17.176 with HTTP; Tue, 5 Sep 2017 04:13:37 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=/hgJsPGWrjg7Y+mVCMx6QGY6r8oBczR9Qy3Ecx9CFgo=;\n\tb=NbxO12fwMTyPmB4/oFyclJE1wKSqcf2MzNNiWFse5SQF8v5imWCzF0x8JKTKc7Cz8M\n\tl/vJIUXkjO9bzBmxo2WgAfEGHroUYYB8dF0gUd1wHaWW8q+qk/+OrwDAjXW7yFBaID3y\n\tSctQT8FALcK7We+H7dgTbjnljm1ZX1XZNSatDw4+JvDsecoJJZi84AAFL9CdFW8JWR4M\n\tEkKbAxTBDkXfi1PdTArh2i9QwOccfjKAKuI0YuuWl4ahbCy2f9QAJucCzWqCLuLLQVD8\n\tx4AAy/uId9TVQLfkXB0bNQPlcMKSJDs7VpD7JcyO/ILbjJLhVRWYt4f8dAKC4QWOY6K8\n\tczWw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=/hgJsPGWrjg7Y+mVCMx6QGY6r8oBczR9Qy3Ecx9CFgo=;\n\tb=BJf6kRHBTmVVFC5gcPKAbBFr6nKyQBRmxPj3VFo9Zpr20cTjlXS2ZQ+CBOsOZxaSjE\n\t9DT0324wpkOF5Lv9zuUy/lDXCrp05+4NrbsHvG4tAnp306YDT5B40loPBOBYuAsX2L6y\n\tdI64QHsYb3xESIAf/s8q7eVry2/2bWiLQ7qIcB6Lj9B8C3ah+7bdS/Spi5gcw4fMeHEr\n\tMlowM9shCyhNTcR1PYtBUoEzJplWZQG04HU+f4Z8NUtmcphedSf1aakx1ELJxUNHTEum\n\thtUandHpAQvf8pgBhEm6HmePcz951rBpOr91t2mc7aUFljGBkezMyWpeJB0sQBhCL+zn\n\tRz2w==","X-Gm-Message-State":"AHPjjUiFflWkqks1MldLZcwjwHLQiUCikYYVZ3bP0HTc4f3VWXJcD7UY\n\t90QA2mtuXZl7HeBozmpvgHsPsEMzIw==","X-Google-Smtp-Source":"ADKCNb4p7cRcIcq/sc/memhQQjGg7cFrvHfyXBiYhO5cuXhLMb91eMSiaH4JT225OnGP6k1I3a3OmHuINn3ANUcPbUU=","X-Received":"by 10.202.76.9 with SMTP id z9mr3356909oia.253.1504610017560;\n\tTue, 05 Sep 2017 04:13:37 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170905012144.4833-1-stefan@agner.ch>","References":"<20170905012144.4833-1-stefan@agner.ch>","From":"Fabio Estevam <festevam@gmail.com>","Date":"Tue, 5 Sep 2017 08:13:37 -0300","Message-ID":"<CAOMZO5DV12OfH_5hsz16L6A3SXMtwE40_0-T5Q8A6Bib=ppFeA@mail.gmail.com>","To":"Stefan Agner <stefan@agner.ch>","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763232,"web_url":"http://patchwork.ozlabs.org/comment/1763232/","msgid":"<57a8b816-529a-22d3-c981-37468b58244b@denx.de>","list_archive_url":null,"date":"2017-09-05T11:16:32","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":5771,"url":"http://patchwork.ozlabs.org/api/people/5771/","name":"Stefano Babic","email":"sbabic@denx.de"},"content":"Hi Stefan,\n\nOn 05/09/2017 03:21, Stefan Agner wrote:\n> From: Stefan Agner <stefan.agner@toradex.com>\n> \n> This macro allows to detect whether the boot ROM initialized USB\n> already (serial downloader). This is helpful to reliably detect\n> if the system has been recovered via USB serial downloader.\n> \n> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n> ---\n> Hi Stefano,\n> \n> I noted already in my initial post that detection of serial\n> downloader mode is somewhat brittle:\n> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n> \n> This came up quite fast now also for other boards:\n> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n> \n> We use this patches since quite some time. Also NXP uses this\n> detection method to start their mfgr tools...\n\nThen it seems to be an \"undocumented feature\" rather a hack.\n\n> Altough a hack,\n> maybe we should still add it upstream?\n\nIf we can detect at runtime as this patch is thought to do, it is really\nan improvement and I will glad to merge it.\n\nMaybe we get some further info from our \"insider\" (Fabio, Peng). It will\nbe very interesting to know if we can apply this to all spectrum from\ni.MX6, or if there is some MX6 variant where the Bootrom is doing\nsomething different.\n\nRegards,\nStefano\n\n> \n> --\n> Stefan\n> \n> \n>  arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n>  1 file changed, 7 insertions(+)\n> \n> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\n> index 86e267087a..895ef4de83 100644\n> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h\n> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h\n> @@ -985,5 +985,12 @@ struct pwm_regs {\n>  \tu32\tpr;\n>  \tu32\tcnr;\n>  };\n> +\n> +/*\n> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n> + * If boot from the other mode, USB0_PWD will keep reset value\n> + */\n> +#define\tis_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n> +\n>  #endif /* __ASSEMBLER__*/\n>  #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmkhT1vkRz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 21:17:29 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid A6DC8C21F9E; Tue,  5 Sep 2017 11:16:56 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 25863C21F69;\n\tTue,  5 Sep 2017 11:16:55 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid EE62AC21D7B; Tue,  5 Sep 2017 11:16:46 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9])\n\tby lists.denx.de (Postfix) with ESMTPS id C56C7C21F4E\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 11:16:45 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xmkgc6vd7z1qqyq;\n\tTue,  5 Sep 2017 13:16:44 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xmkgc4MMqz3jR9t;\n\tTue,  5 Sep 2017 13:16:44 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id RR2ePIUJocWF; Tue,  5 Sep 2017 13:16:41 +0200 (CEST)","from babic.homelinux.org (host-88-217-136-221.customer.m-online.net\n\t[88.217.136.221])\n\t(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tTue,  5 Sep 2017 13:16:41 +0200 (CEST)","from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id 902EC4540594;\n\tTue,  5 Sep 2017 13:16:40 +0200 (CEST)","from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id fkk8JGu5pLrr; Tue,  5 Sep 2017 13:16:33 +0200 (CEST)","from [192.168.178.132] (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id 91ACE45404CD;\n\tTue,  5 Sep 2017 13:16:32 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","X-Virus-Scanned":["amavisd-new at mnet-online.de","Debian amavisd-new at babic.homelinux.org"],"To":"Stefan Agner <stefan@agner.ch>, sbabic@denx.de, fabio.estevam@nxp.com","References":"<20170905012144.4833-1-stefan@agner.ch>","From":"Stefano Babic <sbabic@denx.de>","Message-ID":"<57a8b816-529a-22d3-c981-37468b58244b@denx.de>","Date":"Tue, 5 Sep 2017 13:16:32 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170905012144.4833-1-stefan@agner.ch>","Content-Language":"en-US","Cc":"marex@denx.de, albert.u.boot@aribaud.net,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tjoel.esponde@honeywell.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tjagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763236,"web_url":"http://patchwork.ozlabs.org/comment/1763236/","msgid":"<36b86844-6260-6375-e2ce-0c837cff6e84@denx.de>","list_archive_url":null,"date":"2017-09-05T11:20:21","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":5771,"url":"http://patchwork.ozlabs.org/api/people/5771/","name":"Stefano Babic","email":"sbabic@denx.de"},"content":"Hi Stefan, Eric,\n\nOn 05/09/2017 06:50, Stefan Agner wrote:\n> On 2017-09-04 19:57, Eric Nelson wrote:\n>> Hi Stefan,\n>>\n>> On 09/04/2017 06:21 PM, Stefan Agner wrote:\n>>> From: Stefan Agner <stefan.agner@toradex.com>\n>>>\n>>> This macro allows to detect whether the boot ROM initialized USB\n>>> already (serial downloader). This is helpful to reliably detect\n>>> if the system has been recovered via USB serial downloader.\n>>>\n>>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n>>> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n>>> ---\n>>> Hi Stefano,\n>>>\n>>> I noted already in my initial post that detection of serial\n>>> downloader mode is somewhat brittle:\n>>> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n>>>\n>>> This came up quite fast now also for other boards:\n>>> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n>>>\n>>> We use this patches since quite some time. Also NXP uses this\n>>> detection method to start their mfgr tools... Altough a hack,\n>>> maybe we should still add it upstream?\n>>>\n>>> --\n>>> Stefan\n>>>\n>>>\n>>>   arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n>>>   1 file changed, 7 insertions(+)\n>>>\n>>> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\n>>> index 86e267087a..895ef4de83 100644\n>>> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h\n>>> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h\n>>> @@ -985,5 +985,12 @@ struct pwm_regs {\n>>>   \tu32\tpr;\n>>>   \tu32\tcnr;\n>>>   };\n>>\n>> It seems as if you've already named a constant, so you might as well\n>> #define and use it (USBPH0_PWD or USB0_PWD).\n> \n> Agreed.\n> \n>>\n>> The reference manual seems to call it RXPWDRX though.\n> \n> I guess taking the latest naming from the manual make sense. Will update\n> in v2.\n> \n> Before I send out v2, I'd like to know from Stefano whether he agrees\n> with the general direction of the patch.\n> \n\nGreen light from my side :-)\n\n> \n> \n>>\n>>> +\n>>> +/*\n>>> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n>>> + * If boot from the other mode, USB0_PWD will keep reset value\n>>> + */\n>>> +#define\tis_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n>>> +\n>>>   #endif /* __ASSEMBLER__*/\n>>>   #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */\n>>>\n>> If I'm reading your comment correctly, the RXPWDRX bit will be set (the\n>> PHY will be powered down) unless it was enabled by the Boot ROM.\n>>\n>> Won't this also be clear if you've run 'usb start' under U-Boot?\n> \n> Yes, this only works before a USB initialization...\n> \n> This should be fine for the use case I have in mind (see patch 2).\n\nAgree. We want to detect just in SPL which was the (last) bootdevice and\nrather we cannot detect them from SCR/GPR that just reflect the\nconfigured booting device and not a fallback.\n\n> \n> Note this idea is borrowed from NXP downstream and seems to work here:\n> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7/imx-regs.h?h=imx_v2016.03_4.1.15_2.0.0_ga#n1204\n> \n\nRegards,\nStefano","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmkmH5Jh8z9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 21:20:47 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 5E34BC21C54; Tue,  5 Sep 2017 11:20:45 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 3BC77C21C54;\n\tTue,  5 Sep 2017 11:20:42 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 448DFC21C54; Tue,  5 Sep 2017 11:20:40 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9])\n\tby lists.denx.de (Postfix) with ESMTPS id DE0BDC21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 11:20:39 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xmkm71CmQz1qrN6;\n\tTue,  5 Sep 2017 13:20:39 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xmkm55fwvz3jR9m;\n\tTue,  5 Sep 2017 13:20:37 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id SaOMJDJvHIfY; Tue,  5 Sep 2017 13:20:33 +0200 (CEST)","from babic.homelinux.org (host-88-217-136-221.customer.m-online.net\n\t[88.217.136.221])\n\t(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tTue,  5 Sep 2017 13:20:32 +0200 (CEST)","from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id 53D014540594;\n\tTue,  5 Sep 2017 13:20:32 +0200 (CEST)","from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id E9v-UKfzoJY9; Tue,  5 Sep 2017 13:20:22 +0200 (CEST)","from [192.168.178.132] (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id CC07245404CD;\n\tTue,  5 Sep 2017 13:20:21 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","X-Virus-Scanned":["amavisd-new at mnet-online.de","Debian amavisd-new at babic.homelinux.org"],"To":"Stefan Agner <stefan@agner.ch>, Eric Nelson <eric@nelint.com>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>\n\t<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","From":"Stefano Babic <sbabic@denx.de>","Message-ID":"<36b86844-6260-6375-e2ce-0c837cff6e84@denx.de>","Date":"Tue, 5 Sep 2017 13:20:21 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","Content-Language":"de-DE","Cc":"marex@denx.de, albert.u.boot@aribaud.net, joel.esponde@honeywell.com,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tfabio.estevam@nxp.com, jagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763367,"web_url":"http://patchwork.ozlabs.org/comment/1763367/","msgid":"<1cd51b7a-02f8-cc97-7c32-12a25ba56c2f@nelint.com>","list_archive_url":null,"date":"2017-09-05T13:45:10","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":67231,"url":"http://patchwork.ozlabs.org/api/people/67231/","name":"Eric Nelson","email":"eric@nelint.com"},"content":"Hi Stefan,\n\nOn 09/04/2017 09:50 PM, Stefan Agner wrote:\n> On 2017-09-04 19:57, Eric Nelson wrote:\n>> On 09/04/2017 06:21 PM, Stefan Agner wrote:\n\n<snip>\n\n>>> +\n>>> +/*\n>>> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n>>> + * If boot from the other mode, USB0_PWD will keep reset value\n>>> + */\n>>> +#define\tis_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n>>> +\n>>>    #endif /* __ASSEMBLER__*/\n>>>    #endif /* __ASM_ARCH_MX6_IMX_REGS_H__ */\n>>>\n>> If I'm reading your comment correctly, the RXPWDRX bit will be set (the\n>> PHY will be powered down) unless it was enabled by the Boot ROM.\n>>\n>> Won't this also be clear if you've run 'usb start' under U-Boot?\n> \n> Yes, this only works before a USB initialization...\n> \n\nBased on this, I'd recommend changing the macro name to something\nlike \"is_udc_active\" to reflect it's true meaning.\n\n> This should be fine for the use case I have in mind (see patch 2).\n> \n> Note this idea is borrowed from NXP downstream and seems to work here:\n> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7/imx-regs.h?h=imx_v2016.03_4.1.15_2.0.0_ga#n1204\n> \n\nUnderstood.\n\nUsing this detection mechanism in SPL (where there isn't another path\nfor initializing the UDC) makes sense.\n\nRegards,\n\n\nEric","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tsecure) header.d=nelint.com header.i=@nelint.com header.b=\"KAaBuNG2\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmnz71lkpz9t2l\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 23:45:23 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid E1BF8C21D64; Tue,  5 Sep 2017 13:45:18 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 7AE98C21C8F;\n\tTue,  5 Sep 2017 13:45:16 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid BA662C21C8F; Tue,  5 Sep 2017 13:45:14 +0000 (UTC)","from mail-pf0-f179.google.com (mail-pf0-f179.google.com\n\t[209.85.192.179])\n\tby lists.denx.de (Postfix) with ESMTPS id 0C12FC21C57\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 13:45:14 +0000 (UTC)","by mail-pf0-f179.google.com with SMTP id y68so7956745pfd.0\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 06:45:13 -0700 (PDT)","from ?IPv6:2600:8800:1300:1c00:d1aa:5201:10a5:5347?\n\t([2600:8800:1300:1c00:d1aa:5201:10a5:5347])\n\tby smtp.gmail.com with ESMTPSA id\n\tp1sm1318302pfb.53.2017.09.05.06.45.11\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 05 Sep 2017 06:45:11 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nelint.com; s=google;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=9LeJPh3d9NSLzLI6KiUsnMoUZ/ZXnAudVgSwdI4/CP8=;\n\tb=KAaBuNG2RPhxVf1JRrIsUztnCFLW166/rT0y20/Ct3zdcDt6A/bzeVwQ9Dpoizj8zZ\n\tEtWNsaG9kJsT6FKqq8t+f0LhFB/tnaQ2CGlibCzPbGKKqtdcJKpfb10uaU3DaqadMQbW\n\tNM71Uzjx8ya9jvxpfr3YPISTsr6TvR4yMcpjw=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=9LeJPh3d9NSLzLI6KiUsnMoUZ/ZXnAudVgSwdI4/CP8=;\n\tb=LdRbJa5UulwLFqlm4A4JbKckPNCMFsmpCEi5tt9ZYvEXiZ6EUS3nHhYEzaAPa9p7h9\n\tC3v4wyrAtgzgQ27+mj5OjY9gj6CmBSAanHMNPmK8qys5D7e1FpeFhFmMUkFBV5HSyxtd\n\trkyPWDqfeX+NBAsgQgPaua2fZ3kdmdLDPUpp4yjKtY7xVSNMOuQIiTHDA4xG30gcvoHI\n\tpXSaNpG2qDqsJCF5NQTtO2Bx+v8mY87guo3jNRnRV7Lh5Od8c+2znCv1YxpovUQSPRLJ\n\tMtE+fWYNFNUb8AXRkp6BbP465m8v7fpPillDQ61PWfC8CBQP/AwsgdpXn1EDFyxO1qc+\n\tSXmw==","X-Gm-Message-State":"AHPjjUiSARXunfwEkAZ5P6T9bjPu+mQgkQT2iPZb2cj95Y5nzlFLtxpU\n\tKOs1RgKqvH2BeP7Q","X-Google-Smtp-Source":"ADKCNb5dYOiRvCKmB2SmaQU24XX6KJijQYgvMM8ldnKGhcwfjsiE6Ib8MaPjD/2mRnSsYA8KvhHyRw==","X-Received":"by 10.101.68.130 with SMTP id l2mr4138360pgq.346.1504619112465; \n\tTue, 05 Sep 2017 06:45:12 -0700 (PDT)","To":"Stefan Agner <stefan@agner.ch>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>\n\t<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","From":"Eric Nelson <eric@nelint.com>","Message-ID":"<1cd51b7a-02f8-cc97-7c32-12a25ba56c2f@nelint.com>","Date":"Tue, 5 Sep 2017 06:45:10 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","Content-Language":"en-US","Cc":"marex@denx.de, albert.u.boot@aribaud.net, joel.esponde@honeywell.com,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tfabio.estevam@nxp.com, jagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763370,"web_url":"http://patchwork.ozlabs.org/comment/1763370/","msgid":"<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>","list_archive_url":null,"date":"2017-09-05T13:45:51","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":6978,"url":"http://patchwork.ozlabs.org/api/people/6978/","name":"Fabio Estevam","email":"festevam@gmail.com"},"content":"Hi Stefano,\n\nOn Tue, Sep 5, 2017 at 8:16 AM, Stefano Babic <sbabic@denx.de> wrote:\n\n> Maybe we get some further info from our \"insider\" (Fabio, Peng). It will\n> be very interesting to know if we can apply this to all spectrum from\n> i.MX6, or if there is some MX6 variant where the Bootrom is doing\n> something different.\n\nLooking at NXP U-Boot code I see that this same mechanism applies not\nonly to mx6, but it extends to mx7 and mx7ulp, so it seems like a good\napproach.\n\nThanks","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"kBR/Su2J\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmnzw75Khz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 23:46:04 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid AF3C8C21DBC; Tue,  5 Sep 2017 13:45:57 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 53B15C21D8B;\n\tTue,  5 Sep 2017 13:45:55 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 56270C21D8B; Tue,  5 Sep 2017 13:45:54 +0000 (UTC)","from mail-oi0-f66.google.com (mail-oi0-f66.google.com\n\t[209.85.218.66])\n\tby lists.denx.de (Postfix) with ESMTPS id C1B15C21C8F\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 13:45:53 +0000 (UTC)","by mail-oi0-f66.google.com with SMTP id l185so2660132oib.1\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 06:45:53 -0700 (PDT)","by 10.157.17.176 with HTTP; Tue, 5 Sep 2017 06:45:51 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=+PHECfDyHrCnleevZvNzCdYnF7nooMOnqaTHF27StLo=;\n\tb=kBR/Su2Jfh5PcjJW/eStKN4KIz0I+FB/2oMHiGEpZQLJ/fcen2YkzwHGKojnEGDvFL\n\tPniKEtie+I6rdMQCkmHH8VEVlY+KjruJ+3MqTMRz7HDo/djbb1D8jUjM5urGSHvg24/s\n\tjT0Pbflpp2aAJ2Ff1L4f2ukTodFYsH8IIzcOB1brX8+NDy/yIGSRLnDiUUV/8gpvRspr\n\tGtCSjJU17i1/gr98H+/OMjRoMJ/tUw3UPZ8ykKzaSB8h0zTPOEgV8nzBSLNr9zD3lFKZ\n\tA0iADtm8XXHYgPRiMi5NplmpD6SPWPiLJnR7Ky9gQy6lt/fGlNiw3FRncOLyFGyVdi4Q\n\t4E6g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=+PHECfDyHrCnleevZvNzCdYnF7nooMOnqaTHF27StLo=;\n\tb=S1xKYn4QtBTbzGVCyUJkSrLcojo5UTiIS2W6rcLqtHlCDlKAGVIqFZV1HKy1hzzHSJ\n\tqnhSir/csFWsilt2I24wV4zLM3RuNkMnUlDV4CVX5JQm6V9qZfDUp47kqPMWmINyU3pg\n\tmLJHSCuBMxIojz4M/J0eh8/VLy/WWPgyhBMtYGaPH/IE0GIM+FOdFQ8qfg7IbcmPRJnp\n\tx2ZktbHtIZjBIq2WMUI8BJKpQLR/jRR2fMW6QnPynf/m2sJ3rIxflabhVuRcKs6MoFWH\n\tIM/rLwM3L4CGYkLD+DCNwgtboK9kSpxK6/Izl7pzlpdv+thUmulyOLUr7aFdyZ0hEx0b\n\tooDg==","X-Gm-Message-State":"AHPjjUg+3GrS4Jea4rt+TFwWe2J+OnA2Y1eW5JgolQ9zfhQCY8rDRoH6\n\tjO53I4Af/rECbeaxiioZt27p7sbpHg==","X-Google-Smtp-Source":"ADKCNb7HjjOPmphgLlyq8D/0Y9yXfFTb3HKnGPw08fyJ/B37C3bRUxvcNtdAtXN7Mt+bML5gpkvE0RMvHZD63OFJxO0=","X-Received":"by 10.202.78.70 with SMTP id c67mr3560066oib.248.1504619152430; \n\tTue, 05 Sep 2017 06:45:52 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<57a8b816-529a-22d3-c981-37468b58244b@denx.de>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>","From":"Fabio Estevam <festevam@gmail.com>","Date":"Tue, 5 Sep 2017 10:45:51 -0300","Message-ID":"<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>","To":"Stefano Babic <sbabic@denx.de>","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763371,"web_url":"http://patchwork.ozlabs.org/comment/1763371/","msgid":"<CAOMZO5BFYhF+8Dq0zXDz3FctRedOCT_CZ5nt7j7qHzA40Y3ZpQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-05T13:47:32","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":6978,"url":"http://patchwork.ozlabs.org/api/people/6978/","name":"Fabio Estevam","email":"festevam@gmail.com"},"content":"Hi Stefan,\n\nOn Tue, Sep 5, 2017 at 1:50 AM, Stefan Agner <stefan@agner.ch> wrote:\n\n> Note this idea is borrowed from NXP downstream and seems to work here:\n> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7/imx-regs.h?h=imx_v2016.03_4.1.15_2.0.0_ga#n1204\n\nPlease mention the NXP patch in the commit log, so that it is clear\nwhere this idea is coming from.\n\nThanks","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"PSB0VYnO\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmp1n53Cxz9t2W\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 23:47:41 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 56335C21E85; Tue,  5 Sep 2017 13:47:37 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 19AFDC21C57;\n\tTue,  5 Sep 2017 13:47:36 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 78536C21C57; Tue,  5 Sep 2017 13:47:34 +0000 (UTC)","from mail-oi0-f51.google.com (mail-oi0-f51.google.com\n\t[209.85.218.51])\n\tby lists.denx.de (Postfix) with ESMTPS id DA9DAC21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 13:47:33 +0000 (UTC)","by mail-oi0-f51.google.com with SMTP id n18so24991325oig.2\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 06:47:33 -0700 (PDT)","by 10.157.17.176 with HTTP; Tue, 5 Sep 2017 06:47:32 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=9nQ5LBDFucZS3GdFemuBxHrDEUIpTtxX5AWW1O0xNEE=;\n\tb=PSB0VYnOoBOML3iv1tSQ9pPTMKf+SwC5v5FuXdrMAM5zHrZ2ug7ifH13X6k4P+GkHx\n\th79a6NTE1auocTybtU9Sk9iKB9YQRNJB4fWgTyNGrFwQVkJstbxvdvJlFadgEEweRqcF\n\t6NjTa7qpHKeXojtYe3FW12hg0IhUvpqP8Kqerqr9VxoGDaC0Gtx6h2Q5sKrLNkqpmMpM\n\t1q5O614Pcsvz8+SBhLaRnzkld3kEgkKsQ5cLZ16/EfSHO+51yyBKIfwBio+EXeuwfCND\n\tstSmA0wv9T/y4R56RMBd+Phc+jWUJbmoZm0TLlriuZiT7+3FT22EWcKiGft+b6coEwuv\n\tZXNg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=9nQ5LBDFucZS3GdFemuBxHrDEUIpTtxX5AWW1O0xNEE=;\n\tb=agz19tdjYsp75kluIE8NuN2xJB04Z9jbLlYXaWfK3ioj0jdhcpWG9oDXhaWyYX/46a\n\t7COMomQkSAUfHTBnJz5jBh5PMGL+vdilLP3cKwxapTIneBbT9NZjWWgej3BDeAn3Dq4f\n\tqXkvDPH41MzOKlsPg3tqEu/I/4ve+0uyYjUvB0iIN+OV9nvAd/oqJb9weDuNCOqKuVS9\n\tnOo7pwXIx1xvvRWK4AV7tLGd9DBur00/sUV7bjXywgXMeWQomJM9pYCzKExsL5BCrMQG\n\tUO36AzeuZ2G0knYPm27kJbq23cW3fyXW/7ZEmuEVXlxbRXI1e/pYBzHhhBNCwEEtPWuJ\n\tu7Fg==","X-Gm-Message-State":"AHPjjUjx7RIGum5pkbEJA8GDy4tCZ6Tfhq0DT41JaTuVrpIJbrwM55ju\n\tsjtPVcRGLeR43Z4MXUWoauyJGzB6mg==","X-Google-Smtp-Source":"ADKCNb5zg9JPgQw+UuthQk8Vu3HM7/nv3ZUb2Ody2itYTJx8CgSudZUBflZXULfM/orTezEDUTruJG45cEtT+DtLjpg=","X-Received":"by 10.202.114.150 with SMTP id\n\tp144mr3589173oic.176.1504619252405; \n\tTue, 05 Sep 2017 06:47:32 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<9c2473f5-8c7c-5224-5073-a2c7c4c00b05@nelint.com>\n\t<a004c3aff92ee10f7bd1c9188477f84d@agner.ch>","From":"Fabio Estevam <festevam@gmail.com>","Date":"Tue, 5 Sep 2017 10:47:32 -0300","Message-ID":"<CAOMZO5BFYhF+8Dq0zXDz3FctRedOCT_CZ5nt7j7qHzA40Y3ZpQ@mail.gmail.com>","To":"Stefan Agner <stefan@agner.ch>","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>, \"Esponde,\n\tJoel\" <joel.esponde@honeywell.com>, U-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763374,"web_url":"http://patchwork.ozlabs.org/comment/1763374/","msgid":"<ea60833d-fc87-a15b-2bc1-e3f50b6d6a99@nelint.com>","list_archive_url":null,"date":"2017-09-05T13:49:27","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":67231,"url":"http://patchwork.ozlabs.org/api/people/67231/","name":"Eric Nelson","email":"eric@nelint.com"},"content":"Hi Stefano,\n\nOn 09/05/2017 04:16 AM, Stefano Babic wrote:\n> Hi Stefan,\n> On 05/09/2017 03:21, Stefan Agner wrote:\n>> From: Stefan Agner <stefan.agner@toradex.com>\n>>\n>> This macro allows to detect whether the boot ROM initialized USB\n>> already (serial downloader). This is helpful to reliably detect\n>> if the system has been recovered via USB serial downloader.\n>>\n>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n>> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n>> ---\n>> Hi Stefano,\n>>\n>> I noted already in my initial post that detection of serial\n>> downloader mode is somewhat brittle:\n>> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n>>\n>> This came up quite fast now also for other boards:\n>> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n>>\n>> We use this patches since quite some time. Also NXP uses this\n>> detection method to start their mfgr tools...\n> \n> Then it seems to be an \"undocumented feature\" rather a hack.\n> \n\nThis patch only detects that the OTG PHY is active, so it's\nnot really a hack.\n\nThe next patch uses this to infer how it happened (booted using\nSDP), and since I don't think there's another way for that to\nhappen, it also seems to be reasonable.\n\nCan you think of another way that the OTG PHY could be alive\nwhen the code is hit in SPL?\n\n... A comment to that effect is probably in order though.\n\nPlease advise,\n\n\nEric","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tsecure) header.d=nelint.com header.i=@nelint.com header.b=\"kHq3JIr1\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmp4600Xzz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 23:49:41 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid BADF3C21DF0; Tue,  5 Sep 2017 13:49:36 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id D620CC21C57;\n\tTue,  5 Sep 2017 13:49:33 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid E2C4EC21C57; Tue,  5 Sep 2017 13:49:32 +0000 (UTC)","from mail-pg0-f43.google.com (mail-pg0-f43.google.com\n\t[74.125.83.43])\n\tby lists.denx.de (Postfix) with ESMTPS id 235FFC21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 13:49:32 +0000 (UTC)","by mail-pg0-f43.google.com with SMTP id m9so9601149pgd.3\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 06:49:32 -0700 (PDT)","from ?IPv6:2600:8800:1300:1c00:d1aa:5201:10a5:5347?\n\t([2600:8800:1300:1c00:d1aa:5201:10a5:5347])\n\tby smtp.gmail.com with ESMTPSA id\n\tf70sm1534853pfd.74.2017.09.05.06.49.28\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 05 Sep 2017 06:49:30 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nelint.com; s=google;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=8FKbXHPEZ3pPjSddBttvhJ5QwoqREiZny9qJns7CETc=;\n\tb=kHq3JIr1sJwIEzhTq1L7s/IFxAPNJtg9Hybi2/76ZqfGJLV1lCL++Jist+ahS3c4aa\n\tWCVSBpOXuAqpqhXL3nD+4bFSaHiAJFjkSaJxC202Ss4CIl7r8VTnO+jxtOVfbDU7mO1m\n\t4V3tomDcUXm4v+A2Da74cuhbSORdo6KoYZVXw=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=8FKbXHPEZ3pPjSddBttvhJ5QwoqREiZny9qJns7CETc=;\n\tb=pxsHfyYt57pcZ176pmNXRnm3ETfcuH75ghpfR3HyszRzHJpwtq3iZSBtXtdMTMkyvu\n\tZUIGSndl25wOFl8uZIar15PK+ob4MV8QcnZcKamwBWQX4UY+oUlTj0PHk4W0sAvCLg/u\n\tz3ZpGLk/RyZlPaeFSMPAcqZfIfm267atRccKpIld3BJ7s7bmg+ZcZ0qM32ANOafa+yo/\n\tgkwExWoj8xTb/gMT2vkXIyQxcVglfogCSv3TKplCdbdyXBl/xtR9A6XV5VvqAtSGM6dT\n\tUOZHHqKmIed6zCNTEVWJJm1evSpi5FtWKbXWlxFM90lYitSecDEx8cnqnmLcDHFEHUS5\n\txFCQ==","X-Gm-Message-State":"AHPjjUipftxs52V3YAHZP7oWG7SOHjxuQHLqnDp9EjhpiEqiAh3iEd+T\n\teur0EIswnEHrFNLNbOs=","X-Google-Smtp-Source":"ADKCNb6VKpukN0U/mFN9P0ixCFokV94V16piD0zz5erbWh7EXvA8KM9s+cHjpE4T9XUwoQFC5EehVw==","X-Received":"by 10.99.126.84 with SMTP id o20mr4091839pgn.129.1504619370762; \n\tTue, 05 Sep 2017 06:49:30 -0700 (PDT)","To":"Stefano Babic <sbabic@denx.de>, Stefan Agner <stefan@agner.ch>,\n\tfabio.estevam@nxp.com","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>","From":"Eric Nelson <eric@nelint.com>","Message-ID":"<ea60833d-fc87-a15b-2bc1-e3f50b6d6a99@nelint.com>","Date":"Tue, 5 Sep 2017 06:49:27 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<57a8b816-529a-22d3-c981-37468b58244b@denx.de>","Content-Language":"en-US","Cc":"marex@denx.de, albert.u.boot@aribaud.net,\n\tStefan Agner <stefan.agner@toradex.com>, joel.esponde@honeywell.com, \n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tjagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763379,"web_url":"http://patchwork.ozlabs.org/comment/1763379/","msgid":"<bd88fcbb-474b-3ad2-4034-508cfb33ec83@denx.de>","list_archive_url":null,"date":"2017-09-05T13:57:53","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":5771,"url":"http://patchwork.ozlabs.org/api/people/5771/","name":"Stefano Babic","email":"sbabic@denx.de"},"content":"Hi Eric,\n\nOn 05/09/2017 15:49, Eric Nelson wrote:\n> Hi Stefano,\n> \n> On 09/05/2017 04:16 AM, Stefano Babic wrote:\n>> Hi Stefan,\n>> On 05/09/2017 03:21, Stefan Agner wrote:\n>>> From: Stefan Agner <stefan.agner@toradex.com>\n>>>\n>>> This macro allows to detect whether the boot ROM initialized USB\n>>> already (serial downloader). This is helpful to reliably detect\n>>> if the system has been recovered via USB serial downloader.\n>>>\n>>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n>>> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n>>> ---\n>>> Hi Stefano,\n>>>\n>>> I noted already in my initial post that detection of serial\n>>> downloader mode is somewhat brittle:\n>>> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n>>>\n>>> This came up quite fast now also for other boards:\n>>> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n>>>\n>>> We use this patches since quite some time. Also NXP uses this\n>>> detection method to start their mfgr tools...\n>>\n>> Then it seems to be an \"undocumented feature\" rather a hack.\n>>\n> \n> This patch only detects that the OTG PHY is active, so it's\n> not really a hack.\n> \n\nAgree.\n\n> The next patch uses this to infer how it happened (booted using\n> SDP), and since I don't think there's another way for that to\n> happen, it also seems to be reasonable.\n\nRight. It is absolutely reasonable.\n\n> \n> Can you think of another way that the OTG PHY could be alive\n> when the code is hit in SPL?\n\nNo, I can't - nothing that makes sense ;-)\n\n> \n> ... A comment to that effect is probably in order though.\n> \n> Please advise,\n\nRegards,\nStefano","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmpGS6JY3z9t2W\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 23:58:40 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 8B4E1C21DBC; Tue,  5 Sep 2017 13:58:37 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 0ED2BC21C57;\n\tTue,  5 Sep 2017 13:58:35 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 0356FC21C57; Tue,  5 Sep 2017 13:58:32 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id AB28DC21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 13:58:32 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xmpGH285Lz1qryj;\n\tTue,  5 Sep 2017 15:58:31 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xmpGG5MZcz3hqXY;\n\tTue,  5 Sep 2017 15:58:30 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id OcNKpKttQyqM; Tue,  5 Sep 2017 15:58:27 +0200 (CEST)","from babic.homelinux.org (host-88-217-136-221.customer.m-online.net\n\t[88.217.136.221])\n\t(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPS;\n\tTue,  5 Sep 2017 15:58:27 +0200 (CEST)","from localhost (mail.babic.homelinux.org [127.0.0.1])\n\tby babic.homelinux.org (Postfix) with ESMTP id AAA534540594;\n\tTue,  5 Sep 2017 15:58:13 +0200 (CEST)","from babic.homelinux.org ([127.0.0.1])\n\tby localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 75zAY3z4OOL2; Tue,  5 Sep 2017 15:58:01 +0200 (CEST)","from [192.168.178.132] (papero.fritz.box [192.168.178.132])\n\tby babic.homelinux.org (Postfix) with ESMTP id 2695645404CD;\n\tTue,  5 Sep 2017 15:57:53 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=KHOP_BIG_TO_CC,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","X-Virus-Scanned":["amavisd-new at mnet-online.de","Debian amavisd-new at babic.homelinux.org"],"To":"Eric Nelson <eric@nelint.com>, Stefano Babic <sbabic@denx.de>,\n\tStefan Agner <stefan@agner.ch>, fabio.estevam@nxp.com","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>\n\t<ea60833d-fc87-a15b-2bc1-e3f50b6d6a99@nelint.com>","From":"Stefano Babic <sbabic@denx.de>","Message-ID":"<bd88fcbb-474b-3ad2-4034-508cfb33ec83@denx.de>","Date":"Tue, 5 Sep 2017 15:57:53 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<ea60833d-fc87-a15b-2bc1-e3f50b6d6a99@nelint.com>","Content-Language":"de-DE","Cc":"marex@denx.de, albert.u.boot@aribaud.net,\n\tStefan Agner <stefan.agner@toradex.com>, joel.esponde@honeywell.com, \n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tgary.bisson@boundarydevices.com, \n\tu-boot@lists.denx.de, Max Krummenacher <max.krummenacher@toradex.com>,\n\tjagan@openedev.com","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763469,"web_url":"http://patchwork.ozlabs.org/comment/1763469/","msgid":"<450511321b098820cdb0c673bf6527db@agner.ch>","list_archive_url":null,"date":"2017-09-05T16:02:11","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":4137,"url":"http://patchwork.ozlabs.org/api/people/4137/","name":"Stefan Agner","email":"stefan@agner.ch"},"content":"On 2017-09-05 04:13, Fabio Estevam wrote:\n> Hi Stefan,\n> \n> On Mon, Sep 4, 2017 at 10:21 PM, Stefan Agner <stefan@agner.ch> wrote:\n>> From: Stefan Agner <stefan.agner@toradex.com>\n>>\n>> This macro allows to detect whether the boot ROM initialized USB\n>> already (serial downloader). This is helpful to reliably detect\n>> if the system has been recovered via USB serial downloader.\n>>\n>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>\n>> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n> \n> This allows Serial Download Protocol to work on imx6q sabresd:\n> \n> Tested-by: Fabio Estevam <fabio.estevam@nxp.com>\n> \n>> ---\n>> Hi Stefano,\n>>\n>> I noted already in my initial post that detection of serial\n>> downloader mode is somewhat brittle:\n>> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n>>\n>> This came up quite fast now also for other boards:\n>> https://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n>>\n>> We use this patches since quite some time. Also NXP uses this\n>> detection method to start their mfgr tools... Altough a hack,\n>> maybe we should still add it upstream?\n>>\n>> --\n>> Stefan\n>>\n>>\n>>  arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n>>  1 file changed, 7 insertions(+)\n>>\n>> diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\n>> index 86e267087a..895ef4de83 100644\n>> --- a/arch/arm/include/asm/arch-mx6/imx-regs.h\n>> +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h\n>> @@ -985,5 +985,12 @@ struct pwm_regs {\n>>         u32     pr;\n>>         u32     cnr;\n>>  };\n>> +\n>> +/*\n>> + * If ROM fell back to USB recover mode, USBPH0_PWD will be clear to use USB\n>> + * If boot from the other mode, USB0_PWD will keep reset value\n>> + */\n>> +#define        is_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))\n> \n> Minor nit: imx-regs.h is better suited for storing register layout definitions.\n> \n> I think that arch/arm/include/asm/mach-imx/sys_proto.h  would be a\n> more appropriate location for this macro.\n\nMakes sense, will move it.\n\n\n> \n> Also you could remove that tab between 'define' and the macro name.\n\nAgreed.\n\n--\nStefan","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=agner.ch header.i=@agner.ch header.b=\"n4wACkl2\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xms4f23GHz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 02:05:20 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 445AAC21EBA; Tue,  5 Sep 2017 16:05:14 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 42D5CC21C62;\n\tTue,  5 Sep 2017 16:05:11 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 58505C21C62; Tue,  5 Sep 2017 16:05:09 +0000 (UTC)","from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109])\n\tby lists.denx.de (Postfix) with ESMTPS id 4BE69C21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 16:05:08 +0000 (UTC)","from webmail.kmu-office.ch (unknown [178.209.48.103])\n\tby mail.kmu-office.ch (Postfix) with ESMTPSA id A5CD15C0F04;\n\tTue,  5 Sep 2017 18:01:32 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","MIME-Version":"1.0","Date":"Tue, 05 Sep 2017 09:02:11 -0700","From":"Stefan Agner <stefan@agner.ch>","To":"Fabio Estevam <festevam@gmail.com>","In-Reply-To":"<CAOMZO5DV12OfH_5hsz16L6A3SXMtwE40_0-T5Q8A6Bib=ppFeA@mail.gmail.com>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<CAOMZO5DV12OfH_5hsz16L6A3SXMtwE40_0-T5Q8A6Bib=ppFeA@mail.gmail.com>","Message-ID":"<450511321b098820cdb0c673bf6527db@agner.ch>","X-Sender":"stefan@agner.ch","User-Agent":"Roundcube Webmail/1.2.5","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim;\n\tt=1504627292; bh=f5nLLikU0nO5ymv1fNYi97UXgYn0eRArBfOdbdiILiM=;\n\th=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID;\n\tb=n4wACkl2Qe8pP6nct5Kxk4orU+sSSK3wTMHBLVaAvOTu75qne3CobTm472cATFROmRMmZwxPpwz11STHaNqviKF6Wx0QWjP48mS6yKjixJPQ9ve6t9pSeZhUT6/hf4vuI9kVDeRoxKdOWXCYYlNWKtLrDdjYyCIcEOU82aEjajU=","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763473,"web_url":"http://patchwork.ozlabs.org/comment/1763473/","msgid":"<76d29ac29e5e4bd76ee7126f372405e0@agner.ch>","list_archive_url":null,"date":"2017-09-05T16:05:40","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":4137,"url":"http://patchwork.ozlabs.org/api/people/4137/","name":"Stefan Agner","email":"stefan@agner.ch"},"content":"On 2017-09-05 06:45, Fabio Estevam wrote:\n> Hi Stefano,\n> \n> On Tue, Sep 5, 2017 at 8:16 AM, Stefano Babic <sbabic@denx.de> wrote:\n> \n>> Maybe we get some further info from our \"insider\" (Fabio, Peng). It will\n>> be very interesting to know if we can apply this to all spectrum from\n>> i.MX6, or if there is some MX6 variant where the Bootrom is doing\n>> something different.\n> \n> Looking at NXP U-Boot code I see that this same mechanism applies not\n> only to mx6, but it extends to mx7 and mx7ulp, so it seems like a good\n> approach.\n\ni.MX 7 has a Boot Information structure which is passed from the Boot\nROM, so we have a much cleaner method there.\nhttp://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=arch/arm/mach-imx/mx7/soc.c;h=87bf105f385d4c12bee6d038c0ba50e2e588124c;hb=HEAD#l392\n\nAs far as I can tell this boot information structure is also accurate\nwhen the Boot ROM entered serial downloader as a fallback.\n\nDo we have boards using SPL on i.MX 7?\n\n--\nStefan","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=agner.ch header.i=@agner.ch header.b=\"wB9m5W2C\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xms8W0pPLz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 02:08:43 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid C8AA4C21DBC; Tue,  5 Sep 2017 16:08:40 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id C2728C21C8F;\n\tTue,  5 Sep 2017 16:08:38 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 0044EC21C8F; Tue,  5 Sep 2017 16:08:37 +0000 (UTC)","from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109])\n\tby lists.denx.de (Postfix) with ESMTPS id E6B4CC21C62\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 16:08:36 +0000 (UTC)","from webmail.kmu-office.ch (unknown [178.209.48.103])\n\tby mail.kmu-office.ch (Postfix) with ESMTPSA id 6C53D5C1400;\n\tTue,  5 Sep 2017 18:05:01 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","MIME-Version":"1.0","Date":"Tue, 05 Sep 2017 09:05:40 -0700","From":"Stefan Agner <stefan@agner.ch>","To":"Fabio Estevam <festevam@gmail.com>","In-Reply-To":"<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>\n\t<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>","Message-ID":"<76d29ac29e5e4bd76ee7126f372405e0@agner.ch>","X-Sender":"stefan@agner.ch","User-Agent":"Roundcube Webmail/1.2.5","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim;\n\tt=1504627501; bh=CR2CUuxSa/Xwz0n8BCBNKH/H2CxW8cPGvzrdxp/wKA0=;\n\th=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID;\n\tb=wB9m5W2CrItyig6L3wqNc+BrsRy1Hp+Yt6kFKyhtz7ZeGdwMKTvk9qO/WXxJwkfH8jxMRCcMiqKPqnfsbF2DgAMAKb/sx7A4d3OxznDIRs1PTBR/ar5Pfety89Isp+UdHzFImdgJu7kX1wygGHaA1roPkluopGdhFr6qR8T7So4=","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763478,"web_url":"http://patchwork.ozlabs.org/comment/1763478/","msgid":"<CAOMZO5BgJEmypeX6-67fb9R-EYuJ1gAFhtNxnRZ7+svrH-w4Zg@mail.gmail.com>","list_archive_url":null,"date":"2017-09-05T16:18:43","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":6978,"url":"http://patchwork.ozlabs.org/api/people/6978/","name":"Fabio Estevam","email":"festevam@gmail.com"},"content":"On Tue, Sep 5, 2017 at 1:05 PM, Stefan Agner <stefan@agner.ch> wrote:\n\n> i.MX 7 has a Boot Information structure which is passed from the Boot\n> ROM, so we have a much cleaner method there.\n> http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=arch/arm/mach-imx/mx7/soc.c;h=87bf105f385d4c12bee6d038c0ba50e2e588124c;hb=HEAD#l392\n>\n> As far as I can tell this boot information structure is also accurate\n> when the Boot ROM entered serial downloader as a fallback.\n\nWhat I meant is that the is_boot_from_usb() macro is also defined for\nMX7 and MX7ULP:\n\nhttp://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7/imx-regs.h?h=imx_v2016.03_4.1.33_7ulp_beta#n1209\n\nhttp://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7ulp/imx-regs.h?h=imx_v2016.03_4.1.33_7ulp_beta#n1207\n\n\n> Do we have boards using SPL on i.MX 7?\n\nNo, we don't have it currently.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"R6mJ5+2o\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmsND2cNwz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 02:18:52 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 1D21AC21DF4; Tue,  5 Sep 2017 16:18:50 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 242E5C21C62;\n\tTue,  5 Sep 2017 16:18:48 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 0A3AAC21C62; Tue,  5 Sep 2017 16:18:45 +0000 (UTC)","from mail-oi0-f47.google.com (mail-oi0-f47.google.com\n\t[209.85.218.47])\n\tby lists.denx.de (Postfix) with ESMTPS id 5A009C21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 16:18:45 +0000 (UTC)","by mail-oi0-f47.google.com with SMTP id n18so27598602oig.2\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 09:18:45 -0700 (PDT)","by 10.157.17.176 with HTTP; Tue, 5 Sep 2017 09:18:43 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=boHj6SFakRbRFhAnHPjTT1juN+BoeheJfTjxFWMigzw=;\n\tb=R6mJ5+2o33xunDSiun/rGtQHk3EbKCSX2BOEqRWGXQGze4H1cVPge43Bd6uiINqwsx\n\th7qdUB4bkS8Tuq5igDp2h4SJv9jrlbmpdCt6XLwJSvn0mEiW/UCCjOGPEvr8/hWkTpkv\n\tg6li7DM5F8Fe2USymVCqfOHyapJI5ZO7NQqMWS7SE+ZUl87R1Q23olJkRt1UowIDivCm\n\triVqe6Gmr9G8WDBhNzzdkKJKPwPlfL7Nd0v0m6bUekWJOE6jhfpYXLpavgXc+eyqcr6t\n\tEeSbSDxYwf7SZWyPRaohIg4YLWU8ysLtMpTXcniVLVfM4AEajXqkDmijqWYk3mWnZWF7\n\tir2Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=boHj6SFakRbRFhAnHPjTT1juN+BoeheJfTjxFWMigzw=;\n\tb=meD0CZWsTRJ33/a4XOIc5AF4zmd7S8k68Qes88GuGnbu2NGCE8yvEGU6wjM3ljt1ii\n\tY3JAQdR4UnHoR6bl0gDYifwpYAzK3sHrx1ogxn3G4uaeCQ9wRA68kLUnxhGKM2TeCs8X\n\tAqqhtaDCT9gLXlOmmvW5bqt/F9U1wYDpkgInpjfzsH0YEkRpTndwGeWu8ajw4zAuIvY3\n\thApoEmdhpbuqHVHEBywW23dut/tKI3LFuPXHKkFJt6N6YK/7RShKhn5PDDn8INyHkl6w\n\tIG4mlsMFF9KgrS3ZXQZliBXJgDi/qry3gPadPZhjaQo1Jz2IHTMjyfIksw30tGHVmh2R\n\tk5Jw==","X-Gm-Message-State":"AHPjjUglHL9lqFzzpHnJuM4Q04aR5u/3nh1e4dsmma7tTAlU+VY2ElUz\n\tiMsuoCT4IQaKZhu8F5IbW3iRw7AUvg==","X-Google-Smtp-Source":"ADKCNb5SZ2EYjB363ksckWKCMagB0EPYmAExaR2KOfwOh5t1nNfWlxn7xYIpcWWiduN/Uv7kexAoj2bbKk7/G4NCtmY=","X-Received":"by 10.202.207.72 with SMTP id f69mr3713053oig.87.1504628323910; \n\tTue, 05 Sep 2017 09:18:43 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<76d29ac29e5e4bd76ee7126f372405e0@agner.ch>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>\n\t<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>\n\t<76d29ac29e5e4bd76ee7126f372405e0@agner.ch>","From":"Fabio Estevam <festevam@gmail.com>","Date":"Tue, 5 Sep 2017 13:18:43 -0300","Message-ID":"<CAOMZO5BgJEmypeX6-67fb9R-EYuJ1gAFhtNxnRZ7+svrH-w4Zg@mail.gmail.com>","To":"Stefan Agner <stefan@agner.ch>","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763489,"web_url":"http://patchwork.ozlabs.org/comment/1763489/","msgid":"<9add787fa6b1e923011de21891b0130e@agner.ch>","list_archive_url":null,"date":"2017-09-05T16:26:44","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":4137,"url":"http://patchwork.ozlabs.org/api/people/4137/","name":"Stefan Agner","email":"stefan@agner.ch"},"content":"On 2017-09-05 09:18, Fabio Estevam wrote:\n> On Tue, Sep 5, 2017 at 1:05 PM, Stefan Agner <stefan@agner.ch> wrote:\n> \n>> i.MX 7 has a Boot Information structure which is passed from the Boot\n>> ROM, so we have a much cleaner method there.\n>> http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=arch/arm/mach-imx/mx7/soc.c;h=87bf105f385d4c12bee6d038c0ba50e2e588124c;hb=HEAD#l392\n>>\n>> As far as I can tell this boot information structure is also accurate\n>> when the Boot ROM entered serial downloader as a fallback.\n> \n> What I meant is that the is_boot_from_usb() macro is also defined for\n> MX7 and MX7ULP:\n> \n> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7/imx-regs.h?h=imx_v2016.03_4.1.33_7ulp_beta#n1209\n> \n> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/arch/arm/include/asm/arch-mx7ulp/imx-regs.h?h=imx_v2016.03_4.1.33_7ulp_beta#n1207\n> \n\nYes, I understand.\n\nI am just saying, I don't see a point to use that macro over i.MX 7's\nBoot Information structure...\n\n> \n>> Do we have boards using SPL on i.MX 7?\n> \n> No, we don't have it currently.\n\nOk.\n\n--\nStefan","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tsecure) header.d=agner.ch header.i=@agner.ch header.b=\"BtBjKj8X\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmsct4C44z9s7C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 02:29:50 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 8BB37C21E3E; Tue,  5 Sep 2017 16:29:43 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 92567C21C8F;\n\tTue,  5 Sep 2017 16:29:41 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid C6395C21C8F; Tue,  5 Sep 2017 16:29:40 +0000 (UTC)","from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109])\n\tby lists.denx.de (Postfix) with ESMTPS id 74156C21C45\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 16:29:40 +0000 (UTC)","from webmail.kmu-office.ch (unknown [178.209.48.103])\n\tby mail.kmu-office.ch (Postfix) with ESMTPSA id E36A95C143B;\n\tTue,  5 Sep 2017 18:26:04 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","MIME-Version":"1.0","Date":"Tue, 05 Sep 2017 09:26:44 -0700","From":"Stefan Agner <stefan@agner.ch>","To":"Fabio Estevam <festevam@gmail.com>","In-Reply-To":"<CAOMZO5BgJEmypeX6-67fb9R-EYuJ1gAFhtNxnRZ7+svrH-w4Zg@mail.gmail.com>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>\n\t<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>\n\t<76d29ac29e5e4bd76ee7126f372405e0@agner.ch>\n\t<CAOMZO5BgJEmypeX6-67fb9R-EYuJ1gAFhtNxnRZ7+svrH-w4Zg@mail.gmail.com>","Message-ID":"<9add787fa6b1e923011de21891b0130e@agner.ch>","X-Sender":"stefan@agner.ch","User-Agent":"Roundcube Webmail/1.2.5","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim;\n\tt=1504628764; bh=pylycjWuaVPIu+z2c0mdWIx3AMjsX3wVLDyV7bZe0PI=;\n\th=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID;\n\tb=BtBjKj8Xvxkf1nk7wdjfGnAFZEqY80sDTOiu+8qDjB11xvZLhnsmHBO44IN/l5MlUehTT+6z2sMI0TDL0C5rvNvppKGms7XyCmcmZNf4uOQy89rXqCkM9N2U+OxllvUSTUeap+y13ODp3VYzy1zlcA8bMV8leYBerTA1XFSR4uw=","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1763491,"web_url":"http://patchwork.ozlabs.org/comment/1763491/","msgid":"<CAOMZO5Dt0bZFUmmJxDPLV3XKvL9kM4VjTRNc-LZj3Up6W_O_CQ@mail.gmail.com>","list_archive_url":null,"date":"2017-09-05T16:31:26","subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","submitter":{"id":6978,"url":"http://patchwork.ozlabs.org/api/people/6978/","name":"Fabio Estevam","email":"festevam@gmail.com"},"content":"On Tue, Sep 5, 2017 at 1:26 PM, Stefan Agner <stefan@agner.ch> wrote:\n\n> Yes, I understand.\n>\n> I am just saying, I don't see a point to use that macro over i.MX 7's\n> Boot Information structure...\n\nCorrect, and I did not suggest this either :-)","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"QY7Gqy9i\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmsfy5Z1Dz9s7C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 02:31:38 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 84AAAC21E4C; Tue,  5 Sep 2017 16:31:32 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 12EF0C21D8D;\n\tTue,  5 Sep 2017 16:31:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 5C338C21DBC; Tue,  5 Sep 2017 16:31:29 +0000 (UTC)","from mail-oi0-f50.google.com (mail-oi0-f50.google.com\n\t[209.85.218.50])\n\tby lists.denx.de (Postfix) with ESMTPS id D4029C21C8F\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 16:31:28 +0000 (UTC)","by mail-oi0-f50.google.com with SMTP id x184so27873930oia.0\n\tfor <u-boot@lists.denx.de>; Tue, 05 Sep 2017 09:31:28 -0700 (PDT)","by 10.157.17.176 with HTTP; Tue, 5 Sep 2017 09:31:26 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=SB3MSLPFOHjmjyk9xZ2rwkFLE71MGTf5S1LhdKmsJjI=;\n\tb=QY7Gqy9ik9JjWJsHHQsweohKm24fFAm1Jkks57YSkiyrDmLVFCV8bz6gOoBUVWYnLO\n\tEX8jf85UbCnyAEV5xFN43eUuEu3jLa0bOIIxGMrIlOnt4995eFFki8bzZyto07kU7dJ6\n\tFx56NELBhLIMzklURgX1lf1m7BiLuSFqSb5hoHDvIcpNUt7C14ocywIIhMLi27XlL+jb\n\tQd5yukhbZ1VBVx7VfTVWnL5zlxtV2ko4OAJtUerYKwVr3MVAXfDo3GZNDdzwm+ffizyv\n\tfx6pjPB+YJzkqKFnbFmXsW+AYhRgem2LjYVnyFdDc/zXW/OUUdSzYeEaEbaIOKPHv2GY\n\tswYQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=SB3MSLPFOHjmjyk9xZ2rwkFLE71MGTf5S1LhdKmsJjI=;\n\tb=tINoMzur0zFOFd0+lbxKjrSEuUDb0xaf6NtLATZvbQBEH8MLmZSe6c/VuNtbeCJaJi\n\t8gWVZWNJXRb8ad2H/fZ5uWfPIfgv5/etU5ah6hszlnjr5zS0sw/P/b7FlL4D/PJZDjd5\n\tQwZWK7Z1ASgtCLGMIOEejTbLNQ+RHWI7WG+hdQaLBBKGnnMPHGXH303nDakFRUMTLAf/\n\tAinGs3dOdC5YMJIk3djI+zStpNBaDGFl1r0ThG/s1kSfDYZm5HEW6xBaN6pSKBY9Scr6\n\t7mHr486Jh+Tt40fd8RcHLjk6cf4e/JAOHFitzlsbeUgtUz9AFuzXQC3EP3q31m3HnheO\n\tHExQ==","X-Gm-Message-State":"AHPjjUjZOX/GjYMbFzod2OTb+IEM1MnYtE+TT4Gxgx3B73VwSybKsJfm\n\t+s78UPVJgsA9/pUoIlcXt2E0nSNXXw==","X-Google-Smtp-Source":"ADKCNb6nbewMSp00/RaBfH7lB+2+tUcE6fnBiXkZZOUUoMHEIaTsGNyCljl9Y0L5xr54EdO6t7PAacw4/HM84HBqRrA=","X-Received":"by 10.202.78.70 with SMTP id c67mr4063870oib.248.1504629087507; \n\tTue, 05 Sep 2017 09:31:27 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<9add787fa6b1e923011de21891b0130e@agner.ch>","References":"<20170905012144.4833-1-stefan@agner.ch>\n\t<57a8b816-529a-22d3-c981-37468b58244b@denx.de>\n\t<CAOMZO5APR=x8pa5XrnHaN7Ha7zia6Ypsr8xH8c7A8xOwzSPP=Q@mail.gmail.com>\n\t<76d29ac29e5e4bd76ee7126f372405e0@agner.ch>\n\t<CAOMZO5BgJEmypeX6-67fb9R-EYuJ1gAFhtNxnRZ7+svrH-w4Zg@mail.gmail.com>\n\t<9add787fa6b1e923011de21891b0130e@agner.ch>","From":"Fabio Estevam <festevam@gmail.com>","Date":"Tue, 5 Sep 2017 13:31:26 -0300","Message-ID":"<CAOMZO5Dt0bZFUmmJxDPLV3XKvL9kM4VjTRNc-LZj3Up6W_O_CQ@mail.gmail.com>","To":"Stefan Agner <stefan@agner.ch>","Cc":"Marek Vasut <marex@denx.de>, Albert ARIBAUD <albert.u.boot@aribaud.net>, \n\t\"Esponde, Joel\" <joel.esponde@honeywell.com>,\n\tStefan Agner <stefan.agner@toradex.com>,\n\tMarcel Ziswiler <marcel.ziswiler@toradex.com>,\n\tGary Bisson <gary.bisson@boundarydevices.com>,\n\tU-Boot-Denx <u-boot@lists.denx.de>,\n\tMax Krummenacher <max.krummenacher@toradex.com>,\n\tFabio Estevam <fabio.estevam@nxp.com>, Jagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB\n\thas been initialized","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]