Skip to contentSkip to conversation

doc: mmc man-page

RFC PATCH New Jaehoon Chung 2 participants 3 messages Feb 26, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20210226100058epcas1p3b2ed1a20412b147ed66bd92c367f46c3@epcas1p3.samsung.com

#1 lore raw

RFC PATCH 1/1 doc: mmc man-page

Provide a man-pages for the mmc command.

---
 doc/usage/mmc.rst | 149 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 149 insertions(+)
 create mode 100644 doc/usage/mmc.rst
doc/usage/mmc.rst new file +149 -0
new file mode 100644
index 000000000000..30fee447d409
@@ -0,0 +1,149 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+mmc command
+============
+
+Synopsis
+--------
+
+::
+
+    mmc info
+    mmc read addr blk# cnt
+    mmc write addr blk# cnt
+    mmc erase blk# cnt
+    mmc rescan
+    mmc part
+    mmc dev [dev] [part]
+    mmc list
+    mmc wp
+    mmc bootbus <dev> <boot_bus_width> <reset_boot_bus_width> <boot_mode>
+    mmc bootpart-resize <dev> <dev part size MB> <RPMB part size MB>
+    mmc partconf <dev> [boot_ack boot_partition partition_access]
+    mmc rst-function <dev> <value>
+
+Description
+-----------
+
+The mmc command is used to control MMC(eMMC/SD) device
+
+The *mmc info* displays information (Manufacturer ID, OEM, Name, Bus Speed, Mode, ...) of MMC device
+
+The *mmc read* command reads raw data to memory address from MMC device with block offset and count
+
+The *mmc write* write raw data to MMC device from memory address with block offset and count
+    addr - memory address
+
+    blk# - start block offset
+
+    cnt - block count
+
+The *mmc erase* erases MMC device from block offset until count
+    blk# - start block offset
+
+    cnt - block count
+
+The *mmc rescan* scans the available MMC device
+
+The *mmc part* displays the list available partition on current mmc device
+
+The *mmc dev* show or set current mmc device
+    [dev]
+        device number to change
+    [part]
+        partition number to change
+
+The *mmc list* displays the list avaiable devices
+
+The *mmc wp* enables "power on write protect" function about boot partitions
+
+The *mmc bootbus* sets the BOOT_BUS_WIDTH feild
+    BOOTU_BUS_WIDTH[177] is one of EXT_CSD register. (*Refer to eMMC specification*)
+
+The *mmc-bootpart-resize* changes sizes of boot and RPMB partition
+    dev - device number
+
+    boot part size MB - Size to change boot partition
+
+    RPMB part size MB - Size to chagne RPMB partition
+
+The *mmc rst-function* change the RST_n_FUNCTION filed
+    **WARNING**: This is a write-once filed. (*Refer to eMMC specification*)
+
+Example
+-------
+
+The *mmc info* command displays device's capabilities:
+::
+
+    => mmc info
+    Device: EXYNOS DWMMC
+    Manufacturer ID: 45
+    OEM: 100
+    Name: SDW16
+    Bus Speed: 52000000
+    Mode: MMC DDR52 (52MHz)
+    Rd Block Len: 512
+    MMC version 5.0
+    High Capacity: Yes
+    Capacity: 14.7 GiB
+    Bus Width: 8-bit DDR
+    Erase Group Size: 512 KiB
+    HC WP Group Size: 8 MiB
+    User Capacity: 14.7 GiB WRREL
+    Boot Capacity: 4 MiB ENH
+    RPMB Capacity: 4 MiB ENH
+    Boot area 0 is not write protected
+    Boot area 1 is not write protected
+
+The raw data can be read/written via *mmc read/write* command:
+::
+
+    => mmc read 0x40000000 0x5000 0x100
+    MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK
+
+    => mmc write 0x40000000 0x5000 0x10
+    MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK
+
+The partition list can be shown via *mmc part* command:
+::
+
+    => mmc part
+    Partition Map for MMC device 0  --   Partition Type: DOS
+
+    Part    Start Sector    Num Sectors     UUID            Type
+      1     8192            131072          dff8751a-01     0e Boot
+      2     139264          6291456         dff8751a-02     83
+      3     6430720         1048576         dff8751a-03     83
+      4     7479296         23298048        dff8751a-04     05 Extd
+      5     7481344         307200          dff8751a-05     83
+      6     7790592         65536           dff8751a-06     83
+      7     7858176         16384           dff8751a-07     83
+      8     7876608         22900736        dff8751a-08     83
+
+The current device can be shown or set via *mmc dev* command:
+::
+
+    => mmc dev
+    switch to partitions #0, OK
+    mmc0(part0) is current device
+    => mmc dev 2 0
+    switch to partitions #0, OK
+    mmc2 is current device
+
+The list of available devices can be shown via *mmc list* command:
+::
+
+    => mmc list
+    mmc list
+    EXYNOS DWMMC: 0 (eMMC)
+    EXYNOS DWMMC: 2 (SD)
+
+Configuration
+-------------
+
+The mmc command is only avaialble if CONFIG_CMD_MMC=y.
+Some commands need to enable more configuration.
+
+* write / erase - CONFIG_MMC_WRITE
+* bootbus - CONFIG_SUPPORT_EMMC_BOOT=y
Signature · 1 line
2.29.0
#2 lore raw

