All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Cc: <tudor.ambarus@linaro.org>,  <michael@walle.cc>,
	 <broonie@kernel.org>, <pratyush@kernel.org>,  <richard@nod.at>,
	 <vigneshr@ti.com>, <robh@kernel.org>,  <conor+dt@kernel.org>,
	 <krzk+dt@kernel.org>, <venkatesh.abbarapu@amd.com>,
	 <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	 <linux-mtd@lists.infradead.org>, <nicolas.ferre@microchip.com>,
	 <alexandre.belloni@bootlin.com>, <claudiu.beznea@tuxon.dev>,
	 <michal.simek@amd.com>, <linux-arm-kernel@lists.infradead.org>,
	 <alsa-devel@alsa-project.org>, <patches@opensource.cirrus.com>,
	 <git@amd.com>, <amitrkcian2002@gmail.com>,  <beanhuo@micron.com>
Subject: Re: [RFC PATCH 1/2] dt-bindings: mtd: Add bindings for describing concatinated MTD devices
Date: Mon, 18 Nov 2024 14:27:21 +0100	[thread overview]
Message-ID: <87frnoy8na.fsf@bootlin.com> (raw)
In-Reply-To: <20241026075347.580858-2-amit.kumar-mahapatra@amd.com> (Amit Kumar Mahapatra's message of "Sat, 26 Oct 2024 13:23:46 +0530")

On 26/10/2024 at 13:23:46 +0530, Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> wrote:

> This approach was suggested by Rob [1] during a discussion on Miquel's
> initial approach [2] to extend the MTD-CONCAT driver to support stacked
> memories.
> Define each flash node separately with its respective partitions, and add
> a 'concat-parts' binding to link the partitions of the two flash nodes that
> need to be concatenated.
>
> flash@0 {
>         compatible = "jedec,spi-nor"
>         ...
>                 partitions {

Wrong indentation here and below which makes the example hard to read.

>                 compatible = "fixed-partitions";
>                         concat-partition = <&flash0_partition &flash1_partition>;
>                         flash0_partition: partition@0 {
>                                 label = "part0_0";
>                                 reg = <0x0 0x800000>;
>                         }
>                 }
> }
> flash@1 {
>         compatible = "jedec,spi-nor"
>         ...
>                 partitions {
>                 compatible = "fixed-partitions";
>                         concat-partition = <&flash0_partition &flash1_partition>;
>                         flash1_partition: partition@0 {
>                                 label = "part0_1";
>                                 reg = <0x0 0x800000>;
>                         }
>                 }
> }

This approach has a limitation I didn't think about before: you cannot
use anything else than fixed partitions as partition parser.

> Based on the bindings the MTD-CONCAT driver need to be updated to create
> virtual mtd-concat devices.
>
> [1] https://lore.kernel.org/all/20191118221341.GA30937@bogus/
> [2] https://lore.kernel.org/all/20191113171505.26128-4-miquel.raynal@bootlin.com/
>
> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> ---
>  .../mtd/partitions/fixed-partitions.yaml       | 18 ++++++++++++++++++
>  .../bindings/mtd/partitions/partitions.yaml    |  6 ++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> index 058253d6d889..df4ccb3dfeba 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> @@ -183,3 +183,21 @@ examples:
>              read-only;
>          };
>      };
> +
> +  - |
> +    partitions {
> +        compatible = "fixed-partitions";
> +        #address-cells = <1>;
> +        #size-cells = <1>;

This is not strictly related but I believe we will soon have issues with
these, as we will soon cross the 4GiB boundary.

> +        concat-parts = <&part0 &part1>;
> +
> +        part0: partition@0 {
> +            label = "flash0-part0";
> +            reg = <0x0000000 0x100000>;
> +        };
> +
> +        part1: partition@100000 {
> +            label = "flash1-part0";
> +            reg = <0x0100000 0x200000>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> index 1dda2c80747b..86bbd83c3f6d 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> @@ -32,6 +32,12 @@ properties:
>    '#size-cells':
>      enum: [1, 2]
>  
> +  concat-parts:
> +    description: List of MTD partitions phandles that should be concatenated.
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    minItems: 2
> +    maxItems: 4
> +
>  patternProperties:
>    "^partition(-.+|@[0-9a-f]+)$":
>      $ref: partition.yaml

Fine by me otherwise.

Thanks,
Miquèl

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Cc: alexandre.belloni@bootlin.com, vigneshr@ti.com,
	amitrkcian2002@gmail.com, linux-mtd@lists.infradead.org,
	claudiu.beznea@tuxon.dev, beanhuo@micron.com, git@amd.com,
	robh@kernel.org, richard@nod.at, tudor.ambarus@linaro.org,
	conor+dt@kernel.org, alsa-devel@alsa-project.org,
	broonie@kernel.org, venkatesh.abbarapu@amd.com,
	michal.simek@amd.com, linux-arm-kernel@lists.infradead.org,
	patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
	linux-spi@vger.kernel.org, michael@walle.cc, krzk+dt@kernel.org,
	pratyush@kernel.org
Subject: Re: [RFC PATCH 1/2] dt-bindings: mtd: Add bindings for describing concatinated MTD devices
Date: Mon, 18 Nov 2024 14:27:21 +0100	[thread overview]
Message-ID: <87frnoy8na.fsf@bootlin.com> (raw)
In-Reply-To: <20241026075347.580858-2-amit.kumar-mahapatra@amd.com> (Amit Kumar Mahapatra's message of "Sat, 26 Oct 2024 13:23:46 +0530")

On 26/10/2024 at 13:23:46 +0530, Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> wrote:

> This approach was suggested by Rob [1] during a discussion on Miquel's
> initial approach [2] to extend the MTD-CONCAT driver to support stacked
> memories.
> Define each flash node separately with its respective partitions, and add
> a 'concat-parts' binding to link the partitions of the two flash nodes that
> need to be concatenated.
>
> flash@0 {
>         compatible = "jedec,spi-nor"
>         ...
>                 partitions {

Wrong indentation here and below which makes the example hard to read.

>                 compatible = "fixed-partitions";
>                         concat-partition = <&flash0_partition &flash1_partition>;
>                         flash0_partition: partition@0 {
>                                 label = "part0_0";
>                                 reg = <0x0 0x800000>;
>                         }
>                 }
> }
> flash@1 {
>         compatible = "jedec,spi-nor"
>         ...
>                 partitions {
>                 compatible = "fixed-partitions";
>                         concat-partition = <&flash0_partition &flash1_partition>;
>                         flash1_partition: partition@0 {
>                                 label = "part0_1";
>                                 reg = <0x0 0x800000>;
>                         }
>                 }
> }

This approach has a limitation I didn't think about before: you cannot
use anything else than fixed partitions as partition parser.

> Based on the bindings the MTD-CONCAT driver need to be updated to create
> virtual mtd-concat devices.
>
> [1] https://lore.kernel.org/all/20191118221341.GA30937@bogus/
> [2] https://lore.kernel.org/all/20191113171505.26128-4-miquel.raynal@bootlin.com/
>
> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> ---
>  .../mtd/partitions/fixed-partitions.yaml       | 18 ++++++++++++++++++
>  .../bindings/mtd/partitions/partitions.yaml    |  6 ++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> index 058253d6d889..df4ccb3dfeba 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> @@ -183,3 +183,21 @@ examples:
>              read-only;
>          };
>      };
> +
> +  - |
> +    partitions {
> +        compatible = "fixed-partitions";
> +        #address-cells = <1>;
> +        #size-cells = <1>;

This is not strictly related but I believe we will soon have issues with
these, as we will soon cross the 4GiB boundary.

> +        concat-parts = <&part0 &part1>;
> +
> +        part0: partition@0 {
> +            label = "flash0-part0";
> +            reg = <0x0000000 0x100000>;
> +        };
> +
> +        part1: partition@100000 {
> +            label = "flash1-part0";
> +            reg = <0x0100000 0x200000>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> index 1dda2c80747b..86bbd83c3f6d 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> @@ -32,6 +32,12 @@ properties:
>    '#size-cells':
>      enum: [1, 2]
>  
> +  concat-parts:
> +    description: List of MTD partitions phandles that should be concatenated.
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    minItems: 2
> +    maxItems: 4
> +
>  patternProperties:
>    "^partition(-.+|@[0-9a-f]+)$":
>      $ref: partition.yaml

Fine by me otherwise.

Thanks,
Miquèl


WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Cc: <tudor.ambarus@linaro.org>,  <michael@walle.cc>,
	 <broonie@kernel.org>, <pratyush@kernel.org>,  <richard@nod.at>,
	 <vigneshr@ti.com>, <robh@kernel.org>,  <conor+dt@kernel.org>,
	 <krzk+dt@kernel.org>, <venkatesh.abbarapu@amd.com>,
	 <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	 <linux-mtd@lists.infradead.org>, <nicolas.ferre@microchip.com>,
	 <alexandre.belloni@bootlin.com>, <claudiu.beznea@tuxon.dev>,
	 <michal.simek@amd.com>, <linux-arm-kernel@lists.infradead.org>,
	 <alsa-devel@alsa-project.org>, <patches@opensource.cirrus.com>,
	 <git@amd.com>, <amitrkcian2002@gmail.com>,  <beanhuo@micron.com>
Subject: Re: [RFC PATCH 1/2] dt-bindings: mtd: Add bindings for describing concatinated MTD devices
Date: Mon, 18 Nov 2024 14:27:21 +0100	[thread overview]
Message-ID: <87frnoy8na.fsf@bootlin.com> (raw)
In-Reply-To: <20241026075347.580858-2-amit.kumar-mahapatra@amd.com> (Amit Kumar Mahapatra's message of "Sat, 26 Oct 2024 13:23:46 +0530")

On 26/10/2024 at 13:23:46 +0530, Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> wrote:

> This approach was suggested by Rob [1] during a discussion on Miquel's
> initial approach [2] to extend the MTD-CONCAT driver to support stacked
> memories.
> Define each flash node separately with its respective partitions, and add
> a 'concat-parts' binding to link the partitions of the two flash nodes that
> need to be concatenated.
>
> flash@0 {
>         compatible = "jedec,spi-nor"
>         ...
>                 partitions {

Wrong indentation here and below which makes the example hard to read.

>                 compatible = "fixed-partitions";
>                         concat-partition = <&flash0_partition &flash1_partition>;
>                         flash0_partition: partition@0 {
>                                 label = "part0_0";
>                                 reg = <0x0 0x800000>;
>                         }
>                 }
> }
> flash@1 {
>         compatible = "jedec,spi-nor"
>         ...
>                 partitions {
>                 compatible = "fixed-partitions";
>                         concat-partition = <&flash0_partition &flash1_partition>;
>                         flash1_partition: partition@0 {
>                                 label = "part0_1";
>                                 reg = <0x0 0x800000>;
>                         }
>                 }
> }

This approach has a limitation I didn't think about before: you cannot
use anything else than fixed partitions as partition parser.

> Based on the bindings the MTD-CONCAT driver need to be updated to create
> virtual mtd-concat devices.
>
> [1] https://lore.kernel.org/all/20191118221341.GA30937@bogus/
> [2] https://lore.kernel.org/all/20191113171505.26128-4-miquel.raynal@bootlin.com/
>
> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> ---
>  .../mtd/partitions/fixed-partitions.yaml       | 18 ++++++++++++++++++
>  .../bindings/mtd/partitions/partitions.yaml    |  6 ++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> index 058253d6d889..df4ccb3dfeba 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
> @@ -183,3 +183,21 @@ examples:
>              read-only;
>          };
>      };
> +
> +  - |
> +    partitions {
> +        compatible = "fixed-partitions";
> +        #address-cells = <1>;
> +        #size-cells = <1>;

This is not strictly related but I believe we will soon have issues with
these, as we will soon cross the 4GiB boundary.

> +        concat-parts = <&part0 &part1>;
> +
> +        part0: partition@0 {
> +            label = "flash0-part0";
> +            reg = <0x0000000 0x100000>;
> +        };
> +
> +        part1: partition@100000 {
> +            label = "flash1-part0";
> +            reg = <0x0100000 0x200000>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> index 1dda2c80747b..86bbd83c3f6d 100644
> --- a/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> +++ b/Documentation/devicetree/bindings/mtd/partitions/partitions.yaml
> @@ -32,6 +32,12 @@ properties:
>    '#size-cells':
>      enum: [1, 2]
>  
> +  concat-parts:
> +    description: List of MTD partitions phandles that should be concatenated.
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    minItems: 2
> +    maxItems: 4
> +
>  patternProperties:
>    "^partition(-.+|@[0-9a-f]+)$":
>      $ref: partition.yaml

Fine by me otherwise.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2024-11-18 13:28 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-26  7:53 [RFC PATCH 0/2] Add support for stacked and parallel memories Amit Kumar Mahapatra
2024-10-26  7:53 ` Amit Kumar Mahapatra
2024-10-26  7:53 ` Amit Kumar Mahapatra
2024-10-26  7:53 ` [RFC PATCH 1/2] dt-bindings: mtd: Add bindings for describing concatinated MTD devices Amit Kumar Mahapatra
2024-10-26  7:53   ` Amit Kumar Mahapatra
2024-10-26  7:53   ` Amit Kumar Mahapatra
2024-10-26 11:13   ` Krzysztof Kozlowski
2024-10-26 11:13     ` Krzysztof Kozlowski
2024-10-26 11:13     ` Krzysztof Kozlowski
2024-10-28  6:41     ` Mahapatra, Amit Kumar
2024-10-28  6:41       ` Mahapatra, Amit Kumar
2024-10-28  6:41       ` Mahapatra, Amit Kumar
2024-11-18 13:27   ` Miquel Raynal [this message]
2024-11-18 13:27     ` Miquel Raynal
2024-11-18 13:27     ` Miquel Raynal
2024-11-19 17:02     ` Mahapatra, Amit Kumar
2024-11-19 17:02       ` Mahapatra, Amit Kumar
2024-11-19 17:02       ` Mahapatra, Amit Kumar
2024-11-20  9:52       ` Miquel Raynal
2024-11-20  9:52         ` Miquel Raynal
2024-11-20  9:52         ` Miquel Raynal
2024-11-20 10:08         ` Mahapatra, Amit Kumar
2024-11-20 10:08           ` Mahapatra, Amit Kumar
2024-11-20 10:08           ` Mahapatra, Amit Kumar
2024-10-26  7:53 ` [RFC PATCH 2/2] dt-bindings: spi: Update stacked and parallel bindings Amit Kumar Mahapatra
2024-10-26  7:53   ` Amit Kumar Mahapatra
2024-10-26  7:53   ` Amit Kumar Mahapatra
2024-11-18 13:39   ` Miquel Raynal
2024-11-18 13:39     ` Miquel Raynal
2024-11-18 13:39     ` Miquel Raynal
2024-11-19 17:02     ` Mahapatra, Amit Kumar
2024-11-19 17:02       ` Mahapatra, Amit Kumar
2024-11-19 17:02       ` Mahapatra, Amit Kumar
2024-11-20  9:58       ` Miquel Raynal
2024-11-20  9:58         ` Miquel Raynal
2024-11-20  9:58         ` Miquel Raynal
2024-11-20 10:57         ` Mahapatra, Amit Kumar
2024-11-20 10:57           ` Mahapatra, Amit Kumar
2024-11-20 10:57           ` Mahapatra, Amit Kumar
     [not found] ` <b025774a-adf6-443f-b795-bb138c490c2b@metux.net>
2024-10-30 12:09   ` [RFC PATCH 0/2] Add support for stacked and parallel memories Mahapatra, Amit Kumar
2024-10-30 12:09     ` Mahapatra, Amit Kumar
2024-10-30 12:09     ` Mahapatra, Amit Kumar
2024-11-08 14:25 ` Mahapatra, Amit Kumar
2024-11-08 14:25   ` Mahapatra, Amit Kumar
2024-11-08 14:25   ` Mahapatra, Amit Kumar
2024-11-25 15:40 ` Pratyush Yadav
2024-11-25 15:40   ` Pratyush Yadav
2024-11-25 15:40   ` Pratyush Yadav
2024-11-25 15:40   ` Pratyush Yadav

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=87frnoy8na.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amit.kumar-mahapatra@amd.com \
    --cc=amitrkcian2002@gmail.com \
    --cc=beanhuo@micron.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=git@amd.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=michal.simek@amd.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=patches@opensource.cirrus.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=robh@kernel.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=venkatesh.abbarapu@amd.com \
    --cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.