Lines Matching full:timing
368 dev_err(emc->dev, "failed to update timing: %d\n", err); in emc_seq_update_timing()
399 struct emc_timing *timing = NULL; in emc_find_timing() local
404 timing = &emc->timings[i]; in emc_find_timing()
409 if (!timing) { in emc_find_timing()
410 dev_err(emc->dev, "no timing for rate %lu\n", rate); in emc_find_timing()
414 return timing; in emc_find_timing()
417 static bool emc_dqs_preset(struct tegra_emc *emc, struct emc_timing *timing, in emc_dqs_preset() argument
423 if (timing->data[71] & EMC_XM2DQSPADCTRL2_VREF_ENABLE) { in emc_dqs_preset()
434 if (timing->data[78] & EMC_XM2DQSPADCTRL3_VREF_ENABLE) { in emc_dqs_preset()
445 if (timing->data[77] & EMC_XM2QUSEPADCTRL_IVREF_ENABLE) { in emc_dqs_preset()
484 struct emc_timing *timing = emc_find_timing(emc, rate); in emc_prepare_timing_change() local
497 if (!timing || emc->bad_state) in emc_prepare_timing_change()
500 dev_dbg(emc->dev, "%s: using timing rate %lu for requested rate %lu\n", in emc_prepare_timing_change()
501 __func__, timing->rate, rate); in emc_prepare_timing_change()
516 if (emc->dll_on == !!(timing->emc_mode_1 & 0x1)) in emc_prepare_timing_change()
518 else if (timing->emc_mode_1 & 0x1) in emc_prepare_timing_change()
523 emc->dll_on = !!(timing->emc_mode_1 & 0x1); in emc_prepare_timing_change()
525 if (timing->data[80] && !readl_relaxed(emc->regs + EMC_ZCAL_INTERVAL)) in emc_prepare_timing_change()
560 if (emc_dqs_preset(emc, timing, &schmitt_to_vref)) { in emc_prepare_timing_change()
574 if (timing->emc_auto_cal_interval) { in emc_prepare_timing_change()
576 val ^= timing->data[74]; in emc_prepare_timing_change()
595 for (i = 0; i < ARRAY_SIZE(timing->data); i++) { in emc_prepare_timing_change()
598 writel_relaxed(timing->data[i], in emc_prepare_timing_change()
602 err = tegra_mc_write_emem_configuration(emc->mc, timing->rate); in emc_prepare_timing_change()
613 val = timing->data[82] & EMC_MRS_WAIT_CNT_SHORT_WAIT_MASK; in emc_prepare_timing_change()
617 val = timing->data[82] & ~EMC_MRS_WAIT_CNT_LONG_WAIT_MASK; in emc_prepare_timing_change()
633 new_mode = timing->data[39] & EMC_CFG5_QUSE_MODE_MASK; in emc_prepare_timing_change()
662 writel_relaxed(timing->emc_mode_1, in emc_prepare_timing_change()
675 writel_relaxed(timing->data[73], emc->regs + EMC_XM2CLKPADCTRL); in emc_prepare_timing_change()
679 if (qrst_used || timing->emc_cfg_periodic_qrst != val) { in emc_prepare_timing_change()
680 if (timing->emc_cfg_periodic_qrst) in emc_prepare_timing_change()
696 if (timing->emc_mode_1 != emc->emc_mode_1) in emc_prepare_timing_change()
697 writel_relaxed(timing->emc_mode_1, in emc_prepare_timing_change()
700 if (timing->emc_mode_2 != emc->emc_mode_2) in emc_prepare_timing_change()
701 writel_relaxed(timing->emc_mode_2, in emc_prepare_timing_change()
704 if (timing->emc_mode_reset != emc->emc_mode_reset || in emc_prepare_timing_change()
706 val = timing->emc_mode_reset; in emc_prepare_timing_change()
716 if (timing->emc_mode_2 != emc->emc_mode_2) in emc_prepare_timing_change()
717 writel_relaxed(timing->emc_mode_2, in emc_prepare_timing_change()
720 if (timing->emc_mode_1 != emc->emc_mode_1) in emc_prepare_timing_change()
721 writel_relaxed(timing->emc_mode_1, in emc_prepare_timing_change()
725 emc->emc_mode_1 = timing->emc_mode_1; in emc_prepare_timing_change()
726 emc->emc_mode_2 = timing->emc_mode_2; in emc_prepare_timing_change()
727 emc->emc_mode_reset = timing->emc_mode_reset; in emc_prepare_timing_change()
754 struct emc_timing *timing = emc_find_timing(emc, rate); in emc_complete_timing_change() local
774 writel_relaxed(timing->emc_auto_cal_interval, in emc_complete_timing_change()
778 if (timing->emc_cfg_dyn_self_ref) { in emc_complete_timing_change()
785 writel_relaxed(timing->emc_zcal_cnt_long, in emc_complete_timing_change()
791 /* update restored timing */ in emc_complete_timing_change()
807 dev_err(emc->dev, "timing configuration can't be reverted\n"); in emc_unprepare_timing_change()
848 struct emc_timing *timing, in load_one_timing_from_dt() argument
856 dev_err(emc->dev, "timing %pOF: failed to read rate: %d\n", in load_one_timing_from_dt()
861 timing->rate = value; in load_one_timing_from_dt()
864 timing->data, in load_one_timing_from_dt()
868 "timing %pOF: failed to read emc timing data: %d\n", in load_one_timing_from_dt()
874 timing->prop = of_property_read_bool(node, dtprop); in load_one_timing_from_dt()
877 err = of_property_read_u32(node, dtprop, &timing->prop); \ in load_one_timing_from_dt()
880 "timing %pOFn: failed to read " #prop ": %d\n", \ in load_one_timing_from_dt()
896 dev_dbg(emc->dev, "%s: %pOF: rate %lu\n", __func__, node, timing->rate); in load_one_timing_from_dt()
929 "emc/mc timing rate mismatch: %lu %lu\n", in emc_check_mc_timings()
942 struct emc_timing *timing; in emc_load_timings_from_dt() local
952 emc->timings = devm_kcalloc(emc->dev, child_count, sizeof(*timing), in emc_load_timings_from_dt()
958 timing = emc->timings; in emc_load_timings_from_dt()
961 err = load_one_timing_from_dt(emc, timing++, child); in emc_load_timings_from_dt()
968 sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings, in emc_load_timings_from_dt()
1056 struct emc_timing *timing = NULL; in emc_round_rate() local
1076 timing = &emc->timings[i]; in emc_round_rate()
1080 if (!timing) { in emc_round_rate()
1081 dev_err(emc->dev, "no timing for rate %lu min %lu max %lu\n", in emc_round_rate()
1086 return timing->rate; in emc_round_rate()