Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/477525/?format=api
{ "id": 477525, "url": "http://patchwork.ozlabs.org/api/patches/477525/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1432863742-18427-7-git-send-email-mathieu@codeaurora.org/", "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": "<1432863742-18427-7-git-send-email-mathieu@codeaurora.org>", "list_archive_url": null, "date": "2015-05-29T01:42:21", "name": "[6/7] net: dsa: ar8xxx: add support for second xMII interfaces through DT", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "ae7c780021d7e774c54da31ab5d0b92882cfce5a", "submitter": { "id": 65737, "url": "http://patchwork.ozlabs.org/api/people/65737/?format=api", "name": "Mathieu Olivari", "email": "mathieu@codeaurora.org" }, "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/1432863742-18427-7-git-send-email-mathieu@codeaurora.org/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/477525/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/477525/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 77F82140E1A\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 29 May 2015 11:44:33 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754357AbbE2BnN (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 28 May 2015 21:43:13 -0400", "from smtp.codeaurora.org ([198.145.29.96]:37481 \"EHLO\n\tsmtp.codeaurora.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1754755AbbE2Bme (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 28 May 2015 21:42:34 -0400", "from smtp.codeaurora.org (localhost [127.0.0.1])\n\tby smtp.codeaurora.org (Postfix) with ESMTP id 60579140DBC;\n\tFri, 29 May 2015 01:42:34 +0000 (UTC)", "by smtp.codeaurora.org (Postfix, from userid 486)\n\tid 4D34F140DC3; Fri, 29 May 2015 01:42:34 +0000 (UTC)", "from mathieu-linux.qualcomm.com (qf-scl1nat.qualcomm.com\n\t[207.114.132.30])\n\t(using TLSv1.2 with cipher AES128-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\t(Authenticated sender: mathieu@smtp.codeaurora.org)\n\tby smtp.codeaurora.org (Postfix) with ESMTPSA id 6BB4F140DBC;\n\tFri, 29 May 2015 01:42:33 +0000 (UTC)" ], "X-Spam-Checker-Version": "SpamAssassin 3.3.1 (2010-03-16) on\n\tpdx-caf-smtp.dmz.codeaurora.org", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00\n\tautolearn=ham version=3.3.1", "From": "Mathieu Olivari <mathieu@codeaurora.org>", "To": "robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,\n\tijc+devicetree@hellion.org.uk, galak@codeaurora.org,\n\tdavem@davemloft.net, mathieu@codeaurora.org, andrew@lunn.ch,\n\tf.fainelli@gmail.com, linux@roeck-us.net, gang.chen.5i5j@gmail.com,\n\tjiri@resnulli.us, leitec@staticky.com, fabf@skynet.be,\n\talexander.h.duyck@intel.com, pavel.nakonechny@skitlab.ru,\n\tjoe@perches.com, sfeldma@gmail.com, nbd@openwrt.org, juhosg@openwrt.org", "Cc": "devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tnetdev@vger.kernel.org", "Subject": "[PATCH 6/7] net: dsa: ar8xxx: add support for second xMII\n\tinterfaces through DT", "Date": "Thu, 28 May 2015 18:42:21 -0700", "Message-Id": "<1432863742-18427-7-git-send-email-mathieu@codeaurora.org>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1432863742-18427-1-git-send-email-mathieu@codeaurora.org>", "References": "<1432863742-18427-1-git-send-email-mathieu@codeaurora.org>", "X-Virus-Scanned": "ClamAV using ClamSMTP", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This patch is adding support for port6 specific options to device tree.\nThey can be used to setup the second xMII interface, and connect it to\none of the switch port.\n\nSigned-off-by: Mathieu Olivari <mathieu@codeaurora.org>\n---\n drivers/net/dsa/ar8xxx.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 50 insertions(+)", "diff": "diff --git a/drivers/net/dsa/ar8xxx.c b/drivers/net/dsa/ar8xxx.c\nindex 4044614..7559249 100644\n--- a/drivers/net/dsa/ar8xxx.c\n+++ b/drivers/net/dsa/ar8xxx.c\n@@ -19,6 +19,7 @@\n #include <net/dsa.h>\n #include <linux/phy.h>\n #include <linux/of_net.h>\n+#include <linux/of_platform.h>\n \n #include \"ar8xxx.h\"\n \n@@ -260,6 +261,9 @@ static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)\n \t\tar8xxx_write(ds, AR8327_REG_PORT5_PAD_CTRL,\n \t\t\t AR8327_PORT_PAD_RGMII_RX_DELAY_EN);\n \t\tbreak;\n+\tcase PHY_INTERFACE_MODE_SGMII:\n+\t\tar8xxx_write(ds, reg, AR8327_PORT_PAD_SGMII_EN);\n+\t\tbreak;\n \tdefault:\n \t\tpr_err(\"xMII mode %d not supported\\n\", mode);\n \t\treturn -EINVAL;\n@@ -268,6 +272,48 @@ static int ar8xxx_set_pad_ctrl(struct dsa_switch *ds, int port, int mode)\n \treturn 0;\n }\n \n+static int ar8xxx_of_setup(struct dsa_switch *ds)\n+{\n+\tstruct device_node *dn = ds->pd->of_node;\n+\tconst char *s_phymode;\n+\tint ret, mode;\n+\tu32 phy_id, ctrl;\n+\n+\t/* If port6-phy-mode property exists, configure it accordingly */\n+\tif (!of_property_read_string(dn, \"qca,port6-phy-mode\", &s_phymode)) {\n+\t\tfor (mode = 0; mode < PHY_INTERFACE_MODE_MAX; mode++)\n+\t\t\tif (!strcasecmp(s_phymode, phy_modes(mode)))\n+\t\t\t\tbreak;\n+\n+\t\tif (mode == PHY_INTERFACE_MODE_MAX)\n+\t\t\tpr_err(\"Unknown phy-mode: \\\"%s\\\"\\n\", s_phymode);\n+\n+\t\tret = ar8xxx_set_pad_ctrl(ds, 6, mode);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t}\n+\n+\t/* If a phy ID is specified for PORT6 mac, connect them together */\n+\tif (!of_property_read_u32(dn, \"qca,port6-phy-id\", &phy_id)) {\n+\t\tar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(6),\n+\t\t\t AR8327_PORT_LOOKUP_MEMBER, BIT(phy_to_port(phy_id)));\n+\t\tar8xxx_rmw(ds, AR8327_PORT_LOOKUP_CTRL(phy_to_port(phy_id)),\n+\t\t\t AR8327_PORT_LOOKUP_MEMBER, BIT(6));\n+\n+\t\t/* We want the switch to be pass-through and act like a PHY on\n+\t\t * these ports. So BC/MC/UC & IGMP frames need to be accepted\n+\t\t */\n+\t\tctrl = BIT(phy_to_port(phy_id)) | BIT(6);\n+\t\tar8xxx_reg_set(ds, AR8327_REG_GLOBAL_FW_CTRL1,\n+\t\t\t ctrl << AR8327_GLOBAL_FW_CTRL1_IGMP_DP_S |\n+\t\t\t ctrl << AR8327_GLOBAL_FW_CTRL1_BC_DP_S |\n+\t\t\t ctrl << AR8327_GLOBAL_FW_CTRL1_MC_DP_S |\n+\t\t\t ctrl << AR8327_GLOBAL_FW_CTRL1_UC_DP_S);\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int ar8xxx_setup(struct dsa_switch *ds)\n {\n \tstruct ar8xxx_priv *priv = ds_to_priv(ds);\n@@ -341,6 +387,10 @@ static int ar8xxx_setup(struct dsa_switch *ds)\n \t\t}\n \t}\n \n+\tret = ar8xxx_of_setup(ds);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n \treturn 0;\n }\n \n", "prefixes": [ "6/7" ] }