Lines Matching refs:sdhci_am654

165 	struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host);  in sdhci_am654_setup_dll()  local
171 regmap_update_bits(sdhci_am654->base, PHY_CTRL5, in sdhci_am654_setup_dll()
174 if (sdhci_am654->flags & FREQSEL_2_BIT) { in sdhci_am654_setup_dll()
192 regmap_update_bits(sdhci_am654->base, PHY_CTRL5, mask, val); in sdhci_am654_setup_dll()
203 regmap_update_bits(sdhci_am654->base, PHY_CTRL5, FREQSEL_MASK, in sdhci_am654_setup_dll()
208 val = sdhci_am654->trm_icp << DLL_TRIM_ICP_SHIFT; in sdhci_am654_setup_dll()
212 val |= sdhci_am654->drv_strength << DR_TY_SHIFT; in sdhci_am654_setup_dll()
213 regmap_update_bits(sdhci_am654->base, PHY_CTRL1, mask, val); in sdhci_am654_setup_dll()
216 regmap_update_bits(sdhci_am654->base, PHY_CTRL1, ENDLL_MASK, in sdhci_am654_setup_dll()
222 ret = regmap_read_poll_timeout(sdhci_am654->base, PHY_STAT1, val, in sdhci_am654_setup_dll()
230 static void sdhci_am654_write_itapdly(struct sdhci_am654_data *sdhci_am654, in sdhci_am654_write_itapdly() argument
234 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPCHGWIN_MASK, in sdhci_am654_write_itapdly()
236 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPDLYSEL_MASK, in sdhci_am654_write_itapdly()
238 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPCHGWIN_MASK, 0); in sdhci_am654_write_itapdly()
241 static void sdhci_am654_setup_delay_chain(struct sdhci_am654_data *sdhci_am654, in sdhci_am654_setup_delay_chain() argument
246 regmap_update_bits(sdhci_am654->base, PHY_CTRL1, ENDLL_MASK, 0); in sdhci_am654_setup_delay_chain()
250 regmap_update_bits(sdhci_am654->base, PHY_CTRL5, mask, val); in sdhci_am654_setup_delay_chain()
252 sdhci_am654_write_itapdly(sdhci_am654, in sdhci_am654_setup_delay_chain()
253 sdhci_am654->itap_del_sel[timing]); in sdhci_am654_setup_delay_chain()
259 struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); in sdhci_am654_set_clock() local
265 regmap_update_bits(sdhci_am654->base, PHY_CTRL1, ENDLL_MASK, 0); in sdhci_am654_set_clock()
270 if (sdhci_am654->legacy_otapdly) in sdhci_am654_set_clock()
271 otap_del_sel = sdhci_am654->otap_del_sel[0]; in sdhci_am654_set_clock()
273 otap_del_sel = sdhci_am654->otap_del_sel[timing]; in sdhci_am654_set_clock()
283 if (sdhci_am654->flags & STRBSEL_4_BIT) in sdhci_am654_set_clock()
288 val |= sdhci_am654->strb_sel << STRBSEL_SHIFT; in sdhci_am654_set_clock()
291 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, mask, val); in sdhci_am654_set_clock()
296 sdhci_am654_setup_delay_chain(sdhci_am654, timing); in sdhci_am654_set_clock()
298 regmap_update_bits(sdhci_am654->base, PHY_CTRL5, CLKBUFSEL_MASK, in sdhci_am654_set_clock()
299 sdhci_am654->clkbuf_sel); in sdhci_am654_set_clock()
306 struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); in sdhci_j721e_4bit_set_clock() local
312 if (sdhci_am654->legacy_otapdly) in sdhci_j721e_4bit_set_clock()
313 otap_del_sel = sdhci_am654->otap_del_sel[0]; in sdhci_j721e_4bit_set_clock()
315 otap_del_sel = sdhci_am654->otap_del_sel[timing]; in sdhci_j721e_4bit_set_clock()
320 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, mask, val); in sdhci_j721e_4bit_set_clock()
322 regmap_update_bits(sdhci_am654->base, PHY_CTRL5, CLKBUFSEL_MASK, in sdhci_j721e_4bit_set_clock()
323 sdhci_am654->clkbuf_sel); in sdhci_j721e_4bit_set_clock()
406 struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); in sdhci_am654_platform_execute_tuning() local
411 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPDLYENA_MASK, in sdhci_am654_platform_execute_tuning()
415 sdhci_am654_write_itapdly(sdhci_am654, itap); in sdhci_am654_platform_execute_tuning()
434 sdhci_am654_write_itapdly(sdhci_am654, itap); in sdhci_am654_platform_execute_tuning()
559 struct sdhci_am654_data *sdhci_am654) in sdhci_am654_get_otap_delay() argument
566 &sdhci_am654->otap_del_sel[MMC_TIMING_LEGACY]); in sdhci_am654_get_otap_delay()
573 &sdhci_am654->otap_del_sel[0]); in sdhci_am654_get_otap_delay()
581 sdhci_am654->legacy_otapdly = true; in sdhci_am654_get_otap_delay()
589 &sdhci_am654->otap_del_sel[i]); in sdhci_am654_get_otap_delay()
605 &sdhci_am654->itap_del_sel[i]); in sdhci_am654_get_otap_delay()
614 struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); in sdhci_am654_init() local
622 regmap_update_bits(sdhci_am654->base, PHY_CTRL4, mask, 0x0); in sdhci_am654_init()
624 if (sdhci_am654->flags & DLL_CALIB) { in sdhci_am654_init()
625 regmap_read(sdhci_am654->base, PHY_STAT1, &val); in sdhci_am654_init()
628 regmap_update_bits(sdhci_am654->base, PHY_CTRL1, in sdhci_am654_init()
630 ret = regmap_read_poll_timeout(sdhci_am654->base, in sdhci_am654_init()
640 if (sdhci_am654->flags & IOMUX_PRESENT) in sdhci_am654_init()
641 regmap_update_bits(sdhci_am654->base, PHY_CTRL1, in sdhci_am654_init()
648 regmap_update_bits(sdhci_am654->base, CTL_CFG_2, SLOTTYPE_MASK, in sdhci_am654_init()
652 regmap_update_bits(sdhci_am654->base, CTL_CFG_3, TUNINGFORSDR50_MASK, in sdhci_am654_init()
663 ret = sdhci_am654_get_otap_delay(host, sdhci_am654); in sdhci_am654_init()
679 struct sdhci_am654_data *sdhci_am654) in sdhci_am654_get_of_property() argument
685 if (sdhci_am654->flags & DLL_PRESENT) { in sdhci_am654_get_of_property()
687 &sdhci_am654->trm_icp); in sdhci_am654_get_of_property()
698 sdhci_am654->drv_strength = DRIVER_STRENGTH_50_OHM; in sdhci_am654_get_of_property()
701 sdhci_am654->drv_strength = DRIVER_STRENGTH_33_OHM; in sdhci_am654_get_of_property()
704 sdhci_am654->drv_strength = DRIVER_STRENGTH_66_OHM; in sdhci_am654_get_of_property()
707 sdhci_am654->drv_strength = DRIVER_STRENGTH_100_OHM; in sdhci_am654_get_of_property()
710 sdhci_am654->drv_strength = DRIVER_STRENGTH_40_OHM; in sdhci_am654_get_of_property()
718 device_property_read_u32(dev, "ti,strobe-sel", &sdhci_am654->strb_sel); in sdhci_am654_get_of_property()
720 &sdhci_am654->clkbuf_sel); in sdhci_am654_get_of_property()
749 struct sdhci_am654_data *sdhci_am654; in sdhci_am654_probe() local
765 host = sdhci_pltfm_init(pdev, drvdata->pdata, sizeof(*sdhci_am654)); in sdhci_am654_probe()
770 sdhci_am654 = sdhci_pltfm_priv(pltfm_host); in sdhci_am654_probe()
771 sdhci_am654->flags = drvdata->flags; in sdhci_am654_probe()
796 sdhci_am654->base = devm_regmap_init_mmio(dev, base, in sdhci_am654_probe()
798 if (IS_ERR(sdhci_am654->base)) { in sdhci_am654_probe()
800 ret = PTR_ERR(sdhci_am654->base); in sdhci_am654_probe()
804 ret = sdhci_am654_get_of_property(pdev, sdhci_am654); in sdhci_am654_probe()