<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/sdhci.h, 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>mmc: sdhci: Add SDHCI_SPEC_400, _410, and _420 version defines</title>
<updated>2025-12-11T12:53:51+00:00</updated>
<author>
<name>Tanmay Kathpalia</name>
<email>tanmay.kathpalia@altera.com</email>
</author>
<published>2025-12-03T12:21:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=90f43c7edc61634400c808110081f97e42b63bc6'/>
<id>90f43c7edc61634400c808110081f97e42b63bc6</id>
<content type='text'>
Add SDHCI_SPEC_400, SDHCI_SPEC_410, and SDHCI_SPEC_420 macros to sdhci.h
to support newer SDHCI specification versions. These defines are required
for compatibility with controllers implementing SDHCI 4.0 and above.

Reference:
https://lore.kernel.org/all/1535617305-16952-2-git-send-email-zhang.chunyan@linaro.org/

Signed-off-by: Tanmay Kathpalia &lt;tanmay.kathpalia@altera.com&gt;
Reviewed-by: Balsundar Ponnusamy &lt;balsundar.ponnusamy@altera.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>
Add SDHCI_SPEC_400, SDHCI_SPEC_410, and SDHCI_SPEC_420 macros to sdhci.h
to support newer SDHCI specification versions. These defines are required
for compatibility with controllers implementing SDHCI 4.0 and above.

Reference:
https://lore.kernel.org/all/1535617305-16952-2-git-send-email-zhang.chunyan@linaro.org/

Signed-off-by: Tanmay Kathpalia &lt;tanmay.kathpalia@altera.com&gt;
Reviewed-by: Balsundar Ponnusamy &lt;balsundar.ponnusamy@altera.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>sdhci: Reorder interrupt flags in SDHCI_INT_DATA_MASK definition</title>
<updated>2025-10-30T02:11:18+00:00</updated>
<author>
<name>Tanmay Kathpalia</name>
<email>tanmay.kathpalia@altera.com</email>
</author>
<published>2025-10-21T20:54:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f896f5c2523fd1dfabad3441518ced34fc4d816d'/>
<id>f896f5c2523fd1dfabad3441518ced34fc4d816d</id>
<content type='text'>
Reorder the SDHCI_INT_SPACE_AVAIL and SDHCI_INT_DATA_AVAIL flags in the
SDHCI_INT_DATA_MASK definition to match the bit order as defined in the
SDHCI specification and maintain consistency with the register layout.

The functional behavior remains unchanged as this only affects the
order of OR operations in the mask definition.

Signed-off-by: Tanmay Kathpalia &lt;tanmay.kathpalia@altera.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>
Reorder the SDHCI_INT_SPACE_AVAIL and SDHCI_INT_DATA_AVAIL flags in the
SDHCI_INT_DATA_MASK definition to match the bit order as defined in the
SDHCI specification and maintain consistency with the register layout.

The functional behavior remains unchanged as this only affects the
order of OR operations in the mask definition.

Signed-off-by: Tanmay Kathpalia &lt;tanmay.kathpalia@altera.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>mmc: am654_sdhci: Add am654_sdhci_set_control_reg</title>
<updated>2025-04-24T16:44:52+00:00</updated>
<author>
<name>Judith Mendez</name>
<email>jm@ti.com</email>
</author>
<published>2025-04-17T23:43:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6067aa66b3bb44e35742e60fda49eb3fe664ac23'/>
<id>6067aa66b3bb44e35742e60fda49eb3fe664ac23</id>
<content type='text'>
This patch adds am654_sdhci_set_control_reg to am654_sdhci.

This is required to fix UHS_MODE_SELECT for TI K3 boards.

If any of HIGH_SPEED_ENA, V1P8_SIGNAL_ENA, UHS_MODE_SELECT
are set, then data will be launched on the pos-edge of the
clock.

Since K3 SoCs did not meet timing requirements for High Speed
SDR mode at rising clock edge, none of these three should be
set, therefore limit UHS_MODE_SELECT to only be set for modes
above MMC_HS_52.

This fixes MMC write issue on am64x evm at mode High Speed
SDR.

Signed-off-by: Judith Mendez &lt;jm@ti.com&gt;
Reviewed-by: Bryan Brattlof &lt;bb@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds am654_sdhci_set_control_reg to am654_sdhci.

