<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/cmd/mmc.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>cmd: mmc: Drop trailing space in Name: before newline</title>
<updated>2026-02-25T07:07:54+00:00</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2026-02-08T14:51:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6f7d976317c59aad1af0b8bb169adca9b5802ca0'/>
<id>6f7d976317c59aad1af0b8bb169adca9b5802ca0</id>
<content type='text'>
The Name: line of 'mmc info' command prints a trailing space before
newline. This is not useful and shows up as trailing space e.g. when
the output is checked into documentation. Remove the trailing space.

Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Name: line of 'mmc info' command prints a trailing space before
newline. This is not useful and shows up as trailing space e.g. when
the output is checked into documentation. Remove the trailing space.

Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'mmc-for-2026.04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-mmc</title>
<updated>2026-02-03T18:46:30+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-02-03T15:13:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=71f2564b178f3986dc89cdaa4558f0caa74fd88c'/>
<id>71f2564b178f3986dc89cdaa4558f0caa74fd88c</id>
<content type='text'>
- Add DMA support for mediatek mmc
- Cleanup mmc cmd
- Fix typos in mmc

[trini: Fix "quoted string split across lines" checkpatch warning]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add DMA support for mediatek mmc
- Cleanup mmc cmd
- Fix typos in mmc

[trini: Fix "quoted string split across lines" checkpatch warning]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: mmc: Return symbolic value when part switching fails in mmc dev</title>
<updated>2026-02-03T14:11:46+00:00</updated>
<author>
<name>Yao Zi</name>
<email>me@ziyao.cc</email>
</author>
<published>2026-01-30T18:03:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b4f0479e076014f403319fdce53c5c1ac278f8ae'/>
<id>b4f0479e076014f403319fdce53c5c1ac278f8ae</id>
<content type='text'>
Return symbolic value CMD_RET_FAILURE instead of literal "1" when
failing to switch the partition to improve readability.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Return symbolic value CMD_RET_FAILURE instead of literal "1" when
failing to switch the partition to improve readability.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: mmc: Check whether arguments are valid numbers in dev subcommand</title>
<updated>2026-02-03T14:11:45+00:00</updated>
<author>
<name>Yao Zi</name>
<email>me@ziyao.cc</email>
</author>
<published>2026-01-30T18:03:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f955e00e42e9b7ef5a3adf1ba1947f46c05a3d36'/>
<id>f955e00e42e9b7ef5a3adf1ba1947f46c05a3d36</id>
<content type='text'>
Currently when any of speed_mode, part, or dev fails to be parse as a
number, no error is reported. In this case __init_mmc_device() is called
with weird arguments, probably zeroes if there's no digit prefixing the
argument, which is especially confusing when the invocation occasionally
succeeds.

Let's check whether arguments are valid numbers without trailing
characters. This is quite helpful for speed_mode: it requires an index
instead of a mode name, one may easily pass in a string, which will be
parsed as zero (MMC_LEGACY), without carefully reading the
documentation, then finds the MMC device is under an unexpected mode.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently when any of speed_mode, part, or dev fails to be parse as a
number, no error is reported. In this case __init_mmc_device() is called
with weird arguments, probably zeroes if there's no digit prefixing the
argument, which is especially confusing when the invocation occasionally
succeeds.

