diff mbox series

[2/4] arm: dra7xx: Fix Linux boot from eMMC

Message ID 20170921193759.3914-3-semen.protsenko@linaro.org
State New
Headers show
Series arm: am57xx/dra7xx: Improve eMMC Linux boot | expand

Commit Message

Sam Protsenko Sept. 21, 2017, 7:37 p.m. UTC
Right now on OMAP5-based boards we have only one partition defined for
Linux boot, which is rootfs. That doesn't work with bootpart=1:2 (that
is defined in include/environment/ti/boot.h). To fix Linux boot we may
either:

 1. Change bootpart to be 1:1
 2. Or add preceding partition, so that rootfs is actually 1:2

Second choice seems more reasonable, as DFU is already using similar
partition table and can rely on bootpart to be 1:2.

This patch adds "bootloader" partition. So now eMMC layout for Linux
boot looks like this:

offset               content                 size          partition
(KiB)                                        (KiB)

Comments

Tom Rini Sept. 24, 2017, 2:40 p.m. UTC | #1
On Thu, Sep 21, 2017 at 10:37:57PM +0300, Sam Protsenko wrote:

> Right now on OMAP5-based boards we have only one partition defined for

> Linux boot, which is rootfs. That doesn't work with bootpart=1:2 (that

> is defined in include/environment/ti/boot.h). To fix Linux boot we may

> either:

> 

>  1. Change bootpart to be 1:1

>  2. Or add preceding partition, so that rootfs is actually 1:2

> 

> Second choice seems more reasonable, as DFU is already using similar

> partition table and can rely on bootpart to be 1:2.

> 

> This patch adds "bootloader" partition. So now eMMC layout for Linux

> boot looks like this:

> 

> offset               content                 size          partition

> (KiB)                                        (KiB)

> =======================================================================

> 

> 0       +--------------------------------+

>         | MBR/GPT header                 |   128           -

> 128     +--------------------------------+

>         | MLO                            |   256           -

> 384     +--------------------------------+

>         | u-boot.img                     |   1792          bootloader

> 2176    +--------------------------------+

>         | //////////// hole //////////// |   256           -

> 2432    +--------------------------------+

>         | U-Boot environment             |   128           -

> 2560    +--------------------------------+

>         | U-Boot environment (redundant) |   128           -

> 2688    +--------------------------------+

>         | rootfs                         |   remaining     rootfs

> end     +--------------------------------+

> 

> =======================================================================

> 

> Guard hole appears because U-Boot environment offset was calculated for

> Android partition table, which has two additional partitions in place of

> that hole ("environment" and "misc" partitions).

> 

> This patch also changes rootfs offset from 2 MiB further to 2688 KiB,

> so that there won't be any collisions with U-Boot environment when we

> flash rootfs.

> 

> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>


Reviewed-by: Tom Rini <trini@konsulko.com>


-- 
Tom
Tom Rini Sept. 29, 2017, 8:26 p.m. UTC | #2
On Thu, Sep 21, 2017 at 10:37:57PM +0300, Sam Protsenko wrote:

> Right now on OMAP5-based boards we have only one partition defined for

> Linux boot, which is rootfs. That doesn't work with bootpart=1:2 (that

> is defined in include/environment/ti/boot.h). To fix Linux boot we may

> either:

> 

>  1. Change bootpart to be 1:1

>  2. Or add preceding partition, so that rootfs is actually 1:2

> 

> Second choice seems more reasonable, as DFU is already using similar

> partition table and can rely on bootpart to be 1:2.

> 

> This patch adds "bootloader" partition. So now eMMC layout for Linux

> boot looks like this:

> 

> offset               content                 size          partition

> (KiB)                                        (KiB)

> Reviewed-by: Tom Rini <trini@konsulko.com>

> 

> =======================================================================

> 

> 0       +--------------------------------+

>         | MBR/GPT header                 |   128           -

> 128     +--------------------------------+

>         | MLO                            |   256           -

> 384     +--------------------------------+

>         | u-boot.img                     |   1792          bootloader

> 2176    +--------------------------------+

>         | //////////// hole //////////// |   256           -

> 2432    +--------------------------------+

>         | U-Boot environment             |   128           -

> 2560    +--------------------------------+

>         | U-Boot environment (redundant) |   128           -

> 2688    +--------------------------------+

>         | rootfs                         |   remaining     rootfs

> end     +--------------------------------+

> 

> =======================================================================

> 

> Guard hole appears because U-Boot environment offset was calculated for

> Android partition table, which has two additional partitions in place of

> that hole ("environment" and "misc" partitions).

> 

> This patch also changes rootfs offset from 2 MiB further to 2688 KiB,

> so that there won't be any collisions with U-Boot environment when we

> flash rootfs.

> 

> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

=======================================================================

0       +--------------------------------+
        | MBR/GPT header                 |   128           -
128     +--------------------------------+
        | MLO                            |   256           -
384     +--------------------------------+
        | u-boot.img                     |   1792          bootloader
2176    +--------------------------------+
        | //////////// hole //////////// |   256           -
2432    +--------------------------------+
        | U-Boot environment             |   128           -
2560    +--------------------------------+
        | U-Boot environment (redundant) |   128           -
2688    +--------------------------------+
        | rootfs                         |   remaining     rootfs
end     +--------------------------------+

=======================================================================

Guard hole appears because U-Boot environment offset was calculated for
Android partition table, which has two additional partitions in place of
that hole ("environment" and "misc" partitions).

This patch also changes rootfs offset from 2 MiB further to 2688 KiB,
so that there won't be any collisions with U-Boot environment when we
flash rootfs.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 include/configs/dra7xx_evm.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 6c0fc35d3a..1555fc1b50 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -51,7 +51,8 @@ 
 #define PARTS_DEFAULT \
 	/* Linux partitions */ \
 	"uuid_disk=${uuid_gpt_disk};" \
-	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
+	"name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};" \
+	"name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}\0" \
 	/* Android partitions */ \
 	"partitions_android=" \
 	"uuid_disk=${uuid_gpt_disk};" \