From: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jonas Gorski <jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
Cc: "MTD Maling List"
<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Boris Brezillon"
<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
"Linus Walleij"
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Geert Uytterhoeven"
<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
"Simon Arlott" <simon-A6De1vDTPLDsq35pWSNszA@public.gmane.org>,
"Jason Gunthorpe"
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Hauke Mehrtens" <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>,
"Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
"David Hendricks"
<dhendrix-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: Re: [RFC PATCH 0/7] mtd: partitions: add of_match_table support
Date: Thu, 10 Dec 2015 13:06:56 -0800 [thread overview]
Message-ID: <20151210210656.GM144338@google.com> (raw)
In-Reply-To: <CAOiHx==8TFK9t4h2C0Q+j==nuRP3EbyVa+nuYuSEj_LCDa820Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sat, Dec 05, 2015 at 12:35:42PM +0100, Jonas Gorski wrote:
> On Sat, Dec 5, 2015 at 6:19 AM, Brian Norris
> <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hi,
> >
> > There have been several discussions [1] about adding a device tree binding for
> > associating flash devices with the partition parser(s) that are used on the
> > flash. There are a few reasons:
> >
> > (1) drivers shouldn't have to be encoding platform knowledge by listing what
> > parsers might be used on a given system (this is the currently all that's
> > supported)
> > (2) we can't just scan for all supported parsers (like the block system does), since
> > there is a wide diversity of "formats" (no standardization), and it is not
> > always safe or efficient to attempt to do so, particularly since many of
> > them allow their data structures to be placed anywhere on the flash, and
> > so require scanning the entire flash device to find them.
> >
> > So instead, let's support a new binding so that a device tree can specify what
> > partition formats might be used. This seems like a reasonable choice (even
> > though it's not strictly a hardware description) because the flash layout /
> > partitioning is often very closely tied with the bootloader/firmware, at
> > production time.
>
> On a first glance this looks good to me, and looks easily extensible
> for application of non-complete partition parsers.
>
> E.g. for the "brcm,bcm6345-imagetag" we would want to actually do something like
>
> partitions {
> ....
>
> partition@0 {
> reg = <0x0 0x10000>;
> label = "cfe";
> read-only;
> };
>
> partition@10000 {
> reg = <0x10000 0x3d0000>;
> label = "firmware";
> compatible = "brcm,bcm6345-imagetag";
> };
>
> partition@3e0000 {
> reg = <0x3e0000 0x10000>;
> label = "art";
> read-only;
> };
>
> partition@3f0000 {
> reg = <0x3f0000 0x10000>;
> label = "nvram";
> read-only;
> };
> };
>
> as the image tag can only specify the offsets and sizes of the rootfs
> and kernel parts, but not of any other parts.
I had your (and others') prior attempts and suggestions in mind when
planning this, and I agree that the binding looks extendible to cases
like that. I haven't yet worked out what a good MTD infrastructure for
that would look like, so I stuck with defining and implementing only
what I know use :)
> > Also, as an example first-use of this mechanism, I support Google's FMAP flash
> > structure, used on Chrome OS devices.
> >
> > Note that this is an RFC, mainly for the reason noted in patch 6 ("RFC: mtd:
> > partitions: enable of_match_table matching"): the of_match_table support won't
> > yet autoload a partition parser that is built as a module. I'm not quite sure
> > if there's a lot of value in supporting MTD parsers as modules (block partition
> > support can't be), but that is supported for "by-name" parser lookups in MTD
> > already, so I don't feel like dropping that feature yet. Tips or thoughts are
> > particularly welcome on this aspect!
>
> I would assume a lot of the cases these would be a chicken-egg
> problem, you need the parser to be able to find and mount the rootfs,
> but you you need mount the rootfs to load the parser.
Not necessarily. One of my current use cases has a boot SPI NOR flash +
an eMMC rootfs. Modules can be loaded from eMMC.
BTW, I'm realizing that if partition parsers are forced to built-in
only, then we'd have to do the same for the MTD core (or at least, the
MTD core that handles partitioning). Not sure if that's a desirable
trade-off. (Again, block support is 'bool' in Kconfig, if we're trying
to compare.)
Brian
WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <computersforpeace@gmail.com>
To: Jonas Gorski <jogo@openwrt.org>
Cc: "MTD Maling List" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Boris Brezillon" <boris.brezillon@free-electrons.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Simon Arlott" <simon@fire.lp0.eu>,
"Jason Gunthorpe" <jgunthorpe@obsidianresearch.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
devicetree-spec@vger.kernel.org,
"Rob Herring" <robh+dt@kernel.org>,
"Rafał Miłecki" <zajec5@gmail.com>,
"Hauke Mehrtens" <hauke@hauke-m.de>,
"Arnd Bergmann" <arnd@arndb.de>,
"David Hendricks" <dhendrix@chromium.org>
Subject: Re: [RFC PATCH 0/7] mtd: partitions: add of_match_table support
Date: Thu, 10 Dec 2015 13:06:56 -0800 [thread overview]
Message-ID: <20151210210656.GM144338@google.com> (raw)
In-Reply-To: <CAOiHx==8TFK9t4h2C0Q+j==nuRP3EbyVa+nuYuSEj_LCDa820Q@mail.gmail.com>
On Sat, Dec 05, 2015 at 12:35:42PM +0100, Jonas Gorski wrote:
> On Sat, Dec 5, 2015 at 6:19 AM, Brian Norris
> <computersforpeace@gmail.com> wrote:
> > Hi,
> >
> > There have been several discussions [1] about adding a device tree binding for
> > associating flash devices with the partition parser(s) that are used on the
> > flash. There are a few reasons:
> >
> > (1) drivers shouldn't have to be encoding platform knowledge by listing what
> > parsers might be used on a given system (this is the currently all that's
> > supported)
> > (2) we can't just scan for all supported parsers (like the block system does), since
> > there is a wide diversity of "formats" (no standardization), and it is not
> > always safe or efficient to attempt to do so, particularly since many of
> > them allow their data structures to be placed anywhere on the flash, and
> > so require scanning the entire flash device to find them.
> >
> > So instead, let's support a new binding so that a device tree can specify what
> > partition formats might be used. This seems like a reasonable choice (even
> > though it's not strictly a hardware description) because the flash layout /
> > partitioning is often very closely tied with the bootloader/firmware, at
> > production time.
>
> On a first glance this looks good to me, and looks easily extensible
> for application of non-complete partition parsers.
>
> E.g. for the "brcm,bcm6345-imagetag" we would want to actually do something like
>
> partitions {
> ....
>
> partition@0 {
> reg = <0x0 0x10000>;
> label = "cfe";
> read-only;
> };
>
> partition@10000 {
> reg = <0x10000 0x3d0000>;
> label = "firmware";
> compatible = "brcm,bcm6345-imagetag";
> };
>
> partition@3e0000 {
> reg = <0x3e0000 0x10000>;
> label = "art";
> read-only;
> };
>
> partition@3f0000 {
> reg = <0x3f0000 0x10000>;
> label = "nvram";
> read-only;
> };
> };
>
> as the image tag can only specify the offsets and sizes of the rootfs
> and kernel parts, but not of any other parts.
I had your (and others') prior attempts and suggestions in mind when
planning this, and I agree that the binding looks extendible to cases
like that. I haven't yet worked out what a good MTD infrastructure for
that would look like, so I stuck with defining and implementing only
what I know use :)
> > Also, as an example first-use of this mechanism, I support Google's FMAP flash
> > structure, used on Chrome OS devices.
> >
> > Note that this is an RFC, mainly for the reason noted in patch 6 ("RFC: mtd:
> > partitions: enable of_match_table matching"): the of_match_table support won't
> > yet autoload a partition parser that is built as a module. I'm not quite sure
> > if there's a lot of value in supporting MTD parsers as modules (block partition
> > support can't be), but that is supported for "by-name" parser lookups in MTD
> > already, so I don't feel like dropping that feature yet. Tips or thoughts are
> > particularly welcome on this aspect!
>
> I would assume a lot of the cases these would be a chicken-egg
> problem, you need the parser to be able to find and mount the rootfs,
> but you you need mount the rootfs to load the parser.
Not necessarily. One of my current use cases has a boot SPI NOR flash +
an eMMC rootfs. Modules can be loaded from eMMC.
BTW, I'm realizing that if partition parsers are forced to built-in
only, then we'd have to do the same for the MTD core (or at least, the
MTD core that handles partitioning). Not sure if that's a desirable
trade-off. (Again, block support is 'bool' in Kconfig, if we're trying
to compare.)
Brian
next prev parent reply other threads:[~2015-12-10 21:06 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 5:19 [RFC PATCH 0/7] mtd: partitions: add of_match_table support Brian Norris
2015-12-05 5:19 ` Brian Norris
2015-12-05 5:19 ` [RFC PATCH 1/7] mtd: move partition parsers to drivers/mtd/partitions/ Brian Norris
2015-12-05 5:19 ` Brian Norris
2015-12-05 5:19 ` [RFC PATCH 2/7] mtd: move partition parsers' Kconfig under a sub-menu Brian Norris
2015-12-05 5:19 ` Brian Norris
2015-12-05 5:19 ` [RFC PATCH 4/7] mtd: add of_match_mtd_parser() and of_mtd_match_mtd_parser() helpers Brian Norris
2015-12-05 5:19 ` Brian Norris
[not found] ` <1449292763-129421-5-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-07 2:45 ` Rob Herring
2015-12-07 2:45 ` Rob Herring
[not found] ` <CAL_JsqLV1mDpW9tD0XjWRxZSSsYuDiqHbuADQmBUtACgYiHJ+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-07 18:13 ` Brian Norris
2015-12-07 18:13 ` Brian Norris
[not found] ` <20151207181308.GN120110-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-12-07 19:00 ` Rob Herring
2015-12-07 19:00 ` Rob Herring
2015-12-05 5:19 ` [RFC PATCH 6/7] RFC: mtd: partitions: enable of_match_table matching Brian Norris
2015-12-05 5:19 ` Brian Norris
2015-12-05 5:19 ` [RFC PATCH 7/7] mtd: partitions: add Google's FMAP partition parser Brian Norris
2015-12-05 5:19 ` Brian Norris
2015-12-05 5:19 ` Brian Norris
[not found] ` <1449292763-129421-1-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-05 5:19 ` [RFC PATCH 3/7] doc: dt: mtd: partition: add on-flash format binding Brian Norris
2015-12-05 5:19 ` Brian Norris
[not found] ` <1449292763-129421-4-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-05 11:39 ` Jonas Gorski
2015-12-05 11:39 ` Jonas Gorski
[not found] ` <CAOiHx=nz2bdA_R610ozsQHhccdcrHVVCamTtne5ReHrA-FcaaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-05 21:33 ` Michal Suchanek
2015-12-05 21:33 ` Michal Suchanek
[not found] ` <CAOMqctTbUNd0GtY07YJuxem9HkU1WZ-NtO556=Yg2QrsF49Xjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-07 1:36 ` David Gibson
2015-12-07 1:36 ` David Gibson
[not found] ` <20151207013628.GC20139-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2015-12-10 20:43 ` Brian Norris
2015-12-10 20:43 ` Brian Norris
[not found] ` <20151210204324.GK144338-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-12-11 15:58 ` Michal Suchanek
2015-12-11 15:58 ` Michal Suchanek
2015-12-12 5:51 ` David Gibson
[not found] ` <20151212055105.GA17011-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2015-12-14 10:22 ` Geert Uytterhoeven
2015-12-14 10:22 ` Geert Uytterhoeven
[not found] ` <CAMuHMdXA4-BZpvtCM8_9fYWLzoVsuCXDqvF3G4cVd50Cqsfv0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-14 12:28 ` Michal Suchanek
2015-12-14 12:28 ` Michal Suchanek
2015-12-15 6:00 ` David Gibson
2015-12-15 6:00 ` David Gibson
[not found] ` <20151215060056.GB3011-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2015-12-15 10:03 ` Geert Uytterhoeven
2015-12-15 10:03 ` Geert Uytterhoeven
2015-12-17 1:05 ` David Gibson
2015-12-07 3:07 ` Rob Herring
2015-12-07 3:07 ` Rob Herring
2015-12-05 5:19 ` [RFC PATCH 5/7] mtd: partitions: factor out "match by name" handling Brian Norris
2015-12-05 5:19 ` Brian Norris
2015-12-05 10:15 ` [RFC PATCH 0/7] mtd: partitions: add of_match_table support Geert Uytterhoeven
2015-12-05 10:15 ` Geert Uytterhoeven
[not found] ` <CAMuHMdUJXHs_OhT0da+kzc=D4MOFUT9BB3eJ+7a_p6DYx-PKBA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-05 18:06 ` Michal Suchanek
2015-12-05 18:06 ` Michal Suchanek
2015-12-10 20:54 ` Brian Norris
2015-12-10 20:54 ` Brian Norris
[not found] ` <20151210205449.GL144338-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-12-11 8:44 ` Geert Uytterhoeven
2015-12-11 8:44 ` Geert Uytterhoeven
[not found] ` <CAMuHMdV-uethsChWVZGSx1JNcAofODmg14ppGYJP2ewfwhEv1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-11 15:34 ` Michal Suchanek
2015-12-11 15:34 ` Michal Suchanek
[not found] ` <CAOMqctQVMCEa_k4xMW1qooEpe8X1-NhUOjD6pp0qJpDP_H+8hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-11 16:00 ` Geert Uytterhoeven
2015-12-11 16:00 ` Geert Uytterhoeven
[not found] ` <CAMuHMdV2feXKWkJzRkMUBiAUCxp4LwaRgg+aPYwm0sUnKzm0Rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-11 16:18 ` Michal Suchanek
2015-12-11 16:18 ` Michal Suchanek
2015-12-12 1:33 ` Brian Norris
2015-12-12 1:33 ` Brian Norris
[not found] ` <20151212013349.GA86087-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-12-14 10:15 ` Geert Uytterhoeven
2015-12-14 10:15 ` Geert Uytterhoeven
2015-12-05 11:35 ` Jonas Gorski
[not found] ` <CAOiHx==8TFK9t4h2C0Q+j==nuRP3EbyVa+nuYuSEj_LCDa820Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-10 21:06 ` Brian Norris [this message]
2015-12-10 21:06 ` Brian Norris
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=20151210210656.GM144338@google.com \
--to=computersforpeace-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dhendrix-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
--cc=hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=simon-A6De1vDTPLDsq35pWSNszA@public.gmane.org \
--cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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.