summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-08-26 08:33:10 -0600
committerTom Rini <trini@konsulko.com>2025-08-26 08:33:10 -0600
commit3dc5e9a0108bb114175b6362f9cb22367402f624 (patch)
treed5734aeaec554e67907a6db17ac7fef7a7ac6ac3
parent349cf24859b5e169a441d975fb4484d8597964bc (diff)
parent198c48f2657e67ded7fc7679c2ed1c26227f9fdc (diff)
Merge tag 'u-boot-stm32-20250825' of https://source.denx.de/u-boot/custodians/u-boot-stm
CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/27466 - Enable OF_UPSTREAM_BUILD_VENDOR for stm32mp25_defconfig - Fix to avoid inifite loop in stm32_sdmmc2 driver - Populate oobavail field of nand_ecclayout in stm32_fmc2_nand driver
-rw-r--r--configs/stm32mp25_defconfig2
-rw-r--r--drivers/mmc/stm32_sdmmc2.c16
-rw-r--r--drivers/mtd/nand/raw/stm32_fmc2_nand.c1
3 files changed, 18 insertions, 1 deletions
diff --git a/configs/stm32mp25_defconfig b/configs/stm32mp25_defconfig
index 14619ffd96c..2b02cd86d61 100644
--- a/configs/stm32mp25_defconfig
+++ b/configs/stm32mp25_defconfig
@@ -41,6 +41,8 @@ CONFIG_CMD_REGULATOR=y
CONFIG_CMD_LOG=y
CONFIG_CMD_UBI=y
CONFIG_OF_LIVE=y
+CONFIG_OF_UPSTREAM_BUILD_VENDOR=y
+CONFIG_OF_UPSTREAM_VENDOR="st"
CONFIG_ENV_IS_NOWHERE=y
CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_IS_IN_SPI_FLASH=y
diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
index 9483fb57daf..122690aef3e 100644
--- a/drivers/mmc/stm32_sdmmc2.c
+++ b/drivers/mmc/stm32_sdmmc2.c
@@ -385,15 +385,29 @@ static int stm32_sdmmc2_end_data(struct udevice *dev,
u32 mask = SDMMC_STA_DCRCFAIL | SDMMC_STA_DTIMEOUT |
SDMMC_STA_IDMATE | SDMMC_STA_DATAEND;
u32 status;
+ unsigned long timeout_msecs = ctx->data_length >> 8;
+ unsigned long start_timeout;
+
+ /* At least, a timeout of 2 seconds is set */
+ if (timeout_msecs < 2000)
+ timeout_msecs = 2000;
if (data->flags & MMC_DATA_READ)
mask |= SDMMC_STA_RXOVERR;
else
mask |= SDMMC_STA_TXUNDERR;
+ start_timeout = get_timer(0);
status = readl(plat->base + SDMMC_STA);
- while (!(status & mask))
+ while (!(status & mask)) {
+ if (get_timer(start_timeout) > timeout_msecs) {
+ ctx->dpsm_abort = true;
+ return -ETIMEDOUT;
+ }
+
+ schedule();
status = readl(plat->base + SDMMC_STA);
+ }
/*
* Need invalidate the dcache again to avoid any
diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
index d1c88643c98..21e3c88a55a 100644
--- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
+++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
@@ -1034,6 +1034,7 @@ static int stm32_fmc2_nfc_probe(struct udevice *dev)
ecclayout->eccpos[i] = oob_index;
ecclayout->oobfree->offset = oob_index;
ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset;
+ ecclayout->oobavail = ecclayout->oobfree->length;
chip->ecc.layout = ecclayout;
if (chip->options & NAND_BUSWIDTH_16)