From mboxrd@z Thu Jan 1 00:00:00 1970 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 8A256CEACF3 for ; Wed, 2 Oct 2024 19:09:38 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tbzyW+sDRRpK6lllKWMpnmvz5XjrJna/bWot+7sx8DY=; b=H5Fkmz5lqADlv6FUwAHBig1HDH 6AaeK4iO6mlcbAokkmzXY/N4su9CTWTMX/xlqhFrTR4MJclPiAQU+WNnHDZV19MVb+EWiAYrRkw29 XZBM0676fS3U7/fxSn5MaMSdU6EVP6qJx36OJCbirsKhwjGhFcx3ULT9qQJnD9uMNoeoTs+YSaWzg T7+XDPDrCUEvdvw0U3ya5cs0wLDcwTSPlMZyE2IjRyLzuNJDN07icBBg5UKE2NOHVzJ6kT/NohrPM 1Ut4VigAWvZrkHS62OJXpKxOZz189F00a5WUHejob4LoFBPMjUpP25OJIdGaWxS5uMUEplH3FlTjJ 7QuOYe3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw4j0-00000007HTY-2bO9; Wed, 02 Oct 2024 19:09:26 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sw4hi-00000007HBW-2Hk1 for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 19:08:08 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-71b0d9535c0so160787b3a.2 for ; Wed, 02 Oct 2024 12:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1727896085; x=1728500885; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tbzyW+sDRRpK6lllKWMpnmvz5XjrJna/bWot+7sx8DY=; b=OGfuM/UA8PyiAlammRlG5eYTxLpfTQN85hbCYngPNwMRgOqzN3Lx71maCJs45+2Vrk DC+MueOqz/aVUrsJE80hd0ZtzxYsIsr0zq1yRd7UX2Ont6/V42c6lhvosjHbpw78Zvu4 DghPgcGW1aeiQmpXIF7yD2vALU5VkQzfiYQidSw/GfAyIYe/P3tnXuTSpiAZWK23dy1O cC3f1S2SwGQT/mvjrBW+fe4/2BJ91owotX7hPMrONgbWpuO4YeXthYmABNQ8ZVKLL5q6 iiHzFfodq/Fv7Ea38OFK4gUizfcO2kHsmJTX60ksNRseRBZ28HjhrFj9991wOgJD3QKe z0gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727896085; x=1728500885; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tbzyW+sDRRpK6lllKWMpnmvz5XjrJna/bWot+7sx8DY=; b=ANz2648qsORABPoRBjAlbhCNjr6W9T4wRxTBktqfOl51NSx0MZP81iBlv3JGITa6rW uFxuTsBFCTULJObWlBypVzEo2IVmHTx92Nh9oIogOjKZZVMNpsMmrP9gmtSLCpd/Kgp9 +lfInfV4Pq+RAt0PUPlygld9ONQcy4kJwVzWcAs1nO9VOFosycW8uDTmDw+w55whwA39 NIYMOQe7LSa6qfwPfY9dYAXx0bF/lAkMuA5idPkYxb1oalR/1L0SvfX31PkOUT85zPEv JYVrjQ2ADjtiiB8Ihh3RaU2yYZVx65TVq5KfzwSiZ8Nog18Vh48qTzZtwN4G4nNUaFhT y3aw== X-Forwarded-Encrypted: i=1; AJvYcCVDmwRLMekM44QwfOt1hE4i06Ff70xBvH9Qe7nlDciTYsExMN+S+moHJ7xVMUFTMRBZiOedLXvqQmk2GC3WUmFH@lists.infradead.org X-Gm-Message-State: AOJu0Yw4NsHAHvpcsEbk8ROhvo5WC4tverH3OlxqlHJ5dZuF0whLNP+n ZoPwignqDbPi0XgYodflRw4u0iYr4yaBUEEp55OUj7Qw48pBb4mGzfBEbNbepVo= X-Google-Smtp-Source: AGHT+IH49FhVG/FdEKe1agvTPQLbvm7ADyJ5gNkLx0OIeHvevotL/dXZ9AxuAJmFkwusxbmdI1wPKg== X-Received: by 2002:a05:6a00:c84:b0:718:e162:7374 with SMTP id d2e1a72fcca58-71dc5c4dc5emr6364786b3a.5.1727896085209; Wed, 02 Oct 2024 12:08:05 -0700 (PDT) Received: from x1 (71-34-69-82.ptld.qwest.net. [71.34.69.82]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b265388besm10120808b3a.209.2024.10.02.12.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 12:08:04 -0700 (PDT) Date: Wed, 2 Oct 2024 12:08:03 -0700 From: Drew Fustini To: Krzysztof Kozlowski Cc: "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 , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v3 1/3] dt-bindings: net: Add T-HEAD dwmac support Message-ID: References: <20240930-th1520-dwmac-v3-0-ae3e03c225ab@tenstorrent.com> <20240930-th1520-dwmac-v3-1-ae3e03c225ab@tenstorrent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_120806_615040_1D9C786E X-CRM114-Status: GOOD ( 29.30 ) 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 On Tue, Oct 01, 2024 at 08:58:34AM +0200, Krzysztof Kozlowski wrote: > On Mon, Sep 30, 2024 at 11:23:24PM -0700, Drew Fustini wrote: > > From: Jisheng Zhang > > > > Add documentation to describe the DesginWare-based GMAC controllers in > > the T-HEAD TH1520 SoC. > > > > Signed-off-by: Jisheng Zhang > > Signed-off-by: Emil Renner Berthing > > [drew: rename compatible, add apb registers as second reg of gmac node] > > Signed-off-by: Drew Fustini > > --- > > .../devicetree/bindings/net/snps,dwmac.yaml | 1 + > > .../devicetree/bindings/net/thead,th1520-gmac.yaml | 97 ++++++++++++++++++++++ > > MAINTAINERS | 1 + > > 3 files changed, 99 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > index 4e2ba1bf788c..474ade185033 100644 > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > @@ -99,6 +99,7 @@ properties: > > - snps,dwxgmac-2.10 > > - starfive,jh7100-dwmac > > - starfive,jh7110-dwmac > > + - thead,th1520-gmac > > > > reg: > > minItems: 1 > > diff --git a/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml > > new file mode 100644 > > index 000000000000..fef1810b10c4 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml > > @@ -0,0 +1,97 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/thead,th1520-gmac.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: T-HEAD TH1520 GMAC Ethernet controller > > + > > +maintainers: > > + - Drew Fustini > > + > > +description: | > > + The TH1520 GMAC is described in the TH1520 Peripheral Interface User Manual > > + https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/docs > > + > > + Features include > > + - Compliant with IEEE802.3 Specification > > + - IEEE 1588-2008 standard for precision networked clock synchronization > > + - Supports 10/100/1000Mbps data transfer rate > > + - Supports RGMII/MII interface > > + - Preamble and start of frame data (SFD) insertion in Transmit path > > + - Preamble and SFD deletion in the Receive path > > + - Automatic CRC and pad generation options for receive frames > > + - MDIO master interface for PHY device configuration and management > > + > > + The GMAC Registers consists of two parts > > + - APB registers are used to configure clock frequency/clock enable/clock > > + direction/PHY interface type. > > + - AHB registers are use to configure GMAC core (DesignWare Core part). > > + GMAC core register consists of DMA registers and GMAC registers. > > + > > +select: > > + properties: > > + compatible: > > + contains: > > + enum: > > + - thead,th1520-gmac > > + required: > > + - compatible > > + > > +allOf: > > + - $ref: snps,dwmac.yaml# > > + > > +properties: > > + compatible: > > + items: > > + - enum: > > + - thead,th1520-gmac > > + - const: snps,dwmac-3.70a > > + > > + reg: > > + items: > > + - description: DesignWare GMAC IP core registers > > + - description: GMAC APB registers > > + > > + reg-names: > > + items: > > + - const: dwmac > > + - const: apb > > I don't get why none of snps,dwmac properties are restricted. How many > interrupts do you have here? How many clocks? resets? Thanks for pointing this out. Yes, I forgot to document the clocks, interrupts and resets. There needs to be 2 clocks (stmmaceth and pclk). There also needs to be 2 resets: each GMAC has a reset plus a seperate reset for the GMAC AXI interface. There is 1 interrupt (macirq) but it is optional. The BeagleV Ahead uses it but the LicheePi 4A does not use the interrupt. However, I'm uncertain about how to restrict the snps,dwmac properties. I see that starfive,jh7110-dwmac.yaml has the following logic. Should I be adding something like this to restrict the snps,dwmac properties? --------------------------------------------------------------------- allOf: - $ref: snps,dwmac.yaml# - if: properties: compatible: contains: const: starfive,jh7100-dwmac then: properties: interrupts: minItems: 2 maxItems: 2 interrupt-names: minItems: 2 maxItems: 2 resets: maxItems: 1 reset-names: const: ahb --------------------------------------------------------------------- > > > + > > +required: > > + - compatible > > + - reg > > + - clocks > > + - clock-names > > + - interrupts > > Drop Will do. > > > + - interrupt-names > > Drop Will do. > > > + - phy-mode > > + > > +unevaluatedProperties: false > > Best regards, > Krzysztof Thanks for your review, Drew