{"id":813116,"url":"http://patchwork.ozlabs.org/api/patches/813116/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170912235441.19238-1-stefan@agner.ch/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/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":"<20170912235441.19238-1-stefan@agner.ch>","list_archive_url":null,"date":"2017-09-12T23:54:40","name":"[U-Boot,v3,1/2] imx: add macro to detect whether USB PHY is active","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d9e1e23ce2061aec4cb710bc77d2a8f5fe4ca850","submitter":{"id":4137,"url":"http://patchwork.ozlabs.org/api/people/4137/?format=json","name":"Stefan Agner","email":"stefan@agner.ch"},"delegate":{"id":1693,"url":"http://patchwork.ozlabs.org/api/users/1693/?format=json","username":"sbabic","first_name":"Stefano","last_name":"Babic","email":"sbabic@denx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170912235441.19238-1-stefan@agner.ch/mbox/","series":[{"id":2789,"url":"http://patchwork.ozlabs.org/api/series/2789/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=2789","date":"2017-09-12T23:54:40","name":"[U-Boot,v3,1/2] imx: add macro to detect whether USB PHY is active","version":3,"mbox":"http://patchwork.ozlabs.org/series/2789/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/813116/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/813116/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=\"ETqkY+0q\";\n\tdkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsM9S4YFLz9t3J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 09:55:07 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 5EC16C22032; Tue, 12 Sep 2017 23:55:00 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E73EDC21FE8;\n\tTue, 12 Sep 2017 23:54:57 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 37739C21F0B; Tue, 12 Sep 2017 23:54: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 8C234C21E4C\n\tfor <u-boot@lists.denx.de>; Tue, 12 Sep 2017 23:54:55 +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 879D35C1356;\n\tWed, 13 Sep 2017 01:51: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=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,\n\teric@nelint.com","Date":"Tue, 12 Sep 2017 16:54:40 -0700","Message-Id":"<20170912235441.19238-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=1505260268; bh=r13xBjpilQgEmU78+hXMJ2ZobOjlYw/uZyfmL6o4Msk=;\n\th=From:To:Cc:Subject:Date:Message-Id;\n\tb=ETqkY+0qjlyxuKClchIc05Ek6LKI4Rzgq0ww4S6X7RvUu+ypiZOJyoyfj+zClVOCl7JK3fXpwu26iWxlCYsIkF6Wj+0Bz6AF5KG5gCg7akwVIEYZ8Q0GCv53MBF5G32Gl9euJ0nfwZDEyHAeNg32i2ppgpWIU63A6NE1TCwt/u4=","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 v3 1/2] imx: add macro to detect whether USB PHY is\n\tactive","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 USB PHY is active. This\nis helpful to detect if the boot ROM has previously started the\nUSB serial downloader.\n\nThe idea is taken from the mfgtool support in the NXP U-Boot:\nhttp://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/?h=imx_v2016.03_4.1.15_2.0.0_ga&id=a352ed3c5184b95c4c9f7468f5fbb5f43de5e412\n\nSigned-off-by: Stefan Agner <stefan.agner@toradex.com>\nAcked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>\nTested-by: Fabio Estevam <fabio.estevam@nxp.com>\n---\n\nChanges in v3: None\nChanges in v2:\n- Move macro to sys_proto.h\n- Renamed from is_boot_from_usb() to is_usbphy_active()\n- Use defines for register offset and field\n- Remove tab after define\n- Remove comment since the actual \"magic\" is happening and\n  documented at usage side\n\n arch/arm/include/asm/arch-mx6/sys_proto.h | 7 +++++++\n 1 file changed, 7 insertions(+)","diff":"diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h b/arch/arm/include/asm/arch-mx6/sys_proto.h\nindex 14f5d948c9..9d4b1d6768 100644\n--- a/arch/arm/include/asm/arch-mx6/sys_proto.h\n+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h\n@@ -6,3 +6,10 @@\n  */\n \n #include <asm/mach-imx/sys_proto.h>\n+\n+#define USBPHY_PWD\t\t0x00000000\n+\n+#define USBPHY_PWD_RXPWDRX\t(1 << 20) /* receiver block power down */\n+\n+#define is_usbphy_active(void)\t(!(readl(USB_PHY0_BASE_ADDR + USBPHY_PWD) & \\\n+\t\t\t\t   USBPHY_PWD_RXPWDRX))\n","prefixes":["U-Boot","v3","1/2"]}