Lines Matching refs:host
21 struct sdhci_host host; member
28 static inline struct sdhci_iproc_host *to_iproc(struct sdhci_host *host) in to_iproc() argument
30 return (struct sdhci_iproc_host *)host; in to_iproc()
34 static u32 sdhci_iproc_readl(struct sdhci_host *host, int reg) in sdhci_iproc_readl() argument
36 u32 val = readl(host->ioaddr + reg); in sdhci_iproc_readl()
39 host->name, host->index, reg, val); in sdhci_iproc_readl()
44 static u16 sdhci_iproc_readw(struct sdhci_host *host, int reg) in sdhci_iproc_readw() argument
46 u32 val = sdhci_iproc_readl(host, (reg & ~3)); in sdhci_iproc_readw()
51 static u8 sdhci_iproc_readb(struct sdhci_host *host, int reg) in sdhci_iproc_readb() argument
53 u32 val = sdhci_iproc_readl(host, (reg & ~3)); in sdhci_iproc_readb()
58 static void sdhci_iproc_writel(struct sdhci_host *host, u32 val, int reg) in sdhci_iproc_writel() argument
63 host->name, host->index, reg, val); in sdhci_iproc_writel()
65 writel(val, host->ioaddr + reg); in sdhci_iproc_writel()
67 if (host->mmc) in sdhci_iproc_writel()
68 clock = host->mmc->clock; in sdhci_iproc_writel()
97 static void sdhci_iproc_writew(struct sdhci_host *host, u16 val, int reg) in sdhci_iproc_writew() argument
99 struct sdhci_iproc_host *iproc_host = to_iproc(host); in sdhci_iproc_writew()
107 sdhci_iproc_writel(host, iproc_host->shadow_blk, in sdhci_iproc_writew()
117 oldval = sdhci_iproc_readl(host, (reg & ~3)); in sdhci_iproc_writew()
129 sdhci_iproc_writel(host, newval, reg & ~3); in sdhci_iproc_writew()
133 static void sdhci_iproc_writeb(struct sdhci_host *host, u8 val, int reg) in sdhci_iproc_writeb() argument
135 u32 oldval = sdhci_iproc_readl(host, (reg & ~3)); in sdhci_iproc_writeb()
140 sdhci_iproc_writel(host, newval, reg & ~3); in sdhci_iproc_writeb()
144 static int sdhci_iproc_set_ios_post(struct sdhci_host *host) in sdhci_iproc_set_ios_post() argument
146 struct mmc *mmc = (struct mmc *)host->mmc; in sdhci_iproc_set_ios_post()
150 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); in sdhci_iproc_set_ios_post()
152 sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); in sdhci_iproc_set_ios_post()
155 sdhci_set_uhs_timing(host); in sdhci_iproc_set_ios_post()
159 static void sdhci_start_tuning(struct sdhci_host *host) in sdhci_start_tuning() argument
163 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); in sdhci_start_tuning()
165 sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); in sdhci_start_tuning()
167 sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); in sdhci_start_tuning()
168 sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_SIGNAL_ENABLE); in sdhci_start_tuning()
171 static void sdhci_end_tuning(struct sdhci_host *host) in sdhci_end_tuning() argument
174 sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK, in sdhci_end_tuning()
177 sdhci_writel(host, 0x0, SDHCI_SIGNAL_ENABLE); in sdhci_end_tuning()
185 struct sdhci_host *host = dev_get_priv(mmc->dev); in sdhci_iproc_execute_tuning() local
189 sdhci_start_tuning(host); in sdhci_iproc_execute_tuning()
198 sdhci_writew(host, blocksize, SDHCI_BLOCK_SIZE); in sdhci_iproc_execute_tuning()
199 sdhci_writew(host, 1, SDHCI_BLOCK_COUNT); in sdhci_iproc_execute_tuning()
200 sdhci_writew(host, SDHCI_TRNS_READ, SDHCI_TRANSFER_MODE); in sdhci_iproc_execute_tuning()
212 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); in sdhci_iproc_execute_tuning()
221 sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL2); in sdhci_iproc_execute_tuning()
226 sdhci_end_tuning(host); in sdhci_iproc_execute_tuning()
253 struct sdhci_host *host = dev_get_priv(dev); in iproc_sdhci_probe() local
267 host->name = dev->name; in iproc_sdhci_probe()
268 host->ioaddr = dev_read_addr_ptr(dev); in iproc_sdhci_probe()
269 host->quirks = SDHCI_QUIRK_BROKEN_R1B; in iproc_sdhci_probe()
270 host->host_caps = MMC_MODE_DDR_52MHz; in iproc_sdhci_probe()
271 host->index = fdtdec_get_uint(gd->fdt_blob, node, "index", 0); in iproc_sdhci_probe()
272 host->ops = &sdhci_platform_ops; in iproc_sdhci_probe()
273 host->version = sdhci_readw(host, SDHCI_HOST_VERSION); in iproc_sdhci_probe()
281 host->max_clk = f_min_max[1]; in iproc_sdhci_probe()
282 host->bus_width = fdtdec_get_int(gd->fdt_blob, in iproc_sdhci_probe()
286 if (host->bus_width == 8) in iproc_sdhci_probe()
287 host->host_caps |= MMC_MODE_8BIT; in iproc_sdhci_probe()
289 memcpy(&iproc_host->host, host, sizeof(struct sdhci_host)); in iproc_sdhci_probe()
291 iproc_host->host.mmc = &plat->mmc; in iproc_sdhci_probe()
292 iproc_host->host.mmc->dev = dev; in iproc_sdhci_probe()
293 iproc_host->host.mmc->priv = &iproc_host->host; in iproc_sdhci_probe()
294 upriv->mmc = iproc_host->host.mmc; in iproc_sdhci_probe()
296 ret = sdhci_setup_cfg(&plat->cfg, &iproc_host->host, in iproc_sdhci_probe()