24 #include <linux/module.h>
30 #include <linux/slab.h>
37 #define SD_FIFO_PARAM 0xe0
38 #define DIS_PAD_SD_CLK_GATE 0x0400
39 #define CLK_GATE_ON 0x0200
40 #define CLK_GATE_CTL 0x0100
41 #define CLK_GATE_SETTING_BITS (DIS_PAD_SD_CLK_GATE | \
42 CLK_GATE_ON | CLK_GATE_CTL)
44 #define SD_CLOCK_BURST_SIZE_SETUP 0xe6
45 #define SDCLK_SEL_SHIFT 8
46 #define SDCLK_SEL_MASK 0x3
47 #define SDCLK_DELAY_SHIFT 10
48 #define SDCLK_DELAY_MASK 0x3c
50 #define SD_CE_ATA_2 0xea
51 #define MMC_CARD 0x1000
52 #define MMC_WIDTH 0x0100
121 static struct sdhci_ops pxav2_sdhci_ops = {
122 .get_max_clock = pxav2_get_max_clock,
123 .platform_reset_exit = pxav2_set_private_registers,
124 .platform_8bit_width = pxav2_mmc_set_width,
128 static const struct of_device_id sdhci_pxav2_of_match[] = {
141 u32 clk_delay_cycles;
150 of_property_read_u32(np,
"bus-width", &bus_width);
154 of_property_read_u32(np,
"mrvl,clk-delay-cycles", &clk_delay_cycles);
155 if (clk_delay_cycles > 0) {
188 return PTR_ERR(host);
190 pltfm_host = sdhci_priv(host);
191 pltfm_host->
priv = pxa;
193 clk =
clk_get(dev,
"PXA-SDHCLK");
195 dev_err(dev,
"failed to get io clock\n");
199 pltfm_host->
clk = clk;
200 clk_prepare_enable(clk);
208 pdata = pxav2_get_mmc_pdata(dev);
229 host->
ops = &pxav2_sdhci_ops;
237 platform_set_drvdata(pdev, host);
242 clk_disable_unprepare(clk);
252 struct sdhci_host *host = platform_get_drvdata(pdev);
258 clk_disable_unprepare(pltfm_host->
clk);
263 platform_set_drvdata(pdev,
NULL);
270 .name =
"sdhci-pxav2",
273 .of_match_table = sdhci_pxav2_of_match,
277 .probe = sdhci_pxav2_probe,