Patchwork powerpc/85xx: DTS - re-organize the SPI partitions property

login
register
mail settings
Submitter Mingkai Hu
Date Sept. 6, 2013, 8:05 a.m.
Message ID <1378454743-17637-1-git-send-email-Mingkai.Hu@freescale.com>
Download mbox | patch
Permalink /patch/273117/
State Rejected
Headers show

Comments

Mingkai Hu - Sept. 6, 2013, 8:05 a.m.
Re-organize the SPI partitions and use the same SPI flash memory
map for most of the platforms which have 16MB SPI flash mounted.

1. Extend the U-Boot partition to 1MB
   The image for booting from SPI is larger than 512KB, while
   the size of U-Boot partition is 512KB on some boards, so
   enlarge it to 1MB in order to contain the whole U-Boot image.

2. Reserve space for U-Boot environment variables
   The environment variables are stored at offset 0x100000, so
   if other image was put at this address, it'll be overlapped
   when saving the environment variables.

3. Reserve space for FMAN ucode
   The FMAN ucode is required on DPAA platform and is stored at
   offset 0x110000, this address should not be used to store any
   other images.

4. Extend the kernel partition to 5MB

Here is diagram for the SPI flash memory map:

        0x000000 |-------------|
                 | U-Boot      |
                 | (1MB)       |
        0x100000 |-------------|
                 | Env(64KB)   |
        0x110000 |-------------|
                 | ucode       |
        0x180000 |-------------|
                 | DTB         |
                 | (512KB)     |
        0x200000 |-------------|
                 | kernel      |
                 | (5MB)       |
        0x700000 |-------------|
                 | file system |
                 | (9MB)       |
       0x1000000 |-------------|

Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
---

Based on 'next' branch on git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git

 arch/powerpc/boot/dts/bsc9131rdb.dtsi  | 35 ++++++++++++-----------------
 arch/powerpc/boot/dts/c293pcie.dts     | 35 ++++++++++++-----------------
 arch/powerpc/boot/dts/mpc8536ds.dtsi   | 12 +++++-----
 arch/powerpc/boot/dts/p1010rdb.dtsi    | 40 ++++++++++++----------------------
 arch/powerpc/boot/dts/p1020rdb-pc.dtsi | 24 +++++---------------
 arch/powerpc/boot/dts/p1020rdb-pd.dts  | 34 ++++++++++++-----------------
 arch/powerpc/boot/dts/p1020rdb.dtsi    | 23 ++++---------------
 arch/powerpc/boot/dts/p1021mds.dts     | 17 +++++++--------
 arch/powerpc/boot/dts/p1021rdb-pc.dtsi | 32 +++++++++------------------
 arch/powerpc/boot/dts/p1022ds.dtsi     | 21 +++++++++---------
 arch/powerpc/boot/dts/p1023rds.dts     | 10 ++-------
 arch/powerpc/boot/dts/p1024rdb.dtsi    | 40 ++++++++++++----------------------
 arch/powerpc/boot/dts/p1025rdb.dtsi    | 23 +++++--------------
 arch/powerpc/boot/dts/p2020rdb-pc.dtsi | 40 ++++++++++++----------------------
 arch/powerpc/boot/dts/p2020rdb.dts     | 38 ++++++++++----------------------
 arch/powerpc/boot/dts/p2041rdb.dts     | 12 +++++-----
 arch/powerpc/boot/dts/p3041ds.dts      | 12 +++++-----
 arch/powerpc/boot/dts/p4080ds.dts      | 12 +++++-----
 arch/powerpc/boot/dts/p5020ds.dts      | 12 +++++-----
 arch/powerpc/boot/dts/p5040ds.dts      | 13 ++++++-----
 20 files changed, 180 insertions(+), 305 deletions(-)
Scott Wood - Sept. 10, 2013, 11:33 p.m.
On Fri, 2013-09-06 at 16:05 +0800, Mingkai Hu wrote:
> Re-organize the SPI partitions and use the same SPI flash memory
> map for most of the platforms which have 16MB SPI flash mounted.
[snip]
> Based on 'next' branch on git tree:
> git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
> 
>  arch/powerpc/boot/dts/bsc9131rdb.dtsi  | 35 ++++++++++++-----------------
>  arch/powerpc/boot/dts/c293pcie.dts     | 35 ++++++++++++-----------------
>  arch/powerpc/boot/dts/mpc8536ds.dtsi   | 12 +++++-----
>  arch/powerpc/boot/dts/p1010rdb.dtsi    | 40 ++++++++++++----------------------
>  arch/powerpc/boot/dts/p1020rdb-pc.dtsi | 24 +++++---------------
>  arch/powerpc/boot/dts/p1020rdb-pd.dts  | 34 ++++++++++++-----------------
>  arch/powerpc/boot/dts/p1020rdb.dtsi    | 23 ++++---------------
>  arch/powerpc/boot/dts/p1021mds.dts     | 17 +++++++--------
>  arch/powerpc/boot/dts/p1021rdb-pc.dtsi | 32 +++++++++------------------
>  arch/powerpc/boot/dts/p1022ds.dtsi     | 21 +++++++++---------
>  arch/powerpc/boot/dts/p1023rds.dts     | 10 ++-------
>  arch/powerpc/boot/dts/p1024rdb.dtsi    | 40 ++++++++++++----------------------
>  arch/powerpc/boot/dts/p1025rdb.dtsi    | 23 +++++--------------
>  arch/powerpc/boot/dts/p2020rdb-pc.dtsi | 40 ++++++++++++----------------------
>  arch/powerpc/boot/dts/p2020rdb.dts     | 38 ++++++++++----------------------
>  arch/powerpc/boot/dts/p2041rdb.dts     | 12 +++++-----
>  arch/powerpc/boot/dts/p3041ds.dts      | 12 +++++-----
>  arch/powerpc/boot/dts/p4080ds.dts      | 12 +++++-----
>  arch/powerpc/boot/dts/p5020ds.dts      | 12 +++++-----
>  arch/powerpc/boot/dts/p5040ds.dts      | 13 ++++++-----

