diff mbox

[U-Boot,4/4] ARM: sheevaplug: correct nand partition layout

Message ID 1453051425-392-5-git-send-email-peter@korsgaard.com
State Accepted
Commit 371b9e9c394d7d96935afbc6fae318fde2fa2760
Delegated to: Stefan Roese
Headers show

Commit Message

Peter Korsgaard Jan. 17, 2016, 5:23 p.m. UTC
Commit 1e3d640316 (ARM: sheevaplug: redefine MTDPARTS) changed the partition
layout (without any description why), but didn't change the offset/size to
load the kernel from or the root=/dev/mtdblockX in the bootargs.

The 3MB forseen for a kernel is furthermore too little. A 4.4 build of
mvebu_v5_defconfig is 3.6MB:

-rw-r--r-- 1 peko peko 3.6M Jan 16 20:24 uImage.kirkwood-sheevaplug

When device tree support for sheevaplug was added to the kernel in commit
ee514b381e (ARM: Kirkwood: Add dts files for Sheevaplug and eSATA
Sheevaplug) a default flash partition layout (used if mtdparts= isn't passed
on the command line / CONFIG_MTD_CMDLINE_PARTS isn't enabled) with 1MB for
u-boot / environment, 4MB for the kernel and the rest for the rootfs, so use
that layout here and adjust the kernel loading to match.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 include/configs/sheevaplug.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Tom Rini Jan. 19, 2016, 5:14 p.m. UTC | #1
On Sun, Jan 17, 2016 at 06:23:45PM +0100, Peter Korsgaard wrote:

> Commit 1e3d640316 (ARM: sheevaplug: redefine MTDPARTS) changed the partition
> layout (without any description why), but didn't change the offset/size to
> load the kernel from or the root=/dev/mtdblockX in the bootargs.
> 
> The 3MB forseen for a kernel is furthermore too little. A 4.4 build of
> mvebu_v5_defconfig is 3.6MB:
> 
> -rw-r--r-- 1 peko peko 3.6M Jan 16 20:24 uImage.kirkwood-sheevaplug
> 
> When device tree support for sheevaplug was added to the kernel in commit
> ee514b381e (ARM: Kirkwood: Add dts files for Sheevaplug and eSATA
> Sheevaplug) a default flash partition layout (used if mtdparts= isn't passed
> on the command line / CONFIG_MTD_CMDLINE_PARTS isn't enabled) with 1MB for
> u-boot / environment, 4MB for the kernel and the rest for the rootfs, so use
> that layout here and adjust the kernel loading to match.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  include/configs/sheevaplug.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
> index c529636..f9fb9bc 100644
> --- a/include/configs/sheevaplug.h
> +++ b/include/configs/sheevaplug.h
> @@ -64,12 +64,12 @@
>  
>  #define CONFIG_MTDPARTS		\
>  	"orion_nand:512K(uboot),"				\
> -	"512K(env),1M(script),6M(kernel),"				\
> -	"12M(ramdisk),4M(spare),-(rootfs)\0"
> +	"512K(env),4M(kernel),"					\
> +	"-(rootfs)\0"
>  
>  #define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
>  	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
> -	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
> +	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000\0" \
>  	"x_bootcmd_usb=usb start\0" \
>  	"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"

Can I suggest future proofing this by using the names set in MTDPARTS
instead of direct offsets?  Thanks!
Peter Korsgaard Jan. 19, 2016, 5:48 p.m. UTC | #2
>>>>> "Tom" == Tom Rini <trini@konsulko.com> writes:

Hi,

>> #define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
 >> "=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
 >> -	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
 >> +	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000\0" \
 >> "x_bootcmd_usb=usb start\0" \
 >> "x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"

 > Can I suggest future proofing this by using the names set in MTDPARTS
 > instead of direct offsets?  Thanks!

True. I wanted to do as minimal change as possible, but I'll take a look
at using mtdparts and send a patch.

Thanks.
Stefan Roese March 24, 2016, 8:26 a.m. UTC | #3
On 17.01.2016 18:23, Peter Korsgaard wrote:
> Commit 1e3d640316 (ARM: sheevaplug: redefine MTDPARTS) changed the partition
> layout (without any description why), but didn't change the offset/size to
> load the kernel from or the root=/dev/mtdblockX in the bootargs.
>
> The 3MB forseen for a kernel is furthermore too little. A 4.4 build of
> mvebu_v5_defconfig is 3.6MB:
>
> -rw-r--r-- 1 peko peko 3.6M Jan 16 20:24 uImage.kirkwood-sheevaplug
>
> When device tree support for sheevaplug was added to the kernel in commit
> ee514b381e (ARM: Kirkwood: Add dts files for Sheevaplug and eSATA
> Sheevaplug) a default flash partition layout (used if mtdparts= isn't passed
> on the command line / CONFIG_MTD_CMDLINE_PARTS isn't enabled) with 1MB for
> u-boot / environment, 4MB for the kernel and the rest for the rootfs, so use
> that layout here and adjust the kernel loading to match.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Applied to u-boot-marvell/master.

Thanks,
Stefan
diff mbox

Patch

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index c529636..f9fb9bc 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -64,12 +64,12 @@ 
 
 #define CONFIG_MTDPARTS		\
 	"orion_nand:512K(uboot),"				\
-	"512K(env),1M(script),6M(kernel),"				\
-	"12M(ramdisk),4M(spare),-(rootfs)\0"
+	"512K(env),4M(kernel),"					\
+	"-(rootfs)\0"
 
 #define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
 	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
-	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
+	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000\0" \
 	"x_bootcmd_usb=usb start\0" \
 	"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"