This is required to fix UHS_MODE_SELECT for TI K3 boards.

If any of HIGH_SPEED_ENA, V1P8_SIGNAL_ENA, UHS_MODE_SELECT
are set, then data will be launched on the pos-edge of the
clock.

Since K3 SoCs did not meet timing requirements for High Speed
SDR mode at rising clock edge, none of these three should be
set, therefore limit UHS_MODE_SELECT to only be set for modes
above MMC_HS_52.

This fixes MMC write issue on am64x evm at mode High Speed
SDR.

Signed-off-by: Judith Mendez &lt;jm@ti.com&gt;
Reviewed-by: Bryan Brattlof &lt;bb@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: Correct ADMA_DESC_LEN to 12</title>
<updated>2024-05-02T16:34:34+00:00</updated>
<author>
<name>Alexander Sverdlin</name>
<email>alexander.sverdlin@siemens.com</email>
</author>
<published>2024-05-01T18:53:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c92d48f8b2909d08584f17612a23d959467f14b8'/>
<id>c92d48f8b2909d08584f17612a23d959467f14b8</id>
<content type='text'>
Commit 37cb626da25d0d ("mmc: sdhci: Add Support for ADMA2") introduced
ADMA_DESC_LEN == 16 (64 bit case), but it was never used before commit
74755c1fed1b0 ("mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops").

"sizeof(struct sdhci_adma_desc)" (== 12 for 64bit case) was used instead.

Confusion probably originates from Linux commit 685e444bbaa0
("mmc: sdhci: Add ADMA2 64-bit addressing support for V4 mode"), but
the latter "V4 mode" was never ported to U-Boot.

Fixes: 74755c1fed1b0 ("mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops")
Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@siemens.com&gt;
Tested-by: Jonathan Humphreys &lt;j-humphreys@ti.com&gt;
Tested-by: Judith Mendez &lt;jm@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 37cb626da25d0d ("mmc: sdhci: Add Support for ADMA2") introduced
ADMA_DESC_LEN == 16 (64 bit case), but it was never used before commit
74755c1fed1b0 ("mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops").

"sizeof(struct sdhci_adma_desc)" (== 12 for 64bit case) was used instead.

Confusion probably originates from Linux commit 685e444bbaa0
("mmc: sdhci: Add ADMA2 64-bit addressing support for V4 mode"), but
the latter "V4 mode" was never ported to U-Boot.

Fixes: 74755c1fed1b0 ("mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops")
Signed-off-by: Alexander Sverdlin &lt;alexander.sverdlin@siemens.com&gt;
Tested-by: Jonathan Humphreys &lt;j-humphreys@ti.com&gt;
Tested-by: Judith Mendez &lt;jm@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: Support 32-bit only ADMA on 64-bit platforms</title>
<updated>2024-04-26T06:31:11+00:00</updated>
<author>
<name>Greg Malysa</name>
<email>greg.malysa@timesys.com</email>
</author>
<published>2024-03-26T02:28:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5359cd1135d069a3033bda65d3e72a3c4a76160d'/>
<id>5359cd1135d069a3033bda65d3e72a3c4a76160d</id>
<content type='text'>
Some arm64 platforms may include SDIO host controllers that
only support 32-bit ADMA. While the Linux kernel detects which
size is supported and adjusts the descriptor size used dynamically,
the previous u-boot implementation statically selected between the
two depending on whether DMA_ADDR_T_64BIT was defined. Because the
static selection is already in place and effective for most platforms,
this patch logically separates "64 bit addresses are used for DMA on
this platform" and "64 bit addresses are used by the SDIO host
controller for ADMA" in order to support the small number of platforms
where these statements are not equivalent.

Using 32 bits is opt-in and existing 64 bit platforms should be
unaffected by this change.

Co-developed-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Co-developed-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
Signed-off-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
Signed-off-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Reviewed-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some arm64 platforms may include SDIO host controllers that
only support 32-bit ADMA. While the Linux kernel detects which
size is supported and adjusts the descriptor size used dynamically,
the previous u-boot implementation statically selected between the
two depending on whether DMA_ADDR_T_64BIT was defined. Because the
static selection is already in place and effective for most platforms,
this patch logically separates "64 bit addresses are used for DMA on
this platform" and "64 bit addresses are used by the SDIO host
controller for ADMA" in order to support the small number of platforms
where these statements are not equivalent.