What happens to exsting users whose flash is laid out the existing way,
when they upgrade to these device trees?

We really should not be putting partition layout info in the device tree
to begin with...

-Scott
Hu Mingkai-B21284 - Sept. 11, 2013, 2:07 a.m.
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Wednesday, September 11, 2013 7:33 AM
> To: Hu Mingkai-B21284
> Cc: linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> property
> 
> On Fri, 2013-09-06 at 16:05 +0800, Mingkai Hu wrote:
> > Re-organize the SPI partitions and use the same SPI flash memory map
> > for most of the platforms which have 16MB SPI flash mounted.
> [snip]
> > Based on 'next' branch on git tree:
> > git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
> >
> >  arch/powerpc/boot/dts/bsc9131rdb.dtsi  | 35 ++++++++++++--------------
> ---
> >  arch/powerpc/boot/dts/c293pcie.dts     | 35 ++++++++++++--------------
> ---
> >  arch/powerpc/boot/dts/mpc8536ds.dtsi   | 12 +++++-----
> >  arch/powerpc/boot/dts/p1010rdb.dtsi    | 40 ++++++++++++--------------
> --------
> >  arch/powerpc/boot/dts/p1020rdb-pc.dtsi | 24 +++++---------------
> > arch/powerpc/boot/dts/p1020rdb-pd.dts  | 34 ++++++++++++---------------
> --
> >  arch/powerpc/boot/dts/p1020rdb.dtsi    | 23 ++++---------------
> >  arch/powerpc/boot/dts/p1021mds.dts     | 17 +++++++--------
> >  arch/powerpc/boot/dts/p1021rdb-pc.dtsi | 32 +++++++++-----------------
> -
> >  arch/powerpc/boot/dts/p1022ds.dtsi     | 21 +++++++++---------
> >  arch/powerpc/boot/dts/p1023rds.dts     | 10 ++-------
> >  arch/powerpc/boot/dts/p1024rdb.dtsi    | 40 ++++++++++++--------------
> --------
> >  arch/powerpc/boot/dts/p1025rdb.dtsi    | 23 +++++--------------
> >  arch/powerpc/boot/dts/p2020rdb-pc.dtsi | 40 ++++++++++++--------------
> --------
> >  arch/powerpc/boot/dts/p2020rdb.dts     | 38 ++++++++++----------------
> ------
> >  arch/powerpc/boot/dts/p2041rdb.dts     | 12 +++++-----
> >  arch/powerpc/boot/dts/p3041ds.dts      | 12 +++++-----
> >  arch/powerpc/boot/dts/p4080ds.dts      | 12 +++++-----
> >  arch/powerpc/boot/dts/p5020ds.dts      | 12 +++++-----
> >  arch/powerpc/boot/dts/p5040ds.dts      | 13 ++++++-----
> 
> What happens to exsting users whose flash is laid out the existing way,
> when they upgrade to these device trees?
> 

The SPI flash layout should be mapping the new device tree.

If the existing device tree is used to deploy the SPI flash, the following issues
must be run into as the commit message described:

1. Kernel images would be overlapped with U-Boot image.
2. Kernel images would be overlapped with FMAN ucode.
3. Saving environment variables will crash the kernel image.

> We really should not be putting partition layout info in the device tree
> to begin with...
> 
OK, I will remove the layout diagram in the commit message.

Thanks,
Mingkai
Scott Wood - Sept. 12, 2013, 1:15 a.m.
On Tue, 2013-09-10 at 21:07 -0500, Hu Mingkai-B21284 wrote:
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Wednesday, September 11, 2013 7:33 AM
> > To: Hu Mingkai-B21284
> > Cc: linuxppc-dev@ozlabs.org
> > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> > property
> > 
> > What happens to exsting users whose flash is laid out the existing way,
> > when they upgrade to these device trees?
> > 
> 
> The SPI flash layout should be mapping the new device tree.
> 
> If the existing device tree is used to deploy the SPI flash, the following issues
> must be run into as the commit message described:
> 
> 1. Kernel images would be overlapped with U-Boot image.
> 2. Kernel images would be overlapped with FMAN ucode.
> 3. Saving environment variables will crash the kernel image.

Has the SPI U-Boot image always been larger than 512K for all these
platforms?  Why, given that we're under 512K for other boot modes?

> > We really should not be putting partition layout info in the device tree
> > to begin with...
> > 
> OK, I will remove the layout diagram in the commit message.

That's not what I meant.  I meant that the dts should be describing
hardware, and this is the sort of trouble we run into when we deviate
from that.  A better way would be to use the mtdparts command line
option.  Even better would be some sort of on-flash partition table.

-Scott
Hu Mingkai-B21284 - Sept. 17, 2013, 11:06 a.m.
Scott,
Sorry for the delayed response.
Please fine my comments.
Thanks,
Mingkai

> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, September 12, 2013 9:16 AM
> To: Hu Mingkai-B21284
> Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> property
> 
> On Tue, 2013-09-10 at 21:07 -0500, Hu Mingkai-B21284 wrote:
> >
> > > -----Original Message-----
> > > From: Wood Scott-B07421
> > > Sent: Wednesday, September 11, 2013 7:33 AM
> > > To: Hu Mingkai-B21284
> > > Cc: linuxppc-dev@ozlabs.org
> > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > partitions property
> > >
> > > What happens to exsting users whose flash is laid out the existing
> > > way, when they upgrade to these device trees?
> > >
> >
> > The SPI flash layout should be mapping the new device tree.
> >
> > If the existing device tree is used to deploy the SPI flash, the
> > following issues must be run into as the commit message described:
> >
> > 1. Kernel images would be overlapped with U-Boot image.
> > 2. Kernel images would be overlapped with FMAN ucode.
> > 3. Saving environment variables will crash the kernel image.
> 
> Has the SPI U-Boot image always been larger than 512K for all these
> platforms?  Why, given that we're under 512K for other boot modes?
> 

For DPAA platform, the ld script used to link the u-boot image is 
"./arch/powerpc/cpu/mpc85xx/u-boot.lds" which will generate the 512K u-boot
Image. This image will be split into 64bytes and appended PBL command for 
Each 64bytes pieces, so the size of final image must be greater than 512K.

The same applies to the non-DPAA platform which doesn't support TPL.

For non-DPAA platform which support TPL, the image size is also greater than 512K.

> > > We really should not be putting partition layout info in the device
> > > tree to begin with...
> > >
> > OK, I will remove the layout diagram in the commit message.
> 
> That's not what I meant.  I meant that the dts should be describing
> hardware, and this is the sort of trouble we run into when we deviate
> from that.  A better way would be to use the mtdparts command line option.
> Even better would be some sort of on-flash partition table.
> 

You're right, but maybe some customer has already used the device tree partition table...

Thanks,
Mingkai
Scott Wood - Sept. 23, 2013, 11:02 p.m.
On Tue, 2013-09-17 at 06:06 -0500, Hu Mingkai-B21284 wrote:
> Scott,
> Sorry for the delayed response.
> Please fine my comments.
> Thanks,
> Mingkai
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, September 12, 2013 9:16 AM
> > To: Hu Mingkai-B21284
> > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> > property
> > 
> > On Tue, 2013-09-10 at 21:07 -0500, Hu Mingkai-B21284 wrote:
> > >
> > > > -----Original Message-----
> > > > From: Wood Scott-B07421
> > > > Sent: Wednesday, September 11, 2013 7:33 AM
> > > > To: Hu Mingkai-B21284
> > > > Cc: linuxppc-dev@ozlabs.org
> > > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > > partitions property
> > > >
> > > > What happens to exsting users whose flash is laid out the existing
> > > > way, when they upgrade to these device trees?
> > > >
> > >
> > > The SPI flash layout should be mapping the new device tree.
> > >
> > > If the existing device tree is used to deploy the SPI flash, the
> > > following issues must be run into as the commit message described:
> > >
> > > 1. Kernel images would be overlapped with U-Boot image.
> > > 2. Kernel images would be overlapped with FMAN ucode.
> > > 3. Saving environment variables will crash the kernel image.
> > 
> > Has the SPI U-Boot image always been larger than 512K for all these
> > platforms?  Why, given that we're under 512K for other boot modes?
> > 
> 
> For DPAA platform, the ld script used to link the u-boot image is 
> "./arch/powerpc/cpu/mpc85xx/u-boot.lds" which will generate the 512K u-boot
> Image. This image will be split into 64bytes and appended PBL command for 
> Each 64bytes pieces, so the size of final image must be greater than 512K.

What is the entry point in SRAM when you load from PBL?  If it is (or
can be made to be) the beginning of the image rather than the end, then
turn off the resetvec and the fixed image size that results.

> > > > We really should not be putting partition layout info in the device
> > > > tree to begin with...
> > > >
> > > OK, I will remove the layout diagram in the commit message.
> > 
> > That's not what I meant.  I meant that the dts should be describing
> > hardware, and this is the sort of trouble we run into when we deviate
> > from that.  A better way would be to use the mtdparts command line option.
> > Even better would be some sort of on-flash partition table.
> > 
> 
> You're right, but maybe some customer has already used the device tree partition table...

My main point was to encourage us to shift away from this rather than to
rip it out right this instant.

