Skip to content

Instantly share code, notes, and snippets.

@mbahmodin
Last active September 23, 2023 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbahmodin/d0bb5655dbef2ca63a465decf7666171 to your computer and use it in GitHub Desktop.
Save mbahmodin/d0bb5655dbef2ca63a465decf7666171 to your computer and use it in GitHub Desktop.
Android Mboot MMC Command Introduction

Android Mboot MMC Command Introduction

Mboot currently supports the following MMC commands:

  1. MMC Read/Write:

    • Addr: Memory address
    • Blk#: Starting block number
    • Size: Size of the block to be read/written

    Example:

    • MMC Read: #mmc read 0x50000000 0x400b 0x400000
    • MMC Write: #mmc write 0x50000000 0x400b 0x400000

    Note: Return "OK" indicates a successful read/write.

    The latest code of MMC Write adds a parameter "1" at the end, in the following format:

    • #mmc write 0x50000000 0x400b 0x400000 1

    This indicates that the write operation skips the blank invalid data segment and does not write it. By default, if not added, it does not distinguish between writing all data into the MMC.

  2. MMC Read.p/Write.p/Write.p.continue:

    • These commands are similar to MMC Read/Write but use partition_name instead of blk# as the second parameter.

    Example:

    • MMC Read.p: #mmc read.p/write.p 0x50000000 boot 0x400000

    The MMC Write.p.continue command is used to write data to the specified partition offset.

    Example:

    • MMC Write.p.continue: #mmc write.p.continue 0x50000000 userdata 0x6400000 0xa00000

    Note: Return "OK" indicates successful read/write. Similarly, Write.p/Write.p.continue with parameter "1" at the end has the same effect as the MMC Write command.

  3. MMC Rescan:

    • The initialize command is not very useful because it is done before each command.
  4. MMC Part:

    • Print the current partition information.
  5. MMC Dev:

    • Show the current partition and switch between partitions.
    • Usage: #mmc dev 0 1 (Switch from hardware partition 0 to hardware partition 1).
  6. MMC List:

    • List the currently used MMC device commands.
  7. MMC Create:

    • Create MMC partition.
    • Usage: #mmc create boot 0x400000 (Create a partition named "boot" with size 0x400000 bytes).
    • Note: Partitions need to be created in order.
  8. MMC Remove:

    • Remove the MMC partition.
    • Usage: #mmc remove boot (Remove the "boot" partition).
    • If you want to update the partition table, please use it with mmc rmgpt and mmc create.
  9. MMC Rmgpt:

    • Remove all current partitions.
  10. MMC Slc Size Reliable_Write:

    • Set SLC partition size.
    • Size: Number of SLC partition bytes to be set.
    • Size 0 means do not set SLC mode.
    • Reliable_Write: Enable/disable the reliable write function.
  11. MMC Ecsd:

    • Print ECSD register information for debugging.
  12. Bin2emmc:

    • Burn the MMC bin file from FAT32 USB disk into MMC. CL540869 supports.
  13. MMC Setecsd Num Mask Value:

    • Modify the ECSD register by setting a single bit.
  14. MMC Size:

    • Display available capacity, block size, and total number of blocks of ECMS.
    • Show SLC size, the maximum size of SLC partition, and the support/setting status of ECMS for reliable write.
  15. MMC Slcchk:

    • Check the current SLC/MLC configuration, and the related status is stored in ENV.
  16. MMC Relwrchk:

    • Check the current reliable write configuration, and the related status is stored in ENV.
  17. MMC Slcrelwrchk:

    • Check the current SLC/MLC and reliable write configuration, and the related status is saved in ENV.
  18. MMC Unlzo:

    • Decompress the LZO partition image and write it to the MMC partition.
    • Example: #mmc unlzo 0x50000000 0x6400000 system (Decompress the 100MB image saved at address 0x50000000 and write it to the "system" partition).
  19. MMC Erase:

    • Erase MMC blocks or partitions.
    • Usage:
      • #mmc erase 0 0x400000 (Erase 4MB size from block 0)
      • #mmc erase boot 0x400000 (Erase 4MB data from the "boot" partition onwards)
      • #mmc erase (Erase the entire chip)
  20. MMC DD:

    • Dump raw data between MMC and USB.
    • Note: This operation will damage the USB disk file system, so please backup data before use.
    • Usage:
      • #mmc dd mmc2usb (Dump MMC data to USB)
      • #mmc dd usb2mmc (Dump USB data to MMC)
  21. MMC Alignsize:

    • Query the alignment unit of SLC partition size.

Translated with www.DeepL.com/Translator (free version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment