Commit graph

1,426,961 commits

Author SHA1 Message Date
Andre Korol
4cd4e82316 mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent()
dma_alloc_coherent() returns zeroed memory, so the memset() immediately
after allocation is redundant.

Signed-off-by: Andre Korol <andre.korol.dev@gmail.com>
Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Shawn Lin
8ea84b50a9 mmc: dw_mmc: Remove mshc alias support
Remove the long-deprecated mshc alias support, as the mmc core already
provides alias functionality through the standard mmc alias. This eliminates
the redundant dual-alias system. The driver now obtains the controller ID
from struct mmc_host::index(supplied by mmc alias) instead of the legacy mshc
alias.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Shawn Lin
9b541ceaf5 mmc: dw_mmc-k3: Remove mshc alias support
Remove the long-deprecated mshc alias support, as the mmc core already
provides alias functionality through the standard mmc alias. This eliminates
the redundant dual-alias system. The driver now obtains the controller ID
from struct mmc_host::index(supplied by mmc alias) instead of the legacy mshc
alias.

dw_mci_hi6220_parse_dt() which parse mshc alias is used for hi6220, hi3660 and
hi3670. Given hi6220 never assigned mshc alias on the DTS files, and hi3360
and hi3670 share the same code, so with it removed, add a return value to
dw_mci_hs_set_timing() and let dw_mci_hi3660_init() check if index exceeds
TIMING_MODE in the firs place to bail out early, the same as before.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Shawn Lin
6aaa6c561f arm64: dts: hisilicon: hikey960/970: Convert to use standard mmc alias
Convert the long-deprecated mshc alias to standard mmc alias.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Albert Yang
1e61836476 MAINTAINERS: add MMC files to BST entry
Add the MMC device tree binding and driver files to the existing
ARM/BST SOC SUPPORT maintainer entry.

Signed-off-by: Albert Yang <yangzh0906@thundersoft.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Albert Yang
695824f456 mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
Add SDHCI controller driver for Black Sesame Technologies C1200 SoC.

This driver supports the DWCMSHC SDHCI controller with BST-specific
enhancements including:
- Custom clock management and tuning
- Power management support
- BST-specific register configurations
- Support for eMMC and SD card interfaces
- Hardware limitation workaround for 32-bit DMA addressing

The driver addresses specific hardware constraints where:
- System memory uses 64-bit bus, eMMC controller uses 32-bit bus
- eMMC controller cannot access memory through SMMU due to hardware bug
- All system DRAM is configured outside 4GB boundary (ZONE_DMA32)
- Uses SRAM-based bounce buffer within 32-bit address space

Signed-off-by: Ge Gordon <gordon.ge@bst.ai>
Signed-off-by: Albert Yang <yangzh0906@thundersoft.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Albert Yang
ef7eb1a709 mmc: sdhci: allow drivers to pre-allocate bounce buffer
Allow platform drivers to pre-allocate bounce buffer by checking if
host->bounce_buffer is already set before attempting allocation.

This enables platforms with specific DMA constraints (such as 32-bit
DMA on controllers that cannot access high memory) to use their own
reserved memory regions for the bounce buffer.

Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Albert Yang <yangzh0906@thundersoft.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Albert Yang
d515962316 dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
Add device tree bindings for the Black Sesame Technologies
DWCMSHC SDHCI controller used in C1200 SoC.

The binding describes a Synopsys DesignWare Cores Mobile Storage
Host Controller with BST-specific extensions including:
- Two register regions (core SDHCI and CRM registers)
- Optional memory-region for bounce buffer support
- Fixed clock input

Signed-off-by: Ge Gordon <gordon.ge@bst.ai>
Signed-off-by: Albert Yang <yangzh0906@thundersoft.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Yixun Lan
1e9f43a1db mmc: sdhci-of-k1: spacemit: Add support for K3 SoC
The SDHCI controller found on SpacemiT K3 SoC share the same IP with K1
generation and introduce a compatible data to denote the change that broken
64BIT DMA issue has been fixed.

