]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: read ssr for SD spi
authorPragnesh Patel <pragnesh.patel@sifive.com>
Mon, 29 Jun 2020 09:47:26 +0000 (15:17 +0530)
committerPeng Fan <peng.fan@nxp.com>
Tue, 14 Jul 2020 08:19:43 +0000 (16:19 +0800)
The content of ssr is useful only for erase operations.
This saves erase time.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
drivers/mmc/mmc.c
drivers/mmc/mmc_spi.c

index 50f47d4ba26954d89b323dd964773dadfb32dda0..7b5c55be7d9b06fb9717cbed33d281c57a334ea6 100644 (file)
@@ -1753,6 +1753,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;
        }
 
index ddfebb6ed69d8ba0be17cd4d27184ec77142d72c..18d36878efaff130c7f9703de1b02f78b8ca12cb 100644 (file)
@@ -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;