-Scott
Hu Mingkai-B21284 - Sept. 24, 2013, 10:27 a.m.
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Tuesday, September 24, 2013 7:03 AM
> To: Hu Mingkai-B21284
> Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> property
> 
> On Tue, 2013-09-17 at 06:06 -0500, Hu Mingkai-B21284 wrote:
> > Scott,
> > Sorry for the delayed response.
> > Please fine my comments.
> > Thanks,
> > Mingkai
> >
> > > -----Original Message-----
> > > From: Wood Scott-B07421
> > > Sent: Thursday, September 12, 2013 9:16 AM
> > > To: Hu Mingkai-B21284
> > > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > partitions property
> > >
> > > On Tue, 2013-09-10 at 21:07 -0500, Hu Mingkai-B21284 wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: Wood Scott-B07421
> > > > > Sent: Wednesday, September 11, 2013 7:33 AM
> > > > > To: Hu Mingkai-B21284
> > > > > Cc: linuxppc-dev@ozlabs.org
> > > > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > > > partitions property
> > > > >
> > > > > What happens to exsting users whose flash is laid out the
> > > > > existing way, when they upgrade to these device trees?
> > > > >
> > > >
> > > > The SPI flash layout should be mapping the new device tree.
> > > >
> > > > If the existing device tree is used to deploy the SPI flash, the
> > > > following issues must be run into as the commit message described:
> > > >
> > > > 1. Kernel images would be overlapped with U-Boot image.
> > > > 2. Kernel images would be overlapped with FMAN ucode.
> > > > 3. Saving environment variables will crash the kernel image.
> > >
> > > Has the SPI U-Boot image always been larger than 512K for all these
> > > platforms?  Why, given that we're under 512K for other boot modes?
> > >
> >
> > For DPAA platform, the ld script used to link the u-boot image is
> > "./arch/powerpc/cpu/mpc85xx/u-boot.lds" which will generate the 512K
> > u-boot Image. This image will be split into 64bytes and appended PBL
> > command for Each 64bytes pieces, so the size of final image must be
> greater than 512K.
> 
> What is the entry point in SRAM when you load from PBL?  If it is (or can
> be made to be) the beginning of the image rather than the end, then turn
> off the resetvec and the fixed image size that results.
> 

1. Thus a special ld script need to be provided.
2. Now the spi image size is about 540KB, that's to say the PBL needs about ~30K
   for PBL commands. It's hard to save such a big space even we turn off the
   resetvec.

> > > > > We really should not be putting partition layout info in the
> > > > > device tree to begin with...
> > > > >
> > > > OK, I will remove the layout diagram in the commit message.
> > >
> > > That's not what I meant.  I meant that the dts should be describing
> > > hardware, and this is the sort of trouble we run into when we
> > > deviate from that.  A better way would be to use the mtdparts command
> line option.
> > > Even better would be some sort of on-flash partition table.
> > >
> >
> > You're right, but maybe some customer has already used the device tree
> partition table...
> 
> My main point was to encourage us to shift away from this rather than to
> rip it out right this instant.
> 

Yes, that's the correct way we should go.
Would you please pick up this patch first to resolve current issue we faced?
And we can consider to use the mtdparts or on-flash partition table for long term.

Thanks,
Mingkai
Scott Wood - Sept. 24, 2013, 7:37 p.m.
On Tue, 2013-09-24 at 05:27 -0500, Hu Mingkai-B21284 wrote:
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Tuesday, September 24, 2013 7:03 AM
> > To: Hu Mingkai-B21284
> > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> > property
> > 
> > On Tue, 2013-09-17 at 06:06 -0500, Hu Mingkai-B21284 wrote:
> > > Scott,
> > > Sorry for the delayed response.
> > > Please fine my comments.
> > > Thanks,
> > > Mingkai
> > >
> > > > -----Original Message-----
> > > > From: Wood Scott-B07421
> > > > Sent: Thursday, September 12, 2013 9:16 AM
> > > > To: Hu Mingkai-B21284
> > > > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > > partitions property
> > > >
> > > > On Tue, 2013-09-10 at 21:07 -0500, Hu Mingkai-B21284 wrote:
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Wood Scott-B07421
> > > > > > Sent: Wednesday, September 11, 2013 7:33 AM
> > > > > > To: Hu Mingkai-B21284
> > > > > > Cc: linuxppc-dev@ozlabs.org
> > > > > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > > > > partitions property
> > > > > >
> > > > > > What happens to exsting users whose flash is laid out the
> > > > > > existing way, when they upgrade to these device trees?
> > > > > >
> > > > >
> > > > > The SPI flash layout should be mapping the new device tree.
> > > > >
> > > > > If the existing device tree is used to deploy the SPI flash, the
> > > > > following issues must be run into as the commit message described:
> > > > >
> > > > > 1. Kernel images would be overlapped with U-Boot image.
> > > > > 2. Kernel images would be overlapped with FMAN ucode.
> > > > > 3. Saving environment variables will crash the kernel image.
> > > >
> > > > Has the SPI U-Boot image always been larger than 512K for all these
> > > > platforms?  Why, given that we're under 512K for other boot modes?
> > > >
> > >
> > > For DPAA platform, the ld script used to link the u-boot image is
> > > "./arch/powerpc/cpu/mpc85xx/u-boot.lds" which will generate the 512K
> > > u-boot Image. This image will be split into 64bytes and appended PBL
> > > command for Each 64bytes pieces, so the size of final image must be
> > greater than 512K.
> > 
> > What is the entry point in SRAM when you load from PBL?  If it is (or can
> > be made to be) the beginning of the image rather than the end, then turn
> > off the resetvec and the fixed image size that results.
> > 
> 
> 1. Thus a special ld script need to be provided.

This is already supported.  See CONFIG_SYS_MPC85XX_NO_RESETVEC.

> 2. Now the spi image size is about 540KB, that's to say the PBL needs about ~30K
>    for PBL commands. It's hard to save such a big space even we turn off the
>    resetvec.

Turning off the resetvec doesn't just eliminate the resetvec code; it
eliminates the padding to 512K (or if it doesn't, that's a bug to be
fixed).

