From patchwork Thu Aug 4 19:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12936671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AC58C25B06 for ; Thu, 4 Aug 2022 19:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UYIX3CYyI/oh/5We/wpZ/7jGYSHcgfzJKyM6B28/2bE=; b=2tpddhnfTruY3R owNJDrwYw801Vqqw2qbQMVb5F5eqeUQGwAmjTqL+dAMnbQ6ofXhdAr/lmClchdHoQ7AtOLCcQGMmn Hlb8Vxjz/HlEMUT7caUpv4i7sXYE5xVZbsUOJlI/Tu1BmsWBcD2Xq+e8O/FBOWG+aqm5uW/5e7wS6 1MaKdtXkmfO4y9vOENWo1D5LPgKlsEMRk8iQTiI0RmY8RtAjVHhhS/b70hEbo1i9B1LQTKfGBt1hj vBw+paqCxrxEKo7GWNNaFCE/+j47MAIXiV3E2IIZrwfTxyDxQqfHTwhDxw7rp8yoM4uc957i/ij9z 3mAkpv4orFpia70nbVuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJgpG-008hEx-9t; Thu, 04 Aug 2022 19:48:10 +0000 Received: from mail-eopbgr130071.outbound.protection.outlook.com ([40.107.13.71] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJgoj-008gwv-SQ for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2022 19:47:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dgo0D1DYkVuBOCwXfdtZOFykEyUBKTvaR7eyaDM3Ms3vSYCdJ3k/Sg7eDDDnf4kAoXgV/VInJNmdMoBFW8xpPH6Dk/jFMFeimXHg8KIkFmC1QQ9UHzQZgWGoJsGaW78UBLjQYsCL0mxdkTS8jTpXVcZXVQYoWC7DulvxhpL0vGews40JCPh6P2rUPvO9c7D4lzMZF3sD00bdyLsu/ycN5e6FOUjZQpvVOSOH426tsHBts7smneFuLlrm7Ok5SF2jrn1fCByBxD/Sk35R7h1ysgXz/NhkjaPEL6tn8YXh3Z3+3+9JLnrwMed3XuWfUfYp2ZhnMyUgNiYwjDTd8MI3Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/rFDiaVxvOHtQ65IrquHz2bwl4lCXIK1BRND8yyrpwM=; b=WhwRl48dYi/oLPDQtRcaEh9DxdywCdZDqFTSCZyTAPan1gDiJO2y72mkwEn96e5cRYlvzgZdW1xeXuI4CfXMawdxrX9mYtPv6ETxOWgFEK4bG+sDXWqixPSgIbw1pccTHQ9zzQBSFunBCrRFynvJIw+ZcctxIi484+AIh/jbNIqQ4aGmJb0kjFtuZcab49CENYGSrQfNwYPumeLnd8JZLJhgpWVZO1DlpeTkcT10I8R+AVZD1h0eTo2JrTwq6fcXZ8txGSojPsZ8m7IMdYV77RrJ334xM2v+jhu6tRi/L32piG3lOe8thiIuXw6VrRoewtXF6RxiON8Deygeh7UUtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/rFDiaVxvOHtQ65IrquHz2bwl4lCXIK1BRND8yyrpwM=; b=rzf6CYQo1whxTqtGc2qpY2tHkNR6J238nQbS7RkWrJG7nQoiRk6E4D4JijYyjN/qulYwXb5COzTafi8VKJBUcOTkX6wFLZEh7e8bTVRr8E+YvZNKQCsaL8Y6qudKhoB7BB9FG+vstMmv5YwXHolVLiLdZo1kUHDVqARBZ101WcoqDadHVlKyDXjEKoDgYJHal23V4Tl/MG4bRMoGlOnFwksMxzHxJjV61uWyLT53tcoXT7pRt/pRe96u39vjvw3V2YPF9E+nKBN9Qfv9y/pW11711LEJs2u9INxHKUoyxQ9Tesgd313KACI/f3NerPhh5qk5BPUFlzLPzsKZriTJPA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by HE1PR0301MB2297.eurprd03.prod.outlook.com (2603:10a6:3:25::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Thu, 4 Aug 2022 19:47:28 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::ecaa:a5a9:f0d5:27a2%4]) with mapi id 15.20.5504.014; Thu, 4 Aug 2022 19:47:28 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , Camelia Alexandra Groza , netdev@vger.kernel.org Cc: "linuxppc-dev @ lists . ozlabs . org" , linux-kernel@vger.kernel.org, Paolo Abeni , linux-arm-kernel@lists.infradead.org, Eric Dumazet , Russell King , Sean Anderson , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH net-next v4 2/8] dt-bindings: net: fman: Add additional interface properties Date: Thu, 4 Aug 2022 15:46:59 -0400 Message-Id: <20220804194705.459670-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220804194705.459670-1-sean.anderson@seco.com> References: <20220804194705.459670-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1P223CA0012.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::17) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b993829-0345-401d-228a-08da7652295e X-MS-TrafficTypeDiagnostic: HE1PR0301MB2297:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W/8vAQpoxTYc2AbrUW0na47iwP6XEjetfpWTBmkNWrU/K6sqeL+qcCHWxVJuSN/t3BqfUIynKmo7R+OhuIxf3CxvThTa+cDa173uJg87ctTrDG+tG3YKcVPKE/IZGU+WMISd0oZOHuAinozQ2HluQu5wt6kEDfzN1fbEJeDTrMDEVtilk4Z1dL6m3lsb4mcmYyo/jUZZhIuAHlwepar3xQvpxnJJ6oTnjjObHCnvG2zfrq+en1KKFnbAAvdppVZQiAMG/4sO0Q6hk3kY29TnOClc2GbHyOGjM0Qz4PSikecNsMXVI3OxQuO4S2u8g4ABo1EW6SBunLvU2iD0vB+jtTU6bgp3u8VvDoP0fuzz+XVtF1wwQNeGXlqHtRQme/eACUsinRalNXFhuam4pJwLvN3GPgkqR0ilQz6VimcYEcMDeS38oaOCjQPloVmfpDU4GQ5WhzScwXfHcfa+9uvjW8V8e0T2fwCO+y6EHcrORSqaeSDzEFNTPPweEygydt8S6v6E6kpCj9U2+yE/4C+G3n9XdLN5ntq50f+x1+c958v6vqUj9cwPNd+QOKcBXWfK5tSV5AIKm3fqIJL4rsZ/eggALTCwKHZqjt/JOKRJdozX1wVlt9ODcppB02omhNOQdeGJZ2hXiUgQWA6FLcDOWR/H0yMlPhysmYzRsZSGy4HhoSSGm8GDDZaDe5iEMTXvppux9daHxxN7BD31s7JMPTm53rFw6ISDdyFH0hY3t6L+sX1Tok+9K6f2e8FAE069GABD0hibTEgJomCvCt24JT1D2sjrP26WLM+Tz6VVQagZRy6PcVBSQN8+SjWqYjsO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39850400004)(366004)(346002)(376002)(136003)(396003)(6486002)(478600001)(186003)(1076003)(26005)(7416002)(6506007)(6666004)(2906002)(6512007)(8936002)(83380400001)(44832011)(41300700001)(38350700002)(110136005)(38100700002)(86362001)(316002)(5660300002)(54906003)(8676002)(36756003)(66946007)(66556008)(4326008)(2616005)(66476007)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3Mpf+df4u76op3CJLR9l/mgNxO+EZPHzPvg/66c0AQ1RuAsg6kWDJ55Tg9d3gGvp3ZWXWucYTzk9QG3GuRUnXdtrA+g+27eAz94TszzWNRDITOZ8JiMsNukjo7+sU1jhj9GJtmqJEGSNC14CMlP13RK8sF3y8EeR1sK3vPoRH2EBdbZEr7s0ELBh8E8J5cuhptxiWgqfvPUAHDLx4byhXOd5XsWvn1xLiq+IKQcRdejDJxHs5exCYI4avDbx+OzjkWc3LQ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Nm1eyqsRyq4qivneJJpNcUqLJYo9ZVet/Bl9dmIFBhMYQ9D3ButMfyvDX7lD7JUQUJjT6AVy1PNGP5G5rEUE7zZhB+g1tvYe7kYi+AKH9nVWzPtb51Xy0HH8icgzXjjb0XDEP30+6b2B50qp9gENUmnCrCqcz6SBSgQEbHLMFh43ucT4YkakWLP95CN+5TDFn+v9GxSD86XFGAMANgqHhgkVC3UCt3bClrwvfEo0Elrcc+xPYEZAcAZn0FP96U2GfWj4ZpavcyyV5AGU8ncyA== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b993829-0345-401d-228a-08da7652295e X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2022 19:47:28.1496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jvI2IxT13BFxZ/e8/Sc7MKy+48pW6yl1+uVFaO2DJRebDghoaJA8twdrCoQLTSUlKxuJE+yMQ/jPJ3IpBXyGAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220804_124738_018607_C2777CAC X-CRM114-Status: GOOD ( 22.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org At the moment, mEMACs are configured almost completely based on the phy-connection-type. That is, if the phy interface is RGMII, it assumed that RGMII is supported. For some interfaces, it is assumed that the RCW/bootloader has set up the SerDes properly. This is generally OK, but restricts runtime reconfiguration. The actual link state is never reported. To address these shortcomings, the driver will need additional information. First, it needs to know how to access the PCS/PMAs (in order to configure them and get the link status). The SGMII PCS/PMA is the only currently-described PCS/PMA. Add the XFI and QSGMII PCS/PMAs as well. The XFI (and 10GBASE-KR) PCS/PMA is a c45 "phy" which sits on the same MDIO bus as SGMII PCS/PMA. By default they will have conflicting addresses, but they are also not enabled at the same time by default. Therefore, we can let the XFI PCS/PMA be the default when phy-connection-type is xgmii. This will allow for backwards-compatibility. QSGMII, however, cannot work with the current binding. This is because the QSGMII PCS/PMAs are only present on one MAC's MDIO bus. At the moment this is worked around by having every MAC write to the PCS/PMA addresses (without checking if they are present). This only works if each MAC has the same configuration, and only if we don't need to know the status. Because the QSGMII PCS/PMA will typically be located on a different MDIO bus than the MAC's SGMII PCS/PMA, there is no fallback for the QSGMII PCS/PMA. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring --- (no changes since v3) Changes in v3: - Add vendor prefix 'fsl,' to rgmii and mii properties. - Set maxItems for pcs-names - Remove phy-* properties from example because dt-schema complains and I can't be bothered to figure out how to make it work. - Add pcs-handle as a preferred version of pcsphy-handle - Deprecate pcsphy-handle - Remove mii/rmii properties Changes in v2: - Better document how we select which PCS to use in the default case .../bindings/net/fsl,fman-dtsec.yaml | 53 ++++++++++++++----- .../devicetree/bindings/net/fsl-fman.txt | 5 +- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml index 3a35ac1c260d..c80c880a9dab 100644 --- a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml +++ b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml @@ -85,9 +85,39 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle description: A reference to the IEEE1588 timer + phys: + description: A reference to the SerDes lane(s) + maxItems: 1 + + phy-names: + items: + - const: serdes + pcsphy-handle: - $ref: /schemas/types.yaml#/definitions/phandle - description: A reference to the PCS (typically found on the SerDes) + $ref: /schemas/types.yaml#/definitions/phandle-array + minItems: 1 + maxItems: 3 + deprecated: true + description: See pcs-handle. + + pcs-handle: + minItems: 1 + maxItems: 3 + description: | + A reference to the various PCSs (typically found on the SerDes). If + pcs-handle-names is absent, and phy-connection-type is "xgmii", then the first + reference will be assumed to be for "xfi". Otherwise, if pcs-handle-names is + absent, then the first reference will be assumed to be for "sgmii". + + pcs-handle-names: + minItems: 1 + maxItems: 3 + items: + enum: + - sgmii + - qsgmii + - xfi + description: The type of each PCS in pcsphy-handle. tbi-handle: $ref: /schemas/types.yaml#/definitions/phandle @@ -100,6 +130,10 @@ required: - fsl,fman-ports - ptp-timer +dependencies: + pcs-handle-names: + - pcs-handle + allOf: - $ref: ethernet-controller.yaml# - if: @@ -110,14 +144,6 @@ allOf: then: required: - tbi-handle - - if: - properties: - compatible: - contains: - const: fsl,fman-memac - then: - required: - - pcsphy-handle unevaluatedProperties: false @@ -138,8 +164,9 @@ examples: reg = <0xe8000 0x1000>; fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>; ptp-timer = <&ptp_timer0>; - pcsphy-handle = <&pcsphy4>; - phy-handle = <&sgmii_phy1>; - phy-connection-type = "sgmii"; + pcs-handle = <&pcsphy4>, <&qsgmiib_pcs1>; + pcs-handle-names = "sgmii", "qsgmii"; + phys = <&serdes1 1>; + phy-names = "serdes"; }; ... diff --git a/Documentation/devicetree/bindings/net/fsl-fman.txt b/Documentation/devicetree/bindings/net/fsl-fman.txt index b9055335db3b..bda4b41af074 100644 --- a/Documentation/devicetree/bindings/net/fsl-fman.txt +++ b/Documentation/devicetree/bindings/net/fsl-fman.txt @@ -320,8 +320,9 @@ For internal PHY device on internal mdio bus, a PHY node should be created. See the definition of the PHY node in booting-without-of.txt for an example of how to define a PHY (Internal PHY has no interrupt line). - For "fsl,fman-mdio" compatible internal mdio bus, the PHY is TBI PHY. -- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY, - PCS PHY addr must be '0'. +- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY. + The PCS PHY address should correspond to the value of the appropriate + MDEV_PORT. EXAMPLE