From patchwork Mon Jun 29 09:47:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pragnesh Patel X-Patchwork-Id: 243073 List-Id: U-Boot discussion From: pragnesh.patel at sifive.com (Pragnesh Patel) Date: Mon, 29 Jun 2020 15:17:26 +0530 Subject: [PATCH 3/6] mmc: read ssr for SD spi In-Reply-To: <20200629094730.10051-1-pragnesh.patel@sifive.com> References: <20200629094730.10051-1-pragnesh.patel@sifive.com> Message-ID: <20200629094730.10051-4-pragnesh.patel@sifive.com> The content of ssr is useful only for erase operations. This saves erase time. Signed-off-by: Pragnesh Patel Reviewed-by: Bin Meng --- drivers/mmc/mmc.c | 5 +++++ drivers/mmc/mmc_spi.c | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 620bb93064..6b193d6d70 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1746,6 +1746,11 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps) mmc_set_bus_width(mmc, 1); mmc_select_mode(mmc, MMC_LEGACY); mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE); +#if CONFIG_IS_ENABLED(MMC_WRITE) + err = sd_read_ssr(mmc); + if (err) + pr_warn("unable to read ssr\n"); +#endif return 0; } diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index ddfebb6ed6..18d36878ef 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -305,6 +305,7 @@ static int dm_mmc_spi_request(struct udevice *dev, struct mmc_cmd *cmd, case MMC_CMD_READ_MULTIPLE_BLOCK: case MMC_CMD_WRITE_SINGLE_BLOCK: case MMC_CMD_WRITE_MULTIPLE_BLOCK: + case MMC_CMD_APP_CMD: resp = &resp8; resp_size = sizeof(resp8); break;