> > > > > > We really should not be putting partition layout info in the
> > > > > > device tree to begin with...
> > > > > >
> > > > > OK, I will remove the layout diagram in the commit message.
> > > >
> > > > That's not what I meant.  I meant that the dts should be describing
> > > > hardware, and this is the sort of trouble we run into when we
> > > > deviate from that.  A better way would be to use the mtdparts command
> > line option.
> > > > Even better would be some sort of on-flash partition table.
> > > >
> > >
> > > You're right, but maybe some customer has already used the device tree
> > partition table...
> > 
> > My main point was to encourage us to shift away from this rather than to
> > rip it out right this instant.
> > 
> 
> Yes, that's the correct way we should go.
> Would you please pick up this patch first to resolve current issue we faced?
> And we can consider to use the mtdparts or on-flash partition table for long term.

Fixing U-Boot would make the problem go away without any issues with
partition compatibility.  Are you sure nobody's using these SPI
partitions without booting from SPI?  Even if nobody's using this, it
seems a wasteful solution.  These are pretty small flashes.

-Scott
Hu Mingkai-B21284 - Sept. 30, 2013, 8:31 a.m.
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Wednesday, September 25, 2013 3:37 AM
> To: Hu Mingkai-B21284
> Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> property
> 
> On Tue, 2013-09-24 at 05:27 -0500, Hu Mingkai-B21284 wrote:
> >
> > > -----Original Message-----
> > > From: Wood Scott-B07421
> > > Sent: Tuesday, September 24, 2013 7:03 AM
> > > To: Hu Mingkai-B21284
> > > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > partitions property
> > >
> > > On Tue, 2013-09-17 at 06:06 -0500, Hu Mingkai-B21284 wrote:
> > > > Scott,
> > > > Sorry for the delayed response.
> > > > Please fine my comments.
> > > > Thanks,
> > > > Mingkai
> > > >
> > > > > -----Original Message-----
> > > > > From: Wood Scott-B07421
> > > > > Sent: Thursday, September 12, 2013 9:16 AM
> > > > > To: Hu Mingkai-B21284
> > > > > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > > > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > > > partitions property
> > > > >
> > > > > On Tue, 2013-09-10 at 21:07 -0500, Hu Mingkai-B21284 wrote:
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Wood Scott-B07421
> > > > > > > Sent: Wednesday, September 11, 2013 7:33 AM
> > > > > > > To: Hu Mingkai-B21284
> > > > > > > Cc: linuxppc-dev@ozlabs.org
> > > > > > > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI
> > > > > > > partitions property
> > > > > > >
> > > > > > > What happens to exsting users whose flash is laid out the
> > > > > > > existing way, when they upgrade to these device trees?
> > > > > > >
> > > > > >
> > > > > > The SPI flash layout should be mapping the new device tree.
> > > > > >
> > > > > > If the existing device tree is used to deploy the SPI flash,
> > > > > > the following issues must be run into as the commit message
> described:
> > > > > >
> > > > > > 1. Kernel images would be overlapped with U-Boot image.
> > > > > > 2. Kernel images would be overlapped with FMAN ucode.
> > > > > > 3. Saving environment variables will crash the kernel image.
> > > > >
> > > > > Has the SPI U-Boot image always been larger than 512K for all
> > > > > these platforms?  Why, given that we're under 512K for other boot
> modes?
> > > > >
> > > >
> > > > For DPAA platform, the ld script used to link the u-boot image is
> > > > "./arch/powerpc/cpu/mpc85xx/u-boot.lds" which will generate the
> > > > 512K u-boot Image. This image will be split into 64bytes and
> > > > appended PBL command for Each 64bytes pieces, so the size of final
> > > > image must be
> > > greater than 512K.
> > >
> > > What is the entry point in SRAM when you load from PBL?  If it is
> > > (or can be made to be) the beginning of the image rather than the
> > > end, then turn off the resetvec and the fixed image size that results.
> > >
> >
> > 1. Thus a special ld script need to be provided.
> 
> This is already supported.  See CONFIG_SYS_MPC85XX_NO_RESETVEC.
> 
> > 2. Now the spi image size is about 540KB, that's to say the PBL needs
> about ~30K
> >    for PBL commands. It's hard to save such a big space even we turn
> off the
> >    resetvec.
> 
> Turning off the resetvec doesn't just eliminate the resetvec code; it
> eliminates the padding to 512K (or if it doesn't, that's a bug to be
> fixed).
> 
> > > > > > > We really should not be putting partition layout info in the
> > > > > > > device tree to begin with...
> > > > > > >
> > > > > > OK, I will remove the layout diagram in the commit message.
> > > > >
> > > > > That's not what I meant.  I meant that the dts should be
> > > > > describing hardware, and this is the sort of trouble we run into
> > > > > when we deviate from that.  A better way would be to use the
> > > > > mtdparts command
> > > line option.
> > > > > Even better would be some sort of on-flash partition table.
> > > > >
> > > >
> > > > You're right, but maybe some customer has already used the device
> > > > tree
> > > partition table...
> > >
> > > My main point was to encourage us to shift away from this rather
> > > than to rip it out right this instant.
> > >
> >
> > Yes, that's the correct way we should go.
> > Would you please pick up this patch first to resolve current issue we
> faced?
> > And we can consider to use the mtdparts or on-flash partition table for
> long term.
> 
> Fixing U-Boot would make the problem go away without any issues with
> partition compatibility.  Are you sure nobody's using these SPI
> partitions without booting from SPI?  Even if nobody's using this, it
> seems a wasteful solution.  These are pretty small flashes.
> 
Scott,

