Lines Matching refs:host

42 	struct sdhci_host *host;  member
72 static void arasan_zynqmp_dll_reset(struct sdhci_host *host, u8 deviceid) in arasan_zynqmp_dll_reset() argument
77 clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); in arasan_zynqmp_dll_reset()
79 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); in arasan_zynqmp_dll_reset()
86 while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL)) in arasan_zynqmp_dll_reset()
89 dev_err(mmc_dev(host->mmc), in arasan_zynqmp_dll_reset()
98 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); in arasan_zynqmp_dll_reset()
106 struct sdhci_host *host; in arasan_sdhci_execute_tuning() local
113 host = priv->host; in arasan_sdhci_execute_tuning()
116 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); in arasan_sdhci_execute_tuning()
118 sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); in arasan_sdhci_execute_tuning()
122 arasan_zynqmp_dll_reset(host, deviceid); in arasan_sdhci_execute_tuning()
124 sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); in arasan_sdhci_execute_tuning()
125 sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_SIGNAL_ENABLE); in arasan_sdhci_execute_tuning()
143 sdhci_writew(host, SDHCI_MAKE_BLKSZ(SDHCI_DEFAULT_BOUNDARY_ARG, in arasan_sdhci_execute_tuning()
146 sdhci_writew(host, data.blocks, SDHCI_BLOCK_COUNT); in arasan_sdhci_execute_tuning()
147 sdhci_writew(host, SDHCI_TRNS_READ, SDHCI_TRANSFER_MODE); in arasan_sdhci_execute_tuning()
150 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); in arasan_sdhci_execute_tuning()
159 sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL2); in arasan_sdhci_execute_tuning()
168 arasan_zynqmp_dll_reset(host, deviceid); in arasan_sdhci_execute_tuning()
171 sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK, in arasan_sdhci_execute_tuning()
174 sdhci_writel(host, 0x0, SDHCI_SIGNAL_ENABLE); in arasan_sdhci_execute_tuning()
188 static int sdhci_zynqmp_sdcardclk_set_phase(struct sdhci_host *host, in sdhci_zynqmp_sdcardclk_set_phase() argument
191 struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); in sdhci_zynqmp_sdcardclk_set_phase()
192 struct mmc *mmc = (struct mmc *)host->mmc; in sdhci_zynqmp_sdcardclk_set_phase()
202 if (SDHCI_GET_VERSION(host) < SDHCI_SPEC_300 || in sdhci_zynqmp_sdcardclk_set_phase()
244 static int sdhci_zynqmp_sampleclk_set_phase(struct sdhci_host *host, in sdhci_zynqmp_sampleclk_set_phase() argument
247 struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); in sdhci_zynqmp_sampleclk_set_phase()
248 struct mmc *mmc = (struct mmc *)host->mmc; in sdhci_zynqmp_sampleclk_set_phase()
258 if (SDHCI_GET_VERSION(host) < SDHCI_SPEC_300 || in sdhci_zynqmp_sampleclk_set_phase()
300 static int sdhci_versal_sdcardclk_set_phase(struct sdhci_host *host, in sdhci_versal_sdcardclk_set_phase() argument
303 struct mmc *mmc = (struct mmc *)host->mmc; in sdhci_versal_sdcardclk_set_phase()
313 if (SDHCI_GET_VERSION(host) < SDHCI_SPEC_300 || in sdhci_versal_sdcardclk_set_phase()
345 regval = sdhci_readl(host, SDHCI_ARASAN_OTAPDLY_REGISTER); in sdhci_versal_sdcardclk_set_phase()
347 sdhci_writel(host, regval, SDHCI_ARASAN_OTAPDLY_REGISTER); in sdhci_versal_sdcardclk_set_phase()
349 sdhci_writel(host, regval, SDHCI_ARASAN_OTAPDLY_REGISTER); in sdhci_versal_sdcardclk_set_phase()
364 static int sdhci_versal_sampleclk_set_phase(struct sdhci_host *host, in sdhci_versal_sampleclk_set_phase() argument
367 struct mmc *mmc = (struct mmc *)host->mmc; in sdhci_versal_sampleclk_set_phase()
377 if (SDHCI_GET_VERSION(host) < SDHCI_SPEC_300 || in sdhci_versal_sampleclk_set_phase()
409 regval = sdhci_readl(host, SDHCI_ARASAN_ITAPDLY_REGISTER); in sdhci_versal_sampleclk_set_phase()
411 sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER); in sdhci_versal_sampleclk_set_phase()
413 sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER); in sdhci_versal_sampleclk_set_phase()
415 sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER); in sdhci_versal_sampleclk_set_phase()
417 sdhci_writel(host, regval, SDHCI_ARASAN_ITAPDLY_REGISTER); in sdhci_versal_sampleclk_set_phase()
423 static void arasan_sdhci_set_tapdelay(struct sdhci_host *host) in arasan_sdhci_set_tapdelay() argument
425 struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); in arasan_sdhci_set_tapdelay()
427 struct mmc *mmc = (struct mmc *)host->mmc; in arasan_sdhci_set_tapdelay()
433 dev_dbg(dev, "%s, host:%s, mode:%d\n", __func__, host->name, timing); in arasan_sdhci_set_tapdelay()
437 sdhci_zynqmp_sampleclk_set_phase(host, iclk_phase); in arasan_sdhci_set_tapdelay()
438 sdhci_zynqmp_sdcardclk_set_phase(host, oclk_phase); in arasan_sdhci_set_tapdelay()
441 sdhci_versal_sampleclk_set_phase(host, iclk_phase); in arasan_sdhci_set_tapdelay()
442 sdhci_versal_sdcardclk_set_phase(host, oclk_phase); in arasan_sdhci_set_tapdelay()
527 static void arasan_sdhci_set_control_reg(struct sdhci_host *host) in arasan_sdhci_set_control_reg() argument
529 struct mmc *mmc = (struct mmc *)host->mmc; in arasan_sdhci_set_control_reg()
536 reg = sdhci_readw(host, SDHCI_HOST_CONTROL2); in arasan_sdhci_set_control_reg()
538 sdhci_writew(host, reg, SDHCI_HOST_CONTROL2); in arasan_sdhci_set_control_reg()
543 sdhci_set_uhs_timing(host); in arasan_sdhci_set_control_reg()
558 struct sdhci_host *host; in arasan_sdhci_probe() local
563 host = priv->host; in arasan_sdhci_probe()
585 host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD | in arasan_sdhci_probe()
589 host->quirks |= SDHCI_QUIRK_BROKEN_HISPD_MODE; in arasan_sdhci_probe()
593 host->quirks |= SDHCI_QUIRK_NO_1_8_V; in arasan_sdhci_probe()
601 host->max_clk = clock; in arasan_sdhci_probe()
603 host->mmc = &plat->mmc; in arasan_sdhci_probe()
604 host->mmc->dev = dev; in arasan_sdhci_probe()
605 host->mmc->priv = host; in arasan_sdhci_probe()
607 ret = sdhci_setup_cfg(&plat->cfg, host, plat->cfg.f_max, in arasan_sdhci_probe()
611 upriv->mmc = host->mmc; in arasan_sdhci_probe()
620 priv->host = calloc(1, sizeof(struct sdhci_host)); in arasan_sdhci_of_to_plat()
621 if (!priv->host) in arasan_sdhci_of_to_plat()
624 priv->host->name = dev->name; in arasan_sdhci_of_to_plat()
627 priv->host->ops = &arasan_ops; in arasan_sdhci_of_to_plat()
631 priv->host->ioaddr = (void *)dev_read_addr(dev); in arasan_sdhci_of_to_plat()
632 if (IS_ERR(priv->host->ioaddr)) in arasan_sdhci_of_to_plat()
633 return PTR_ERR(priv->host->ioaddr); in arasan_sdhci_of_to_plat()