public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Boris Brezillon" <boris.brezillon@free-electrons.com>,
	devicetree@vger.kernel.org, "Richard Weinberger" <richard@nod.at>,
	"Marek Vasut" <marek.vasut@gmail.com>,
	linux-mtd@lists.infradead.org,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH 1/2] dt-bindings: mtd: explicitly describe nesting partitions
Date: Thu, 31 May 2018 11:20:29 -0500	[thread overview]
Message-ID: <20180531162029.GA8242@rob-hp-laptop> (raw)
In-Reply-To: <20180523171448.26234-1-zajec5@gmail.com>

On Wed, May 23, 2018 at 07:14:47PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Documentation was already saying that fixed and dynamic partitioning can
> be mixed but was missing a clear description and examples. This commit
> adds a proper description of how partitions can be nested and how layout
> descriptions can be mixed.
> 
> This addition is important for partitions that contain subpartitions.
> It's useful to have parent partition registered (e.g. for overwriting
> purposes) as well as children ones (for accessing data). It's also
> required when a single partition uses different partitioning method
> (e.g. vendor custom "firmware" partition with kernel + rootfs).
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> Another example (I couldn't put in Documentation yet) could be:
> 
> flash@0 {
> 	partitions {
> 		compatible = "fixed-partitions";
> 		#address-cells = <1>;
> 		#size-cells = <1>;
> 
> 		partition@0 {
> 			label = "bootloader";
> 			reg = <0x0000000 0x0100000>;
> 			read-only;
> 		};
> 
> 		firmware@100000 {
> 			label = "firmware";
> 			reg = <0x0100000 0x0800000>;
> 			compatible = "brcm,trx";
> 		};
> 	};
> };
> 
> It's probably even more realistic one, but we don't describe "brcm,trx"
> binding yet.

This one makes more sense to me than the one you've added because if you 
only have fixed partitions, it seems like most times you could just 
flatten them to 1 level. I suppose having some levels could make doing 
updates easier.

> The purpose of above description would be to:
> 1) Specify fixed partitions (they never change)
> 2) Tell operating system that "firmware" partition uses Broadcom's TRX
>    format which is a container for 2 or 3 subpartitions (usually: kernel
>    and rootfs).
> ---
>  .../devicetree/bindings/mtd/partition.txt          | 25 ++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/partition.txt b/Documentation/devicetree/bindings/mtd/partition.txt
> index a8f382642ba9..2214167ce88a 100644
> --- a/Documentation/devicetree/bindings/mtd/partition.txt
> +++ b/Documentation/devicetree/bindings/mtd/partition.txt
> @@ -14,6 +14,13 @@ method is used for a given flash device. To describe the method there should be
>  a subnode of the flash device that is named 'partitions'. It must have a
>  'compatible' property, which is used to identify the method to use.
>  
> +When a single partition is represented with a DT node (it depends on a used
> +format) it may also be described using above rules ('compatible' and optionally
> +some extra properties / subnodes). It allows describing more complex,
> +hierarchical (multi-level) layouts and should be used if there is some
> +significant relation between partitions or some partition internally uses
> +another partitioning method.
> +
>  Available bindings are listed in the "partitions" subdirectory.
>  
>  
> @@ -73,6 +80,24 @@ flash@0 {
>  		uimage@100000 {
>  			reg = <0x0100000 0x200000>;
>  		};
> +
> +		calibration@200000 {
> +			label = "calibration";
> +			reg = <0x0200000 0x100000>;
> +			compatible = "fixed-partitions";
> +			#address-cells = <1>;
> +			#size-cells = <1>;

You are missing 'ranges' here.

> +
> +			partition@0 {
> +				label = "wifi0";
> +				reg = <0x000000 0x080000>;
> +			};
> +
> +			partition@80000 {
> +				label = "wifi1";
> +				reg = <0x080000 0x080000>;
> +			};
> +		};
>  	};
>  };
>  
> -- 
> 2.13.6
> 

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

      parent reply	other threads:[~2018-05-31 16:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 17:14 [PATCH 1/2] dt-bindings: mtd: explicitly describe nesting partitions Rafał Miłecki
2018-05-23 17:14 ` [PATCH 2/2] mtd: partitions: use DT info for parsing partitions with specified type Rafał Miłecki
2018-05-23 18:24   ` Boris Brezillon
2018-05-24  5:50     ` Rafał Miłecki
2018-05-24  6:15       ` Boris Brezillon
2018-05-31 16:20 ` Rob Herring [this message]

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=20180531162029.GA8242@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=zajec5@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