RFC PATCH 1/1 doc: mmc man-page

Quoted 5 lines · Jaehoon Chung

Provide a man-pages for the mmc command.

---
  doc/usage/mmc.rst | 149 ++++++++++++++++++++++++++++++++++++++++++++++

Thanks a lot for providing a man-page for the mmc command.

You have to change doc/usage/index.rst too.

Quoted 21 lines
  1 file changed, 149 insertions(+)

create mode 100644 doc/usage/mmc.rst

doc/usage/mmc.rst new file +12 -0
new file mode 100644
index 000000000000..30fee447d409
@@ -0,0 +1,149 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+mmc command
+============
+
+Synopsis
+--------
+
+::
+
+    mmc info
+    mmc read addr blk# cnt

doc/usage/mmc.rst line 22

Quoted 10 lines
doc/usage/mmc.rst new file +10 -0
+    mmc write addr blk# cnt
+    mmc erase blk# cnt
+    mmc rescan
+    mmc part
+    mmc dev [dev] [part]
+    mmc list
+    mmc wp
+    mmc bootbus <dev> <boot_bus_width> <reset_boot_bus_width> <boot_mode>
+    mmc bootpart-resize <dev> <dev part size MB> <RPMB part size MB>
+    mmc partconf <dev> [boot_ack boot_partition partition_access]

This sub-command is missing below.

doc/usage/mmc.rst line 28

Quoted 6 lines
doc/usage/mmc.rst new file +6 -0
+    mmc rst-function <dev> <value>
+
+Description
+-----------
+
+The mmc command is used to control MMC(eMMC/SD) device

Please, add missing full stops '.'.

doc/usage/mmc.rst line 35

Quoted 7 lines
doc/usage/mmc.rst new file +7 -0
+
+The *mmc info* displays information (Manufacturer ID, OEM, Name, Bus Speed, Mode, ...) of MMC device
+
+The *mmc read* command reads raw data to memory address from MMC device with block offset and count
+
+The *mmc write* write raw data to MMC device from memory address with block offset and count
+    addr - memory address

Please format arguments like this:

addr
memory address

You can check the formatting using 'make htmldocs'.

Quoted 6 lines
doc/usage/mmc.rst new file +6 -0
+
+    blk# - start block offset
+
+    cnt - block count
+
+The *mmc erase* erases MMC device from block offset until count

doc/usage/mmc.rst line 51

Quoted 10 lines
doc/usage/mmc.rst new file +10 -0
+    blk# - start block offset
+
+    cnt - block count
+
+The *mmc rescan* scans the available MMC device
+
+The *mmc part* displays the list available partition on current mmc device
+
+The *mmc dev* show or set current mmc device
+    [dev]

Please, remove the brackets.

doc/usage/mmc.rst line 56

Quoted 5 lines
doc/usage/mmc.rst new file +5 -0
+        device number to change
+    [part]
+        partition number to change
+
+The *mmc list* displays the list avaiable devices

The *mmc list* command ...

doc/usage/mmc.rst line 58

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+The *mmc wp* enables "power on write protect" function about boot partitions

The *mmc wp* command ...

%s/about/for/

Please, mention that power cycling is needed to lift the write protection.

doc/usage/mmc.rst line 60

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+The *mmc bootbus* sets the BOOT_BUS_WIDTH feild

The *mmc bootbus* command ...

%s/feild/field/

doc/usage/mmc.rst line 63

Quoted 3 lines
doc/usage/mmc.rst new file +3 -0
+    BOOTU_BUS_WIDTH[177] is one of EXT_CSD register. (*Refer to eMMC specification*)
+
+The *mmc-bootpart-resize* changes sizes of boot and RPMB partition

