• Home
  • Raw
  • Download

Lines Matching +full:sdhci +full:- +full:caps +full:- +full:mask

15  * iProc SDHCI platform driver
24 #include "sdhci-pltfm.h"
28 u32 caps; member
45 u32 val = readl(host->ioaddr + reg); in sdhci_iproc_readl()
48 mmc_hostname(host->mmc), reg, val); in sdhci_iproc_readl()
59 if ((reg == SDHCI_TRANSFER_MODE) && iproc_host->is_cmd_shadowed) { in sdhci_iproc_readw()
61 val = iproc_host->shadow_cmd; in sdhci_iproc_readw()
63 iproc_host->is_blk_shadowed) { in sdhci_iproc_readw()
65 val = iproc_host->shadow_blk; in sdhci_iproc_readw()
83 mmc_hostname(host->mmc), reg, val); in sdhci_iproc_writel()
85 writel(val, host->ioaddr + reg); in sdhci_iproc_writel()
87 if (host->clock <= 400000) { in sdhci_iproc_writel()
88 /* Round up to micro-second four SD clock delay */ in sdhci_iproc_writel()
89 if (host->clock) in sdhci_iproc_writel()
90 udelay((4 * 1000000 + host->clock - 1) / host->clock); in sdhci_iproc_writel()
98 * writes to the same register that are within two SD-card clock cycles of
100 * register does not have this problem, which is just as well - otherwise we'd
104 * controller with 32-bit writes. So two different 16-bit registers are
112 * Then, write the BLOCK_SIZE+BLOCK_COUNT in a single 32-bit write followed
113 * by the TRANSFER+COMMAND in another 32-bit write.
120 u32 mask = 0xffff << word_shift; in sdhci_iproc_writew() local
125 if (iproc_host->is_blk_shadowed) { in sdhci_iproc_writew()
126 sdhci_iproc_writel(host, iproc_host->shadow_blk, in sdhci_iproc_writew()
128 iproc_host->is_blk_shadowed = false; in sdhci_iproc_writew()
130 oldval = iproc_host->shadow_cmd; in sdhci_iproc_writew()
131 iproc_host->is_cmd_shadowed = false; in sdhci_iproc_writew()
133 iproc_host->is_blk_shadowed) { in sdhci_iproc_writew()
135 oldval = iproc_host->shadow_blk; in sdhci_iproc_writew()
140 newval = (oldval & ~mask) | (val << word_shift); in sdhci_iproc_writew()
144 iproc_host->shadow_cmd = newval; in sdhci_iproc_writew()
145 iproc_host->is_cmd_shadowed = true; in sdhci_iproc_writew()
148 iproc_host->shadow_blk = newval; in sdhci_iproc_writew()
149 iproc_host->is_blk_shadowed = true; in sdhci_iproc_writew()
151 /* Command or other regular 32-bit write */ in sdhci_iproc_writew()
160 u32 mask = 0xff << byte_shift; in sdhci_iproc_writeb() local
161 u32 newval = (oldval & ~mask) | (val << byte_shift); in sdhci_iproc_writeb()
170 if (pltfm_host->clk) in sdhci_iproc_get_max_clock()
173 return pltfm_host->clock; in sdhci_iproc_get_max_clock()
177 * There is a known bug on BCM2711's SDHCI core integration where the
182 * - No SD card plugged in, polling thread is running, probing cards at
184 * - BCM2711's core clock configured at 500MHz or more
224 .caps = ((0x1 << SDHCI_MAX_BLOCK_SHIFT)
248 .caps = ((0x1 << SDHCI_MAX_BLOCK_SHIFT)
272 .caps = ((0x1 << SDHCI_MAX_BLOCK_SHIFT)
308 { .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data },
309 { .compatible = "brcm,bcm2711-emmc2", .data = &bcm2711_data },
310 { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_cygnus_data},
311 { .compatible = "brcm,sdhci-iproc", .data = &iproc_data },
318 * This is a duplicate of bcm2835_(pltfrm_)data without caps quirks
345 struct device *dev = &pdev->dev; in sdhci_iproc_probe()
354 return -ENODEV; in sdhci_iproc_probe()
356 host = sdhci_pltfm_init(pdev, iproc_data->pdata, sizeof(*iproc_host)); in sdhci_iproc_probe()
363 iproc_host->data = iproc_data; in sdhci_iproc_probe()
365 ret = mmc_of_parse(host->mmc); in sdhci_iproc_probe()
371 host->mmc->caps |= iproc_host->data->mmc_caps; in sdhci_iproc_probe()
373 if (dev->of_node) { in sdhci_iproc_probe()
374 pltfm_host->clk = devm_clk_get(dev, NULL); in sdhci_iproc_probe()
375 if (IS_ERR(pltfm_host->clk)) { in sdhci_iproc_probe()
376 ret = PTR_ERR(pltfm_host->clk); in sdhci_iproc_probe()
379 ret = clk_prepare_enable(pltfm_host->clk); in sdhci_iproc_probe()
386 if (iproc_host->data->pdata->quirks & SDHCI_QUIRK_MISSING_CAPS) { in sdhci_iproc_probe()
387 host->caps = iproc_host->data->caps; in sdhci_iproc_probe()
388 host->caps1 = iproc_host->data->caps1; in sdhci_iproc_probe()
398 if (dev->of_node) in sdhci_iproc_probe()
399 clk_disable_unprepare(pltfm_host->clk); in sdhci_iproc_probe()
407 .name = "sdhci-iproc",
419 MODULE_DESCRIPTION("IPROC SDHCI driver");