Let's check whether arguments are valid numbers without trailing
characters. This is quite helpful for speed_mode: it requires an index
instead of a mode name, one may easily pass in a string, which will be
parsed as zero (MMC_LEGACY), without carefully reading the
documentation, then finds the MMC device is under an unexpected mode.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: mmc: Simplify dev subcommand handling</title>
<updated>2026-02-03T14:11:45+00:00</updated>
<author>
<name>Yao Zi</name>
<email>me@ziyao.cc</email>
</author>
<published>2026-01-30T18:03:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=97cc26f6b6a85312305e5b953ef44861891936bf'/>
<id>97cc26f6b6a85312305e5b953ef44861891936bf</id>
<content type='text'>
Replace the big if-else block in do_mmc_dev() with switch-case and use
fallthrough to remove the duplicated code for parsing dev and part.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the big if-else block in do_mmc_dev() with switch-case and use
fallthrough to remove the duplicated code for parsing dev and part.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>global: Avoid indirect inclusion of &lt;env.h&gt; from &lt;command.h&gt;</title>
<updated>2025-05-29T14:29:16+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-05-14T22:46:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dcb7d927d181b5798c6fd4a1b1650cd821e3b6ed'/>
<id>dcb7d927d181b5798c6fd4a1b1650cd821e3b6ed</id>
<content type='text'>
The include file &lt;command.h&gt; does not need anything from &lt;env.h&gt;.
Furthermore, include/env.h itself includes other headers which can lead
to longer indirect inclusion paths. To prepare to remove &lt;env.h&gt; from
&lt;command.h&gt; fix all of the places which had relied on this indirect
inclusion to instead include &lt;env.h&gt; directly.

Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt; # android, bcb
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt; # spawn
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The include file &lt;command.h&gt; does not need anything from &lt;env.h&gt;.
Furthermore, include/env.h itself includes other headers which can lead
to longer indirect inclusion paths. To prepare to remove &lt;env.h&gt; from
&lt;command.h&gt; fix all of the places which had relied on this indirect
inclusion to instead include &lt;env.h&gt; directly.

Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt; # android, bcb
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt; # spawn
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge patch series "Fix various bugs"</title>
<updated>2024-09-18T19:07:19+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2024-09-18T19:07:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c17805e19b9335e1fb5295c81b59eddf88d1b9ec'/>
<id>c17805e19b9335e1fb5295c81b59eddf88d1b9ec</id>
<content type='text'>
Simon Glass &lt;sjg@chromium.org&gt; says:

This series includes the patches needed to make make the EFI 'boot' test
work. That test has now been split off into a separate series along with
the EFI patches.

This series fixes these problems:
- sandbox memory-mapping conflict with PCI
- the fix for that causes the mbr test to crash as it sets up pointers
  instead of addresses for its 'mmc' commands
- the mmc and read commands which cast addresses to pointers
- a tricky bug to do with USB keyboard and stdio
- a few other minor things
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simon Glass &lt;sjg@chromium.org&gt; says:

This series includes the patches needed to make make the EFI 'boot' test
work. That test has now been split off into a separate series along with
the EFI patches.

This series fixes these problems:
- sandbox memory-mapping conflict with PCI
- the fix for that causes the mbr test to crash as it sets up pointers
  instead of addresses for its 'mmc' commands
- the mmc and read commands which cast addresses to pointers
- a tricky bug to do with USB keyboard and stdio
- a few other minor things
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: Use map_sysmem() with buffers in the mmc command</title>
<updated>2024-09-18T19:01:00+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2024-09-01T22:26:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cc6a1b690257b333c38a1d9bd20d861f6ce7faf1'/>
<id>cc6a1b690257b333c38a1d9bd20d861f6ce7faf1</id>
<content type='text'>
The current implementation casts an address to a pointer. Make it more
sandbox-friendly by using map_sysmem().

Rename the variable to 'ptr' since it is a pointer, not an address.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current implementation casts an address to a pointer. Make it more
sandbox-friendly by using map_sysmem().

Rename the variable to 'ptr' since it is a pointer, not an address.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd: mmc: Allow using partition name in mmc erase command</title>
<updated>2024-09-16T22:45:55+00:00</updated>
<author>
<name>Tomas Paukrt</name>
<email>tomaspaukrt@email.cz</email>
</author>
<published>2024-09-02T18:49:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6c0943ff54ec27bf3c277767c2a9e1fb458e57a0'/>
<id>6c0943ff54ec27bf3c277767c2a9e1fb458e57a0</id>
<content type='text'>
The mmc erase command currently requires blk# and cnt parameters
which can be obtained using the part start and part size commands
if the entire partition needs to be erased.

Simplify the use of the mmc erase command by allowing the partition
name to be specified directly.