Using 32 bits is opt-in and existing 64 bit platforms should be
unaffected by this change.

Co-developed-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Co-developed-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
Signed-off-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
Signed-off-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Reviewed-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: Fix potential ADMA descriptor table overflow</title>
<updated>2024-04-26T06:31:00+00:00</updated>
<author>
<name>Ian Roberts</name>
<email>ian.roberts@timesys.com</email>
</author>
<published>2024-03-26T02:22:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5f0714496869b95e57a8b72192089e7df18c94cf'/>
<id>5f0714496869b95e57a8b72192089e7df18c94cf</id>
<content type='text'>
Change ADMA_TABLE_NO_ENTRIES to round the division up to fully
contain CONFIG_SYS_MMC_MAX_BLK_COUNT, fixing potential buffer overflow
of the ADMA descriptor table.

sdhci_prepare_adma_table() expecitily states it does _not_ check for
overflow as the descriptor table size is dependent on
CONFIG_SYS_MMC_MAX_BLK_COUNT. However, the ADMA_TABLE_NO_ENTRIES
calculation does not round up the divison, so with the current u-boot
 defaults:
max_mmc_transfer = (CONFIG_SYS_MMC_MAX_BLK_COUNT * MMC_MAX_BLOCK_LEN) =
65535 * 512 = 33553920 bytes.
ADMA_TABLE_NO_ENTRIES = max_mmc_transfer / ADMA_MAX_LEN =
33553920 / 65532, which does not divide cleanly.
actual_max_transfer = ADMA_TABLE_NO_ENTRIES * ADMA_MAX_LEN = 512 *
65532 = 33552384, which is smaller than max_mmc_transfer.
This can cause sdhci_prepare_adma_table() to write one extra
descriptor, overflowing the table when a transaction larger than
actual_max_transfer is issued.

Co-developed-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Signed-off-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
Reviewed-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change ADMA_TABLE_NO_ENTRIES to round the division up to fully
contain CONFIG_SYS_MMC_MAX_BLK_COUNT, fixing potential buffer overflow
of the ADMA descriptor table.

sdhci_prepare_adma_table() expecitily states it does _not_ check for
overflow as the descriptor table size is dependent on
CONFIG_SYS_MMC_MAX_BLK_COUNT. However, the ADMA_TABLE_NO_ENTRIES
calculation does not round up the divison, so with the current u-boot
 defaults:
max_mmc_transfer = (CONFIG_SYS_MMC_MAX_BLK_COUNT * MMC_MAX_BLOCK_LEN) =
65535 * 512 = 33553920 bytes.
ADMA_TABLE_NO_ENTRIES = max_mmc_transfer / ADMA_MAX_LEN =
33553920 / 65532, which does not divide cleanly.
actual_max_transfer = ADMA_TABLE_NO_ENTRIES * ADMA_MAX_LEN = 512 *
65532 = 33552384, which is smaller than max_mmc_transfer.
This can cause sdhci_prepare_adma_table() to write one extra
descriptor, overflowing the table when a transaction larger than
actual_max_transfer is issued.

Co-developed-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Signed-off-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
Reviewed-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops</title>
<updated>2024-04-26T06:30:48+00:00</updated>
<author>
<name>Ian Roberts</name>
<email>ian.roberts@timesys.com</email>
</author>
<published>2024-04-22T19:00:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=74755c1fed1b09526b0993c729fe3ae909752fbd'/>
<id>74755c1fed1b09526b0993c729fe3ae909752fbd</id>
<content type='text'>
Add this hook so that it can be overridden with driver specific
implementations. We also let the original sdhci_adma_write_desc()
accept &amp;desc so that the function can set its new value. Then export
the function so that it could be reused by driver's specific
implementations.

The above is a port of Linux kernel commit 54552e4948cbf

In addition, allow drivers to allocate their own ADMA descriptor
tables if additional space is required.

Finally, fix the assignment of adma_addr to fix compiler warning
on 64-bit platforms that still use 32-bit DMA addressing.

Co-developed-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Co-developed-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Signed-off-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Signed-off-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add this hook so that it can be overridden with driver specific
implementations. We also let the original sdhci_adma_write_desc()
accept &amp;desc so that the function can set its new value. Then export
the function so that it could be reused by driver's specific
implementations.

