From 8e2b0af7216d78b60fccb46a107a4a047938aea9 Mon Sep 17 00:00:00 2001 From: Stefan Bosch Date: Sat, 23 Jan 2021 13:37:41 +0100 Subject: mmc: fix response timeout after switch command After issuing the switch command: Wait until 'current state' of the card status becomes 'tran'. This prevents from response timeout at the next command because of 'current state' = 'data'. Signed-off-by: Stefan Bosch Reviewed-by: Jaehoon Chung --- include/mmc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index c12c7a0b5c..effccaaca0 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -178,6 +178,7 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx) #define MMC_STATUS_ERROR (1 << 19) #define MMC_STATE_PRG (7 << 9) +#define MMC_STATE_TRANS (4 << 9) #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ #define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ -- cgit From caee38aef71105c6bbc1910bad0e60bdabd053e2 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 16 Feb 2021 10:16:52 +0900 Subject: mmc: pwrseq: add mmc-pwrseq file to provide a generic interface Add mmc-pwrseq file to provide a generic interface. Signed-off-by: Jaehoon Chung --- include/mmc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index effccaaca0..8600881705 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -592,6 +592,9 @@ struct mmc_config { uint f_max; uint b_max; unsigned char part_type; +#ifdef CONFIG_MMC_PWRSEQ + struct udevice *pwr_dev; +#endif }; struct sd_ssr { @@ -808,6 +811,17 @@ int mmc_deinit(struct mmc *mmc); */ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg); +#ifdef CONFIG_MMC_PWRSEQ +/** + * mmc_pwrseq_get_power() - get a power device from device tree + * + * @dev: MMC device + * @cfg: MMC configuration + * @return 0 if OK, -ve on error + */ +int mmc_pwrseq_get_power(struct udevice *dev, struct mmc_config *cfg); +#endif + int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size); /** -- cgit