summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2025-04-11mmc: Exit from mmc_init() if mmc_complete_init() failsMarek Vasut
In case mmc_complete_init() returns error, exit from mmc_init() without possibly calling cyclic_register(), which at that point would be undesired. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-04-11mmc: Simplify poll CD logic in case cyclic framework is enabledMarek Vasut
Simplify 90cc07fd786d ("mmc: Poll CD in case cyclic framework is enabled") according to suggestions by Rasmus. The struct cyclic_info is zero-size in case CONFIG_CYCLIC is not enabled and does not add any size to struct mmc, so it can unconditionally be part of that structure. This allows clean up of all the other conditionals in mmc.c which can now be unconditionally present, as they also add no extra space. Suggested-by: Rasmus Villemoes <ravi@prevas.dk> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2025-04-11mmc: Kconfig: Correct dependencies SDHCI ADMA optionsTom Rini
The option MMC_SDHCI_ADMA_FORCE_32BIT is only tested or used when MMC_SDHCI_ADMA or SPL_MMC_SDHCI_ADMA is enabled. And for MMC_SDHCI_ADMA_64BIT the same is true except we also require MMC_SDHCI_ADMA_FORCE_32BIT to be disabled. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Peng Fan <peng.fan@nxp.com>
2025-03-27sunxi: mmc: Improve reset procedureJernej Skrabec
Cards should always be reset and threshold set. This fixes eMMC on H616. Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> [Andre: use macro-defined offsets to fix build on older SoCs] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2025-03-27sunxi: mmc: Fix T113-s3 MMC clock dividerAndre Przywara
On the Allwinner D1/R528/T113-s3 SoCs the MMC clock source selected by mux value 1 is PLL_PERIPH0(1x), not (2x), as in the other SoCs. But we have still the hidden divisor of 2 in the MMC mod clock, so need to explicitly compensate for that on those SoCs. This leads to the actually programmed clock rate to be double compared to before, which increases the MMC performance on those SoCs. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reported-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-17mmc: msm_sdhci: Reset clocks before reconfigurationVaradarajan Narayanan
U-Boot has to reconfigure the clocks that were set in the boot loaders. However, in IPQ9574, the clocks have to be reset before they can be reconfigured. Hence add code to do the relevant resets. Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> Link: https://lore.kernel.org/r/20250226064505.1178054-7-quic_varada@quicinc.com Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-13mmc: fsl_esdhc: Migrate ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE to KconfigTom Rini
The flag for enabling the ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE quirk can be handled easily enough in Kconfig. This lets us remove a function but not obviously correct usage of the IS_ENABLED() macro. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-12mmc: Add support for ADI SC5XX-family processor SDHCI peripheralsNathan Barrett-Morrison
Co-developed-by: Greg Malysa <malysagreg@gmail.com> Signed-off-by: Greg Malysa <malysagreg@gmail.com> Co-developed-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Ian Roberts <ian.roberts@timesys.com> Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com> Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com> Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com> Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
2025-02-24mmc: Fix size calculation for sector addressed MMC version 4Marek Vasut
For eMMC v4 and newer that is smaller than 2 GiB, the JEDEC JESD84-B51 section 6.2.4 Configure partitions indicates that EXT_CSD SEC_COUNT should not be used to determine device size, and instead device size should be calculated from C_SIZE and C_SIZE_MULT. This is not exactly accurate, the 2 GiB limit is not a hard line, there are eMMC devices which are smaller than 2 GiB and still require device size to be determined from EXT_CSD SEC_COUNT. The hard line is instead OCR HCS bit, which indicates whether the device is byte or sector addressed, the former applies to most devices below 2 GiB, and the later applies mostly to devices above 2 GiB. However, there are a couple of devices which are smaller than 2 GiB and still set the OCR HCS bit to indicate they are sector addressed, and therefore the size calculation for those devices should also use EXT_CSD SEC_COUNT . Use mmc->high_capacity flag to discern the devices instead of arbitrary 2 GiB limit. The mmc->high_capacity flag reflects the OCR HCS bit state. Fixes: 639b7827d1ca ("mmc: fix the condition for MMC version 4") Signed-off-by: Marek Vasut <marex@denx.de>
2025-02-03mmc: Allow controlling DM_MMC for VPL buildsSimon Glass
VPL may want to use driver model for MMC even if TPL does not. Update the rule in this driver to support that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-01-30mmc: mediatek: add support for MediaTek MT7987 SoCsWeijie Gao
This patch adds eMMC/SD support for MT7987 SoC Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-01-20blk: Make block subsystems select BLKTom Rini
The BLK symbol has a few meanings, one of which is that it controls the driver model portion of a "block device". Rather than having this hidden symbol be "default y if ..." it should be select'd by the various block subsystems. Symbols such as PVBLOCK which already select'd BLK are unchanged". Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-01-20drivers/mmc/Kconfig: Make DM_MMC a hidden symbolTom Rini
At this point in time, DM is always enabled. So if MMC is enabled, it should select DM_MMC. No drivers need to depend on DM_MMC being enabled now, so remove that from dependency lists. This now means that a number of platforms which select'd DM_MMC need to select MMC instead. This also fixes a migration problem with espresso7420 in that MMC is built again with the platform. Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2025-01-20drivers/mmc/Kconfig: Remove extraneous BLK dependenciesTom Rini
At this point in time, we know that with the MMC symbol enabled we will always also have the BLK symbol enabled, so we do not need to list that as a dependency for MMC drivers. Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-12-25Merge tag 'v2025.01-rc5' into nextTom Rini
Prepare v2025.01-rc5
2024-12-18mmc: snps_sdhci: Add sdhci driver support for TH1520 SoCMaksim Kiselev
Add support for DesignWare SDHCI host controller on Alibaba TH1520 SoC Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com> Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-12-18mmc: dw_mmc: Add "starfive, jh7110-mmc" compatible to match upstream DTHal Feng
Make the U-Boot JH7110 MMC driver compatible with upstream DT. Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
2024-12-16mmc: Fix potential timer value truncationRonald Wahl
On 64bit systems the timer value might be truncated to a 32bit value causing malfunctions. For example on ARM the timer might start from 0 again only after a cold reset. The 32bit overflow occurs after a bit more than 49 days (1000 Hz counter) so booting after that time may lead to a surprise because the board might become stuck requiring a cold reset. Signed-off-by: Ronald Wahl <ronald.wahl@legrand.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-12-11mmc: renesas: Fix R-Car spellingMarek Vasut
The correct spelling is R-Car, including the dash, update the usage. Comment changes only, no functional change. Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-11-20mmc: msm_sdhci: enable vqmmc at probe if availableNeil Armstrong
On earlier platforms, the vqmmc regulator was enabled by the previous bootloader, but on the newest (SM8650) it's not and we need vqmmc to be enabled in order to have the card to respond. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-10-28mmc: renesas-sdhi: Add compatible string for rzg2l-sdhiPaul Barker
After the recent dts/upstream subtree merge, the sdhi compatible string used in the device tree for RZ/G2L family SoCs is "renesas,rzg2l-sdhi" not "renesas,rcar-gen3-sdhi". This broke the ability to access the eMMC and SD card devices on RZ/G2L boards. Fix this by adding the new compatible string to the sdhi driver. Fixes: 136b7b6d2e98 ("Subtree merge tag 'v6.11-dts' of dts repo [1] into dts/upstream") Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2024-10-25mmc: fsl_esdhc: Convert to use livetree API for fdt accessTim Harvey
Convert to using livetree API functions. Without this if livetree is enabled (OF_LIVE) the fsl_esdhc_imx driver will fail to read vendor-specific properties from the dt. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-10-15Revert "mmc: dw_mmc: Extract FIFO data transfer into a separate routine"Jonas Karlman
The commit 0252924ac6d4 ("mmc: dw_mmc: Extract FIFO data transfer into a separate routine") unintentionally changed behavior of the FIFO data transfer routine. When data is read and size reaches 0 the original loop would wait on DWMCI_INTMSK_DTO or timeout. The remaining size to read and buf position is no longer tracked across dwmci_data_transfer_fifo() calls and because of this an extra call to fifo() and dwmci_fifo_ready() may now trigger a FIFO underflow timeout error and slows down FIFO reading. Buswidth = 4, clock: 50000000 Sending CMD16 Sending CMD17 dwmci_fifo_ready: FIFO underflow timeout Sending CMD16 Sending CMD18 dwmci_fifo_ready: FIFO underflow timeout Sending CMD12 ## Checking hash(es) for config config-1 ... OK This reverts commit 0252924ac6d4af69061bb9589d16b30c5bdb7178 to restore the old working behavior. Fixes: 0252924ac6d4 ("mmc: dw_mmc: Extract FIFO data transfer into a separate routine") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Quentin Schulz <quentin.schulz@cherry.de> # RK3588 Tiger Reviewed-by: Simon Glass <sjg@chromium.org>
2024-10-14Merge patch series "Integrate MbedTLS v3.6 LTS with U-Boot"Tom Rini
Raymond Mao <raymond.mao@linaro.org> says: Integrate MbedTLS v3.6 LTS (currently v3.6.0) with U-Boot. Motivations: ------------ 1. MbedTLS is well maintained with LTS versions. 2. LWIP is integrated with MbedTLS and easily to enable HTTPS. 3. MbedTLS recently switched license back to GPLv2. Prerequisite: ------------- This patch series requires mbedtls git repo to be added as a subtree to the main U-Boot repo via: $ git subtree add --prefix lib/mbedtls/external/mbedtls \ https://github.com/Mbed-TLS/mbedtls.git \ v3.6.0 --squash Moreover, due to the Windows-style files from mbedtls git repo, we need to convert the CRLF endings to LF and do a commit manually: $ git add --renormalize . $ git commit New Kconfig options: -------------------- `MBEDTLS_LIB` is for MbedTLS general switch. `MBEDTLS_LIB_CRYPTO` is for replacing original digest and crypto libs with MbedTLS. `MBEDTLS_LIB_CRYPTO_ALT` is for using original U-Boot crypto libs as MbedTLS crypto alternatives. `MBEDTLS_LIB_X509` is for replacing original X509, PKCS7, MSCode, ASN1, and Pubkey parser with MbedTLS. By default `MBEDTLS_LIB_CRYPTO_ALT` and `MBEDTLS_LIB_X509` are selected when `MBEDTLS_LIB` is enabled. `LEGACY_CRYPTO` is introduced as a main switch for legacy crypto library. `LEGACY_CRYPTO_BASIC` is for the basic crypto functionalities and `LEGACY_CRYPTO_CERT` is for the certificate related functionalities. For each of the algorithm, a pair of `<alg>_LEGACY` and `<alg>_MBEDTLS` Kconfig options are introduced. Meanwhile, `SPL_` Kconfig options are introduced. In this patch set, MBEDTLS_LIB, MBEDTLS_LIB_CRYPTO and MBEDTLS_LIB_X509 are by default enabled in qemu_arm64_defconfig and sandbox_defconfig for testing purpose. Patches for external MbedTLS project: ------------------------------------- Since U-Boot uses Microsoft Authentication Code to verify PE/COFFs executables which is not supported by MbedTLS at the moment, addtional patches for MbedTLS are created to adapt with the EFI loader: 1. Decoding of Microsoft Authentication Code. 2. Decoding of PKCS#9 Authenticate Attributes. 3. Extending MbedTLS PKCS#7 lib to support multiple signer's certificates. 4. MbedTLS native test suites for PKCS#7 signer's info. All above 4 patches (tagged with `mbedtls/external`) are submitted to MbedTLS project and being reviewed, eventually they should be part of MbedTLS LTS release. But before that, please merge them into U-Boot, otherwise the building will be broken when MBEDTLS_LIB_X509 is enabled. See below PR link for the reference: https://github.com/Mbed-TLS/mbedtls/pull/9001 Miscellaneous: -------------- Optimized MbedTLS library size by tailoring the config file and disabling all unnecessary features for EFI loader. From v2, original libs (rsa, asn1_decoder, rsa_helper, md5, sha1, sha256, sha512) are completely replaced when MbedTLS is enabled. From v3, the size-growth is slightly reduced by refactoring Hash functions. From v6, smaller implementations for SHA256 and SHA512 are enabled and target size reduce significantly. Target(QEMU arm64) size-growth when enabling MbedTLS: v1: 6.03% v2: 4.66% v3 - v5: 4.55% v6: 2.90% Tests done: ----------- EFI Secure Boot test (EFI variables loading and verifying, EFI signed image verifying and booting) via U-Boot console. EFI Secure Boot and Capsule sandbox test passed. Known issues: ------------- None. Link: https://lore.kernel.org/u-boot/20241003215112.3103601-1-raymond.mao@linaro.org/
2024-10-14lib: Adapt digest header files to MbedTLSRaymond Mao
Adapt digest header files to support both original libs and MbedTLS by switching on/off MBEDTLS_LIB_CRYPTO. Introduce <alg>_LEGACY kconfig for legacy hash implementations. sha256.o should depend on SHA256 kconfig only but not SUPPORT_EMMC_RPMB, SHA256 should be selected when SUPPORT_EMMC_RPMB is enabled instead. `IS_ENABLED` or `CONFIG_IS_ENABLED` is not applicable here, since including <linux/kconfig.h> causes undefined reference on schedule() with sandbox build, as <linux/kconfig.h> includes <generated/autoconf.h> which enables `CONFIG_HW_WATCHDOG` and `CONFIG_WATCHDOG` but no schedule() are defined in sandbox build, Thus we use `#if defined(CONFIG_MBEDTLS_LIB_CRYPTO)` instead. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-11Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"Tom Rini
Simon Glass <sjg@chromium.org> says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit.
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11global: Rename SPL_ to XPL_Simon Glass
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is no-longer set. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-04mmc: fsl_esdhc_imx: Reset tuning logicPeng Fan
When supporting partition reset for SoC such as i.MX95 , the Linux Kernel may have configured the tuning, while after force reset by wdog or else, uboot CMD0 will never pass unless config RSTT to reset tuning logic. Since RSTA and RSTT are independent, so need both to be reseted in the controller. Acked-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-04mmc: fsl_esdhc_imx: Avoid resource leakYe Li
The memory of priv and plat are leaked if max_bus_width is wrong. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-04mmc: fsl_esdhc_imx: Fix host_caps issue for non-DM driverYe Li
The plat->cfg is wrongly memset to 0, so the host_caps value configured in fsl_esdhc_initialize is reset. Remove the unnecessary memset since plat is allocated via calloc. Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-04mmc: fsl_esdhc_imx: Send 80 clocks before IDLE commandYe Li
According to SD and MMC spec, 74 clocks must be sent to device after power stable. This is need in reinit ops for DM MMC or init ops for non-DM MMC after power cycle. So set the INTIA to send 80 clocks in esdhc_init_common and move its calling from probe to reinit. However, on 8MQ EVK and 8QXP MEK with some brands of SD cards, sending 80 clocks may not work well. The root cause is related with power up time. According to spec, after power stable, host shall supply at least 74 SD clocks to the SD card with the maximum of 1ms. However, the power ram up time is related with the characteristic of SD card. At the moment of sending 74 SD clocks, the power probably not ram up to the operating level on the problematic cards. Then cause the cards not ready. This patch changes to send SD clock with 1ms duration to replace 80 SD clocks (0.2ms at 400Khz clock). This way meets the spec requirement as well, and adds the margin for power ram up time to be compatible with the problematic SD cards. This is also aligned with implementation which has FORCE clock always on. Reviewed-and-tested-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-04mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk APIPeng Fan
With partition reset supported for i.MX8QM/QXP/95 and etc, when linux mmc runtime suspended, the mmc clks are gated off. While at same time system controller reset Cortex-A cores because of various reasons( WDOG timeout and etc), with SPL run again, only enable PER clk is not enough, also need to enable AHB/IPG clk, here use clk bulk API to enable all the clocks. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-03Merge patch series "vbe: Series part D"Tom Rini
Simon Glass <sjg@chromium.org> says: This includes various patches towards implementing the VBE abrec bootmeth in U-Boot.
2024-10-03rockchip: mmc: Fix a missing colon and newlineSimon Glass
Add a missing colon and newline in rk3399_emmc_get_phy(). Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-03mmc: rockchip: Allow clocks to be missingSimon Glass
Allow MMC init when clock support is not enabled in a particular phase. Refactor the setting of priv->emmc_clk so it is a bit clearer. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-03mmc: rockchip: Log some error returnsSimon Glass
Add a little logging to some places in this driver, to aid debugging when something goes wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-03mmc: Log the error when init failsSimon Glass
Add an error-return log to the call in mmc_init_device() Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-03mmc: Support driver model in TPLSimon Glass
Some boards want to use DM_MMC in TPL so add an option for that. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-09-23Merge tag 'xilinx-for-v2025.01-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next AMD/Xilinx changes for v2025.01-rc1 kbuild: - Add rules for automatically applying DT overlays Microblaze: - Enable bootscript location via DT AMD/Xilinx - Enable SIMPLE_PM_BUS by default ZynqMP: - DT updates and alignments with dt-schema - Call fdtoverlay via make directly - Enable non-invasive CCI-400 PMU debug - Disable secure access for boot devices - Add new zynqmp reboot command Versal NET: - Cleanup spi_get_env_dev() Kria: - Add bootmenu support sdhci: - Do not call device_is_compatible everywhere net: - Remove is-internal-pcspma DT flag
2024-09-21mmc: Poll CD in case cyclic framework is enabledMarek Vasut
In case the cyclic framework is enabled, poll the card detect of already initialized cards and deinitialize them in case they are removed. Since the card initialization is a longer process and card initialization is done on first access to an uninitialized card anyway, avoid initializing newly detected uninitialized cards in the cyclic callback. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-09-20mmc: zynq_sdhci: Remove device_is_compatible() functionPadmarao Begari
There are lot of device_is_compatible() present in the driver. Remove them and replace with a variables "SDHCI_COMPATIBLE_SDHCI_89A" and "SDHCI_COMPATIBLE_VERSAL_NET_EMMC" with match data. This change saves the space and reduce the execution time. Signed-off-by: Padmarao Begari <padmarao.begari@amd.com> Link: https://lore.kernel.org/r/20240913093157.2343476-1-padmarao.begari@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-09-05mmc: consider cd-gpios in Synopsys DesignWare driverHeinrich Schuchardt
The JH7110 SoC uses a GPIO for card detect. * In the of_to_plat function check if a cd-gpios definition exists and request the GPIO. * In the getcd function return the GPIO value in this case. Reported-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-09-05mmc: msm_sdhci: program core_vendor_specCaleb Connolly
After resetting the host controller, program in the POR val for this register just like the Linux driver does. This seems to help with initialization when running U-Boot as the primary bootloader on some boards. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-05mmc: Change the frequency to MMC_HS_52 when selecting hs400Venkatesh Yadav Abbarapu
Per JESD84-B51 P47, host need to change frequency to <=52MHz after setting HS_TIMING to 0x1, and host need to set the 8-bit DDR buswidth. Currently setting the frequency to 26MHz and trying to switch 8-bit DDR buswidth resulting timeouts. mmc dev 1 0 Select HS400 failed -110 switch to partitions #0, OK mmc1(part 0) is current device Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-09-05mmc: sdhci-cadence: Add support for Cadence sdmmc v6Kuan Lim Lee
Cadence SDMMC v6 controller has a lot of changes on initialize compared to v4 controller. PHY is needed by v6 controller. Signed-off-by: Kuan Lim Lee <kuanlim.lee@starfivetech.com> Co-developed-by: Alex Soo <yuklin.soo@starfivetech.com> Signed-off-by: Wei Liang Lim <weiliang.lim@starfivetech.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-09-05Merge patch series "provide names for emmc hardware partitions"Tom Rini
Tim Harvey <tharvey@gateworks.com> 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 << 6) EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0) EXT_CSD_BOOT_ACK(x) (x << 6) EXT_CSD_BOOT_PART_NUM(x) (x << 3) EXT_CSD_PARTITION_ACCESS(x) (x << 0) EXT_CSD_EXTRACT_BOOT_ACK(x) (((x) >> 6) & 0x1) EXT_CSD_EXTRACT_BOOT_PART(x) (((x) >> 3) & 0x7) EXT_CSD_EXTRACT_PARTITION_ACCESS(x) ((x) & 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.
2024-09-05mmc: allow use of hardware partition names for mmc partconfTim Harvey
eMMC v4+ devices have hardware partitions that are accessed via the PARTITION_CONFIG (Extended CSD Register 179) PARTITION_ACCESS and BOOT_PARTITION_ENABLE fields defined as: 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 Add char arrays to provide names for these values. Use these names which displaying or setting the PARTITION_CONFIG register via the 'mmc partconf' command. Before: u-boot=> mmc partconf 2 1 1 0 && mmc partconf 2 EXT_CSD[179], PARTITION_CONFIG: BOOT_ACK: 0x1 BOOT_PARTITION_ENABLE: 0x2 PARTITION_ACCESS: 0x0 After: u-boot=> mmc partconf 2 1 1 0 && mmc partconf 2 EXT_CSD[179], PARTITION_CONFIG: BOOT_ACK: 0x1 BOOT_PARTITION_ENABLE: 0x1 (boot0) PARTITION_ACCESS: 0x0 (user) u-boot=> mmc partconf 2 1 boot1 0 && mmc partconf 2 EXT_CSD[179], PARTITION_CONFIG: BOOT_ACK: 0x1 BOOT_PARTITION_ENABLE: 0x2 (boot1) PARTITION_ACCESS: 0x0 (user) Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2024-08-23mmc: Use logging instead of pr_err()Simon Glass
Use the log subsystem instead of dev, to avoid including function names in the code. The CONFIG_LOGF_FUNC option can be used to enable the function name. Update 'enhanced size' to use hex since this is the U-Boot default and more natural for the large numbers involved. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>