Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/675292/?format=api
{ "id": 675292, "url": "http://patchwork.ozlabs.org/api/patches/675292/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20160926182917.27531-17-paul.burton@imgtec.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "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": "<20160926182917.27531-17-paul.burton@imgtec.com>", "list_archive_url": null, "date": "2016-09-26T18:29:10", "name": "[U-Boot,16/23] net: pch_gbe: Support PHY reset GPIOs", "commit_ref": null, "pull_url": null, "state": "deferred", "archived": false, "hash": "7709e06fcb5f9f06f2383c70648231a90031b887", "submitter": { "id": 33698, "url": "http://patchwork.ozlabs.org/api/people/33698/?format=api", "name": "Paul Burton", "email": "paul.burton@imgtec.com" }, "delegate": { "id": 4307, "url": "http://patchwork.ozlabs.org/api/users/4307/?format=api", "username": "danielschwierzeck", "first_name": "Daniel", "last_name": "Schwierzeck", "email": "daniel.schwierzeck@googlemail.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20160926182917.27531-17-paul.burton@imgtec.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/675292/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/675292/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", "Received": [ "from theia.denx.de (theia.denx.de [85.214.87.163])\n\tby ozlabs.org (Postfix) with ESMTP id 3sjXfh66HVz9s3T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 27 Sep 2016 04:33:48 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 6B470A766A;\n\tMon, 26 Sep 2016 20:33:32 +0200 (CEST)", "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 05gBeZNursOD; Mon, 26 Sep 2016 20:33:32 +0200 (CEST)", "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id C3532A75F6;\n\tMon, 26 Sep 2016 20:33:31 +0200 (CEST)", "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 60D75A75F6\n\tfor <u-boot@lists.denx.de>; Mon, 26 Sep 2016 20:33:29 +0200 (CEST)", "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 1gSHWK0fwx-c for <u-boot@lists.denx.de>;\n\tMon, 26 Sep 2016 20:33:29 +0200 (CEST)", "from mailapp01.imgtec.com (mailapp02.imgtec.com [217.156.133.132])\n\tby theia.denx.de (Postfix) with ESMTP id 312CCA75E4\n\tfor <u-boot@lists.denx.de>; Mon, 26 Sep 2016 20:33:29 +0200 (CEST)", "from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19])\n\tby Forcepoint Email with ESMTPS id D93D6AD9AB31B;\n\tMon, 26 Sep 2016 19:33:24 +0100 (IST)", "from localhost (10.100.200.111) by HHMAIL01.hh.imgtec.org\n\t(10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0;\n\tMon, 26 Sep 2016 19:33:27 +0100" ], "X-policyd-weight": "NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5\n\tNOT_IN_BL_NJABL=-1.5 (only DNSBL check requested)", "From": "Paul Burton <paul.burton@imgtec.com>", "To": "<u-boot@lists.denx.de>, Daniel Schwierzeck <daniel.schwierzeck@gmail.com>", "Date": "Mon, 26 Sep 2016 19:29:10 +0100", "Message-ID": "<20160926182917.27531-17-paul.burton@imgtec.com>", "X-Mailer": "git-send-email 2.10.0", "In-Reply-To": "<20160926182917.27531-1-paul.burton@imgtec.com>", "References": "<20160926182917.27531-1-paul.burton@imgtec.com>", "MIME-Version": "1.0", "X-Originating-IP": "[10.100.200.111]", "Cc": "Joe Hershberger <joe.hershberger@ni.com>", "Subject": "[U-Boot] [PATCH 16/23] net: pch_gbe: Support PHY reset GPIOs", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<http://lists.denx.de/mailman/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": "<http://lists.denx.de/mailman/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "Add support to the pch_gbe driver for resetting the PHY using a GPIO\nspecified in the device tree. This matches the support already in Linux.\n\nSigned-off-by: Paul Burton <paul.burton@imgtec.com>\n\n---\n\n drivers/net/pch_gbe.c | 29 +++++++++++++++++++++++++++--\n drivers/net/pch_gbe.h | 1 +\n 2 files changed, 28 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c\nindex 8866f66..cc3ca8b 100644\n--- a/drivers/net/pch_gbe.c\n+++ b/drivers/net/pch_gbe.c\n@@ -12,6 +12,7 @@\n #include <asm/io.h>\n #include <pci.h>\n #include <miiphy.h>\n+#include <asm/gpio.h>\n #include \"pch_gbe.h\"\n \n #if !defined(CONFIG_PHYLIB)\n@@ -72,6 +73,14 @@ static int pch_gbe_reset(struct udevice *dev)\n \tpriv->rx_idx = 0;\n \tpriv->tx_idx = 0;\n \n+\tif (dm_gpio_is_valid(&priv->gpio_phy_reset)) {\n+\t\t/* Reset the PHY */\n+\t\tdm_gpio_set_value(&priv->gpio_phy_reset, 1);\n+\t\tudelay(15000);\n+\t\tdm_gpio_set_value(&priv->gpio_phy_reset, 0);\n+\t\tudelay(5000);\n+\t}\n+\n \twritel(PCH_GBE_ALL_RST, &mac_regs->reset);\n \n \t/*\n@@ -451,6 +460,11 @@ int pch_gbe_probe(struct udevice *dev)\n \tplat->iobase = (ulong)iobase;\n \tpriv->mac_regs = (struct pch_gbe_regs *)iobase;\n \n+\terr = gpio_request_by_name(dev, \"phy-reset-gpios\", 0,\n+\t\t\t\t &priv->gpio_phy_reset, GPIOD_IS_OUT);\n+\tif (err && (err != -ENOENT))\n+\t\treturn err;\n+\n \t/* Read MAC address from SROM and initialize dev->enetaddr with it */\n \tpch_gbe_mac_read(priv->mac_regs, plat->enetaddr);\n \n@@ -460,9 +474,17 @@ int pch_gbe_probe(struct udevice *dev)\n \n \terr = pch_gbe_reset(dev);\n \tif (err)\n-\t\treturn err;\n+\t\tgoto out_err;\n \n-\treturn pch_gbe_phy_init(dev);\n+\terr = pch_gbe_phy_init(dev);\n+\tif (err)\n+\t\tgoto out_err;\n+\n+\treturn 0;\n+out_err:\n+\tif (dm_gpio_is_valid(&priv->gpio_phy_reset))\n+\t\tdm_gpio_free(dev, &priv->gpio_phy_reset);\n+\treturn err;\n }\n \n int pch_gbe_remove(struct udevice *dev)\n@@ -473,6 +495,9 @@ int pch_gbe_remove(struct udevice *dev)\n \tmdio_unregister(priv->bus);\n \tmdio_free(priv->bus);\n \n+\tif (dm_gpio_is_valid(&priv->gpio_phy_reset))\n+\t\tdm_gpio_free(dev, &priv->gpio_phy_reset);\n+\n \treturn 0;\n }\n \ndiff --git a/drivers/net/pch_gbe.h b/drivers/net/pch_gbe.h\nindex 0ea0c73..1d13380 100644\n--- a/drivers/net/pch_gbe.h\n+++ b/drivers/net/pch_gbe.h\n@@ -293,6 +293,7 @@ struct pch_gbe_priv {\n \tstruct udevice *dev;\n \tint rx_idx;\n \tint tx_idx;\n+\tstruct gpio_desc gpio_phy_reset;\n };\n \n #endif /* _PCH_GBE_H_ */\n", "prefixes": [ "U-Boot", "16/23" ] }