eMMC Flash Layout

This is really great Topic and can help to understand eMMC layout. Still I am not quite sure how to calculate start offset to re-partition eMCC storage. Android u-boot and Linux u-boot don’t use same eMMC layout!

android u-boot:

kvim#version

U-Boot 2015.01-g8d3f947 (Jun 03 2017 - 17:55:30)
aarch64-linux-gnu-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
GNU ld (GNU Binutils for Ubuntu) 2.24
kvim#


MMC: aml_priv->desc_buf = 0x0000000073ecc6b0
aml_priv->desc_buf = 0x0000000073ece9d0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
[mmc_startup] mmc refix success
[mmc_init] mmc init success
mmc read lba=0x14000, blocks=0x400
start dts,buffer=0000000073ed1270,dt_addr=0000000073ed1270
parts: 11
00: logo 0000000002000000 1
01: recovery 0000000002000000 1
02: rsv 0000000000800000 1
03: tee 0000000000800000 1
04: crypt 0000000002000000 1
05: misc 0000000002000000 1
06: instaboot 0000000020000000 1
07: boot 0000000002000000 1
08: system 0000000040000000 1
09: cache 0000000020000000 2
10: data ffffffffffffffff 4
get_dtb_struct: Get emmc dtb OK!
overide_emmc_partition_table: overide cache
[mmc_get_partition_table] skip partition cache.
Partition table get from SPL is :
name offset size flag

0: bootloader 0 400000 0
1: reserved 2400000 4000000 0
2: cache 6c00000 20000000 2
3: env 27400000 800000 0
4: logo 28400000 2000000 1
5: recovery 2ac00000 2000000 1
6: rsv 2d400000 800000 1
7: tee 2e400000 800000 1
8: crypt 2f400000 2000000 1
9: misc 31c00000 2000000 1
10: instaboot 34400000 20000000 1
11: boot 54c00000 2000000 1
12: system 57400000 40000000 1
13: data 97c00000 30c200000 4
mmc read lba=0x12000, blocks=0x2
mmc read lba=0x12002, blocks=0x2
mmc_read_partition_tbl: mmc read partition OK!
eMMC/TSD partition table have been checked OK!
mmc env offset: 0x27400000

Ubuntu u-boot:
kvim#version

U-Boot 2015.01-g7861c5a (Jun 04 2017 - 15:40:09)
aarch64-linux-gnu-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
GNU ld (GNU Binutils for Ubuntu) 2.24
kvim#


MMC: aml_priv->desc_buf = 0x0000000073ecf6b0
aml_priv->desc_buf = 0x0000000073ed19d0
SDIO Port B: 0, SDIO Port C: 1
emmc/sd response timeout, cmd8, status=0x1ff2800
emmc/sd response timeout, cmd55, status=0x1ff2800
[mmc_startup] mmc refix success
[mmc_init] mmc init success
mmc read lba=0x14000, blocks=0x400
start dts,buffer=0000000073ed4270,dt_addr=0000000073ed4270
parts: 3
00: logo 0000000002000000 1
01: ramdisk 0000000002000000 1
02: rootfs ffffffffffffffff 4
get_dtb_struct: Get emmc dtb OK!
Partition table get from SPL is :
name offset size flag

0: bootloader 0 400000 0
1: reserved 2400000 4000000 0
2: env 6c00000 800000 0
3: logo 7c00000 2000000 1
4: ramdisk a400000 2000000 1
5: rootfs cc00000 397200000 4
mmc read lba=0x12000, blocks=0x2
mmc read lba=0x12002, blocks=0x2
mmc_read_partition_tbl: mmc read partition OK!
eMMC/TSD partition table have been checked OK!
mmc env offset: 0x6c00000

So if using Ubuntu u-boot what is start sector for fdisk? Ubunt u-boot have ext4load so there is no need for that ramdisk partition right? If so then one could create new partition from ramdisk offset a400000 ?

@Andrey how did you came to this start sector: 212992

Plan is currently to create an eMMC partition, but not to break u-boot, to install [ArchLinuxArm] (Installing ArchLinuxARM on Khadas VIM Pro device - #3 by vrabac) and boot from that partition. Currently I boot ArchLinuxArm from micro SD card and that works fine, but is a bit slow and not enough capacity.