Lines Matching +full:bcm2835 +full:- +full:pm

1 // SPDX-License-Identifier: GPL-2.0-only
14 #include "sdhci-pltfm.h"
36 u32 val = readl(host->ioaddr + reg); in sdhci_iproc_readl()
39 mmc_hostname(host->mmc), reg, val); in sdhci_iproc_readl()
50 if ((reg == SDHCI_TRANSFER_MODE) && iproc_host->is_cmd_shadowed) { in sdhci_iproc_readw()
52 val = iproc_host->shadow_cmd; in sdhci_iproc_readw()
54 iproc_host->is_blk_shadowed) { in sdhci_iproc_readw()
56 val = iproc_host->shadow_blk; in sdhci_iproc_readw()
74 mmc_hostname(host->mmc), reg, val); in sdhci_iproc_writel()
76 writel(val, host->ioaddr + reg); in sdhci_iproc_writel()
78 if (host->clock <= 400000) { in sdhci_iproc_writel()
79 /* Round up to micro-second four SD clock delay */ in sdhci_iproc_writel()
80 if (host->clock) in sdhci_iproc_writel()
81 udelay((4 * 1000000 + host->clock - 1) / host->clock); in sdhci_iproc_writel()
89 * writes to the same register that are within two SD-card clock cycles of
91 * register does not have this problem, which is just as well - otherwise we'd
95 * controller with 32-bit writes. So two different 16-bit registers are
103 * Then, write the BLOCK_SIZE+BLOCK_COUNT in a single 32-bit write followed
104 * by the TRANSFER+COMMAND in another 32-bit write.
116 if (iproc_host->is_blk_shadowed) { in sdhci_iproc_writew()
117 sdhci_iproc_writel(host, iproc_host->shadow_blk, in sdhci_iproc_writew()
119 iproc_host->is_blk_shadowed = false; in sdhci_iproc_writew()
121 oldval = iproc_host->shadow_cmd; in sdhci_iproc_writew()
122 iproc_host->is_cmd_shadowed = false; in sdhci_iproc_writew()
124 iproc_host->is_blk_shadowed) { in sdhci_iproc_writew()
126 oldval = iproc_host->shadow_blk; in sdhci_iproc_writew()
135 iproc_host->shadow_cmd = newval; in sdhci_iproc_writew()
136 iproc_host->is_cmd_shadowed = true; in sdhci_iproc_writew()
139 iproc_host->shadow_blk = newval; in sdhci_iproc_writew()
140 iproc_host->is_blk_shadowed = true; in sdhci_iproc_writew()
142 /* Command or other regular 32-bit write */ in sdhci_iproc_writew()
161 if (pltfm_host->clk) in sdhci_iproc_get_max_clock()
164 return pltfm_host->clock; in sdhci_iproc_get_max_clock()
173 * - No SD card plugged in, polling thread is running, probing cards at
175 * - BCM2711's core clock configured at 500MHz or more
322 { .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data },
323 { .compatible = "brcm,bcm2711-emmc2", .data = &bcm2711_data },
324 { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_cygnus_data},
325 { .compatible = "brcm,sdhci-iproc", .data = &iproc_data },
326 { .compatible = "brcm,bcm7211a0-sdhci", .data = &bcm7211a0_data },
360 struct device *dev = &pdev->dev; in sdhci_iproc_probe()
369 return -ENODEV; in sdhci_iproc_probe()
371 host = sdhci_pltfm_init(pdev, iproc_data->pdata, sizeof(*iproc_host)); in sdhci_iproc_probe()
378 iproc_host->data = iproc_data; in sdhci_iproc_probe()
380 ret = mmc_of_parse(host->mmc); in sdhci_iproc_probe()
386 host->mmc->caps |= iproc_host->data->mmc_caps; in sdhci_iproc_probe()
388 if (dev->of_node) { in sdhci_iproc_probe()
389 pltfm_host->clk = devm_clk_get_enabled(dev, NULL); in sdhci_iproc_probe()
390 if (IS_ERR(pltfm_host->clk)) { in sdhci_iproc_probe()
391 ret = PTR_ERR(pltfm_host->clk); in sdhci_iproc_probe()
396 if (iproc_host->data->missing_caps) { in sdhci_iproc_probe()
398 &iproc_host->data->caps, in sdhci_iproc_probe()
399 &iproc_host->data->caps1); in sdhci_iproc_probe()
415 sdhci_pltfm_suspend(&pdev->dev); in sdhci_iproc_shutdown()
420 .name = "sdhci-iproc",
424 .pm = &sdhci_pltfm_pmops,