devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: "Jens Axboe" <axboe@kernel.dk>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Simon Glass" <sjg@chromium.org>,
	"INAGAKI Hiroshi" <musashino.open@gmail.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	"Christian Brauner" <brauner@kernel.org>,
	"Li Lingfeng" <lilingfeng3@huawei.com>,
	"Christian Heusel" <christian@heusel.eu>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	linux-block@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org,
	"Lorenzo Bianconi" <lorenzo@kernel.org>
Subject: Re: [RFC PATCH v2 4/5] dt-bindings: block: Generalize and introduce property for partitions
Date: Thu, 26 Sep 2024 09:03:51 -0500	[thread overview]
Message-ID: <20240926140351.GA2596132-robh@kernel.org> (raw)
In-Reply-To: <20240925214544.6114-5-ansuelsmth@gmail.com>

On Wed, Sep 25, 2024 at 11:45:24PM +0200, Christian Marangi wrote:
> Generalize property from MTD partitions schema and introduce property for
> block partitions defined in OF.
> 
> Partition schema for block devices is a reduced schema of the MTD as
> only a few property are supported for it. (reg, label and read-only)
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  .../bindings/block/partitions/partition.yaml  | 33 +++++++++++++++++++
>  .../bindings/block/partitions/partitions.yaml | 27 +++++++++++++++
>  .../bindings/mtd/partitions/partition.yaml    | 10 ++----
>  3 files changed, 62 insertions(+), 8 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/block/partitions/partition.yaml
>  create mode 100644 Documentation/devicetree/bindings/block/partitions/partitions.yaml

Partitions are partitions. We don't need them defined in both mtd and 
block. Could perhaps move them to bindings/partitions/, but that's not 
really worth it in my opinion. Just use and add to what's in mtd.

> 
> diff --git a/Documentation/devicetree/bindings/block/partitions/partition.yaml b/Documentation/devicetree/bindings/block/partitions/partition.yaml
> new file mode 100644
> index 000000000000..b9b1d8139e56
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/block/partitions/partition.yaml
> @@ -0,0 +1,33 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/block/partitions/partition.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Partition
> +
> +description: |

Don't need '|' if no formatting.

> +  This binding describes a single flash partition. Each partition must have its
> +  relative offset and size specified. Depending on partition function extra
> +  properties can be used.
> +
> +maintainers:
> +  - Christian Marangi <ansuelsmth@gmail.com>
> +
> +properties:
> +  reg:
> +    description: partition's offset and size within the flash (in sector
> +      block, 512byte)
> +    maxItems: 1
> +
> +  label:
> +    description: The label / name for this partition.
> +
> +  read-only:
> +    description: This parameter, if present, is a hint that this partition
> +      should only be mounted read-only. This is usually used for flash
> +      partitions containing early-boot firmware images or data which should
> +      not be clobbered.
> +    type: boolean
> +
> +additionalProperties: true
> diff --git a/Documentation/devicetree/bindings/block/partitions/partitions.yaml b/Documentation/devicetree/bindings/block/partitions/partitions.yaml
> new file mode 100644
> index 000000000000..9c161aac364d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/block/partitions/partitions.yaml
> @@ -0,0 +1,27 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/block/partitions/partitions.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Partitions
> +
> +description: |
> +  This binding is generic and describes the content of the partitions container
> +  node.
> +
> +maintainers:
> +  - Christian Marangi <ansuelsmth@gmail.com>
> +
> +properties:
> +  '#address-cells':
> +    enum: [1, 2]
> +
> +  '#size-cells':
> +    enum: [1, 2]


Like *all* other 'partitions' nodes, you need a compatible to say what 
kind of partitions you have. It's conceivable that some vendor invented 
their own scheme just like MTD devices.

As I said before, this is just 'fixed-partitions'. If some properties 
aren't supported, that's fine. All the 'align' properties are for 
flashing tools and aren't supported in Linux. 

Rob

  reply	other threads:[~2024-09-26 14:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 21:45 [RFC PATCH v2 0/5] block: partition table OF support Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 1/5] block: add support for defining read-only partitions Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 2/5] docs: block: Document support for read-only partition in cmdline part Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 3/5] block: add support for partition table defined in OF Christian Marangi
2024-09-25 21:45 ` [RFC PATCH v2 4/5] dt-bindings: block: Generalize and introduce property for partitions Christian Marangi
2024-09-26 14:03   ` Rob Herring [this message]
2024-09-25 21:45 ` [RFC PATCH v2 5/5] dt-bindings: mmc: Document support for partition table in mmc-card Christian Marangi
2024-09-26 14:15   ` Rob Herring
2024-09-29 13:13     ` Christian Marangi

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=20240926140351.GA2596132-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=christian@heusel.eu \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@makrotopia.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lilingfeng3@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=musashino.open@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=sjg@chromium.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).