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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_NEOMUTT autolearn=ham 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 10B6EC072B5 for ; Fri, 24 May 2019 09:05:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CEA5F2175B for ; Fri, 24 May 2019 09:05:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tts1P4pJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEA5F2175B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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=Hv4ACMyzQx5qMN6h5KS0PM47k4xS76GuQ25lOYzWmP4=; b=Tts1P4pJMaZvUaWo3LI/6ccNv j65YwncRJPXmo0C2/wBusOxauInH7lTaauDnfy3JJrj/2iDfzb1oNXAvxZCTPYlyUU1uCe4V+4S2P sRheMVp9XsNlpmvsEgCkyMRmHR8kqDOY0Uufdx7EWkVMquhUG6ZhkjYs7MgouEeEAHWYfo3PdaKpx jFwtx0fOxrbPRkrltIfQ8j23Nhet+UiN99CpXK4cCD9Wt6Gh2jWUatrKTuz6wE6pYdKhvrwMK9OMl jk4oocfM/05mxt3Hj4srHVayG3SxN4V7uXPG4RFOErD9vJWaSS2ftep7DjiH2YvcSIua7Ha94baJp jues6tkzQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hU697-0007se-Uc; Fri, 24 May 2019 09:05:49 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hU694-0007kk-6U for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2019 09:05:48 +0000 X-Originating-IP: 90.88.147.134 Received: from localhost (aaubervilliers-681-1-27-134.w90-88.abo.wanadoo.fr [90.88.147.134]) (Authenticated sender: maxime.ripard@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id B1F24C0017; Fri, 24 May 2019 09:05:29 +0000 (UTC) Date: Fri, 24 May 2019 11:05:29 +0200 From: Maxime Ripard To: Rob Herring Subject: Re: [PATCH 6/8] dt-bindings: net: stmmac: Convert the binding to a schemas Message-ID: <20190524090529.bvjzapgy35pfcow5@flea> References: <74d98cc3c744d53710c841381efd41cf5f15e656.1558605170.git-series.maxime.ripard@bootlin.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190524_020546_542771_D45A1539 X-CRM114-Status: GOOD ( 33.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Alexandre Torgue , Antoine =?utf-8?Q?T=C3=A9nart?= , netdev , linux-stm32@st-md-mailman.stormreply.com, Chen-Yu Tsai , Maxime Coquelin , Maxime Chevallier , Frank Rowand , "David S . Miller" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: multipart/mixed; boundary="===============0911238722039913348==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0911238722039913348== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="feqnt36fgpyz3hlk" Content-Disposition: inline --feqnt36fgpyz3hlk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Rob, On Thu, May 23, 2019 at 10:33:05AM -0500, Rob Herring wrote: > On Thu, May 23, 2019 at 4:57 AM Maxime Ripard wrote: > > > > Switch the STMMAC / Synopsys DesignWare MAC controller binding to a YAML > > schema to enable the DT validation. > > You picked an easy one. ;) Yeah, that's what happens when you run out of trivial bindings, you end up with only the hard ones left to work on :) > > Signed-off-by: Maxime Ripard > > --- > > Documentation/devicetree/bindings/net/snps,dwmac.yaml | 344 +++++++++++- > > Documentation/devicetree/bindings/net/stmmac.txt | 179 +------ > > 2 files changed, 345 insertions(+), 178 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/net/snps,dwmac.yaml > > > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > new file mode 100644 > > index 000000000000..be3ada5121e1 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > @@ -0,0 +1,344 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/snps,dwmac.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Synopsys DesignWare MAC Device Tree Bindings > > + > > +maintainers: > > + - Alexandre Torgue > > + - Giuseppe Cavallaro > > + - Jose Abreu > > + > > +properties: > > + compatible: > > + oneOf: > > + - const: snps,dwmac > > + - const: snps,dwmac-3.50a > > + - const: snps,dwmac-3.610 > > + - const: snps,dwmac-3.70a > > + - const: snps,dwmac-3.710 > > + - const: snps,dwmac-4.00 > > + - const: snps,dwmac-4.10a > > + - const: snps,dwxgmac > > + - const: snps,dwxgmac-2.10 > > + - const: st,spear600-gmac > > + description: Deprecated > > Like the other, just make this an enum. Ack. I did this initially because the sun8i-emac bindings also have multiple compatibles we can use, and thus I needed an items here, but since we will move them away in separate files, we can just use an enum (with a contains). > Though, what to do on deprecated things? If we expect dts files to be > updated, then we should remove or disallow in the schema (e.g. 'prop: > false' for properties). Oh, so that's what the false are here for. I wanted to send a PR to the meta-schemas because *-gpio was not working, and that binding uses one, but I guess that solves it. For the deprecation process, I haven't made up my mind yet. We could put in comment the deprecated properties and compatibles, but that has two significant drawbacks: - for the compatibles, we wouldn't have the nodes with a deprecated compatible validated, and thus we wouldn't even have a warning that our compatible is deprecated in the first place. And any property we might have not used properly will be ignored as well. - for the other properties, it's still pretty hard to disable additionalProperties, so any deprecated property wouldn't be validated if they were in a comment, and we wouldn't have a warning either if additionalProperties is true, because we tolerate them. I guess we can workaround the first one with a custom select that has all the supported compatibles (including the deprecated ones), but only list the non-deprecated options in the compatible properties. I don't really see a solution for the second one. > The issue with updating dts files, is it may break old kernels with > new dtbs. While this is something that is mentionned by some people, and I can see how it's problematic to some, it's also something we never really committed to, so I'm fine with that. > > + snps,axi-config: > > + $ref: /schemas/types.yaml#definitions/phandle > > + description: > > + AXI BUS Mode parameters. Phandle to a node that can contain the > > + following properties > > + * snps,lpi_en, enable Low Power Interface > > + * snps,xit_frm, unlock on WoL > > + * snps,wr_osr_lmt, max write outstanding req. limit > > + * snps,rd_osr_lmt, max read outstanding req. limit > > + * snps,kbbe, do not cross 1KiB boundary. > > + * snps,blen, this is a vector of supported burst length. > > + * snps,fb, fixed-burst > > + * snps,mb, mixed-burst > > + * snps,rb, rebuild INCRx Burst > > This obviously needs its own schema, but that can come latter. I haven't been able to describe a node that doesn't have any particular copmatible or node name, but we just need to follow a phandle. How could we do this? > > + snps,reset-gpio: > > + description: > > + PHY Reset GPIO > > maxItems: 1 > > > + > > + snps,reset-active-low: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Indicates that the PHY Reset is active low > > Would be nice to deprecate these 2 properties for just 'reset-gpios'. > Though really, this should be in the phy node as this is a phy reset. The PHYs already have such a property, so we should just deprecate them. > > + > > + snps,reset-delay-us: > > + allOf: > > + - $ref: /schemas/types.yaml#definitions/uint32-array > > + - minItems: 3 > > + maxItems: 3 > > + description: > > + Triplet of delays. The 1st cell is reset pre-delay in micro > > + seconds. The 2nd cell is reset pulse in micro seconds. The 3rd > > + cell is reset post-delay in micro seconds. And this one too I guess? > > + snps,aal: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Use Address-Aligned Beats > > + > > + snps,fixed-burst: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Program the DMA to use the fixed burst mode > > + > > + snps,mixed-burst: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Program the DMA to use the mixed burst mode > > + > > + snps,force_thresh_dma_mode: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Force DMA to use the threshold mode for both tx and rx > > + > > + snps,force_sf_dma_mode: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Force DMA to use the Store and Forward mode for both tx and > > + rx. This flag is ignored if force_thresh_dma_mode is set. > > + > > + snps,en-tx-lpi-clockgating: > > + $ref: /schemas/types.yaml#definitions/flag > > + description: > > + Enable gating of the MAC TX clock during TX low-power mode > > + > > + snps,multicast-filter-bins: > > + $ref: /schemas/types.yaml#definitions/uint32 > > + description: > > + Number of multicast filter hash bins supported by this device > > + instance > > + > > + snps,perfect-filter-entries: > > + $ref: /schemas/types.yaml#definitions/uint32 > > + description: > > + Number of perfect filter entries supported by this device > > + instance > > + > > + snps,ps-speed: > > + $ref: /schemas/types.yaml#definitions/uint32 > > + description: > > + Port selection speed that can be passed to the core when PCS > > + is supported. For example, this is used in case of SGMII and > > + MAC2MAC connection. > > + > > + mdio: > > + type: object > > + description: > > + Creates and registers an MDIO bus. > > + > > + properties: > > + compatible: > > + const: snps,dwmac-mdio > > required? Yep, I'll add it. Thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --feqnt36fgpyz3hlk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXOez2QAKCRDj7w1vZxhR xe/NAPwPdSE4B39GjzI0+sjp0j/vK4Hlg4A+3uLLJjEAO/CpowD/cRbzLnJfLN2U cEJXc12nJ54M6GHljxzLwfapQynBkQU= =sFc+ -----END PGP SIGNATURE----- --feqnt36fgpyz3hlk-- --===============0911238722039913348== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0911238722039913348==--