summaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2024-05-02mmc: am654_sdhci: Fix ITAPDLY for HS400 timingJudith Mendez
At HS400 mode the ITAPDLY value is that from High Speed mode which is incorrect and may cause boot failures. The ITAPDLY for HS400 speed mode should be the same as ITAPDLY as HS200 timing after tuning is executed. Add the functionality to save ITAPDLY from HS200 tuning and save as HS400 ITAPDLY. Upstream-Status: Backport [f13a830e6e4ad884069e25c7cd2dc333b474da98] Fixes: c964447ea3d6 ("mmc: am654_sdhci: Add support for input tap delay") Signed-off-by: Judith Mendez <jm@ti.com>
2024-05-02mmc: am654_sdhci: Set ENDLL=1 for DDR52 modeJudith Mendez
According to the device datasheet [0], ENDLL=1 for DDR52 mode, so call am654_sdhci_setup_dll() and write itapdly after since we do not carry out tuning. [0] https://www.ti.com/lit/ds/symlink/am62p.pdf Upstream-Status: Backport [a124e31a97cd2963181d3a8a00678998bf9958a2] Fixes: c964447ea3d6 ("mmc: am654_sdhci: Add support for input tap delay") Signed-off-by: Judith Mendez <jm@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-05-02mmc: am654_sdhci: Add itap_del_ena[] to store itapdlyena bitJudith Mendez
Set itap_del_ena if ITAPDLY is found in DT or if the tuning algorithm was executed and found the optimal ITAPDLY. Add the functionality to save ITAPDLYENA that can be referenced later by storing the bit in array itap_del_ena[]. Upstream-Status: Backport [056af04a39aef6d9777a8d4fc29917b4494db4a5] Signed-off-by: Judith Mendez <jm@ti.com>
2024-05-02mmc: am654_sdhci: Fix OTAP/ITAP delay valuesNitin Yadav
U-Boot is failing to boot class U1 UHS SD cards due to incorrect OTAP and ITAP delay select values. Update OTAP and ITAP delay select values from DT. Upstream-Status: Backport [5048b5c61afddddb0a6ff2e6bffdd9dd028e399b] Fixes: c7d106b4eb3 ("mmc: am654_sdhci: Update output tap delay writes") Signed-off-by: Nitin Yadav <n-yadav@ti.com> Signed-off-by: Judith Mendez <jm@ti.com> Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
2024-05-02mmc: am654_sdhci: Add tuning algorithm for delay chainJudith Mendez
Currently the sdhci_am654 driver only supports one tuning algorithm which should be used only when DLL is enabled. The ITAPDLY is selected from the largest passing window and the buffer is viewed as a circular buffer. The new tuning algorithm should be used when the delay chain is enabled; the ITAPDLY is selected from the largest passing window and the buffer is not viewed as a circular buffer. This implementation is based off of the following paper: [1]. Also add support for multiple failing windows. [1] https://www.ti.com/lit/an/spract9/spract9.pdf Upstream-Status: Backport [6b8dd9ca6e06bc9ebd3d55cbbe094d4947e197bf] Fixes: a759abf569d4 ("mmc: am654_sdhci: Add support for software tuning") Signed-off-by: Judith Mendez <jm@ti.com> Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
2023-05-31drivers: mmc: am654_sdhci: Update OTAP/ITAP delayNitin Yadav
U-Boot is fail to boot class U1 UHS SD cards (such as microcenter) due to incorrect OTAP and ITAP delay select values. Update OTAP and ITAP delay select values based on recommeded RIOT values to fix boot issue. Signed-off-by: Nitin Yadav <n-yadav@ti.com>
2023-03-24Merge branch 'rpi-2023.04' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-raspberrypi - Fixes for booting newer revs of the SoC in the Raspberry Pi 4 - Propagate some firmware DT properties to the loaded DT - Update the Zero2W upstream DT name
2023-03-24mmc: bcm2835-host: let firmware manage the clock divisorVincent Fazio
Newer firmware can manage the SDCDIV clock divisor register, allowing the divisor to scale with the core as necessary. Leverage this ability if the firmware supports it. Adapted from the following raspberrypi Linux kernel commit: bcm2835-sdhost: Firmware manages the clock divisor https://github.com/raspberrypi/linux/commit/08532d242d7702ae0add95096aa49c5e96e066e2 Signed-off-by: Vincent Fazio <vfazio@xes-inc.com> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2023-03-19rockchip: sdhci: rk3568: bypass DLL when clk <= 52 MHzVasily Khoruzhick
For Rockchip platform, DLL bypass bit and start bit need to be set if DLL is not locked. With this change applied eMMC in my NanoPi R5S can run at 52 MHz. Based on linux commit b75a52b0dda3 ("mmc: sdhci-of-dwcmshc: Update DLL and pre-change delay for rockchip platform") Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-19mmc: rockchip_dw_mmc: Fix get_mmc_clk return valueJonas Karlman
The get_mmc_clk ops is expected to set a clock rate and return the configured rate as an unsigned value. However, if clk_set_rate fails, e.g. using a fixed rate clock, a negative error value is returned. The mmc core will treat this as a valid unsigned rate and tries to configure a divider based on this bogus clock rate. Use 0 as the return value when setting clock rate fails, the mmc core will configure to use bypass mode instead of using a bogus divider. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-03-10mmc: renesas-sdhi: Add proper probe error fail pathMarek Vasut
In case one of the calls in probe fail, trigger a fail path and undo all the steps done in probe until the point of failure. The current implementation failed to stop controller clock and free claimed clock, so fix that. Furthermore, print return code in error prints for easier debugging. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-10mmc: renesas-sdhi: Always configure default SDnH clock rate to 800 MHzMarek Vasut
The prior stage bootloader might have left the SDnCKCR register in completely arbitrary state before passing control to U-Boot, which includes the register being populated with incorrect values. Currently the SDHI driver will attempt to use clock framework to configure SDn clock, which may fail in case SDnCKCR contains invalid values for the SDnH clock, because the clock framework would not be able to determine SDnH clock rate and would get -EINVAL instead, which in turn would not allow the clock framework to determine the correct SDn clock divider ratio. This failure occurs specifically in case SDnCKCR reads back 0x209 . Correct the problem by first setting default SDnH clock rate to 800 MHz, thus assuring the SDnCKCR SDnH bits are correct, and only afterward set up the SDn clock rate to default 200 MHz. Note that the SDHI driver may reconfigure SDnH clock later based on IOS settings obtained from the attached card, the 800 MHz set up here is only the default value. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-02-28mmc: rockchip_dw_mmc: fix DDR52 8-bit mode handlingJohn Keeping
The RK3288 TRM states that, for 8-bit DDR modes: The CLKDIV register should always be programmed with a value higher than zero (0); that is, a clock divider should always be used for 8-bit DDR mode. In Linux, the driver applies this logic for all SoCs using the driver and does not distinguish RK3288, so presumably this requirement is the same for all other Rockchip SoCs using this IP. Add the necessary code to double the clock frequency when 8-bit DDR is selected. The dw_mmc core already handles setting CLKDIV correctly given the input clock and desired bus clock. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-10Correct SPL use of SUPPORT_EMMC_RPMBSimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_SUPPORT_EMMC_RPMB defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-10Correct SPL use of RENESAS_SDHISimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_RENESAS_SDHI defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL use of MMC_QUIRKSSimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_MMC_QUIRKS defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02clk: renesas: Switch to new SD clock handlingHai Pham
The old SD handling code was huge and could not handle all the details which showed up on R-Car Gen3 SoCs meanwhile. It is time to switch to another design. Have SDnH a separate clock, use the existing divider clocks and move the errata handling from the clock driver to the SDHI driver where it belongs. Based on Linux series by Wolfram Sang, commit bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling") and commit e5f7e81ee430a ("mmc: renesas_sdhi: Parse DT for SDnH") Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Marek: - Add rcar_clk_* prefix to all functions - Fix missing ~ in GENMASK(a, b), use clrsetbits_le32 instead - Use DIV_ROUND_CLOSEST, else if parent clock = 199999992 and rate = 200000000, the divider would be 0 and table lookup would fail. - Turn rcar_clk_get_table_val into signed integer, so it can return 0 as a valid value and negative values as errors. - Make the code operate on correct clock and add comment which explains the reasoning behind it. - Rebase on changes to clk: renesas: Introduce and use rcar_clk_get_rate64_div_table function
2023-02-02mmc: renesas-sdhi: Flag non-standard SDnH handling for V3MHai Pham
V3M handles SDnH differently than other Gen3 SoCs, so let's add a separate entry for that. This will allow better SDnH handling in the future. Based on Linux commit 627151b4966f ("mmc: renesas_sdhi: Flag non-standard SDnH handling for V3M") by Wolfram Sang Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02mmc: renesas-sdhi: Drop R-Car H3 ES3.0 HS400 calibration tableHai Pham
It is unnecessary, so clean it up. Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # update commit message, mention ES3.0 Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02mmc: renesas-sdhi: Add R8A77961 M3-W+ supportHai Pham
Support R8A77961 M3-W+ SoC. Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02mmc: renesas-sdhi: Adjust HS400 calibration offsets for M3-W r1.3Hai Pham
Still uses 0x3 for now, adjust the offset value to TMPPORT3 accordingly Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02mmc: renesas-sdhi: Adjust HS400 calibration tablesHai Pham
Adjust HS400 calibration tables based on Linux settings Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02mmc: renesas-sdhi: Filter out HS400 on M3-W r1.2, V3M, V3H r1.x, D3Hai Pham
Further filter out HS400 support on certain SoCs. Since M3-W r1.2 does not support HS400, drop the calibration table and rename the one for M3-W r1.3 to r8a7796_rev13_calib_table Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-02mmc: renesas-sdhi: R-Car M3 r1.3 also uses 4 tuning tapsHai Pham
Early ES revisions of M3-W SoCs requires 4-tap HS400. Reflect the status from datasheet. Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-01-31mmc: zynq_sdhci: Add support and quirk for HS400Ashok Reddy Soma
Add support for HS400 in mode2timing array. Add a quirk for Versal NET platform to indicate that HS400 is supported through bit63 of capability register. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
2023-01-31mmc: sdhci: Enable HS400 support if available in capsAshok Reddy Soma
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 <ashok.reddy.soma@amd.com>
2023-01-31mmc: sdhci: Check and call config_dll callback functionsAshok Reddy Soma
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 <ashok.reddy.soma@amd.com>
2023-01-31mmc: zynq_sdhci: Add support for eMMC5.1 for Versal NET platformAshok Reddy Soma
Add support for eMMC 5.1 for Versal NET platform - Add new compatible string(xlnx,versal-net-5.1-emmc). - Add CONFIG_ARCH_VERSAL_NET condition wherever required. - Add DLL and Delay Chain mode support - Add input and output tap delays for eMMC. - Add Strobe select tap for HS400 mode. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
2023-01-31cmd: mmc: Expand bkops handlingMarek Vasut
Add more capable "bkops" command which allows enabling and disabling both manual and automatic bkops. The existing 'mmc bkops-enable' subcommand is poorly named to cover all the possibilities, hence the new-ish subcommand. Note that both commands are wrappers around the same common code. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-01-27Merge tag 'xilinx-for-v2023.04-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx chnages for v2023.04-rc1 makefile: - Add multi_dtb_fit dependency clk: - Handle error cases microblaze: - Disable falcon mode and cleanup code around xilinx: - Enable regular expression matching in board_fit_config_name_match() - Fix FRU handling for 0xC1 format - Fix Xilinx legacy format eeprom parsing zynqmp: - Some DT updates/cleanups - Fix IDcode for xck24 - Remove empty mini config files - Add support for k24 versal: - Remove empty mini config files versal_net: - Setup timer when runs in EL3 - Build u-boot.elf for mini configurations zynq-gem: - Add support for new compatible strings - Remove support for Avnet Ultrazedev SOM - Handle SGMII with PCS phy spi: - Add support for gigadevice parts misc: - Remove CONFIG_TARGET_VENUS ifdef - Add missing headers to remove sparse warnings
2023-01-27drivers: mmc: Change datatype of tuning_loop_counter to intAlgapally Santosh Sagar
tuning_loop_counter is of char type, which is not capable of handling the entire data range of this variable. This is pointed by below sparse warning. Change datatype to int to fix this. warning: comparison is always false due to limited range of data type. Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Link: https://lore.kernel.org/r/20230120053617.32463-5-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-01-24Merge https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini
This contains some fixes, and the first bunch of some clean up patches to get rid of legacy GPIO and PMIC code. Highlight is the DM AXP PMIC driver, which is required to convert some drivers over to use DM regulators, and also is required to get rid of some less optimal PMIC setup code in Trusted Firmware. This isn't enabled by any defconfig yet, but can be enabled manually and works. For the full glory some patches are still missing, and this requires more testing, which would be simpler if the core code is upstream.
2023-01-23bootstd: Add a new pre-scan priority for bootdevsSimon Glass
We need extensions to be set up before we start trying to boot any of the bootdevs. Add a new priority before all the others for tht sort of thing. Also add a 'none' option, so that the first one is not 0. While we are here, comment enum bootdev_prio_t fully and expand the test for the 'bootdev hunt' command. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add an MMC hunterSimon Glass
Add a hunter for MMC. This doesn't do anything at present, since MMC is currently set up when U-Boot starts. If MMC moves to lazy init then we can add a hunter function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a default method to get bootflowsSimon Glass
The code in these functions turns out to often be the same. Add a default get_bootflow() function and allow the drivers to select it by setting the method to NULL. This saves a little code space. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23dm: mmc: Use bootdev_setup_sibling_blk()Simon Glass
At present MMC uses the bootdev_setup_for_dev() function to set up the bootdev. This is because MMC only has one block-device child, so does not need to worry about naming of the bootdev. However this inconsistency with other bootdevs that use block devices is a bit annoying. The only real reason for it is to have a name like 'mmc0.bootdev' instead of 'mmc0.blk.bootdev'. Update bootdev_setup_sibling_blk() to drop '.blk' from the name where it appears, thus removing the only reason to use the bootdev_setup_for_dev(). Switch MMC over to the subling function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23sandbox: mmc: Start off with a zeroed fileSimon Glass
When running multiple tests the mmc emulator calls malloc() to obtain the memory for its disk image. Since the memory is not cleared, it is possible that it happens to contain a partition table. The dm_test_part() test (for one) relies on mmc0 being empty on startup. Zero the memory to ensure that it is. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-21sunxi: mmc: group non-DM specific functionsAndre Przywara
As the SPL code for sunxi boards does not use the driver model, we have two mmc_ops structures, one for DM, one for non-DM. The actual hardware access code is shared, with the respective callback functions using that common code. To make this more obvious and easier to read, reorder the functions to group them: we first have the common code, then the non-DM bits, and the proper DM implementation at the end. Also document this structure in the comment at the beginning of the file. No functional change intended. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Samuel Holland <samuel@sholland.org> Tested-by: Samuel Holland <samuel@sholland.org>
2023-01-21sunxi: mmc: ignore card detect in SPLAndre Przywara
The sunxi MMC code does not use the DM in the SPL, as we don't have a device tree available that early, also no space for it. This also means we cannot access the card-detect GPIO information from there, so we have Kconfig symbols called CONFIG_MMCx_CD_PIN, which each board has to define. This is a burden, also requires extra GPIO code in the SPL. As the SPL is the natural successor of the BootROM (from which we are loaded), we can actually ignore the CD pin completely, as this is what the BootROM does as well: CD GPIOs are board specific, but the BootROM is not, so accesses the MMC devices anyway. Also, as we must have been loaded from an MMC device when reaching this code, there must have been a card in the slot. Remove the card detect code from the non-DM implementation of the sunxi MMC driver, to get rid of this unneeded code. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Samuel Holland <samuel@sholland.org> Tested-by: Samuel Holland <samuel@sholland.org>
2022-12-22Convert CONFIG_FSL_ESDHC_PIN_MUX to KconfigTom Rini
This converts the following to Kconfig: CONFIG_FSL_ESDHC_PIN_MUX Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-22Convert CONFIG_FLASH_SPANSION_S29WS_N et al to KconfigTom Rini
This converts the following to Kconfig: CONFIG_FLASH_SPANSION_S29WS_N CONFIG_FLASH_VERIFY CONFIG_FSL_FM_10GEC_REGULAR_NOTATION CONFIG_FSL_ISBC_KEY_EXT CONFIG_FSL_TRUST_ARCH_v1 CONFIG_FSL_SDHC_V2_3 CONFIG_MAX_DSP_CPUS CONFIG_MIU_2BIT_INTERLEAVED CONFIG_SERIAL_BOOT CONFIG_SPI_BOOTING CONFIG_X86EMU_RAW_IO Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-22Convert CONFIG_HSMMC2_8BIT to KconfigTom Rini
This converts the following to Kconfig: CONFIG_HSMMC2_8BIT Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-05global: Move remaining CONFIG_SYS_* to CFG_SYS_*Tom Rini
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespaceTom Rini
Migrate all of COFIG_SYS_FSL* to the CFG_SYS namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-10Convert CONFIG_SYS_MMC_MAX_BLK_COUNT to KconfigTom Rini
This converts the following to Kconfig: CONFIG_SYS_MMC_MAX_BLK_COUNT Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-10-31dm: mmc: Allow sandbox emulator to build without writesSimon Glass
When MMC_WRITE is disabled this driver produced a build error. Fix this. Also update a comment while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-10-31dm: blk: mmc: Tidy up some Makefile rules for SPLSimon Glass
Use the correct SPL_TPL_ variable so that these features can be enabled in TPL and VPL as needed. Disable it by default in TPL to avoid any code-size increase. No boards are actually using it since the Makefile rules don't allow including drivers/block/ with TPL_DM enabled. It can be manually enabled as needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-10-24Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmcTom Rini
2022-10-24mmc: Fix static checker warningsVenkatesh Yadav Abbarapu
Correct pointer dereferencing check to be more consistent. Eliminate the below smatch warning: drivers/mmc/mmc.c:3118 mmc_init_device() warn: variable dereferenced before check 'm' (see line 3116) Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Reviewed-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-10-24mmc: dwmmc: only clear handled interruptsJohn Keeping
Unconditionally clearing DTO when RXDR is set leads to spurious timeouts in FIFO mode transfers if events occur in the following order: mask = dwmci_readl(host, DWMCI_RINTSTS); // Hardware asserts DWMCI_INTMSK_DTO here dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_DTO); if (mask & DWMCI_INTMSK_DTO) { // Unreachable as DTO is cleared without being handled! return 0; } Only clear interrupts that we have seen and are handling so that DTO is not missed. Signed-off-by: John Keeping <john@metanate.com> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (Rock PI 4B) Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>