Signed-off-by: Tomas Paukrt &lt;tomaspaukrt@email.cz&gt;
Reviewed-by: Quentin Schulz &lt;quentin.schulz@cherry.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The mmc erase command currently requires blk# and cnt parameters
which can be obtained using the part start and part size commands
if the entire partition needs to be erased.

Simplify the use of the mmc erase command by allowing the partition
name to be specified directly.

Signed-off-by: Tomas Paukrt &lt;tomaspaukrt@email.cz&gt;
Reviewed-by: Quentin Schulz &lt;quentin.schulz@cherry.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge patch series "provide names for emmc hardware partitions"</title>
<updated>2024-09-05T18:13:24+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2024-09-05T18:13:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=208fc7a9f9022240e47ae4969227f60d2b84dbb9'/>
<id>208fc7a9f9022240e47ae4969227f60d2b84dbb9</id>
<content type='text'>
Tim Harvey &lt;tharvey@gateworks.com&gt; says:

Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC
specification described as:
 Boot Area Partition 1
 Boot Area Partition 2
 RPMB Partition
 General Purpose Partition 1
 General Purpose Partition 2
 General Purpose Partition 3
 General Purpose Partition 4
 User Data Area

These are referenced by fields in the PARTITION_CONFIG register
(Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6: BOOT_ACK
  0x0: No boot acknowledge sent (default
  0x1: Boot acknowledge sent during boot operation Bit
bit 5:3: BOOT_PARTITION_ENABLE
  0x0: Device not boot enabled (default)
  0x1: Boot Area partition 1 enabled for boot
  0x2: Boot Area partition 2 enabled for boot
  0x3-0x6: Reserved
  0x7: User area enabled for boot
bit 2:0 PARTITION_ACCESS
  0x0: No access to boot partition (default)
  0x1: Boot Area partition 1
  0x2: Boot Area partition 2
  0x3: Replay Protected Memory Block (RPMB)
  0x4: Access to General Purpose partition 1
  0x5: Access to General Purpose partition 2
  0x6: Access to General Purpose partition 3
  0x7: Access to General Purpose partition 4

Note that setting PARTITION_ACCESS to 0x0 results in selecting the User
Data Area partition.

You can see above that the two fields BOOT_PARTITION_ENABLE and
PARTITION_ACCESS do not use the same enumerated values.

U-Boot uses a set of macros to access fields of the PARTITION_CONFIG
register:
EXT_CSD_BOOT_ACK_ENABLE                 (1 &lt;&lt; 6)
EXT_CSD_BOOT_PARTITION_ENABLE           (1 &lt;&lt; 3)
EXT_CSD_PARTITION_ACCESS_ENABLE         (1 &lt;&lt; 0)
EXT_CSD_PARTITION_ACCESS_DISABLE        (0 &lt;&lt; 0)

EXT_CSD_BOOT_ACK(x)             (x &lt;&lt; 6)
EXT_CSD_BOOT_PART_NUM(x)        (x &lt;&lt; 3)
EXT_CSD_PARTITION_ACCESS(x)     (x &lt;&lt; 0)

EXT_CSD_EXTRACT_BOOT_ACK(x) (((x) &gt;&gt; 6) &amp; 0x1)
EXT_CSD_EXTRACT_BOOT_PART(x) (((x) &gt;&gt; 3) &amp; 0x7)
EXT_CSD_EXTRACT_PARTITION_ACCESS(x) ((x) &amp; 0x7)

There are various places in U-Boot where the BOOT_PARTITION_ENABLE field
is accessed via EXT_CSD_EXTRACT_PARTITION_ACCESS and converted to a
hardware partition consistent with the definition of the
PARTITION_ACCESS field used by the various mmc_switch incarnations.

To add some sanity to the distinction between BOOT_PARTITION_ENABLE
(used to specify the active device on power-cycle) and PARTITION_ACCESS
(used to switch between hardware partitions) create two enumerated types
and use them wherever struct mmc * part_config is used or the above
macros are used.

Additionally provide arrays of the field names and allow those to be
used in the 'mmc partconf' command and in board support files.

The first patch adds enumerated types and makes use of them which
represents no compiled code change.

The 2nd patch adds the array of names and uses them in the 'mmc
partconf' command.

The 3rd patch uses the array of hardware partition names in a board
support file to show what emmc hardware partition U-Boot is being loaded
from.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tim Harvey &lt;tharvey@gateworks.com&gt; says:

Modern eMMC v4+ devices have multiple hardware partitions per the JEDEC
specification described as:
 Boot Area Partition 1
 Boot Area Partition 2
 RPMB Partition
 General Purpose Partition 1
 General Purpose Partition 2
 General Purpose Partition 3
 General Purpose Partition 4
 User Data Area

These are referenced by fields in the PARTITION_CONFIG register
(Extended CSD Register 179) which is defined as:
bit 7: reserved
bit 6: BOOT_ACK
  0x0: No boot acknowledge sent (default
  0x1: Boot acknowledge sent during boot operation Bit
bit 5:3: BOOT_PARTITION_ENABLE
  0x0: Device not boot enabled (default)
  0x1: Boot Area partition 1 enabled for boot
  0x2: Boot Area partition 2 enabled for boot
  0x3-0x6: Reserved
  0x7: User area enabled for boot
bit 2:0 PARTITION_ACCESS
  0x0: No access to boot partition (default)
  0x1: Boot Area partition 1
  0x2: Boot Area partition 2
  0x3: Replay Protected Memory Block (RPMB)
  0x4: Access to General Purpose partition 1
  0x5: Access to General Purpose partition 2
  0x6: Access to General Purpose partition 3
  0x7: Access to General Purpose partition 4

Note that setting PARTITION_ACCESS to 0x0 results in selecting the User
Data Area partition.

You can see above that the two fields BOOT_PARTITION_ENABLE and
PARTITION_ACCESS do not use the same enumerated values.

U-Boot uses a set of macros to access fields of the PARTITION_CONFIG
register:
EXT_CSD_BOOT_ACK_ENABLE                 (1 &lt;&lt; 6)
EXT_CSD_BOOT_PARTITION_ENABLE           (1 &lt;&lt; 3)
EXT_CSD_PARTITION_ACCESS_ENABLE         (1 &lt;&lt; 0)
EXT_CSD_PARTITION_ACCESS_DISABLE        (0 &lt;&lt; 0)

EXT_CSD_BOOT_ACK(x)             (x &lt;&lt; 6)
EXT_CSD_BOOT_PART_NUM(x)        (x &lt;&lt; 3)
EXT_CSD_PARTITION_ACCESS(x)     (x &lt;&lt; 0)

EXT_CSD_EXTRACT_BOOT_ACK(x) (((x) &gt;&gt; 6) &amp; 0x1)
EXT_CSD_EXTRACT_BOOT_PART(x) (((x) &gt;&gt; 3) &amp; 0x7)
EXT_CSD_EXTRACT_PARTITION_ACCESS(x) ((x) &amp; 0x7)

There are various places in U-Boot where the BOOT_PARTITION_ENABLE field
is accessed via EXT_CSD_EXTRACT_PARTITION_ACCESS and converted to a
hardware partition consistent with the definition of the
PARTITION_ACCESS field used by the various mmc_switch incarnations.

To add some sanity to the distinction between BOOT_PARTITION_ENABLE
(used to specify the active device on power-cycle) and PARTITION_ACCESS
(used to switch between hardware partitions) create two enumerated types
and use them wherever struct mmc * part_config is used or the above
macros are used.

Additionally provide arrays of the field names and allow those to be
used in the 'mmc partconf' command and in board support files.

The first patch adds enumerated types and makes use of them which
represents no compiled code change.

The 2nd patch adds the array of names and uses them in the 'mmc
partconf' command.

The 3rd patch uses the array of hardware partition names in a board
support file to show what emmc hardware partition U-Boot is being loaded
from.
</pre>
</div>
</content>
</entry>
</feed>
