From patchwork Thu Feb 20 04:45:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 236636 List-Id: U-Boot discussion From: jh80.chung at samsung.com (Jaehoon Chung) Date: Thu, 20 Feb 2020 13:45:32 +0900 Subject: [PATCH 1/3] mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default In-Reply-To: <20200220044534.19600-1-jh80.chung@samsung.com> References: <20200220044534.19600-1-jh80.chung@samsung.com> Message-ID: <20200220044534.19600-2-jh80.chung@samsung.com> Add MMC_CAP_NEEDS_POLL by default. Signed-off-by: Jaehoon Chung --- drivers/mmc/jz_mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/jz_mmc.c b/drivers/mmc/jz_mmc.c index 8d4f886cb4..df995bda2f 100644 --- a/drivers/mmc/jz_mmc.c +++ b/drivers/mmc/jz_mmc.c @@ -395,7 +395,8 @@ static struct jz_mmc_plat jz_mmc_plat_static = { .voltages = MMC_VDD_27_28 | MMC_VDD_28_29 | MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36, - .host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS, + .host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS | + MMC_CAP_NEEDS_POLL, .f_min = 375000, .f_max = 48000000, @@ -452,7 +453,8 @@ static int jz_mmc_ofdata_to_platdata(struct udevice *dev) cfg = &plat->cfg; cfg->name = "MSC"; - cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS; + cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS | + MMC_CAP_NEEDS_POLL; ret = mmc_of_parse(dev, cfg); if (ret < 0) { From patchwork Thu Feb 20 04:45:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 236634 List-Id: U-Boot discussion From: jh80.chung at samsung.com (Jaehoon Chung) Date: Thu, 20 Feb 2020 13:45:33 +0900 Subject: [PATCH 2/3] mmc: check the flags of host_caps about broken-cd In-Reply-To: <20200220044534.19600-1-jh80.chung@samsung.com> References: <20200220044534.19600-1-jh80.chung@samsung.com> Message-ID: <20200220044534.19600-3-jh80.chung@samsung.com> broken-cd is provided to dt-property. Then it's set to MMC_CAP_NEEDS_POLL flag. Signed-off-by: Jaehoon Chung --- drivers/mmc/mmc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index b50fcbf6cf..cac60ea034 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2846,11 +2846,11 @@ int mmc_start_init(struct mmc *mmc) mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) | MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT; -#if !defined(CONFIG_MMC_BROKEN_CD) - no_card = mmc_getcd(mmc) == 0; -#else - no_card = 0; -#endif + if (mmc->host_caps & MMC_CAP_NEEDS_POLL) + no_card = 0; + else + no_card = mmc_getcd(mmc) == 0; + #if !CONFIG_IS_ENABLED(DM_MMC) /* we pretend there's no card when init is NULL */ no_card = no_card || (mmc->cfg->ops->init == NULL); From patchwork Thu Feb 20 04:45:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 236635 List-Id: U-Boot discussion From: jh80.chung at samsung.com (Jaehoon Chung) Date: Thu, 20 Feb 2020 13:45:34 +0900 Subject: [PATCH 3/3] mmc: Kconfig: remove MMC_BROKEN_CD configuration In-Reply-To: <20200220044534.19600-1-jh80.chung@samsung.com> References: <20200220044534.19600-1-jh80.chung@samsung.com> Message-ID: <20200220044534.19600-4-jh80.chung@samsung.com> Remove MMC_BROKEN_CD configuration. It doesn't need to use configuration, instead use broken-cd property. Signed-off-by: Jaehoon Chung --- configs/brppt2_defconfig | 1 - configs/ci20_mmc_defconfig | 1 - configs/meerkat96_defconfig | 1 - drivers/mmc/Kconfig | 5 ----- 4 files changed, 8 deletions(-) diff --git a/configs/brppt2_defconfig b/configs/brppt2_defconfig index f94ea28376..5d1dfde36e 100644 --- a/configs/brppt2_defconfig +++ b/configs/brppt2_defconfig @@ -68,7 +68,6 @@ CONFIG_SPL_DM_SEQ_ALIAS=y # CONFIG_SPL_BLK is not set CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_I2C_MXC=y -CONFIG_MMC_BROKEN_CD=y # CONFIG_SPL_DM_MMC is not set CONFIG_FSL_ESDHC=y CONFIG_MTD=y diff --git a/configs/ci20_mmc_defconfig b/configs/ci20_mmc_defconfig index a0b0772f40..f31a3c44f4 100644 --- a/configs/ci20_mmc_defconfig +++ b/configs/ci20_mmc_defconfig @@ -34,7 +34,6 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y # CONFIG_DM_DEVICE_REMOVE is not set CONFIG_JZ4780_EFUSE=y CONFIG_MMC=y -CONFIG_MMC_BROKEN_CD=y CONFIG_DM_MMC=y # CONFIG_MMC_HW_PARTITIONING is not set CONFIG_MMC_IO_VOLTAGE=y diff --git a/configs/meerkat96_defconfig b/configs/meerkat96_defconfig index 45f12115ba..d358ed23a5 100644 --- a/configs/meerkat96_defconfig +++ b/configs/meerkat96_defconfig @@ -34,7 +34,6 @@ CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="imx7d-meerkat96" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y -CONFIG_MMC_BROKEN_CD=y CONFIG_DM_MMC=y CONFIG_FSL_ESDHC=y CONFIG_MTD=y diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 2f0eedc22f..3722e7bc13 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -18,11 +18,6 @@ config MMC_WRITE help Enable write access to MMC and SD Cards -config MMC_BROKEN_CD - bool "Poll for broken card detection case" - help - If card detection feature is broken, just poll to detect. - config DM_MMC bool "Enable MMC controllers using Driver Model" depends on DM