{"id":809889,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809889/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170905012144.4833-1-stefan@agner.ch/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170905012144.4833-1-stefan@agner.ch>","list_archive_url":null,"date":"2017-09-05T01:21:43","name":"[U-Boot,v1,1/2] imx: add macro to detect whether USB has been initialized","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"e07ac440218dc984da119be3c88a34f71b5987b6","submitter":{"id":4137,"url":"http://patchwork.ozlabs.org/api/1.2/people/4137/?format=json","name":"Stefan Agner","email":"stefan@agner.ch"},"delegate":{"id":1693,"url":"http://patchwork.ozlabs.org/api/1.2/users/1693/?format=json","username":"sbabic","first_name":"Stefano","last_name":"Babic","email":"sbabic@denx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170905012144.4833-1-stefan@agner.ch/mbox/","series":[{"id":1477,"url":"http://patchwork.ozlabs.org/api/1.2/series/1477/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=1477","date":"2017-09-05T01:21:43","name":"[U-Boot,v1,1/2] imx: add macro to detect whether USB has been initialized","version":1,"mbox":"http://patchwork.ozlabs.org/series/1477/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809889/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809889/checks/","tags":{},"related":[],"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=\"vdqqgb3i\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmTVX5KcLz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 11:23:00 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 603DEC21F4E; Tue,  5 Sep 2017 01:22:55 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 0835FC21D8D;\n\tTue,  5 Sep 2017 01:22:53 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 594E7C21D70; Tue,  5 Sep 2017 01:21:56 +0000 (UTC)","from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109])\n\tby lists.denx.de (Postfix) with ESMTPS id 6BD7BC21EE2\n\tfor <u-boot@lists.denx.de>; Tue,  5 Sep 2017 01:21:56 +0000 (UTC)","from trochilidae.toradex.int\n\t(75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181])\n\tby mail.kmu-office.ch (Postfix) with ESMTPSA id 304D05C1225;\n\tTue,  5 Sep 2017 03:18:19 +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","From":"Stefan Agner <stefan@agner.ch>","To":"sbabic@denx.de,\n\tfabio.estevam@nxp.com","Date":"Mon,  4 Sep 2017 18:21:43 -0700","Message-Id":"<20170905012144.4833-1-stefan@agner.ch>","X-Mailer":"git-send-email 2.14.1","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim;\n\tt=1504574301; bh=EVqRKkAT7oFvS2ZT4j4F3u+atBLI9k9R4gmJV1XS454=;\n\th=From:To:Cc:Subject:Date:Message-Id;\n\tb=vdqqgb3irywiyuk8TkqYLyNVXIOJRZZVb+qdrNsL2O4RuhNc/icbGg+Kyrk5YeHRr7GjxwmB3IyDgp6wxgjLvIem7j37GZaJmLbvte/Ud2Iid6IjLjcC32/CaoVXQMJO7G+OclhlEkpTvom5sXbXerO86MO5VmtzJ/IcX2ncjRE=","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":"[U-Boot] [PATCH v1 1/2] imx: add macro to detect whether USB has\n\tbeen 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>","MIME-Version":"1.0","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>"},"content":"From: Stefan Agner <stefan.agner@toradex.com>\n\nThis macro allows to detect whether the boot ROM initialized USB\nalready (serial downloader). This is helpful to reliably detect\nif the system has been recovered via USB serial downloader.\n\nSigned-off-by: Stefan Agner <stefan.agner@toradex.com>\nAcked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\n---\nHi Stefano,\n\nI noted already in my initial post that detection of serial\ndownloader mode is somewhat brittle:\nhttps://lists.denx.de/pipermail/u-boot/2017-August/301952.html\n\nThis came up quite fast now also for other boards:\nhttps://www.mail-archive.com/u-boot@lists.denx.de/msg262234.html\n\nWe use this patches since quite some time. Also NXP uses this\ndetection method to start their mfgr tools... Altough a hack,\nmaybe we should still add it upstream?\n\n--\nStefan\n\n\n arch/arm/include/asm/arch-mx6/imx-regs.h | 7 +++++++\n 1 file changed, 7 insertions(+)","diff":"diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h\nindex 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","prefixes":["U-Boot","v1","1/2"]}