From patchwork Fri Mar 15 22:27:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wadim Mueller X-Patchwork-Id: 13594099 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 D5BFEC54E58 for ; Fri, 15 Mar 2024 22:29:32 +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=Edf6jKQYeoPDftb7ldOdIeC78l73wvmcbLVRYjFhBd8=; b=IOjypikww/4lHE +/LnWJbdPEx1a07RWgtu3t2/PTjGoe5ug68zGWoGs+0cumOBxrWk10X3M00MKcbSoJFzuz8aKiCtn pVe5wQV4tK9yJQJ0yE03yHDTYjlzTKt86zm1aefMqsq17eAAz8EBhBF3ZmZ9ehqxVRvXZiKhQVWpy WxnsL0/hoUBi6rHfCbHqZQPFhobi6UBw4PGem/BHGInKPk/mf+bFKsz11NQlU21QdIX8+EIbKPpVW +8KTxrE8grnr/ho9nvz+Ufe8+FvRJjLxFllt2AUIBZmH9UOKLVu9hS8DnlM5sTty1L9sfIecUdc6e qno2blRh87hJf89/U2eQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlG3B-00000001kRn-0xfT; Fri, 15 Mar 2024 22:29:17 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlG2p-00000001kFM-0r9L for linux-arm-kernel@lists.infradead.org; Fri, 15 Mar 2024 22:29:07 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2d27184197cso31526231fa.1 for ; Fri, 15 Mar 2024 15:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710541733; x=1711146533; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=302kqphgnvloT7tRflp5vmAeTFbHsjR2zeOi1oIAOPs=; b=HUPPLLj1NCpZfdYTjoeV7sxp+P9us89Z+0EaHJ+O5+k0Y8fb7ln6VRK4jrSt6Su2m6 CX5pbaUagdeDVdSnqKzCgsVb11K3J7ujYAUleicXYWYesWJNsjXE8zKzL1w4skxkhYOZ ZmjTkES6LAULswiUDDSDXJOCZLnvbBsXyQI7/Sxdja+FMPdYRzm2k3WtK93rwgovgEPP /M+uxf0kQ1sRLc/xDlhWEdPiwx40HtpBa+7j/Px1sLn+LFL/jrQW/gwq2jz9ZNeW8nnB EQpOKliKd4X1arauVoXRHwtMMB5Cu8nO7u98vfPKyMJNo4BurIdPQQ8MousXRoT2cEet BoqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710541733; x=1711146533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=302kqphgnvloT7tRflp5vmAeTFbHsjR2zeOi1oIAOPs=; b=RsjQqymaqJkY23tuanPv5RE+vmaRcbSEjxDoObCMGwllN9taE+4EDyREnmlWCdgHHa pILQA1Q996oasuSmdmveVeiRMwjHqlvZbjACoA3wr2CLs2gchi6YvH4Muk40s4/OWNkb VBtmLgDcVeUWzWN6fy5oYTqqAb6JgnfZwMVqmveheMRchTgVYycJuLxx4nYxOJ6+UCAw Tt4dvBFd6MghOqm+p/q7B0DkpHnGONxLUhTrLIUQv+6BkHkfkyXRdR/j5//XGTlztKY4 IqZvDb2oN4uEEEkN+r2ZuhDJm/zmL4FBQqRzrKx8Okp3oogJ8aWIrA7T23DBT1vweuI+ bm4Q== X-Forwarded-Encrypted: i=1; AJvYcCVyM+jZwejX2KT/67xytGtGkEA4gVWda4TLc+Fnsn7XDmnk6lFcCsKGGoBYDvEUGBs7U+76B1uEPc32yygLJNSGoBZHkN5UsuU9MTeLyv3KnD7T1oM= X-Gm-Message-State: AOJu0Yx/RuwT3UrMxIGo3MUv+mMziL6VyfP/9sshPNm3zlvWzhEjsw0S uyWRMUGYnZjKHARI3YFDmFk2G+V+lYd/T7dX35iyKBT1J7a66wgn X-Google-Smtp-Source: AGHT+IHcjRin3ixKrRDCEXWR1NTp6DqzyykF1/dJQj9Pfcg3SJc4VnuWq0HeLh8Kw0lcnJE/ychySA== X-Received: by 2002:a2e:b81a:0:b0:2d2:cb43:bc86 with SMTP id u26-20020a2eb81a000000b002d2cb43bc86mr3340739ljo.45.1710541732845; Fri, 15 Mar 2024 15:28:52 -0700 (PDT) Received: from bhlegrsu.conti.de ([2a02:908:2525:6ea0::f845]) by smtp.googlemail.com with ESMTPSA id el9-20020a056402360900b005684173e413sm2039833edb.72.2024.03.15.15.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 15:28:52 -0700 (PDT) From: Wadim Mueller To: Cc: Wadim Mueller , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Chester Lin , =?utf-8?q?Andreas_F=C3=A4rber?= , Matthias Brugger , NXP S32 Linux Team , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Michael Turquette , Stephen Boyd , Richard Cochran , Andrew Halaney , Simon Horman , Bartosz Golaszewski , Johannes Zink , Shenwei Wang , "Russell King (Oracle)" , Swee Leong Ching , Giuseppe Cavallaro , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-clk@vger.kernel.org Subject: [PATCH 3/3] dt-bindings: net: add schema for NXP S32 dwmac glue driver Date: Fri, 15 Mar 2024 23:27:49 +0100 Message-Id: <20240315222754.22366-4-wafgo01@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240315222754.22366-1-wafgo01@gmail.com> References: <20240315222754.22366-1-wafgo01@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240315_152855_287400_C2E18333 X-CRM114-Status: GOOD ( 18.05 ) 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 Add DT binding schema documentation for the NXP S32 dwmac glue driver. This documentation is based on the patchset originally provided by Chester Lin [1]. This commit is a re-send of [2] and [3]. [1] https://patchwork.kernel.org/project/netdevbpf/patch/20221031101052.14956-6-clin@suse.com/#25068228 [2] https://lore.kernel.org/lkml/20221031101052.14956-1-clin@suse.com/T/#me96c28bd0536de276dee941469ea084d51b42244 [3] https://lore.kernel.org/lkml/20221031101052.14956-1-clin@suse.com/T/#m887a1b34e612f8dc0d5b718e4d6834c083f1e245 Signed-off-by: Wadim Mueller --- .../bindings/net/nxp,s32-dwmac.yaml | 130 ++++++++++++++++++ .../devicetree/bindings/net/snps,dwmac.yaml | 5 +- 2 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml diff --git a/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml new file mode 100644 index 000000000000..0fbca6ce7d60 --- /dev/null +++ b/Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml @@ -0,0 +1,130 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/net/nxp,s32-dwmac.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: NXP S32 DWMAC Ethernet controller + +select: + properties: + compatible: + contains: + enum: + - nxp,s32-dwmac + required: + - compatible + +allOf: + - $ref: "snps,dwmac.yaml#" + +properties: + compatible: + contains: + enum: + - nxp,s32-dwmac + + reg: + items: + - description: Main GMAC registers + - description: S32 MAC control registers + + dma-coherent: + description: + Declares GMAC device as DMA coherent + + clocks: + items: + - description: Main GMAC clock + - description: Peripheral registers clock + - description: Transmit SGMII clock + - description: Transmit RGMII clock + - description: Transmit RMII clock + - description: Transmit MII clock + - description: Receive SGMII clock + - description: Receive RGMII clock + - description: Receive RMII clock + - description: Receive MII clock + - description: + PTP reference clock. This clock is used for programming the + Timestamp Addend Register. If not passed then the system + clock will be used. + + clock-names: + items: + - const: stmmaceth + - const: pclk + - const: tx_sgmii + - const: tx_rgmii + - const: tx_rmii + - const: tx_mii + - const: rx_sgmii + - const: rx_rgmii + - const: rx_rmii + - const: rx_mii + - const: ptp_ref + + tx-fifo-depth: + const: 20480 + + rx-fifo-depth: + const: 20480 + +required: + - compatible + - reg + - tx-fifo-depth + - rx-fifo-depth + - clocks + - clock-names + +additionalProperties: true + +examples: + - | + #include + #include + #include + + soc { + #address-cells = <1>; + #size-cells = <1>; + + gmac0: ethernet@4033c000 { + compatible = "nxp,s32-dwmac"; + reg = <0x4033c000 0x2000>, /* gmac IP */ + <0x4007C004 0x4>; /* S32 CTRL_STS reg */ + interrupt-parent = <&gic>; + interrupts = ; + interrupt-names = "macirq"; + phy-mode = "rgmii-id"; + tx-fifo-depth = <20480>; + rx-fifo-depth = <20480>; + dma-coherent; + clocks = <&clks S32_SCMI_CLK_GMAC0_AXI>, + <&clks S32_SCMI_CLK_GMAC0_AXI>, + <&clks S32_SCMI_CLK_GMAC0_TX_SGMII>, + <&clks S32_SCMI_CLK_GMAC0_TX_RGMII>, + <&clks S32_SCMI_CLK_GMAC0_TX_RMII>, + <&clks S32_SCMI_CLK_GMAC0_TX_MII>, + <&clks S32_SCMI_CLK_GMAC0_RX_SGMII>, + <&clks S32_SCMI_CLK_GMAC0_RX_RGMII>, + <&clks S32_SCMI_CLK_GMAC0_RX_RMII>, + <&clks S32_SCMI_CLK_GMAC0_RX_MII>, + <&clks S32_SCMI_CLK_GMAC0_TS>; + clock-names = "stmmaceth", "pclk", + "tx_sgmii", "tx_rgmii", "tx_rmii", "tx_mii", + "rx_sgmii", "rx_rgmii", "rx_rmii", "rx_mii", + "ptp_ref"; + + gmac0_mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + ethernet-phy@1 { + reg = <0x01>; + }; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 5c2769dc689a..e5bf61347b66 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -66,6 +66,7 @@ properties: - ingenic,x2000-mac - loongson,ls2k-dwmac - loongson,ls7a-dwmac + - nxp,s32-dwmac - qcom,qcs404-ethqos - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos @@ -117,7 +118,7 @@ properties: clocks: minItems: 1 - maxItems: 8 + maxItems: 11 additionalItems: true items: - description: GMAC main clock @@ -129,7 +130,7 @@ properties: clock-names: minItems: 1 - maxItems: 8 + maxItems: 11 additionalItems: true contains: enum: