I have built the system based on U-Boot and Linux taken from ubuntu branches of your Git repository and created bootable SD card (16G size).
Then I have erased eMMC flash including the partition table and do the following procedure:
1) Boot the boart and enter into U-Boot console by pressing Esc or Enter or Ctrl+C key.
2) initialize SD Card:
Device: SDIO Port B
Manufacturer ID: 41
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.5 GiB
mmc clock: 40000000
Bus Width: 4-bit
3) read DTB from SD Card:
kvim# ext4load mmc 0:1 0x01080000 /boot/kvim.dtb
37054 bytes read in 42 ms (861.3 KiB/s)
4) write DTB to eMMC (and init partition table):
kvim# store dtb write 1080000
[store]To run cmd[emmc dtb_write 1080000 0x40000]
write emmc dtb
mmc read lba=0x14000, blocks=0x400
00: logo 0000000002000000 1
01: boot 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: cache 6c00000 0 0
3: env 7400000 800000 0
4: logo 8400000 2000000 1
5: boot ac00000 2000000 1
6: rootfs d400000 1c4c00000 4
mmc read lba=0x12000, blocks=0x2
mmc read lba=0x12002, blocks=0x2
mmc_read_partition_tbl: mmc read partition ERROR!
mmc write lba=0x12000, blocks=0x2
mmc write lba=0x12002, blocks=0x2
mmc_write_partition_tbl: mmc write partition OK!
partition table success
5) Store U-Boot Environmets to the env partition:
Saving Environment to aml-storage...
mmc env offset: 0x7400000
Writing to MMC(1)... done
6) reboot the system:
Now I have following
1) On the Linux userspace after system start in the dev file system I have following inodes:
How these devices corresponded with U-Boot partition table present in the Preamble?
2) When I create following partitions on the /dev/mmcblk1 device:
start sector: 352256
end sector: 417791
start sector: 417892
end sector: (last sector of eMMC)
I see the new inodes:
and I create the filesystems boot - 32M, rootfs size of rest of eMMC.
But after reboot the new file systems ar lost I think because U-Boot re-initializes partitions during start.
How to use the boot and rootfs partitions on user-space?
May be we have to do some patch for kernel and U-Boot to be able keep the partitions for a long time?
3) Could you please prepare the documentation which consider:
- eMMC initialisation from scrutch
- U-Boot partition table format (from U-Boot vision, kernel vision, user-space vision)
4) Could you please write a guidance about LOGO and publish at Khadas Docs.
I have upload my first build to the FTP.
If you interest then you can create bootable SD by following commands:
# cat khadas-vim.boot-records khadas-vim.ext4fs > SDHC.img
# dd if=SDHC.img of=/dev/<your mounted device, for example, mmcblk0>