partitions.

doc/usage/mmc.rst line 66

Quoted 3 lines
doc/usage/mmc.rst new file +3 -0
+    dev - device number
+
+    boot part size MB - Size to change boot partition

How about:

target size of boot partition

doc/usage/mmc.rst line 68

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+    RPMB part size MB - Size to chagne RPMB partition

%s/chagne/change/

target size of RPMB partition

doc/usage/mmc.rst line 70

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+The *mmc rst-function* change the RST_n_FUNCTION filed

field?

I think we should describe what a RST_n_FUNCTION is.

We should enumerate the allowable values. The eMMC specification (JEDEC Standard No. 84-B51, 2014) has:

0x0: RST_n signal is temporarily disabled (default) 0x1: RST_n signal is permanently enabled 0x2: RST_n signal is permanently disabled

doc/usage/mmc.rst line 71

Quoted 1 line
doc/usage/mmc.rst new file +1 -0
+    **WARNING**: This is a write-once filed. (*Refer to eMMC specification*)

%s/filed/field/

Quoted 65 lines
doc/usage/mmc.rst new file +65 -0
+
+Example
+-------
+
+The *mmc info* command displays device's capabilities:
+::
+
+    => mmc info
+    Device: EXYNOS DWMMC
+    Manufacturer ID: 45
+    OEM: 100
+    Name: SDW16
+    Bus Speed: 52000000
+    Mode: MMC DDR52 (52MHz)
+    Rd Block Len: 512
+    MMC version 5.0
+    High Capacity: Yes
+    Capacity: 14.7 GiB
+    Bus Width: 8-bit DDR
+    Erase Group Size: 512 KiB
+    HC WP Group Size: 8 MiB
+    User Capacity: 14.7 GiB WRREL
+    Boot Capacity: 4 MiB ENH
+    RPMB Capacity: 4 MiB ENH
+    Boot area 0 is not write protected
+    Boot area 1 is not write protected
+
+The raw data can be read/written via *mmc read/write* command:
+::
+
+    => mmc read 0x40000000 0x5000 0x100
+    MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK
+
+    => mmc write 0x40000000 0x5000 0x10
+    MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK
+
+The partition list can be shown via *mmc part* command:
+::
+
+    => mmc part
+    Partition Map for MMC device 0  --   Partition Type: DOS
+
+    Part    Start Sector    Num Sectors     UUID            Type
+      1     8192            131072          dff8751a-01     0e Boot
+      2     139264          6291456         dff8751a-02     83
+      3     6430720         1048576         dff8751a-03     83
+      4     7479296         23298048        dff8751a-04     05 Extd
+      5     7481344         307200          dff8751a-05     83
+      6     7790592         65536           dff8751a-06     83
+      7     7858176         16384           dff8751a-07     83
+      8     7876608         22900736        dff8751a-08     83
+
+The current device can be shown or set via *mmc dev* command:
+::
+
+    => mmc dev
+    switch to partitions #0, OK
+    mmc0(part0) is current device
+    => mmc dev 2 0
+    switch to partitions #0, OK
+    mmc2 is current device
+
+The list of available devices can be shown via *mmc list* command:
+::
+

doc/usage/mmc.rst line 146

Quoted 10 lines
doc/usage/mmc.rst new file +10 -0
+    => mmc list
+    mmc list
+    EXYNOS DWMMC: 0 (eMMC)
+    EXYNOS DWMMC: 2 (SD)
+
+Configuration
+-------------
+
+The mmc command is only avaialble if CONFIG_CMD_MMC=y.
+Some commands need to enable more configuration.

Some sub-command need require further configuration:

doc/usage/mmc.rst line 148

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+* write / erase - CONFIG_MMC_WRITE

write, erase
CONFIG_MMC_WRITE=y

doc/usage/mmc.rst line 149

Quoted 2 lines
doc/usage/mmc.rst new file +1 -0
+* bootbus - CONFIG_SUPPORT_EMMC_BOOT=y

Best regards

Heinrich

#3 lore raw

RFC PATCH 1/1 doc: mmc man-page

Hi Heinrich,

Quoted 10 lines · Heinrich Schuchardt
Quoted 5 lines · Jaehoon Chung

Provide a man-pages for the mmc command.

---
? doc/usage/mmc.rst | 149 ++++++++++++++++++++++++++++++++++++++++++++++

