51 lines
1.5 KiB
Diff
51 lines
1.5 KiB
Diff
|
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
|
||
|
index fb266745f824..e56987522182 100644
|
||
|
--- a/drivers/mmc/host/mmci.c
|
||
|
+++ b/drivers/mmc/host/mmci.c
|
||
|
@@ -103,6 +103,7 @@ struct variant_data {
|
||
|
bool explicit_mclk_control;
|
||
|
bool qcom_fifo;
|
||
|
bool qcom_dml;
|
||
|
+ bool any_blksize;
|
||
|
bool reversed_irq_handling;
|
||
|
};
|
||
|
|
||
|
@@ -200,6 +201,7 @@ static struct variant_data variant_ux500v2 = {
|
||
|
.pwrreg_clkgate = true,
|
||
|
.busy_detect = true,
|
||
|
.pwrreg_nopower = true,
|
||
|
+ .any_blksize = true,
|
||
|
};
|
||
|
|
||
|
static struct variant_data variant_qcom = {
|
||
|
@@ -218,6 +220,7 @@ static struct variant_data variant_qcom = {
|
||
|
.explicit_mclk_control = true,
|
||
|
.qcom_fifo = true,
|
||
|
.qcom_dml = true,
|
||
|
+ .any_blksize = true,
|
||
|
};
|
||
|
|
||
|
static int mmci_card_busy(struct mmc_host *mmc)
|
||
|
@@ -245,10 +248,11 @@ static int mmci_card_busy(struct mmc_host *mmc)
|
||
|
static int mmci_validate_data(struct mmci_host *host,
|
||
|
struct mmc_data *data)
|
||
|
{
|
||
|
+ struct variant_data *variant = host->variant;
|
||
|
+
|
||
|
if (!data)
|
||
|
return 0;
|
||
|
-
|
||
|
- if (!is_power_of_2(data->blksz)) {
|
||
|
+ if (!is_power_of_2(data->blksz) && !variant->any_blksize) {
|
||
|
dev_err(mmc_dev(host->mmc),
|
||
|
"unsupported block size (%d bytes)\n", data->blksz);
|
||
|
return -EINVAL;
|
||
|
@@ -804,7 +808,6 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
|
||
|
writel(host->size, base + MMCIDATALENGTH);
|
||
|
|
||
|
blksz_bits = ffs(data->blksz) - 1;
|
||
|
- BUG_ON(1 << blksz_bits != data->blksz);
|
||
|
|
||
|
if (variant->blksz_datactrl16)
|
||
|
datactrl = MCI_DPSM_ENABLE | (data->blksz << 16);
|