devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Daniel Golle <daniel@makrotopia.org>
Cc: "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Dave Chinner" <dchinner@redhat.com>, "Jan Kara" <jack@suse.cz>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Christian Brauner" <brauner@kernel.org>,
	"Li Lingfeng" <lilingfeng3@huawei.com>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	"Min Li" <min15.li@samsung.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Hannes Reinecke" <hare@suse.de>,
	"Christian Loehle" <CLoehle@hyperstone.com>,
	"Avri Altman" <avri.altman@wdc.com>,
	"Bean Huo" <beanhuo@micron.com>, "Yeqi Fu" <asuk4.q@gmail.com>,
	"Victor Shih" <victor.shih@genesyslogic.com.tw>,
	"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
	"Ricardo B. Marliere" <ricardo@marliere.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-block@vger.kernel.org,
	"Diping Zhang" <diping.zhang@gl-inet.com>,
	"Jianhui Zhao" <zhaojh329@gmail.com>,
	"Jieying Zeng" <jieying.zeng@gl-inet.com>,
	"Chad Monroe" <chad.monroe@adtran.com>,
	"Adam Fox" <adam.fox@adtran.com>,
	"John Crispin" <john@phrozen.org>
Subject: Re: [RFC PATCH v2 1/8] dt-bindings: block: add basic bindings for block devices
Date: Thu, 7 Mar 2024 08:51:02 -0600	[thread overview]
Message-ID: <20240307145102.GA2550133-robh@kernel.org> (raw)
In-Reply-To: <f70bb480aef6f55228a25ce20ff0e88e670e1b70.1709667858.git.daniel@makrotopia.org>

On Tue, Mar 05, 2024 at 08:23:20PM +0000, Daniel Golle wrote:
> Add bindings for block devices which are used to allow referencing
> nvmem bits on them.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>  .../bindings/block/block-device.yaml          | 22 ++++++++
>  .../devicetree/bindings/block/partition.yaml  | 51 +++++++++++++++++++
>  .../devicetree/bindings/block/partitions.yaml | 20 ++++++++
>  3 files changed, 93 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/block/block-device.yaml
>  create mode 100644 Documentation/devicetree/bindings/block/partition.yaml
>  create mode 100644 Documentation/devicetree/bindings/block/partitions.yaml
> 
> diff --git a/Documentation/devicetree/bindings/block/block-device.yaml b/Documentation/devicetree/bindings/block/block-device.yaml
> new file mode 100644
> index 0000000000000..c83ea525650ba
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/block/block-device.yaml
> @@ -0,0 +1,22 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/block/block-device.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: block storage device
> +
> +description: |
> +  This binding is generic and describes a block-oriented storage device.
> +
> +maintainers:
> +  - Daniel Golle <daniel@makrotopia.org>
> +
> +properties:
> +  partitions:
> +    $ref: /schemas/block/partitions.yaml
> +
> +  nvmem-layout:
> +    $ref: /schemas/nvmem/layouts/nvmem-layout.yaml#
> +
> +unevaluatedProperties: false
> diff --git a/Documentation/devicetree/bindings/block/partition.yaml b/Documentation/devicetree/bindings/block/partition.yaml
> new file mode 100644
> index 0000000000000..df561dd33cbc9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/block/partition.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/block/partition.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Partition on a block device
> +
> +description: |
> +  This binding describes a partition on a block storage device.
> +  Partitions may be matched by a combination of partition number, name,
> +  and UUID.
> +
> +maintainers:
> +  - Daniel Golle <daniel@makrotopia.org>
> +
> +properties:
> +  $nodename:
> +    pattern: '^block-partition-.+$'
> +
> +  partnum:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Matches partition by number if present.
> +
> +  partname:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description:
> +      Matches partition by PARTNAME if present.

Why do we need something new here? The existing fixed-partitions can 
already define block device partitions. It just matches by 
address/offset which works whether its MBR or GPT. Also, in DT we always 
have an address when there is an address.

I'm sure you want to statically define this and have it work even if the 
partitions move, but sorry...

> +
> +  uuid:
> +    $ref: /schemas/types.yaml#/definitions/string
> +    description:
> +      Matches partition by PARTUUID if present.

If this remains it will need some work in the dtschema tools. The reason 
is json-schema already has support for UUIDs as a defined 'format' key 
value and we should use that.

> +
> +  nvmem-layout:
> +    $ref: /schemas/nvmem/layouts/nvmem-layout.yaml#
> +    description:
> +      This container may reference an NVMEM layout parser.
> +
> +anyOf:
> +  - required:
> +      - partnum
> +
> +  - required:
> +      - partname
> +
> +  - required:
> +      - uuid
> +
> +unevaluatedProperties: false

  parent reply	other threads:[~2024-03-07 14:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 20:23 [RFC PATCH v2 0/8] nvmem: add block device NVMEM provider Daniel Golle
2024-03-05 20:23 ` [RFC PATCH v2 1/8] dt-bindings: block: add basic bindings for block devices Daniel Golle
2024-03-06  7:22   ` Sascha Hauer
2024-03-06  7:32     ` Sascha Hauer
2024-03-07 14:51   ` Rob Herring [this message]
2024-03-11 19:40     ` [EXTERNAL] " Chad Monroe
2024-03-05 20:23 ` [RFC PATCH v2 2/8] block: partitions: populate fwnode Daniel Golle
2024-03-05 20:23 ` [RFC PATCH v2 3/8] block: add new genhd flag GENHD_FL_NVMEM Daniel Golle
2024-03-05 20:23 ` [RFC PATCH v2 4/8] block: implement NVMEM provider Daniel Golle
2024-03-06 12:00   ` Ricardo B. Marliere
2024-03-05 20:24 ` [RFC PATCH v2 5/8] dt-bindings: mmc: mmc-card: add block device nodes Daniel Golle
2024-03-05 20:24 ` [RFC PATCH v2 6/8] mmc: core: set card fwnode_handle Daniel Golle
2024-03-08  8:04   ` Avri Altman
2024-03-08 14:55     ` Daniel Golle
2024-03-05 20:24 ` [RFC PATCH v2 7/8] mmc: block: set fwnode of disk devices Daniel Golle
2024-03-05 20:24 ` [RFC PATCH v2 8/8] mmc: block: set GENHD_FL_NVMEM Daniel Golle
2024-03-12 12:22 ` [RFC PATCH v2 0/8] nvmem: add block device NVMEM provider Ulf Hansson
2024-03-12 12:30   ` Daniel Golle
2024-03-12 12:57     ` Ulf Hansson
2024-03-12 13:12       ` Daniel Golle
2024-03-13 10:19         ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240307145102.GA2550133-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=CLoehle@hyperstone.com \
    --cc=adam.fox@adtran.com \
    --cc=adrian.hunter@intel.com \
    --cc=asuk4.q@gmail.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=brauner@kernel.org \
    --cc=chad.monroe@adtran.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=dchinner@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=diping.zhang@gl-inet.com \
    --cc=dlemoal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=jack@suse.cz \
    --cc=jieying.zeng@gl-inet.com \
    --cc=john@phrozen.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lilingfeng3@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=min15.li@samsung.com \
    --cc=ricardo@marliere.net \
    --cc=ulf.hansson@linaro.org \
    --cc=victor.shih@genesyslogic.com.tw \
    --cc=zhaojh329@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).