Signed-off-by: Yixun Lan <dlan@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Yixun Lan
b4206966e2 dt-bindings: mmc: spacemit,sdhci: add support for K3 SoC
The SDHCI controller found on SpacemiT K3 SoC share the same IP with
K1 generation, while fixed the broken 64BIT DMA issue. Introduce a
compatible string to enable support for it.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Yixun Lan <dlan@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Linus Walleij
366b594156 mmc: sdhci: Stop advertising the driver in dmesg
As much as we have grown used to seeing this message on
every kernel boot, it does not add any technical value.

Drop all messages from sdhci_drv_init(), and drop the
module_init() and module_exit() calls as well since they
now become empty.

The modules becomes a pure library module, meaning it will
get pulled in by modprobe() when the symbols inside it
are needed, or compiled in if any users are compiled in.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:55 +01:00
Jeff Chen
c0b68bc25e mmc: sdio: add NXP vendor and IW61x device IDs
Add NXP's SDIO vendor ID (0x0471) and IW61x device ID (0x0205) to
sdio_ids.h for future support of NXP Wi-Fi chips over SDIO.

Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
2c7fe99a71 mmc: dw_mmc-pltfm: use modern PM macros
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP
are disabled, without having to use #ifdef guards.

When this's done, remove all variant drivers' local pm definition and
replace it with dw_mci_pltfm_pmops.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
[Ulf: Fixed conflict by dropping changes for dw_mmc-rockchip]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
765f4836ec mmc: dw_mmc-pci: Use BAR_2 and pcim_iomap_region()
PCIe endpoint framework defines standard BAR enum for EP drivers
to use, so remove PCI_BAR_NO here.

Then, pcim_iomap_regions has been deprecated for a long time, replace
it with pcim_iomap_region();

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
c6969a13f6 mmc: dw_mmc: Remove unused register access macros
The mci_readw/mci_writew/mci_readq/mci_writeq macros were added
to provide 16-bit and 64-bit register access operations, but they
have remained unused since their introduction. Remove these dead code.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
7597d68cea mmc: dw_mmc: Improve dw_mci_get_cd()
The current dw_mci_get_cd() implementation maintains a DW_MMC_CARD_PRESENT
flag primarily for logging purposes, which adds unnecessary complexity.
Additionally, the if-else-elif control flow does not align with the Linux
kernel coding style.

This commit simplifies the function by:
- Removing the redundant card presence flag
- Replacing the conditional chain with a cleaner implementation
- Improving code readability while maintaining functionality

The change reduces code complexity without affecting the actual card
detection behavior.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
29d3f6a643 mmc: dw_mmc: Remove DW_MCI_SEND_STATUS and DW_MCI_RECV_STATUS macros
Use MMC_DATA_READ and MMC_DATA_WRITE defined by MMC core instead.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
e453a08b3a mmc: dw_mmc: Remove redundant struct mmc_data forward declaration
The header file linux/mmc/core.h, which is already included in dw_mmc.h,
contains the forward declaration of struct mmc_data. There's no need to
redeclare it here.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
792bd24b6e mmc: dw_mmc: Remove struct dw_mci_board
The only user of dw_mci_board is dw_pci-pci, now we can provide
the caps from dw_mci_drv_data, so we could let dw_pci-pci use
dw_mci_drv_data and remove caps from struct dw_mci_board.

With that, struct dw_mci_board is no longer needed, we can remove
it. Then we should check all settings in dw_mci_parse_dt in order
not to overwrite them if provided from variant drivers.