I will submit a patch in U-Boot to fix this issue. Some quick questions:
1. Should we set the SPI flash as MTDPARTS_DEFAULT?
2. Should we consider the partition for NAND/NOR in mtdparts?
3. We need to remove the partition table in device tree, right?

Thanks,
Mingkai
Scott Wood - Oct. 1, 2013, 7:37 p.m.
On Mon, 2013-09-30 at 03:31 -0500, Hu Mingkai-B21284 wrote:
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Wednesday, September 25, 2013 3:37 AM
> > To: Hu Mingkai-B21284
> > Cc: Wood Scott-B07421; linuxppc-dev@ozlabs.org
> > Subject: Re: [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions
> > property
> > 
> > Fixing U-Boot would make the problem go away without any issues with
> > partition compatibility.  Are you sure nobody's using these SPI
> > partitions without booting from SPI?  Even if nobody's using this, it
> > seems a wasteful solution.  These are pretty small flashes.
> > 
> Scott,
> 
> I will submit a patch in U-Boot to fix this issue. Some quick questions:
> 1. Should we set the SPI flash as MTDPARTS_DEFAULT?
> 2. Should we consider the partition for NAND/NOR in mtdparts?
> 3. We need to remove the partition table in device tree, right?

Fixing the U-Boot size problem is separate from changing how we do
partitioning, but yes, we should transition all flashes to using
mtdparts instead of device tree partitions.

As to when to remove them from the device tree, that's a bit tricky.
There's no guarantee when a user updates their U-Boot environment
relative to when they update their device tree.  It's better to have
the partitions appear twice than to not appear at all.  But we do want
to discourage the use of the device tree partitions, and it would be
bad if the descriptions don't match and a user ends up mixing the two.

-Scott

Patch

diff --git a/arch/powerpc/boot/dts/bsc9131rdb.dtsi b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
index 9e6c013..8250593 100644
--- a/arch/powerpc/boot/dts/bsc9131rdb.dtsi
+++ b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
@@ -81,32 +81,25 @@ 
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <50000000>;
-
-			/* 512KB for u-boot Bootloader Image */
-			partition@0 {
-				reg = <0x0 0x00080000>;
-				label = "SPI Flash U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			/* 512KB for DTB Image */
-			partition@80000 {
-				reg = <0x00080000 0x00080000>;
-				label = "SPI Flash DTB Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			/* 4MB for Linux Kernel Image */
-			partition@100000 {
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Flash Kernel Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			/*11MB for RFS Image */
-			partition@500000 {
-				reg = <0x00500000 0x00B00000>;
-				label = "SPI Flash RFS Image";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
-
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/c293pcie.dts b/arch/powerpc/boot/dts/c293pcie.dts
index 1238bda..8ee8459 100644
--- a/arch/powerpc/boot/dts/c293pcie.dts
+++ b/arch/powerpc/boot/dts/c293pcie.dts
@@ -169,31 +169,24 @@ 
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <50000000>;
-
-			partition@0 {
-				/* 1MB for u-boot Bootloader Image */
-				/* 1MB for Environment */
-				reg = <0x0 0x00100000>;
-				label = "SPI Flash U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@100000 {
-				/* 512KB for DTB Image */
-				reg = <0x00100000 0x00080000>;
-				label = "SPI Flash DTB Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@180000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00180000 0x00400000>;
-				label = "SPI Flash Linux Kernel Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@580000 {
-				/* 10.5MB for RFS Image */
-				reg = <0x00580000 0x00a80000>;
-				label = "SPI Flash RFS Image";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dtsi b/arch/powerpc/boot/dts/mpc8536ds.dtsi
index 7c3dde8..daa3de4 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dtsi
+++ b/arch/powerpc/boot/dts/mpc8536ds.dtsi
@@ -150,14 +150,14 @@ 
 				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-			partition@kernel {
-				label = "kernel";
-				reg = <0x00100000 0x00500000>;
-				read-only;
-			};
 			partition@dtb {
 				label = "dtb";
-				reg = <0x00600000 0x00100000>;
+				reg = <0x00180000 0x00080000>;
+				read-only;
+			};
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
 				read-only;
 			};
 			partition@fs {
diff --git a/arch/powerpc/boot/dts/p1010rdb.dtsi b/arch/powerpc/boot/dts/p1010rdb.dtsi
index ec7c27a..e67db57 100644
--- a/arch/powerpc/boot/dts/p1010rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1010rdb.dtsi
@@ -152,36 +152,24 @@ 
 			reg = <0>;
 			spi-max-frequency = <40000000>;
 
-			partition@0 {
-				/* 1MB for u-boot Bootloader Image */
-				/* 1MB for Environment */
-				reg = <0x0 0x00100000>;
-				label = "SPI Flash U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@100000 {
-				/* 512KB for DTB Image */
-				reg = <0x00100000 0x00080000>;
-				label = "SPI Flash DTB Image";
-			};
-
-			partition@180000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00180000 0x00400000>;
-				label = "SPI Flash Linux Kernel Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@580000 {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00580000 0x00400000>;
-				label = "SPI Flash Compressed RFSImage";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@980000 {
-				/* 6.5MB for JFFS2 based RFS */
-				reg = <0x00980000 0x00680000>;
-				label = "SPI Flash JFFS2 RFS";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1020rdb-pc.dtsi b/arch/powerpc/boot/dts/p1020rdb-pc.dtsi
index c952cd3..277b563 100644
--- a/arch/powerpc/boot/dts/p1020rdb-pc.dtsi
+++ b/arch/powerpc/boot/dts/p1020rdb-pc.dtsi
@@ -154,36 +154,24 @@ 
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
 				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image*/
-				reg = <0x00080000 0x00080000>;
 				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
 				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
 				label = "file system";
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "file system jffs2";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1020rdb-pd.dts b/arch/powerpc/boot/dts/p1020rdb-pd.dts
index 987017e..b37f3e0 100644
--- a/arch/powerpc/boot/dts/p1020rdb-pd.dts
+++ b/arch/powerpc/boot/dts/p1020rdb-pd.dts
@@ -159,30 +159,24 @@ 
 				reg = <0>;
 				/* input clock */
 				spi-max-frequency = <40000000>;
-
-				partition@0 {
-					/* 512KB for u-boot Bootloader Image */
-					reg = <0x0 0x00080000>;
-					label = "SPI U-Boot Image";
+				partition@u-boot {
+					label = "u-boot";
+					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-
-				partition@80000 {
-					/* 512KB for DTB Image*/
-					reg = <0x00080000 0x00080000>;
-					label = "SPI DTB Image";
+				partition@dtb {
+					label = "dtb";
+					reg = <0x00180000 0x00080000>;
+					read-only;
 				};
-
-				partition@100000 {
-					/* 4MB for Linux Kernel Image */
-					reg = <0x00100000 0x00400000>;
-					label = "SPI Linux Kernel Image";
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
+					read-only;
 				};
-
-				partition@500000 {
-					/* 11MB for FS System Image */
-					reg = <0x00500000 0x00b00000>;
-					label = "SPI File System Image";
+				partition@fs {
+					label = "file system";
+					reg = <0x00700000 0x00900000>;
 				};
 			};
 
diff --git a/arch/powerpc/boot/dts/p1020rdb.dtsi b/arch/powerpc/boot/dts/p1020rdb.dtsi
index 1fb7e0e..f320acc 100644
--- a/arch/powerpc/boot/dts/p1020rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1020rdb.dtsi
@@ -151,39 +151,24 @@ 
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
 				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
 				label = "dtb";
+				reg = <0x00180000 0x00080000>;
 				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
 				label = "kernel";
+				reg = <0x00200000 0x00500000>;
 				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
 				label = "file system";
-				read-only;
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "file system jffs2";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1021mds.dts b/arch/powerpc/boot/dts/p1021mds.dts
index 97116f1..0d0b6f7 100644
--- a/arch/powerpc/boot/dts/p1021mds.dts
+++ b/arch/powerpc/boot/dts/p1021mds.dts
@@ -126,24 +126,23 @@ 
 				compatible = "spansion,s25sl12801";
 				reg = <0>;
 				spi-max-frequency = <40000000>; /* input clock */
-
 				partition@u-boot {
-					label = "u-boot-spi";
+					label = "u-boot";
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel-spi";
-					reg = <0x00100000 0x00500000>;
+				partition@dtb {
+					label = "dtb";
+					reg = <0x00180000 0x00080000>;
 					read-only;
 				};
-				partition@dtb {
-					label = "dtb-spi";
-					reg = <0x00600000 0x00100000>;
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
-					label = "file system-spi";
+					label = "file system";
 					reg = <0x00700000 0x00900000>;
 				};
 			};
diff --git a/arch/powerpc/boot/dts/p1021rdb-pc.dtsi b/arch/powerpc/boot/dts/p1021rdb-pc.dtsi
index d6274c5..4e6aedd 100644
--- a/arch/powerpc/boot/dts/p1021rdb-pc.dtsi
+++ b/arch/powerpc/boot/dts/p1021rdb-pc.dtsi
@@ -153,36 +153,24 @@ 
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
-				label = "SPI Flash U-Boot Image";
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
-				label = "SPI Flash DTB Image";
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Flash Linux Kernel Image";
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
-				label = "SPI Flash Compressed RFSImage";
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "SPI Flash JFFS2 RFS";
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1022ds.dtsi b/arch/powerpc/boot/dts/p1022ds.dtsi
index 873da35..faa2cb0 100644
--- a/arch/powerpc/boot/dts/p1022ds.dtsi
+++ b/arch/powerpc/boot/dts/p1022ds.dtsi
@@ -162,24 +162,23 @@ 
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
-			partition@0 {
-				label = "u-boot-spi";
+			partition@u-boot {
+				label = "u-boot";
 				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-			partition@100000 {
-				label = "kernel-spi";
-				reg = <0x00100000 0x00500000>;
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
 				read-only;
 			};
-			partition@600000 {
-				label = "dtb-spi";
-				reg = <0x00600000 0x00100000>;
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
 				read-only;
 			};
-			partition@700000 {
-				label = "file system-spi";
+			partition@fs {
+				label = "file system";
 				reg = <0x00700000 0x00900000>;
 			};
 		};
diff --git a/arch/powerpc/boot/dts/p1023rds.dts b/arch/powerpc/boot/dts/p1023rds.dts
index beb6cb1..9fcf9af 100644
--- a/arch/powerpc/boot/dts/p1023rds.dts
+++ b/arch/powerpc/boot/dts/p1023rds.dts
@@ -65,15 +65,9 @@ 
 				reg = <0>;
 				spi-max-frequency = <40000000>; /* input clock */
 				partition@u-boot {
-					/* 512KB for u-boot Bootloader Image */
+					/* 1MB for u-boot Bootloader Image */
 					label = "u-boot-spi";
-					reg = <0x00000000 0x00080000>;
-					read-only;
-				};
-				partition@dtb {
-					/* 512KB for DTB Image */
-					label = "dtb-spi";
-					reg = <0x00080000 0x00080000>;
+					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
 			};
diff --git a/arch/powerpc/boot/dts/p1024rdb.dtsi b/arch/powerpc/boot/dts/p1024rdb.dtsi
index b05dcb4..2896f98 100644
--- a/arch/powerpc/boot/dts/p1024rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1024rdb.dtsi
@@ -132,36 +132,24 @@ 
 			compatible = "spansion,m25p80";
 			reg = <0>;
 			spi-max-frequency = <40000000>;
-
-			partition@0 {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
-				label = "SPI U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@80000 {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
-				label = "SPI DTB Image";
-			};
-
-			partition@100000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Linux Kernel Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@500000 {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
-				label = "SPI Compressed RFS Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@900000 {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "SPI JFFS2 RFS";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1025rdb.dtsi b/arch/powerpc/boot/dts/p1025rdb.dtsi
index f502564..e74439c8 100644
--- a/arch/powerpc/boot/dts/p1025rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1025rdb.dtsi
@@ -142,34 +142,23 @@ 
 			spi-max-frequency = <40000000>; /* input clock */
 
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
 				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
 				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
 				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
 				label = "file system";
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "file system jffs2";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p2020rdb-pc.dtsi b/arch/powerpc/boot/dts/p2020rdb-pc.dtsi
index c21d1c7..d501d35 100644
--- a/arch/powerpc/boot/dts/p2020rdb-pc.dtsi
+++ b/arch/powerpc/boot/dts/p2020rdb-pc.dtsi
@@ -154,36 +154,24 @@ 
 			compatible = "spansion,m25p80";
 			reg = <0>;
 			spi-max-frequency = <40000000>;
-
-			partition@0 {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
-				label = "SPI U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@80000 {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
-				label = "SPI DTB Image";
-			};
-
-			partition@100000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Linux Kernel Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@500000 {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
-				label = "SPI Compressed RFS Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@900000 {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "SPI JFFS2 RFS";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p2020rdb.dts b/arch/powerpc/boot/dts/p2020rdb.dts
index 4d52bce..d47ae13 100644
--- a/arch/powerpc/boot/dts/p2020rdb.dts
+++ b/arch/powerpc/boot/dts/p2020rdb.dts
@@ -159,38 +159,24 @@ 
 				reg = <0>;
 				spi-max-frequency = <40000000>;
 
-				partition@0 {
-					/* 512KB for u-boot Bootloader Image */
-					reg = <0x0 0x00080000>;
-					label = "SPI (RO) U-Boot Image";
+				partition@u-boot {
+					label = "u-boot";
+					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-
-				partition@80000 {
-					/* 512KB for DTB Image */
-					reg = <0x00080000 0x00080000>;
-					label = "SPI (RO) DTB Image";
-					read-only;
-				};
-
-				partition@100000 {
-					/* 4MB for Linux Kernel Image */
-					reg = <0x00100000 0x00400000>;
-					label = "SPI (RO) Linux Kernel Image";
+				partition@dtb {
+					label = "dtb";
+					reg = <0x00180000 0x00080000>;
 					read-only;
 				};
-
-				partition@500000 {
-					/* 4MB for Compressed RFS Image */
-					reg = <0x00500000 0x00400000>;
-					label = "SPI (RO) Compressed RFS Image";
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
-
-				partition@900000 {
-					/* 7MB for JFFS2 based RFS */
-					reg = <0x00900000 0x00700000>;
-					label = "SPI (RW) JFFS2 RFS";
+				partition@fs {
+					label = "file system";
+					reg = <0x00700000 0x00900000>;
 				};
 			};
 		};
diff --git a/arch/powerpc/boot/dts/p2041rdb.dts b/arch/powerpc/boot/dts/p2041rdb.dts
index d97ad74..6fed1ea 100644
--- a/arch/powerpc/boot/dts/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/p2041rdb.dts
@@ -64,14 +64,14 @@ 
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p3041ds.dts b/arch/powerpc/boot/dts/p3041ds.dts
index 2fed3bc..74a3b7e 100644
--- a/arch/powerpc/boot/dts/p3041ds.dts
+++ b/arch/powerpc/boot/dts/p3041ds.dts
@@ -64,14 +64,14 @@ 
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index 1cf6148..06525b3 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -65,14 +65,14 @@ 
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p5020ds.dts b/arch/powerpc/boot/dts/p5020ds.dts
index 2869fea..b0615a3 100644
--- a/arch/powerpc/boot/dts/p5020ds.dts
+++ b/arch/powerpc/boot/dts/p5020ds.dts
@@ -64,14 +64,14 @@ 
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p5040ds.dts b/arch/powerpc/boot/dts/p5040ds.dts
index 860b5cc..1a3a994 100644
--- a/arch/powerpc/boot/dts/p5040ds.dts
+++ b/arch/powerpc/boot/dts/p5040ds.dts
@@ -62,14 +62,17 @@ 
 				partition@u-boot {
 					label = "u-boot";
 					reg = <0x00000000 0x00100000>;
-				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
+					read-only;
 				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
+					read-only;
 				};
 				partition@fs {
 					label = "file system";