Message ID | 20230721212044.59666-4-nick.hawkins@hpe.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp492098vqg; Fri, 21 Jul 2023 15:10:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlGHU03X62QmPu7IZ0ZJMq7tVussQFI9UZbxkp/xFJIrnfBTLIJKWrAlgJwyM5U04Vas3MVW X-Received: by 2002:a2e:6a10:0:b0:2b7:1005:931b with SMTP id f16-20020a2e6a10000000b002b71005931bmr2171995ljc.0.1689977456530; Fri, 21 Jul 2023 15:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689977456; cv=none; d=google.com; s=arc-20160816; b=iyxI04rRH4EI41YPDrlYXNTIGYqGBLFndPx+ZJV2ntenGCdEd45Rd0Qw7tA8Qms3Fs MOjtgU+BGn01AVC1A0SBWCfdyDUqboEv0/Tx6M0kgJdJcPHUPjkh2cXvFbh4BVAi6IJl bkNdj4lt+TzlzHuKbW+QCpdaN5DCmTvPvv8PK24qLYF3waF2yCfXdT/rkOhs36RtGwpa 8YK5r2TvMYz90y15c4qP3a5M5YF+P7IJJoiB8tet3bD5I+phIOLFHsCbJA6XphTHANkg 3xjl1tUWNboipx2ZQ+EfFqApE6nBCTMU18PMj1cxFNPcmdRYKzGEKxQTwTeo/kAmYDTL sZXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=iRlorkov3huiTBrRF5aHfpBB+eam/ZCgsrAc5IIrWq8=; fh=cXYsyN8veLmFVTNsy36SiG+f6UWeiPuuALASZIO6gAk=; b=ePAfFyy6KB27dyIv9Ko86Kv3NMVs94exC4Khjo95pen7vtuRrhK7hiLFEQz0aCWvR1 ZxLWt2lpxRKslNd7HnSafHZxJEkNn+fkTVQeoZYDuhAs/J9fXcKm/L4UuiQiR3VnHTHZ 6RqIwioyzk4KEH5fT0Yqk0q/nW2pWi2bVDSBoyevb8UX86TQof+gOCA0e/Y2j82kCUtM Gjkb3jmAls283EuaSz/1W9xFvr/fH6ZSXGCxzTyUKGG94dPLzzRq24CWS5hE9FG3wVKC Mn7U2B6JGJJn5iF8xAPlHbqqSK2I8mPhgu65JH4Qd9hxCpcF9O+fbv3MZKc+QApMjNEj j7Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=TziHYlpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a170906090900b009827e17b069si2855201ejd.1029.2023.07.21.15.10.31; Fri, 21 Jul 2023 15:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=TziHYlpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230330AbjGUVZ4 (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Fri, 21 Jul 2023 17:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjGUVZW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Jul 2023 17:25:22 -0400 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C615E3A8F; Fri, 21 Jul 2023 14:25:00 -0700 (PDT) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36LK8aev026761; Fri, 21 Jul 2023 21:24:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version; s=pps0720; bh=iRlorkov3huiTBrRF5aHfpBB+eam/ZCgsrAc5IIrWq8=; b=TziHYlpZO6AU9reDDGzkF3KOI5m/BNS+R4Kom6ATxoAPqZF6xeuiPh2JYBd9m0EgfnzN jhqtIJzfwQtmRZH/yjZNCRtube7P3LyR5BmXzoNDsdmzSaXH8391rEYiQu6Lawz3Mq6S MOyXqqr9GFbj0ceuyn/X7zOf/ZztBeXcmAZael02C9Il6p0aEPlLJ3JJxGgNpF6ooTR+ BRS4rr4XtanNs9nnPpdy+0dZBWYp35Z6C5MFtPGdo7aKClz6c26ATxfRa+lFYhcocUSl Qm0JRyvmLI7j8y6TYV3IaeGPzI5wjc91V1fn7GCdJ5kQz2RmQb8rWbZ5GQzOxHX0aUiw zA== Received: from p1lg14881.it.hpe.com (p1lg14881.it.hpe.com [16.230.97.202]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3ryd8b9ywq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 21:24:53 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14881.it.hpe.com (Postfix) with ESMTPS id 9C2AA804DF9; Fri, 21 Jul 2023 21:24:28 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 15CE080A540; Fri, 21 Jul 2023 21:24:28 +0000 (UTC) From: nick.hawkins@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/5] dt-bindings: net: Add HPE GXP UMAC Date: Fri, 21 Jul 2023 16:20:42 -0500 Message-Id: <20230721212044.59666-4-nick.hawkins@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230721212044.59666-1-nick.hawkins@hpe.com> References: <20230721212044.59666-1-nick.hawkins@hpe.com> X-Proofpoint-GUID: ZzxqsRzLTQy19jOxfQcenbfm7Vr8U2BV X-Proofpoint-ORIG-GUID: ZzxqsRzLTQy19jOxfQcenbfm7Vr8U2BV X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_12,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 mlxlogscore=952 lowpriorityscore=0 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307210189 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772069801145808010 X-GMAIL-MSGID: 1772069801145808010 |
Series | ARM: Add GXP UMAC Support | |
Commit Message
Hawkins, Nick
July 21, 2023, 9:20 p.m. UTC
From: Nick Hawkins <nick.hawkins@hpe.com> Provide access to the register regions and interrupt for Universal MAC(UMAC). The driver under the hpe,gxp-umac binding will provide an interface for sending and receiving networking data from both of the UMACs on the system. Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com> --- .../devicetree/bindings/net/hpe,gxp-umac.yaml | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml
Comments
> +examples: > + - | > + ethernet@4000 { > + compatible = "hpe,gxp-umac"; > + reg = <0x4000 0x80>; > + interrupts = <22>; > + mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */ Do both ports get the sane MAC address? > + ethernet-ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { > + reg = <0>; > + phy-handle = <ð_phy0>; > + }; > + > + port@1 { > + reg = <1>; > + phy-handle = <ð_phy1>; > + }; > + }; > + > + mdio { This seems to be wrong. You have a standalone MDIO bus driver, not part of the MAC address space? Andrew
On Fri, Jul 21, 2023 at 04:20:42PM -0500, nick.hawkins@hpe.com wrote: > From: Nick Hawkins <nick.hawkins@hpe.com> > > Provide access to the register regions and interrupt for Universal > MAC(UMAC). The driver under the hpe,gxp-umac binding will provide an > interface for sending and receiving networking data from both of the > UMACs on the system. > > Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com> > --- > .../devicetree/bindings/net/hpe,gxp-umac.yaml | 111 ++++++++++++++++++ > 1 file changed, 111 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml > > diff --git a/Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml b/Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml > new file mode 100644 > index 000000000000..c3b68c4ba7f2 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml > @@ -0,0 +1,111 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/hpe,gxp-umac.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: HPE GXP Unified MAC Controller > + > +maintainers: > + - Nick Hawkins <nick.hawkins@hpe.com> > + > +description: | Don't need '|' if no formatting to maintain. Here and elsewhere. > + HPE GXP 802.3 10/100/1000T Ethernet Unifed MAC controller. > + Device node of the controller has following properties. > + > +properties: > + compatible: > + const: hpe,gxp-umac > + > + use-ncsi: > + type: boolean > + description: | > + Indicates if the device should use NCSI (Network Controlled > + Sideband Interface). > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + mac-address: true > + > + ethernet-ports: > + type: object > + additionalProperties: false > + description: Ethernet ports to PHY > + > + properties: > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > + patternProperties: > + "^port@[0-1]$": > + type: object > + additionalProperties: false > + description: Port to PHY > + > + properties: > + reg: > + minimum: 0 > + maximum: 1 > + > + phy-handle: > + maxItems: 1 > + > + required: > + - reg > + - phy-handle > + > + mdio: > + $ref: mdio.yaml# > + unevaluatedProperties: false > + > +additionalProperties: false > + > +required: > + - compatible > + - reg > + - interrupts > + - ethernet-ports > + > +examples: > + - | > + ethernet@4000 { > + compatible = "hpe,gxp-umac"; > + reg = <0x4000 0x80>; > + interrupts = <22>; > + mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */ > + ethernet-ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { > + reg = <0>; > + phy-handle = <ð_phy0>; > + }; > + > + port@1 { > + reg = <1>; > + phy-handle = <ð_phy1>; > + }; > + }; > + > + mdio { > + #address-cells = <1>; > + #size-cells = <0>; > + > + eth_phy0: ethernet-phy@0 { > + reg = <0>; > + }; > + > + eth_phy1: ethernet-phy@1 { > + reg = <1>; > + }; > + }; > + }; > +... > -- > 2.17.1 >
Hi Andrew, Thank you for the feedback. > > +examples: > > + - | > > + ethernet@4000 { > > + compatible = "hpe,gxp-umac"; > > + reg = <0x4000 0x80>; > > + interrupts = <22>; > > + mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */ > Do both ports get the sane MAC address? No they do not. The first one will get the MAC address, the second will be an external phy we are managing via the MDIO path. > > + ethernet-ports { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + port@0 { > > + reg = <0>; > > + phy-handle = <ð_phy0>; > > + }; > > + > > + port@1 { > > + reg = <1>; > > + phy-handle = <ð_phy1>; > > + }; > > + }; > > + > > + mdio { > This seems to be wrong. You have a standalone MDIO bus driver, not > part of the MAC address space? I based this from other yaml examples I found. Is there a better way to represent it? Here is what I plan on having the dts/dtsi look like: mdio0: mdio@4080 { compatible = "hpe,gxp-umac-mdio"; reg = <0x4080 0x10>; #address-cells = <1>; #size-cells = <0>; ext_phy0: ethernt-phy@0 { compatible = "marvell,88e1415","ethernet-phy-ieee802.3-c22"; phy-mode = "sgmii"; reg = <0>; }; }; mdio1: mdio@5080 { compatible = "hpe,gxp-umac-mdio"; reg = <0x5080 0x10>; #address-cells = <1>; #size-cells = <0>; int_phy0: ethernt-phy@0 { compatible = "ethernet-phy-ieee802.3-c22"; phy-mode = "gmii"; reg = <0>; }; int_phy1: ethernt-phy@1 { compatible = "ethernet-phy-ieee802.3-c22"; phy-mode = "gmii"; reg = <1>; }; }; umac0: ethernet@4000 { compatible = "hpe,gxp-umac"; reg = <0x4000 0x80>; interrupts = <10>; interrupt-parent = <&vic0>; mac-address = [00 00 00 00 00 00]; ethernet-ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; phy-handle = <&int_phy0>; }; port@1 { reg = <1>; phy-handle = <&ext_phy0>; }; }; }; Thank you for the help and assistance. -Nick Hawkins
On Tue, Jul 25, 2023 at 01:44:30PM +0000, Hawkins, Nick wrote: > Hi Andrew, > > Thank you for the feedback. > > > > +examples: > > > + - | > > > + ethernet@4000 { > > > + compatible = "hpe,gxp-umac"; > > > + reg = <0x4000 0x80>; > > > + interrupts = <22>; > > > + mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */ > > > Do both ports get the sane MAC address? > > No they do not. The first one will get the MAC address, the second > will be an external phy we are managing via the MDIO path. Then please put the mac-address property in the correct place, inside port@0. > > > + ethernet-ports { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + port@0 { > > > + reg = <0>; > > > + phy-handle = <ð_phy0>; > > > + }; > > > + mdio { > > > This seems to be wrong. You have a standalone MDIO bus driver, not > > part of the MAC address space? > > I based this from other yaml examples I found. Is there a better way to > represent it? The validator when given examples does not validate phy-handle actually points to a known node. So you can just leave the mdio bus out all together. > mdio0: mdio@4080 { > compatible = "hpe,gxp-umac-mdio"; > reg = <0x4080 0x10>; > #address-cells = <1>; > #size-cells = <0>; > ext_phy0: ethernt-phy@0 { > compatible = "marvell,88e1415","ethernet-phy-ieee802.3-c22"; which is wrong. Please read the binding document for PHYs. Andrew
Note: Resend in correct format. > > > Do both ports get the sane MAC address? > > > > No they do not. The first one will get the MAC address, the second > > will be an external phy we are managing via the MDIO path. > Then please put the mac-address property in the correct place, inside port@0. Greetings Andrew, I was mistaken, the Mac address belongs with UMAC, not the phys. The reason ports are listed here is because having two separate phy-handles in one node is not allowed. The layout of the hardware inside the GXP is unconventional. There is a description of the layout in the cover-letter, I see though I need to add a better description. The internal-phy is connected to the external phy via SGMII. To use UMAC0 we need to configure both the internal, and external phy to enable networking. Ideally it would be something like this: umac0: umac@4000 { compatible = "hpe, gxp-umac"; reg = <0x4000 0x80>; interrupts = <10>; interrupt-parent = <&vic0>; mac-address = [94 18 82 16 04 d8]; ext-phy-handle = <&ext_phy0>; int-phy-handle = <&int_phy0>; }; Thanks, -Nick Hawkins
On Wed, Jul 26, 2023 at 02:35:48PM +0000, Hawkins, Nick wrote: > > > > Do both ports get the sane MAC address? > > > > > > No they do not. The first one will get the MAC address, the second > > > will be an external phy we are managing via the MDIO path. > > > Then please put the mac-address property in the correct place, inside > port@0. > > Greetings Andrew, > > I was mistaken, the Mac address belongs with UMAC, > not the phys. The reason ports are listed here is > because having two separate phy-handles > in one node is not allowed. The layout of the > hardware inside the GXP is unconventional. It is not that unconventional. See Documentation/devicetree/bindings/net/marvell-orion-net.txt This is an Ethernet block, with two MACs inside it. Each MAC gets its own subblock containing MAC specific properties like the MAC address, phy-handle, etc. Andrew
diff --git a/Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml b/Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml new file mode 100644 index 000000000000..c3b68c4ba7f2 --- /dev/null +++ b/Documentation/devicetree/bindings/net/hpe,gxp-umac.yaml @@ -0,0 +1,111 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/hpe,gxp-umac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HPE GXP Unified MAC Controller + +maintainers: + - Nick Hawkins <nick.hawkins@hpe.com> + +description: | + HPE GXP 802.3 10/100/1000T Ethernet Unifed MAC controller. + Device node of the controller has following properties. + +properties: + compatible: + const: hpe,gxp-umac + + use-ncsi: + type: boolean + description: | + Indicates if the device should use NCSI (Network Controlled + Sideband Interface). + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + mac-address: true + + ethernet-ports: + type: object + additionalProperties: false + description: Ethernet ports to PHY + + properties: + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + patternProperties: + "^port@[0-1]$": + type: object + additionalProperties: false + description: Port to PHY + + properties: + reg: + minimum: 0 + maximum: 1 + + phy-handle: + maxItems: 1 + + required: + - reg + - phy-handle + + mdio: + $ref: mdio.yaml# + unevaluatedProperties: false + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + - ethernet-ports + +examples: + - | + ethernet@4000 { + compatible = "hpe,gxp-umac"; + reg = <0x4000 0x80>; + interrupts = <22>; + mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */ + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + phy-handle = <ð_phy0>; + }; + + port@1 { + reg = <1>; + phy-handle = <ð_phy1>; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + eth_phy0: ethernet-phy@0 { + reg = <0>; + }; + + eth_phy1: ethernet-phy@1 { + reg = <1>; + }; + }; + }; +...