From patchwork Wed Mar 24 10:35:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12160661 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 532B3C433E3 for ; Wed, 24 Mar 2021 10:37:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 255A461A05 for ; Wed, 24 Mar 2021 10:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232877AbhCXKhD (ORCPT ); Wed, 24 Mar 2021 06:37:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:32924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233466AbhCXKge (ORCPT ); Wed, 24 Mar 2021 06:36:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3EEAB61A08; Wed, 24 Mar 2021 10:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616582193; bh=B+kZlNE6ljpqmUxCiAVwPVI4YEuUbs4lWKzfgZcbKY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DKlY8U17Ny34GXYvrieV4atKMVlsf6yIp1yayQwCknrrjwIzLbTpKtgTpSIvesyj2 eyR14mV3STj2ZduV37uE5V9/y8LiPTXHkuwLr82Wfzfeij/ZQwdBf55RgV0scuYXJK XEcqTWiC3+Cnz6ElZxFwqyZjPsnbaOHeXnWCy18Ob1CTvxkJcbsRubp5g00XIxizZm IGbMPXZeRHa4uUw6/L+UH/1IJgR5Oh6PjETvvdu7EPssEjNeduFnsk0qG/y4uhUzcV m+HoqRtXIULWh3ukSEizEwzX4slPADFveosBITY3/HlPS4CmjrosvstPvRfyUD6uqs QIygWRNLgD+Ig== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , Rob Herring , devicetree@vger.kernel.org Cc: pali@kernel.org, =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 1/2] dt-bindings: ethernet-controller: create a type for PHY interface modes Date: Wed, 24 Mar 2021 11:35:55 +0100 Message-Id: <20210324103556.11338-2-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324103556.11338-1-kabel@kernel.org> References: <20210324103556.11338-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In order to be able to define a property describing an array of PHY interface modes, we need to change the current scalar `phy-connection-type`, which lists the possible PHY interface modes, to an array of length 1 (otherwise we would need to define the same list at two different places). Moreover Rob Herring says that we cannot reuse the values of a property; we need to $ref a type. Move the definition of possible PHY interface modes from the `phy-connection-type` property to an array type definition `phy-connection-type-array`, and simply reference this type in the original property. Signed-off-by: Marek BehĂșn --- .../bindings/net/ethernet-controller.yaml | 89 ++++++++++--------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml index 4b7d1e5d003c..0ee25ecbffde 100644 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -53,50 +53,12 @@ properties: const: mac-address phy-connection-type: + $ref: "#/$defs/phy-connection-type-array" description: Specifies interface type between the Ethernet device and a physical layer (PHY) device. - enum: - # There is not a standard bus between the MAC and the PHY, - # something proprietary is being used to embed the PHY in the - # MAC. - - internal - - mii - - gmii - - sgmii - - qsgmii - - tbi - - rev-mii - - rmii - - # RX and TX delays are added by the MAC when required - - rgmii - - # RGMII with internal RX and TX delays provided by the PHY, - # the MAC should not add the RX or TX delays in this case - - rgmii-id - - # RGMII with internal RX delay provided by the PHY, the MAC - # should not add an RX delay in this case - - rgmii-rxid - - # RGMII with internal TX delay provided by the PHY, the MAC - # should not add an TX delay in this case - - rgmii-txid - - rtbi - - smii - - xgmii - - trgmii - - 1000base-x - - 2500base-x - - 5gbase-r - - rxaui - - xaui - - # 10GBASE-KR, XFI, SFI - - 10gbase-kr - - usxgmii - - 10gbase-r + minItems: 1 + maxItems: 1 phy-mode: $ref: "#/properties/phy-connection-type" @@ -226,4 +188,49 @@ properties: additionalProperties: true +'$defs': + phy-connection-type-array: + items: + enum: + # There is not a standard bus between the MAC and the PHY, + # something proprietary is being used to embed the PHY in the + # MAC. + - internal + - mii + - gmii + - sgmii + - qsgmii + - tbi + - rev-mii + - rmii + + # RX and TX delays are added by the MAC when required + - rgmii + + # RGMII with internal RX and TX delays provided by the PHY, + # the MAC should not add the RX or TX delays in this case + - rgmii-id + + # RGMII with internal RX delay provided by the PHY, the MAC + # should not add an RX delay in this case + - rgmii-rxid + + # RGMII with internal TX delay provided by the PHY, the MAC + # should not add an TX delay in this case + - rgmii-txid + - rtbi + - smii + - xgmii + - trgmii + - 1000base-x + - 2500base-x + - 5gbase-r + - rxaui + - xaui + + # 10GBASE-KR, XFI, SFI + - 10gbase-kr + - usxgmii + - 10gbase-r + ... From patchwork Wed Mar 24 10:35:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12160663 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83B81C433E4 for ; Wed, 24 Mar 2021 10:37:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3725361A07 for ; Wed, 24 Mar 2021 10:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235886AbhCXKhE (ORCPT ); Wed, 24 Mar 2021 06:37:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:32996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233524AbhCXKgf (ORCPT ); Wed, 24 Mar 2021 06:36:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 61F47619FB; Wed, 24 Mar 2021 10:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616582195; bh=sAWXXg1sOTQ3susDlTKm6scF3n+aU9DBk5jYc6+G7MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d9dUStdo1tt1JA6wXidItI2BdsZ6MuPoLufQsgkV47/8VS1hEBiKNr78hPFmOWQUP cqI5/vJpT39xA7+viaJv+vpA9UhYGdab5Oe9eYKdYxNmKmzDezuL3TxaD1MBJRPnrT NHjqsNueH6rLUbc6JlqZ7AShK4XFdKH0iwnNPfzNefmQGhtJDYMT8U5UFf4F0wIqZs XdTCFeDp4lhrmhXw7rcw+qwYiuAQysu0OzOjbp+n/3Nka64htwovyGPWK78Cf/f4dQ ZxvF7AYvRV4mEjsnUt52wdU8gDA5ELtPGKv9iOI4e/vyXPZ+pus+JWm/SjRTHyRtzl Jh+cqoqLBFdGg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , Rob Herring , devicetree@vger.kernel.org Cc: pali@kernel.org, =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 2/2] dt-bindings: ethernet-phy: define `supported-mac-connection-types` property Date: Wed, 24 Mar 2021 11:35:56 +0100 Message-Id: <20210324103556.11338-3-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324103556.11338-1-kabel@kernel.org> References: <20210324103556.11338-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org An ethernet PHY may support PHY interface modes that are not wired on a specific board (or are broken for some other reason). For example the Marvell 88X3310 PHY supports connecting the MAC with the PHY with `xaui` and `rxaui`, the MAC can also support these modes, but it is possible for a board not to have them wired (since these modes use multiple SerDes lanes). In order for the kernel to know which modes are supported on the board, we need to specify them in the device tree. Define a new ethernet PHY property `supported-mac-connection-types`, which lists the supported modes. If this property is missing, all modes supported by the PHY and MAC are presumed to be supported by the board. Signed-off-by: Marek BehĂșn --- .../devicetree/bindings/net/ethernet-phy.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml index 2766fe45bb98..3706760b5637 100644 --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml @@ -136,6 +136,23 @@ properties: used. The absence of this property indicates the muxers should be configured so that the external PHY is used. + supported-mac-connection-types: + $ref: "ethernet-controller.yaml#/$defs/phy-connection-type-array" + description: + The PHY device may support different interface types for + connecting the Ethernet MAC device to the PHY device (i.e. + rgmii, sgmii, xaui, ...), but not all of these interface + types must necessarily be supported for a specific board + (not all of them are wired, or there may be some known bug + for a specific mode, ...). + This property specifies a list of interface modes to the + MAC supported by the PHY hardware that are also supported + by the board. + If this property is missing, all modes supported by the + PHY are presumend to be supported by the board. + minItems: 1 + maxItems: 64 + resets: maxItems: 1 @@ -196,5 +213,6 @@ examples: reset-gpios = <&gpio1 4 1>; reset-assert-us = <1000>; reset-deassert-us = <2000>; + supported-mac-connection-types = "xaui", "rxaui"; }; };