aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r--drivers/mmc/host/mmci.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 370cd5ad111c..c9dafed550f2 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -61,7 +61,7 @@ static unsigned int fmax = 515633;
61 * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY 61 * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY
62 * is asserted (likewise for RX) 62 * is asserted (likewise for RX)
63 * @data_cmd_enable: enable value for data commands. 63 * @data_cmd_enable: enable value for data commands.
64 * @sdio: variant supports SDIO 64 * @st_sdio: enable ST specific SDIO logic
65 * @st_clkdiv: true if using a ST-specific clock divider algorithm 65 * @st_clkdiv: true if using a ST-specific clock divider algorithm
66 * @datactrl_mask_ddrmode: ddr mode mask in datactrl register. 66 * @datactrl_mask_ddrmode: ddr mode mask in datactrl register.
67 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register 67 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register
@@ -90,7 +90,7 @@ struct variant_data {
90 unsigned int data_cmd_enable; 90 unsigned int data_cmd_enable;
91 unsigned int datactrl_mask_ddrmode; 91 unsigned int datactrl_mask_ddrmode;
92 unsigned int datactrl_mask_sdio; 92 unsigned int datactrl_mask_sdio;
93 bool sdio; 93 bool st_sdio;
94 bool st_clkdiv; 94 bool st_clkdiv;
95 bool blksz_datactrl16; 95 bool blksz_datactrl16;
96 bool blksz_datactrl4; 96 bool blksz_datactrl4;
@@ -139,7 +139,7 @@ static struct variant_data variant_u300 = {
139 .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, 139 .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS,
140 .datalength_bits = 16, 140 .datalength_bits = 16,
141 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN, 141 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN,
142 .sdio = true, 142 .st_sdio = true,
143 .pwrreg_powerup = MCI_PWR_ON, 143 .pwrreg_powerup = MCI_PWR_ON,
144 .f_max = 100000000, 144 .f_max = 100000000,
145 .signal_direction = true, 145 .signal_direction = true,
@@ -153,7 +153,7 @@ static struct variant_data variant_nomadik = {
153 .clkreg = MCI_CLK_ENABLE, 153 .clkreg = MCI_CLK_ENABLE,
154 .datalength_bits = 24, 154 .datalength_bits = 24,
155 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN, 155 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN,
156 .sdio = true, 156 .st_sdio = true,
157 .st_clkdiv = true, 157 .st_clkdiv = true,
158 .pwrreg_powerup = MCI_PWR_ON, 158 .pwrreg_powerup = MCI_PWR_ON,
159 .f_max = 100000000, 159 .f_max = 100000000,
@@ -171,7 +171,7 @@ static struct variant_data variant_ux500 = {
171 .clkreg_neg_edge_enable = MCI_ST_UX500_NEG_EDGE, 171 .clkreg_neg_edge_enable = MCI_ST_UX500_NEG_EDGE,
172 .datalength_bits = 24, 172 .datalength_bits = 24,
173 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN, 173 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN,
174 .sdio = true, 174 .st_sdio = true,
175 .st_clkdiv = true, 175 .st_clkdiv = true,
176 .pwrreg_powerup = MCI_PWR_ON, 176 .pwrreg_powerup = MCI_PWR_ON,
177 .f_max = 100000000, 177 .f_max = 100000000,
@@ -191,7 +191,7 @@ static struct variant_data variant_ux500v2 = {
191 .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, 191 .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE,
192 .datalength_bits = 24, 192 .datalength_bits = 24,
193 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN, 193 .datactrl_mask_sdio = MCI_ST_DPSM_SDIOEN,
194 .sdio = true, 194 .st_sdio = true,
195 .st_clkdiv = true, 195 .st_clkdiv = true,
196 .blksz_datactrl16 = true, 196 .blksz_datactrl16 = true,
197 .pwrreg_powerup = MCI_PWR_ON, 197 .pwrreg_powerup = MCI_PWR_ON,
@@ -814,26 +814,26 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
814 if (data->flags & MMC_DATA_READ) 814 if (data->flags & MMC_DATA_READ)
815 datactrl |= MCI_DPSM_DIRECTION; 815 datactrl |= MCI_DPSM_DIRECTION;
816 816
817 if (variant->sdio && host->mmc->card) 817 if (host->mmc->card && mmc_card_sdio(host->mmc->card)) {
818 if (mmc_card_sdio(host->mmc->card)) { 818 u32 clk;
819 u32 clk;
820 datactrl |= variant->datactrl_mask_sdio;
821 819
822 /* 820 datactrl |= variant->datactrl_mask_sdio;
823 * The ST Micro variant for SDIO small write transfers
824 * needs to have clock H/W flow control disabled,
825 * otherwise the transfer will not start. The threshold
826 * depends on the rate of MCLK.
827 */
828 if (data->flags & MMC_DATA_WRITE &&
829 (host->size < 8 ||
830 (host->size <= 8 && host->mclk > 50000000)))
831 clk = host->clk_reg & ~variant->clkreg_enable;
832 else
833 clk = host->clk_reg | variant->clkreg_enable;
834 821
835 mmci_write_clkreg(host, clk); 822 /*
836 } 823 * The ST Micro variant for SDIO small write transfers
824 * needs to have clock H/W flow control disabled,
825 * otherwise the transfer will not start. The threshold
826 * depends on the rate of MCLK.
827 */
828 if (variant->st_sdio && data->flags & MMC_DATA_WRITE &&
829 (host->size < 8 ||
830 (host->size <= 8 && host->mclk > 50000000)))
831 clk = host->clk_reg & ~variant->clkreg_enable;
832 else
833 clk = host->clk_reg | variant->clkreg_enable;
834
835 mmci_write_clkreg(host, clk);
836 }
837 837
838 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50 || 838 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50 ||
839 host->mmc->ios.timing == MMC_TIMING_MMC_DDR52) 839 host->mmc->ios.timing == MMC_TIMING_MMC_DDR52)