Also, without CONFIG_OF support, dw_mmc doesn' work as host->pdata
is always ERR_PTR(-EINVAL), we could remove it together.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
ec6d8bb39d mmc: dw_mmc: Remove bus_hz from struct dw_mci_board
struct dw_mci already keeps one, reuse it. Now, as dw_mmc-pci still
provide struct dw_mci_board, so host->bus_hz will not be overwritten.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
d3fcd6362a mmc: dw_mmc: Move detect_delay_ms from struct dw_mci_board to struct dw_mci
Now, as dw_mmc-pci still provide struct dw_mci_board, so host->detect_delay_ms
will not be overwritten. So it's fine to move it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
dc1f8aacc9 mmc: dw_mmc: Remove fifo_depth from struct dw_mci_board
struct dw_mci already keeps one, so remove it from struct dw_mci_board.
Now, as dw_mmc-pci still provide struct dw_mci_board, so host->fifo_depth
will not be overwritten.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
d917f35c33 mmc: dw_mmc: Move rstc from struct dw_mci_board to struct dw_mci
Nobody using dw_mci_board passes in rstc, move it to the common struct
dw_mci needed by all users.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
cea6e1a151 mmc: dw_mmc: Remove caps2 and pm_caps from struct dw_mci_board
Nobody uses them.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
fedf31e204 mmc: dw_mmc: Remove assignment of pdata in dw_mci_pltfm_register()
No one using dw_mci_pltfm_register() passes in platform_data when
searching host and arch directories, remove it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
137cf0a4d6 mmc: dw_mmc: Remove SDMMC_INT_ERROR
SDMMC_INT_ERROR is defined as 0xbfc2, which looks like a magic number and
it's never used, so remove it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
57cc962430 mmc: dw_mmc: Remove dma_ops from struct dw_mci_board
It does take dma_ops from struct dw_mci_board, but we immediately
re-assign it from either dw_mci_idmac_ops or dw_mci_edmac_ops in
dw_mci_init_dma(). That means it's never used now, or has been
broken for a long time without noticed. It seems no drivers need
it, so remove it now.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Shawn Lin
4db2a6c857 mmc: dw_mmc: Check return value of dma_ops->init() in resume
dma_ops->init() may fail, should check the return value.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:54 +01:00
Vladimir Zapolskiy
c740532de0 dt-bindings: mmc: arm,pl18x: Do not use plural form of a proper noun PrimeCell
As a proper noun PrimeCell is a single entity and it can not have a plural
form, fix the typo.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Krzysztof Kozlowski
6fba00c98e mmc: sdhci-of-aspeed: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Krzysztof Kozlowski
f6b3889812 mmc: jz4740: Fix Wvoid-pointer-to-enum-cast warning
"jz4740" is an enum, thus cast of pointer on 64-bit compile test with
clang W=1 causes:

  jz4740_mmc.c:1055:18: error: cast to smaller integer type 'enum jz4740_mmc_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Krzysztof Kozlowski
