
On 8 February 2018 at 20:26, Tom Rini trini@konsulko.com wrote:
On Wed, Feb 07, 2018 at 08:41:32PM +0200, Sam Protsenko wrote:
From DFU_ALT_INFO_EMMC (include/environment/ti/dfu.h) we can see that rootfs will be flashed to second partition on eMMC. But at the moment we have only one partition in $partitions environment variable. Let's add "bootloader" partition prior to "rootfs", so that DFU works correctly. This also fixes eMMC boot, which looks for rootfs on second partition.
"bootloader" partition start corresponds to "u-boot.img.raw" in DFU eMMC info, which is 0x300 sector (384 KiB offset from eMMC start).
rootfs start address can be also found from DFU eMMC info. bootloader-related area is finished at 0x1500 sector (2688 KiB offset from eMMC start). This should be the start address for rootfs in $partitions environment variable.
While at it, fix U-Boot environment address to be the same as for AM57x EVM, so that it doesn't clash with other partitions.
So now eMMC layout looks like this:
=============================================================== 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 | 128 - | (redundant) | 2688 +------------------------+ | rootfs | remaining rootfs end +------------------------+ ===============================================================
"hole" area can be used further for storing U-Boot environment (like it's done in AM57x EVM config file) or for increasing u-boot.img area (in case u-boot.img size increased, e.g. if new dtbs were added).
This commit conforms with Linux partition table from f6d245b8c56c ("arm: am57xx: Fix Linux boot from eMMC") commit, making things in uniform way.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
Reviewed-by: Tom Rini trini@konsulko.com
Hi Tom,
If there are no objections against this patch, can you please merge it? We are working on BBB-based course, and I would love to see it in v2018.03, so that students can checkout to that stable tag and have all needed BBB support in upstream.
Thanks!
-- Tom