Tool/software:
The following are the steps I took after entering the u-boot environment
=> mmc list
mmc@fa10000: 0 (eMMC)
mmc@fa00000: 1
=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
Tried to clear the partition table data, failed
=> mmc write 0 0 0x22
MMC write: dev # 0, block # 0, count 34 ... sdhci_transfer_data: Transfer data t
mmc write failed
0 blocks written: ERROR
This is the emmc information
=> mmc info
Device: mmc@fa10000
Manufacturer ID: 13
OEM: 4e
Name: G1M15L
Bus Speed: 200000000
Mode: HS200 (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.6 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.6 GiB WRREL
Boot Capacity: 31.5 MiB ENH
RPMB Capacity: 4 MiB ENH
Tried to partition and write to emmc
=> setenv uuid_gpt_disk 858b79ff-605c-413d-9b37-a4fa34aa9e1d
=> setenv uuid_gpt_boot 1dc2a05a-7801-4a5a-9624-ca7d84757352
=> setenv uuid_gpt_rootfs 853f35d9-d517-4865-8829-b205f336f0ca
=> setenv partitions "uuid_disk=${uuid_gpt_disk};\
> name=boot,start=32MiB,size=128MiB,uuid=${uuid_gpt_boot};\
> name=rootfs,start=160MiB,size=-,uuid=${uuid_gpt_rootfs}"
=> gpt write mmc 0 ${partitions}
gpt - GUID Partition Table
Usage:
gpt <command> <interface> <dev> <partitions_list>
- GUID partition table restoration and validity check
Restore or verify GPT information on a device connected
to interface
Example usage:
gpt repair mmc 0
- repair the GPT on the device
gpt write mmc 0 $partitions
- write the GPT to device
gpt verify mmc 0 $partitions
- verify the GPT on device against $partitions
gpt setenv mmc 0 $name
- setup environment variables for partition $name:
gpt_partition_addr, gpt_partition_size,
gpt_partition_name, gpt_partition_entry,
gpt_partition_bootable
gpt enumerate mmc 0
- store list of partitions to gpt_partition_list environment variable
gpt guid <interface> <dev>
- print disk GUID
gpt guid <interface> <dev> <varname>
- set environment variable to disk GUID
Example usage:
gpt guid mmc 0
gpt guid mmc 0 varname
After reset, re-entered u-boot,
found that there was only a rootfs partition, no boot partition
=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> mmc part
Partition Map for MMC device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00001000 0x03b47fde "rootfs"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 1dc2a05a-7801-4a5a-9624-ca7d84757352