4e709d5d62 mmc: cavium-octeon: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Krzysztof Kozlowski
e8c23b466b mmc: atmel-mci: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Thorsten Blum
0621d52b1d mmc: cavium: Use clamp to simplify cvm_mmc_set_clock
Use clamp() to simplify cvm_mmc_set_clock() and improve its readability.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Yixun Lan
658b716c04 mmc: sdhci-of-k1: add reset support
The SDHCI controller of SpacemiT K1 SoC requires two resets, add
support to explicitly request the reset line and deassert during
initialization phase. Still using devm_xx_get_optional() API to
make the request optional.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Yixun Lan
4231325cfb dt-bindings: mmc: spacemit,sdhci: add reset support
The SpacemiT SDHCI controller has two reset lines, one connect to AXI bus
which shared by all controllers, while another one connect to individual
controller separately.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
5e9f849d8d mmc: dw_mmc: Remove struct dw_mci_slot
Use dw_mci_alloc_host() helper to allocate struct dw_mci for dw_mmc-pci.c
and dw_mmc-pltfm.c. With that, we could get rid of struct dw_mci_slot and
remove it everywhere.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
c72be4c306 mmc: dw_mmc: Introduce dw_mci_alloc_host()
This helper is used for variant drivers to allocate struct dw_mci
and set struct dw_mci as private data of struct mmc_host.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
3449b31eb1 mmc: dw_mmc: Remove queue from dw_mci
It's pointless to use a queue if only one slot is supported.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
78983c4d60 mmc: dw_mmc: Remove mrq from struct dw_mci_slot
struct dw_mci has already kept mrq, so removing keeping mrq again from
struct dw_mci_slot.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
027e1688bc mmc: dw_mmc: Move clock rate stuff from struct dw_mci_slot to struct dw_mci
Except for moving them, this patch also renames __clk_old to clk_old.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
a151329009 mmc: dw_mmc: Remove sdio_id from struct dw_mci_slot
There is only one slot support, the sdio_id is used to indicate the SDIO
slot and where is the irq located. So it's pointless now, remove it. Given
sdio_id0 is only used by Rockchip to inform dwc core the irq is located
with a offset, rename sdio_id0 to sdio_irq to reflect the fact.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
b8cc1e8066 mmc: dw_mmc: Remove id and ctype from dw_mci_slot
There is only one slot support, id should be zero. So no need
to keep it in track as long as ctype associated.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
1a1936f808 mmc: dw_mmc: Move flags from struct dw_mci_slot to struct dw_mci
With this, dw_mmc-exynos.c will not need to access slot. While at it, since
the host->slot is always present when calling
dw_mci_exynos_set_clksel_timing(), let's remove it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
d7ab40c3bd mmc: dw_mmc: Let variant drivers to use struct dw_mci as possible
This patch changes the callbacks of switch_voltage() and execute_tuning()
in order for variant drivers to avoid accessing to struct dw_mci_slot.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
1a990def44 mmc: dw_mmc: Move struct mmc_host from struct dw_mci_slot to struct dw_mci
Move struct mmc_host to struct dw_mci in preparation for removing dw_mci_slot.
No functional change intended.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:53 +01:00
Shawn Lin
53f05821b7 mmc: dw_mmc: Remove unused header files and keep alphabetical order
Some header files are not needed and they are out of order, this patch
remove unused header files and re-order them alphabetically.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:52 +01:00
Shawn Lin
9edf45987d mmc: dw_mmc: Remove check before calling mmc_regulator_set_ocr()
mmc_regulator_set_ocr() already checks if vqmmc is correct.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:52 +01:00
Shawn Lin
9313c6c3db mmc: dw_mmc: Remove vqmmc_enabled from struct dw_mci and update the reset
commit 51da224090 ("mmc: dw_mmc: use mmc_regulator_get_supply to handle regulators")
introduced tracking of vqmmc_enabled. Currently, mmc_regulator_enable_vqmmc()
and mmc_regulator_disable_vqmmc() well record the status of vqmmc, so use
these two helpers to remove vqmmc_enabled locally. With vqmmc_enabled gone,
resetting controller on MMC_POWER_ON phase won't work as dw_mci_set_ios()
will be called several times during enumerating which leads to reset the
controller several times too. This messes up the status machine of controller.

By looking into the commit d1f1dd8600 ("mmc: dw_mmc: Give a good reset
after we give power"), it tried to solve failures on rk3288. The problem
is probably because the vqmmc is used for IO block associated with dw
controller. When SD is removed during I/O, cutting off vqmmc in MMC_POWER_OFF
phase will confuse the controller as its status machine refers to several
IO status, such as data_state_mc_busy and data_busy on SDMMC_STATUS reg.
So the controller could run into an unexpected state and could not enumerate
cards correctly the next time. Reset it on MMC_POWER_ON phase or MMC_POWER_OFF
phase should work, let's do the latter.

This patch is tested on RK3588s/RK3399/RK3576 EVB with TF cards with both
vqmmc present or not.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:52 +01:00
Rob Herring (Arm)
5962f68603 dt-bindings: mmc: arasan,sdhci: Allow "dma-coherent" property
The Arasan SDHCI controller is DMA coherent on the APM merlin SoC, so allow
the dma-coherent property. No reason implementations can't also be coherent
and there's not an SoC specific compatible, so allow it on any platform.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-02-23 12:06:52 +01:00