Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9825936ybi; Wed, 10 Jul 2019 18:00:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdUPFWlxajFajl4fdMlpmfegx4QDeMOs39Wv5sFf9Tk63fpBcMr3ARV1eFh2Ne8LcNJIua X-Received: by 2002:a65:6102:: with SMTP id z2mr1232215pgu.391.1562806859358; Wed, 10 Jul 2019 18:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562806859; cv=none; d=google.com; s=arc-20160816; b=YE3SmrB0rVHpD3HTNKFxo89Vwn9VXL94XQxI8uacSUnMX6ygvWFhntghDVxOa2rwDo aD9fvgc7pj75R/ufQ5uG8G9BP0dIahR4N/dKokTsRQTmhmmsgzCxBxMJfVoNkCNDiNKL pfe1K+XT1E5bD1lMI4OUmguo/430Tn9oC0BwKVb+uTd8UCbWSnsE7HlpkRVnjicq5rNK IAdsVhU1/RCyjSKctR9DG+JLRn+nHqx/H0+uWC0dE8MywpcTrjGJDcATcDn6YqdRJkfy c9U6B6j8B/kQ7dT+t0Otk4TfFqKv64fXZOeBdQfm0zGu77LQC+nAaREo2wFxsXvXlNGF vCRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=oNe9eio8XYT1BZ4ZF/+0zEh/gS2//e+l2qNxRtVLoLs=; b=obujD7tdC8fqSAZd3ZaJOZPCs80KAfZt6f/6C2SYN17rUXVXTQvKMLgHl60ybpGq0Q lMiB85RIlBFX8uDIcloN5+npBZW3pm3pNImH6dy3vudx8/j13AJ6p5yVlSZCoelKNxvJ +eEjEBV/LaxYzNKHAZwXYUXm8aKHa/lo1ajn9cPsATkagonwKamZ4rjlr+fAWpH+Mj05 VgfsrezfKg6Aw3m8B9DQnr6GuHxgJMxAGe4IsU0T3f8Gx+NvO6Qj5FTRhBs3ZyMPW7Tc pyOhRGfoa52AmC/Vuht+/T15xmePXYwzA5vG17/gxEQ+FK7688UhMRhw3v/HE+h9wWCY bfFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=aHdt9kG3; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="I/65hYuq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 188si3681005pgd.404.2019.07.10.18.00.31; Wed, 10 Jul 2019 18:00:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=aHdt9kG3; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="I/65hYuq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbfGKA4i (ORCPT + 99 others); Wed, 10 Jul 2019 20:56:38 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:33031 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727659AbfGKA4i (ORCPT ); Wed, 10 Jul 2019 20:56:38 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id C158EBA1; Wed, 10 Jul 2019 20:56:34 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Wed, 10 Jul 2019 20:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=oNe9eio8XYT1BZ4ZF/+0zEh/gS2//e+ l2qNxRtVLoLs=; b=aHdt9kG3CNNk/uJNVaKK+zTZTYd4G2PBndNMU3gfzXo3K8a H793vKvHpSsnsJAc2+SKuNPiw+aOx+rfHrSZXKLZD1C30e+EbB10RphqxX0mM0p7 SWHCucYCRZQH3lcTXVq1C0V5JdOP6jhe6GN38FQiBfZCYTNaO/wJOElWgQ26lMoP Vjuq4NX70Cc0ihAB5bD93RD3o84lCTNPB2wrytWuqOfH7XcoojwrjAF8yrEhK30q 60fJqLau8FubRMml3YZiWGSlqtunOHSy6b12Lk3eQubDHrz46VGNKQYmwX1YxSV+ 450qZDGvD9Q0dcvxKpalpkFkE+SXeHiAp2WBL4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=oNe9ei o8XYT1BZ4ZF/+0zEh/gS2//e+l2qNxRtVLoLs=; b=I/65hYuq2zmn5keq+6C8PH NxwdkOpfvf1nyNERs9UJOWKby6CQftNAf4LvRRAnnWhaXBoCrHzlrCi1GUjTv9XH 0OTvkchXsDFEo2zz0spJWg0hmKRr0qyqSlNlKNZqIkAN0kC5zCiVPzWaDVo88KMp WzvkSivVALoHRvU1/MkAZtYbr/T8nRw6xRpBHJahFqlAxtfAE6agadB6hoorcXvh J77GmLUM/FCzPx8XMJV8HgrnSGdZJPR2O4hWf2mVhjhHXQFUlBorVE4rbarjRBkF 1yjwPtcAuViFAVQDdUhBTAfJWWCzYh4TpytmwFrZILcWU893ypf1k87dCJYelFaA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeejgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedftehnughr vgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucffohhmrg hinhepuggvvhhitggvthhrvggvrdhorhhgnecurfgrrhgrmhepmhgrihhlfhhrohhmpegr nhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 925B3E0162; Wed, 10 Jul 2019 20:56:33 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-731-g19d3b16-fmstable-20190627v1 Mime-Version: 1.0 Message-Id: <3b0788cf-eee4-48b2-901d-d2ab6716ab1b@www.fastmail.com> In-Reply-To: References: <20190710141611.21159-1-andrew@aj.id.au> <20190710141611.21159-2-andrew@aj.id.au> Date: Thu, 11 Jul 2019 10:26:39 +0930 From: "Andrew Jeffery" To: "Rob Herring" Cc: linux-mmc , "Ulf Hansson" , "Mark Rutland" , "Joel Stanley" , "Adrian Hunter" , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-aspeed@lists.ozlabs.org, "linux-kernel@vger.kernel.org" , "Ryan Chen" Subject: Re: [PATCH 1/2] dt-bindings: mmc: Document Aspeed SD controller Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Jul 2019, at 01:20, Rob Herring wrote: > On Wed, Jul 10, 2019 at 8:16 AM Andrew Jeffery wrote: > > > > The ASPEED SD/SDIO/eMMC controller exposes two slots implementing the > > SDIO Host Specification v2.00, with 1 or 4 bit data buses, or an 8 bit > > data bus if only a single slot is enabled. > > > > Signed-off-by: Andrew Jeffery > > --- > > .../bindings/mmc/sdhci-of-aspeed.yaml | 91 +++++++++++++++++++ > > aspeed,sdhci.yaml Ack. Previously I had separate documents for different compatibles, wasn't sure how to tackle name one document covering multiple compatibles. > > > 1 file changed, 91 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/mmc/sdhci-of-aspeed.yaml > > > > diff --git a/Documentation/devicetree/bindings/mmc/sdhci-of-aspeed.yaml b/Documentation/devicetree/bindings/mmc/sdhci-of-aspeed.yaml > > new file mode 100644 > > index 000000000000..e98a2ac4d46d > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/mmc/sdhci-of-aspeed.yaml > > @@ -0,0 +1,91 @@ > > +# SPDX-License-Identifier: GPL-2.0-or-later > > The preferred license is (GPL-2.0 OR BSD-2-Clause) if that is okay with you. I should poke people internally again, I had asked, just haven't got a clear answer. What was the justification for the preference (just so I can pass that on)? > > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/mmc/sdhci-of-aspeed.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: ASPEED SD/SDIO/eMMC Controller > > + > > +maintainers: > > + - Andrew Jeffery > > + - Ryan Chen > > + > > +description: |+ > > + The ASPEED SD/SDIO/eMMC controller exposes two slots implementing the SDIO > > + Host Specification v2.00, with 1 or 4 bit data buses, or an 8 bit data bus if > > + only a single slot is enabled. > > + > > + The two slots are supported by a common configuration area. As the SDHCIs for > > + the slots are dependent on the common configuration area, they are described > > + as child nodes. > > + > > +properties: > > + compatible: > > + enum: [ aspeed,ast2400-sdc, aspeed,ast2500-sdc ] > > + reg: > > + description: Common configuration registers > > This should have a 'maxItems: 1'. Same for the child reg. Ack. > > > + ranges: true > > + clocks: > > + maxItems: 1 > > + description: The SD/SDIO controller clock gate > > + sdhci: > > This needs to be a pattern (under patternProperties) as these have > unit-addresses. Ah, I didn't think about that. > > > + type: object > > + properties: > > + compatible: > > + allOf: > > + - enum: [ aspeed,ast2400-sdhci, aspeed,ast2500-sdhci ] > > + - const: sdhci > > This condition can never be true. What you need is s/allOf/items/. > However, 'sdhci' is not really a useful compatible because every > implementation has quirks, so I'd drop it. Yeah, I was tossing up whether to include "sdhci". I'll drop it as you suggest. Pity the shorthand doesn't work how I expected. Might explain some of the behaviour I was seeing with the bindings make targets though. > > > + reg: > > + description: The SDHCI registers > > + clocks: > > + maxItems: 1 > > + description: The SD bus clock > > + slot: > > + allOf: > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > + - enum: [0, 1] > > Is this really needed? Offset 0x100 is slot 0 and offset 0x200 is slot > 1. Does that ever change? It doesn't in the SoCs at hand, but the downstream impact (driver implementation) is that you need to derive the slot index from the address and I was trying to avoid that. The slot index influences some bit index calculations. > > > + interrupts: > > + maxItems: 1 > > + description: The SD interrupt shared between both slots > > + required: > > + - compatible > > + - reg > > + - clocks > > + - slot > > + - interrupts > > + > > +required: > > + - compatible > > + - reg > > + - ranges > > + - clocks > > #address-cells and #size-cells are required too. Ack. > > You should also add 'additionalProperties: false' here so other random > properties can't be present. Ah yes. Will fix. > > > + > > +examples: > > + - | > > + #include > > + sdc@1e740000 { > > + compatible = "aspeed,ast2500-sdc"; > > + reg = <0x1e740000 0x100>; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges; > > It's preferred to limit the range here and then the child addresses > are 0x100 and 0x200. Okay. Was just trying to dodge mental arithmetic where I could, but if that's the preference then I'll fix it up. Thanks for the review! Andrew > > > + clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; > > + > > + sdhci0: sdhci@1e740100 { > > + compatible = "aspeed,ast2500-sdhci", "sdhci"; > > + reg = <0x1e740100 0x100>; > > + slot = <0>; > > + interrupts = <26>; > > + sdhci,auto-cmd12; > > + clocks = <&syscon ASPEED_CLK_SDIO>; > > + }; > > + > > + sdhci1: sdhci@1e740200 { > > + compatible = "aspeed,ast2500-sdhci", "sdhci"; > > + reg = <0x1e740200 0x100>; > > + slot = <1>; > > + interrupts = <26>; > > + sdhci,auto-cmd12; > > + clocks = <&syscon ASPEED_CLK_SDIO>; > > + }; > > + }; > > -- > > 2.20.1 > > >