Thanks a lot for providing a man-page for the mmc command.

You have to change doc/usage/index.rst too.

Thanks for reviewing.

Quoted 35 lines
Quoted 22 lines

? 1 file changed, 149 insertions(+)
? create mode 100644 doc/usage/mmc.rst

doc/usage/mmc.rst new file +12 -0
new file mode 100644
index 000000000000..30fee447d409
@@ -0,0 +1,149 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+mmc command
+============
+
+Synopsis
+--------
+
+::
+
+??? mmc info
+??? mmc read addr blk# cnt

doc/usage/mmc.rst line 22

Quoted 10 lines
doc/usage/mmc.rst new file +10 -0
+??? mmc write addr blk# cnt
+??? mmc erase blk# cnt
+??? mmc rescan
+??? mmc part
+??? mmc dev [dev] [part]
+??? mmc list
+??? mmc wp
+??? mmc bootbus <dev> <boot_bus_width> <reset_boot_bus_width> <boot_mode>
+??? mmc bootpart-resize <dev> <dev part size MB> <RPMB part size MB>
+??? mmc partconf <dev> [boot_ack boot_partition partition_access]

This sub-command is missing below.

Quoted 8 lines

doc/usage/mmc.rst line 28

Quoted 6 lines
doc/usage/mmc.rst new file +6 -0
+??? mmc rst-function <dev> <value>
+
+Description
+-----------
+
+The mmc command is used to control MMC(eMMC/SD) device

Please, add missing full stops '.'.

Okay.

Quoted 11 lines

doc/usage/mmc.rst

Quoted 8 lines
doc/usage/mmc.rst new file +7 -0
+
+The *mmc info* displays information (Manufacturer ID, OEM, Name, Bus Speed, Mode, ...) of MMC device
+
+The *mmc read* command reads raw data to memory address from MMC device with block offset and count
+
+The *mmc write* write raw data to MMC device from memory address with block offset and count
+??? addr - memory address

Please format arguments like this:

Quoted 4 lines

addr
????memory address

You can check the formatting using 'make htmldocs'.

Okay. I will check with 'make htmldocs'

Quoted 11 lines
Quoted 11 lines
doc/usage/mmc.rst new file +10 -0
+
+??? blk# - start block offset
+
+??? cnt - block count
+
+The *mmc erase* erases MMC device from block offset until count
+??? blk# - start block offset
+
+??? cnt - block count
+
Quoted 8 lines

doc/usage/mmc.rst

Quoted 6 lines
doc/usage/mmc.rst new file +6 -0
+The *mmc rescan* scans the available MMC device
+
+The *mmc part* displays the list available partition on current mmc device
+
+The *mmc dev* show or set current mmc device
+??? [dev]

Please, remove the brackets.

Will remove.

Quoted 9 lines

doc/usage/mmc.rst line 56

Quoted 6 lines
doc/usage/mmc.rst new file +5 -0
+??????? device number to change
+??? [part]
+??????? partition number to change
+
+The *mmc list* displays the list avaiable devices

The *mmc list* command ...

Quoted 6 lines

doc/usage/mmc.rst line 58

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+The *mmc wp* enables "power on write protect" function about boot partitions

The *mmc wp* command ...

%s/about/for/

I will update other things according to your comments.

Quoted 36 lines

Please, mention that power cycling is needed to lift the write protection.

doc/usage/mmc.rst line 60

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+The *mmc bootbus* sets the BOOT_BUS_WIDTH feild

The *mmc bootbus* command ...

%s/feild/field/

doc/usage/mmc.rst line 63

Quoted 3 lines
doc/usage/mmc.rst new file +3 -0
+??? BOOTU_BUS_WIDTH[177] is one of EXT_CSD register. (*Refer to eMMC specification*)
+
+The *mmc-bootpart-resize* changes sizes of boot and RPMB partition

partitions.

doc/usage/mmc.rst line 66

Quoted 3 lines
doc/usage/mmc.rst new file +3 -0
+??? dev - device number
+
+??? boot part size MB - Size to change boot partition

How about:

target size of boot partition

doc/usage/mmc.rst line 68

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+??? RPMB part size MB - Size to chagne RPMB partition

%s/chagne/change/

target size of RPMB partition

doc/usage/mmc.rst line 70

Quoted 2 lines
doc/usage/mmc.rst new file +2 -0
+
+The *mmc rst-function* change the RST_n_FUNCTION filed

