Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806616/?format=api
{ "id": 806616, "url": "http://patchwork.ozlabs.org/api/patches/806616/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170828145725.2539-5-antoine.tenart@free-electrons.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170828145725.2539-5-antoine.tenart@free-electrons.com>", "list_archive_url": null, "date": "2017-08-28T14:57:16", "name": "[net-next,v3,04/13] net: mvpp2: initialize the comphy", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "38d4050fc4a64c50020e0c24f394e9ae535b177b", "submitter": { "id": 61603, "url": "http://patchwork.ozlabs.org/api/people/61603/?format=api", "name": "Antoine Tenart", "email": "antoine.tenart@free-electrons.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170828145725.2539-5-antoine.tenart@free-electrons.com/mbox/", "series": [ { "id": 187, "url": "http://patchwork.ozlabs.org/api/series/187/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=187", "date": "2017-08-28T14:57:14", "name": "net: mvpp2: comphy configuration", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/187/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806616/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806616/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xgw1T1QYdz9s81\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 01:00:29 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751822AbdH1O5x (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 10:57:53 -0400", "from mail.free-electrons.com ([62.4.15.54]:55620 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751601AbdH1O5o (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 28 Aug 2017 10:57:44 -0400", "by mail.free-electrons.com (Postfix, from userid 110)\n\tid 1E945209E7; Mon, 28 Aug 2017 16:57:42 +0200 (CEST)", "from localhost (nat.foo.tf [163.172.35.26])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id E155720A0A;\n\tMon, 28 Aug 2017 16:57:31 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com", "X-Spam-Level": "", "X-Spam-Status": "No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0", "From": "Antoine Tenart <antoine.tenart@free-electrons.com>", "To": "davem@davemloft.net, kishon@ti.com, andrew@lunn.ch,\n\tjason@lakedaemon.net, sebastian.hesselbarth@gmail.com,\n\tgregory.clement@free-electrons.com", "Cc": "Antoine Tenart <antoine.tenart@free-electrons.com>,\n\tthomas.petazzoni@free-electrons.com, nadavh@marvell.com,\n\tlinux@armlinux.org.uk, linux-kernel@vger.kernel.org,\n\tmw@semihalf.com, stefanc@marvell.com,\n\tmiquel.raynal@free-electrons.com, netdev@vger.kernel.org", "Subject": "[PATCH net-next v3 04/13] net: mvpp2: initialize the comphy", "Date": "Mon, 28 Aug 2017 16:57:16 +0200", "Message-Id": "<20170828145725.2539-5-antoine.tenart@free-electrons.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170828145725.2539-1-antoine.tenart@free-electrons.com>", "References": "<20170828145725.2539-1-antoine.tenart@free-electrons.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "On some platforms, the comphy is between the MAC GoP and the PHYs. The\nmvpp2 driver currently relies on the firmware/bootloader to configure\nthe comphy. As a comphy driver was added to the generic PHY framework,\nthis patch uses it in the mvpp2 driver to configure the comphy at boot\ntime to avoid relying on the bootloader.\n\nSigned-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>\n---\n drivers/net/ethernet/marvell/mvpp2.c | 44 +++++++++++++++++++++++++++++++++++-\n 1 file changed, 43 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c\nindex e312dfc3555b..fab231858a41 100644\n--- a/drivers/net/ethernet/marvell/mvpp2.c\n+++ b/drivers/net/ethernet/marvell/mvpp2.c\n@@ -28,6 +28,7 @@\n #include <linux/of_address.h>\n #include <linux/of_device.h>\n #include <linux/phy.h>\n+#include <linux/phy/phy.h>\n #include <linux/clk.h>\n #include <linux/hrtimer.h>\n #include <linux/ktime.h>\n@@ -861,6 +862,7 @@ struct mvpp2_port {\n \n \tphy_interface_t phy_interface;\n \tstruct device_node *phy_node;\n+\tstruct phy *comphy;\n \tunsigned int link;\n \tunsigned int duplex;\n \tunsigned int speed;\n@@ -4420,6 +4422,32 @@ static int mvpp22_gop_init(struct mvpp2_port *port)\n \treturn -EINVAL;\n }\n \n+static int mvpp22_comphy_init(struct mvpp2_port *port)\n+{\n+\tenum phy_mode mode;\n+\tint ret;\n+\n+\tif (!port->comphy)\n+\t\treturn 0;\n+\n+\tswitch (port->phy_interface) {\n+\tcase PHY_INTERFACE_MODE_SGMII:\n+\t\tmode = PHY_MODE_SGMII;\n+\t\tbreak;\n+\tcase PHY_INTERFACE_MODE_10GKR:\n+\t\tmode = PHY_MODE_10GKR;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tret = phy_set_mode(port->comphy, mode);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn phy_power_on(port->comphy);\n+}\n+\n static void mvpp2_port_mii_gmac_configure_mode(struct mvpp2_port *port)\n {\n \tu32 val;\n@@ -6404,8 +6432,10 @@ static void mvpp2_start_dev(struct mvpp2_port *port)\n \t/* Enable interrupts on all CPUs */\n \tmvpp2_interrupts_enable(port);\n \n-\tif (port->priv->hw_version == MVPP22)\n+\tif (port->priv->hw_version == MVPP22) {\n+\t\tmvpp22_comphy_init(port);\n \t\tmvpp22_gop_init(port);\n+\t}\n \n \tmvpp2_port_mii_set(port);\n \tmvpp2_port_enable(port);\n@@ -6436,6 +6466,7 @@ static void mvpp2_stop_dev(struct mvpp2_port *port)\n \tmvpp2_egress_disable(port);\n \tmvpp2_port_disable(port);\n \tphy_stop(ndev->phydev);\n+\tphy_power_off(port->comphy);\n }\n \n static int mvpp2_check_ringparam_valid(struct net_device *dev,\n@@ -7270,6 +7301,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,\n \t\t\t struct mvpp2 *priv)\n {\n \tstruct device_node *phy_node;\n+\tstruct phy *comphy;\n \tstruct mvpp2_port *port;\n \tstruct mvpp2_port_pcpu *port_pcpu;\n \tstruct net_device *dev;\n@@ -7311,6 +7343,15 @@ static int mvpp2_port_probe(struct platform_device *pdev,\n \t\tgoto err_free_netdev;\n \t}\n \n+\tcomphy = devm_of_phy_get(&pdev->dev, port_node, NULL);\n+\tif (IS_ERR(comphy)) {\n+\t\tif (PTR_ERR(comphy) == -EPROBE_DEFER) {\n+\t\t\terr = -EPROBE_DEFER;\n+\t\t\tgoto err_free_netdev;\n+\t\t}\n+\t\tcomphy = NULL;\n+\t}\n+\n \tif (of_property_read_u32(port_node, \"port-id\", &id)) {\n \t\terr = -EINVAL;\n \t\tdev_err(&pdev->dev, \"missing port-id value\\n\");\n@@ -7344,6 +7385,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,\n \n \tport->phy_node = phy_node;\n \tport->phy_interface = phy_mode;\n+\tport->comphy = comphy;\n \n \tif (priv->hw_version == MVPP21) {\n \t\tres = platform_get_resource(pdev, IORESOURCE_MEM, 2 + id);\n", "prefixes": [ "net-next", "v3", "04/13" ] }