#define MMC_CMULT 8 /* 8 because the card is high-capacity */
#define MMC_BL_LEN_SHIFT 10
#define MMC_BL_LEN BIT(MMC_BL_LEN_SHIFT)
+
+/* Granularity of priv->csize - this is 1MB */
#define SIZE_MULTIPLE ((1 << (MMC_CMULT + 2)) * MMC_BL_LEN)
struct sandbox_mmc_priv {
struct mmc_data *data)
{
struct sandbox_mmc_priv *priv = dev_get_priv(dev);
- struct mmc *mmc = mmc_get_mmc_dev(dev);
static ulong erase_start, erase_end;
switch (cmd->cmdidx) {
case SD_CMD_ERASE_WR_BLK_END:
erase_end = cmd->cmdarg;
break;
- case MMC_CMD_ERASE:
+#if CONFIG_IS_ENABLED(MMC_WRITE)
+ case MMC_CMD_ERASE: {
+ struct mmc *mmc = mmc_get_mmc_dev(dev);
+
memset(&priv->buf[erase_start * mmc->write_bl_len], '\0',
(erase_end - erase_start + 1) * mmc->write_bl_len);
break;
+ }
+#endif
case SD_CMD_APP_SEND_OP_COND:
cmd->response[0] = OCR_BUSY | OCR_HCS;
cmd->response[1] = 0;