field?

Quoted 8 lines

I think we should describe what a RST_n_FUNCTION is.

We should enumerate the allowable values. The eMMC specification (JEDEC Standard No. 84-B51, 2014) has:

0x0: RST_n signal is temporarily disabled (default) 0x1: RST_n signal is permanently enabled 0x2: RST_n signal is permanently disabled

I thought that we don't need to describe in more detail and user has to read eMMC Specification to understand what a RST_n_FUCTION is.

Because it's dangerous to use without exact understanding.

But I agreed yours..I will add description in more detail.

Quoted 74 lines

doc/usage/mmc.rst line 71

Quoted 2 lines
doc/usage/mmc.rst new file +1 -0
+??? **WARNING**: This is a write-once filed. (*Refer to eMMC specification*)

%s/filed/field/

Quoted 69 lines
doc/usage/mmc.rst new file +69 -0
+
+Example
+-------
+
+The *mmc info* command displays device's capabilities:
+::
+
+??? => mmc info
+??? Device: EXYNOS DWMMC
+??? Manufacturer ID: 45
+??? OEM: 100
+??? Name: SDW16
+??? Bus Speed: 52000000
+??? Mode: MMC DDR52 (52MHz)
+??? Rd Block Len: 512
+??? MMC version 5.0
+??? High Capacity: Yes
+??? Capacity: 14.7 GiB
+??? Bus Width: 8-bit DDR
+??? Erase Group Size: 512 KiB
+??? HC WP Group Size: 8 MiB
+??? User Capacity: 14.7 GiB WRREL
+??? Boot Capacity: 4 MiB ENH
+??? RPMB Capacity: 4 MiB ENH
+??? Boot area 0 is not write protected
+??? Boot area 1 is not write protected
+
+The raw data can be read/written via *mmc read/write* command:
+::
+
+??? => mmc read 0x40000000 0x5000 0x100
+??? MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK
+
+??? => mmc write 0x40000000 0x5000 0x10
+??? MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK
+
+The partition list can be shown via *mmc part* command:
+::
+
+??? => mmc part
+??? Partition Map for MMC device 0? --?? Partition Type: DOS
+
+??? Part??? Start Sector??? Num Sectors???? UUID??????????? Type
+????? 1???? 8192??????????? 131072????????? dff8751a-01???? 0e Boot
+????? 2???? 139264????????? 6291456???????? dff8751a-02???? 83
+????? 3???? 6430720???????? 1048576???????? dff8751a-03???? 83
+????? 4???? 7479296???????? 23298048??????? dff8751a-04???? 05 Extd
+????? 5???? 7481344???????? 307200????????? dff8751a-05???? 83
+????? 6???? 7790592???????? 65536?????????? dff8751a-06???? 83
+????? 7???? 7858176???????? 16384?????????? dff8751a-07???? 83
+????? 8???? 7876608???????? 22900736??????? dff8751a-08???? 83
+
+The current device can be shown or set via *mmc dev* command:
+::
+
+??? => mmc dev
+??? switch to partitions #0, OK
+??? mmc0(part0) is current device
+??? => mmc dev 2 0
+??? switch to partitions #0, OK
+??? mmc2 is current device
+
+The list of available devices can be shown via *mmc list* command:
+::
+
+??? => mmc list
+??? mmc list
+??? EXYNOS DWMMC: 0 (eMMC)
+??? EXYNOS DWMMC: 2 (SD)
Quoted 8 lines

doc/usage/mmc.rst line 146

Quoted 6 lines
doc/usage/mmc.rst new file +6 -0
+
+Configuration
+-------------
+
+The mmc command is only avaialble if CONFIG_CMD_MMC=y.
+Some commands need to enable more configuration.

Some sub-command need require further configuration:

Right. I have been checking other sub-command.
There are too many commands, so i wonder that it needs to add the example of all command. Because some commands have one-time programmable, it's difficult to change my eMMC's register.

Best Regards,
Jaehoon Chung

Quoted 14 lines

doc/usage/mmc.rst line 148

Quoted 3 lines
doc/usage/mmc.rst new file +2 -0
+
+* write / erase - CONFIG_MMC_WRITE

write, erase
????CONFIG_MMC_WRITE=y

doc/usage/mmc.rst line 149

Quoted 2 lines
doc/usage/mmc.rst new file +1 -0
+* bootbus - CONFIG_SUPPORT_EMMC_BOOT=y

Best regards

Heinrich