The above is a port of Linux kernel commit 54552e4948cbf

In addition, allow drivers to allocate their own ADMA descriptor
tables if additional space is required.

Finally, fix the assignment of adma_addr to fix compiler warning
on 64-bit platforms that still use 32-bit DMA addressing.

Co-developed-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Signed-off-by: Nathan Barrett-Morrison &lt;nathan.morrison@timesys.com&gt;
Co-developed-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Signed-off-by: Greg Malysa &lt;greg.malysa@timesys.com&gt;
Signed-off-by: Ian Roberts &lt;ian.roberts@timesys.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: Rework SDHCI_QUIRK_BROKEN_R1B</title>
<updated>2023-11-01T01:01:10+00:00</updated>
<author>
<name>Sean Anderson</name>
<email>sean.anderson@seco.com</email>
</author>
<published>2023-10-27T20:57:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=21c84bb1112695f9bd49379f7e32c251b55a3cad'/>
<id>21c84bb1112695f9bd49379f7e32c251b55a3cad</id>
<content type='text'>
As noted in commit 3a6383207be ("mmc: sdhci: add the quirk for broken
r1b response"), some MMC controllers don't always set the transfer
complete bit with R1b responses.

According to the SD Host Controller Simplified Specification v4.20,

&gt; In the case of a command pairing with response-with-busy[, Transfer
&gt; Complete] is set when busy is de-asserted. Refer to DAT Line Active
&gt; and Command Inhibit (DAT) in the Present State register.

By polling the DAT Line Active bit in the present state register, we can
detect when we are no longer busy, without waiting for a long timeout.
This results in much faster reads/writes on buggy controllers.

Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Tested-by: Henrik Grimler &lt;henrik@grimler.se&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As noted in commit 3a6383207be ("mmc: sdhci: add the quirk for broken
r1b response"), some MMC controllers don't always set the transfer
complete bit with R1b responses.

According to the SD Host Controller Simplified Specification v4.20,

&gt; In the case of a command pairing with response-with-busy[, Transfer
&gt; Complete] is set when busy is de-asserted. Refer to DAT Line Active
&gt; and Command Inhibit (DAT) in the Present State register.

By polling the DAT Line Active bit in the present state register, we can
detect when we are no longer busy, without waiting for a long timeout.
This results in much faster reads/writes on buggy controllers.

Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Tested-by: Henrik Grimler &lt;henrik@grimler.se&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: Enable HS400 support if available in caps</title>
<updated>2023-01-31T13:02:27+00:00</updated>
<author>
<name>Ashok Reddy Soma</name>
<email>ashok.reddy.soma@amd.com</email>
</author>
<published>2023-01-10T11:31:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=386f5d367329a202abe71fd790e8ce4598b30e09'/>
<id>386f5d367329a202abe71fd790e8ce4598b30e09</id>
<content type='text'>
HS400 is indicated in bit63 of capability register in few IP's.
Add a quirk to check this and add HS400 to host capabilities.

Signed-off-by: Ashok Reddy Soma &lt;ashok.reddy.soma@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
HS400 is indicated in bit63 of capability register in few IP's.
Add a quirk to check this and add HS400 to host capabilities.

Signed-off-by: Ashok Reddy Soma &lt;ashok.reddy.soma@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: Check and call config_dll callback functions</title>
<updated>2023-01-31T13:02:27+00:00</updated>
<author>
<name>Ashok Reddy Soma</name>
<email>ashok.reddy.soma@amd.com</email>
</author>
<published>2023-01-10T11:31:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6f5bb9913ca54fe0a3e45f83458eb71103e22ef7'/>
<id>6f5bb9913ca54fe0a3e45f83458eb71103e22ef7</id>
<content type='text'>
Check if the low level driver supports config_dll callback function and
call it if it does. Call with dll disable before calling set_clock and
with dll enable after it.

Signed-off-by: Ashok Reddy Soma &lt;ashok.reddy.soma@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check if the low level driver supports config_dll callback function and
call it if it does. Call with dll disable before calling set_clock and
with dll enable after it.

Signed-off-by: Ashok Reddy Soma &lt;ashok.reddy.soma@amd.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
