29 #include <linux/slab.h>
31 #include <linux/module.h>
39 #define SD_CLOCK_BURST_SIZE_SETUP 0x10A
40 #define SDCLK_SEL 0x100
41 #define SDCLK_DELAY_SHIFT 9
42 #define SDCLK_DELAY_MASK 0x1f
44 #define SD_CFG_FIFO_PARAM 0x100
45 #define SDCFG_GEN_PAD_CLK_ON (1<<6)
46 #define SDCFG_GEN_PAD_CLK_CNT_MASK 0xFF
47 #define SDCFG_GEN_PAD_CLK_CNT_SHIFT 24
49 #define SD_SPI_MODE 0x108
50 #define SD_CE_ATA_1 0x10C
52 #define SD_CE_ATA_2 0x10E
53 #define SDCE_MISC_INT (1<<2)
54 #define SDCE_MISC_INT_EN (1<<1)
78 #define MAX_WAIT_COUNT 5
90 "%s: slot->power_mode = %d,"
91 "ios->power_mode = %d\n",
128 static int pxav3_set_uhs_signaling(
struct sdhci_host *
host,
unsigned int uhs)
160 "%s uhs = %d, ctrl_2 = %04X\n",
161 __func__, uhs, ctrl_2);
166 static struct sdhci_ops pxav3_sdhci_ops = {
167 .platform_reset_exit = pxav3_set_private_registers,
168 .set_uhs_signaling = pxav3_set_uhs_signaling,
169 .platform_send_init_74_clocks = pxav3_gen_init_74_clocks,
173 static const struct of_device_id sdhci_pxav3_of_match[] = {
186 u32 clk_delay_cycles;
196 of_property_read_u32(np,
"bus-width", &bus_width);
200 of_property_read_u32(np,
"mrvl,clk-delay-cycles", &clk_delay_cycles);
201 if (clk_delay_cycles > 0)
236 return PTR_ERR(host);
238 pltfm_host = sdhci_priv(host);
239 pltfm_host->
priv = pxa;
243 dev_err(dev,
"failed to get io clock\n");
247 pltfm_host->
clk = clk;
248 clk_prepare_enable(clk);
259 pdata = pxav3_get_mmc_pdata(dev);
285 "failed to allocate card detect gpio\n");
291 host->
ops = &pxav3_sdhci_ops;
301 platform_set_drvdata(pdev, host);
306 clk_disable_unprepare(clk);
318 struct sdhci_host *host = platform_get_drvdata(pdev);
325 clk_disable_unprepare(pltfm_host->
clk);
334 platform_set_drvdata(pdev,
NULL);
341 .name =
"sdhci-pxav3",
343 .of_match_table = sdhci_pxav3_of_match,
348 .probe = sdhci_pxav3_probe,