From patchwork Sat Jul 13 22:35:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 13732528 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 9E94BC3DA45 for ; Sat, 13 Jul 2024 22:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=alTBG+u/YLjKyTy47XAD1gqzMa09sOqVoRaB/kIbg6M=; b=yg962QrdjtGsevYXsoBrAvbLzl IvJzuMxK+mGccr5hFlT3HZKy/FbgYSVjKo4bm8JDSW95efBayKpTEULLjLrtv42rxyRrxAv87H/fY LUsM6XqolT6QX6Gvof9brhrdWHiP44drZSGczH0mWn8Gz34/hIfJWuU+sZEs1fg4/j0wI40a9po+V bzGT6dtvbUMXn8wP3WYalUrFQ5RTFs43l85QfxkYDaU/5iuvEoLxQTJcyu6oyHJF96rONVQ51cofi 9pWoGIftrzF8EDBF3S6PnnCRieSx+Oixuy1f57oZE8i0eNukvAJF78Z+lXSuEhWS5WQ0phewjm4HB tODao3gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSlLn-00000003Irf-0Qlt; Sat, 13 Jul 2024 22:36:19 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSlKv-00000003IRD-0Nck for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2024 22:35:26 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3d853e31de8so1803436b6e.2 for ; Sat, 13 Jul 2024 15:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdp7-com.20230601.gappssmtp.com; s=20230601; t=1720910124; x=1721514924; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=alTBG+u/YLjKyTy47XAD1gqzMa09sOqVoRaB/kIbg6M=; b=p5Tx2VSNpMeJo4nGp3CNHawxOtbTokkYZxLrDchNOAReJpaD+l+IFWMfmrCsBZTbgM NkHRVBS6w2zw5XtWou5YxX7XzqpVRoBdBErKxCTq8SyN5mIHGbvX/+UcjVnM6ZtqXb4/ tAXxJ73smpbCka4F63WcrBxU+u809zDM0Dhd6ugqFV/hd4qasT8uS6bxGe425GtDJ9bR 9FN7/Y15jJrT3vBUj23m3tzkgDjmAG43LT33xCJYnFKrFa+GxxA/6BZciwoeP4CT73dn 0uIXhijGQ6DeUo9MlNM4km5B9ecn65aNHKI2grpP06y/WUHlotvhaYFBLoaBfG3DewYg oz8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720910124; x=1721514924; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=alTBG+u/YLjKyTy47XAD1gqzMa09sOqVoRaB/kIbg6M=; b=fI1B9do4rwcE/N0dZblhU2VMz4qcLi4hBfrDg2YwPRRbD3FUuEMvaQ+JHInNRMjEhS ReDFpuD9fROFAKyxn3YZVYmxoBc6Gu4yWqC+giP807YBqtUa0vXh7xodhZI5all2CicZ 69NR9ocsw1YD6peOuUrEMa96wSJl9SWHLeu10UPkWZDQXa0vkIQXLlI4oKghEQW4q/mk 0VbHPjkLq6fWD9yoKoi77B74ip6ikpoEWh7Cu/kDpnVaRHhh1SEUG3OyByuBapXuZKlc h6Omd1qHX5cRPjph21xYf32uBB9aolXGMO9aaRP1lA0SckfAOSKlKIUdDjP5F+hYmcWk 55VA== X-Forwarded-Encrypted: i=1; AJvYcCWdmXayfjBy9IAL03Tu7I/hKjUb9izMUiKE/q4Qyel61zoFVh8XeI80Z02Ael2TUE1F+KLX6GrI7oe7AGvMjfPVVZEG+Ld1OYhwX/1Tn6OSD6t+T5w= X-Gm-Message-State: AOJu0YwJj86LUdqmmx5MRLFbPmEnKYLBN5FQSgRqZ5Dqoe8ehA7aiviE +h1ZYFXIx3sNRX/Tk5BGboZk2oP/ur9fbwpw8Oum2cjEZYHfKp3FojjPWP4dQHs= X-Google-Smtp-Source: AGHT+IEYT0gC2VTZYS2sf8gfKkEAnenEHDXxurHyzMbwt0lUKt7Uw0JJq9+GvaJQa3SRamrYdVWDxQ== X-Received: by 2002:a54:4887:0:b0:3da:a6ce:f02c with SMTP id 5614622812f47-3daa6cef4c8mr8226788b6e.20.1720910123980; Sat, 13 Jul 2024 15:35:23 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:d7fc:57d0:ada6:13b7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fc0bc4d9d8sm14640025ad.264.2024.07.13.15.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 15:35:23 -0700 (PDT) From: Drew Fustini Date: Sat, 13 Jul 2024 15:35:11 -0700 Subject: [PATCH RFC net-next 2/4] dt-bindings: net: add T-HEAD dwmac support MIME-Version: 1.0 Message-Id: <20240713-thead-dwmac-v1-2-81f04480cd31@tenstorrent.com> References: <20240713-thead-dwmac-v1-0-81f04480cd31@tenstorrent.com> In-Reply-To: <20240713-thead-dwmac-v1-0-81f04480cd31@tenstorrent.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Jisheng Zhang , Maxime Coquelin , Emil Renner Berthing , Drew Fustini , Guo Ren , Fu Wei , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720910119; l=3679; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=Y0E8nHMS0ChuTKJIO/9LY9pitgmvEOTz6OdEh2EGJdM=; b=CnXpDka3RYSnvNevDmDeEY3cdh4Cuclhx83gpRYciYZPaW7Lncl7HiKfGGZ+vf+vL/6bKiiAg NqzeNosEJGHCjNVVRAFPPUyhZ9vKonMP2wKOgI5NMbo4mgJUTSUKo60 X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_153525_174906_C78C7695 X-CRM114-Status: GOOD ( 14.12 ) 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 From: Jisheng Zhang Add documentation to describe T-HEAD dwmac. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/20230827091710.1483-3-jszhang@kernel.org Signed-off-by: Emil Renner Berthing [drew: change apb registers from syscon to second reg of gmac node] Signed-off-by: Drew Fustini --- .../devicetree/bindings/net/snps,dwmac.yaml | 1 + .../devicetree/bindings/net/thead,dwmac.yaml | 81 ++++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 83 insertions(+) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 0ad3bf5dafa7..d417f0e2d9c6 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -97,6 +97,7 @@ properties: - snps,dwxgmac-2.10 - starfive,jh7100-dwmac - starfive,jh7110-dwmac + - thead,th1520-dwmac reg: minItems: 1 diff --git a/Documentation/devicetree/bindings/net/thead,dwmac.yaml b/Documentation/devicetree/bindings/net/thead,dwmac.yaml new file mode 100644 index 000000000000..5618ede47925 --- /dev/null +++ b/Documentation/devicetree/bindings/net/thead,dwmac.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/thead,dwmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: T-HEAD DWMAC Ethernet controller + +maintainers: + - Jisheng Zhang + +select: + properties: + compatible: + contains: + enum: + - thead,th1520-dwmac + required: + - compatible + +properties: + compatible: + items: + - enum: + - thead,th1520-dwmac + - const: snps,dwmac-3.70a + + reg: + minItems: 2 + maxItems: 2 + items: + - description: DesignWare GMAC IP core registers + - description: GMAC APB registers + + reg-names: + minItems: 2 + maxItems: 2 + items: + - const: dwmac + - const: apb + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + - phy-mode + +allOf: + - $ref: snps,dwmac.yaml# + +unevaluatedProperties: false + +examples: + - | + gmac0: ethernet@e7070000 { + compatible = "thead,th1520-dwmac", "snps,dwmac-3.70a"; + reg = <0xe7070000 0x2000>, <0xec003000 0x1000>; + reg-names = "dwmac", "apb"; + clocks = <&clk 1>, <&clk 2>; + clock-names = "stmmaceth", "pclk"; + interrupts = <66>; + interrupt-names = "macirq"; + phy-mode = "rgmii-id"; + snps,fixed-burst; + snps,axi-config = <&stmmac_axi_setup>; + snps,pbl = <32>; + phy-handle = <&phy0>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index e1736969189b..c724c2c4e06c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19319,6 +19319,7 @@ M: Fu Wei L: linux-riscv@lists.infradead.org S: Maintained F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml +F: Documentation/devicetree/bindings/net/thead,dwmac.yaml F: arch/riscv/boot/dts/thead/ F: drivers/clk/thead/clk-th1520-ap.c F: include/dt-bindings/clock/thead,th1520-clk-ap.h