Lines Matching refs:dtm
284 int dtm;
1394 struct arm_cmn_dtm *dtm = NULL;
1401 if (dtm != &cmn->dtms[dn->dtm]) {
1402 dtm = &cmn->dtms[dn->dtm] + hw->dtm_offset;
1403 reg = readq_relaxed(dtm->base + offset);
1600 int wp_idx, dtm = dn->dtm, sel = hw->filter_sel;
1602 val->dtm_count[dtm]++;
1605 val->occupid[dtm][sel] = CMN_EVENT_OCCUPID(event) + 1;
1611 val->wp[dtm][wp_idx] = CMN_EVENT_WP_COMBINE(event) + 1;
1648 int wp_idx, wp_cmb, dtm = dn->dtm, sel = hw->filter_sel;
1650 if (val->dtm_count[dtm] == CMN_DTM_NUM_COUNTERS)
1653 if (sel > SEL_NONE && val->occupid[dtm][sel] &&
1654 val->occupid[dtm][sel] != CMN_EVENT_OCCUPID(event) + 1)
1661 if (val->wp[dtm][wp_idx])
1664 wp_cmb = val->wp[dtm][wp_idx ^ 1];
1772 struct arm_cmn_dtm *dtm = &cmn->dtms[hw->dn[i].dtm] + hw->dtm_offset;
1776 dtm->wp_event[arm_cmn_wp_idx(event)] = -1;
1781 dtm->pmu_config_low &= ~CMN__PMEVCNT_PAIRED(dtm_idx);
1782 writel_relaxed(dtm->pmu_config_low, dtm->base + CMN_DTM_PMU_CONFIG);
1824 struct arm_cmn_dtm *dtm = &cmn->dtms[dn->dtm] + hw->dtm_offset;
1829 while (dtm->pmu_config_low & CMN__PMEVCNT_PAIRED(dtm_idx))
1839 if (dtm->wp_event[wp_idx] >= 0)
1842 tmp = dtm->wp_event[wp_idx ^ 1];
1848 dtm->wp_event[wp_idx] = dtc_idx;
1849 writel_relaxed(cfg, dtm->base + CMN_DTM_WPn_CONFIG(wp_idx));
1865 dtm->input_sel[dtm_idx] = input_sel;
1867 dtm->pmu_config_low &= ~(CMN__PMEVCNT0_GLOBAL_NUM << shift);
1868 dtm->pmu_config_low |= FIELD_PREP(CMN__PMEVCNT0_GLOBAL_NUM, dtc_idx) << shift;
1869 dtm->pmu_config_low |= CMN__PMEVCNT_PAIRED(dtm_idx);
1870 reg = (u64)le32_to_cpu(dtm->pmu_config_high) << 32 | dtm->pmu_config_low;
1871 writeq_relaxed(reg, dtm->base + CMN_DTM_PMU_CONFIG);
2031 static void arm_cmn_init_dtm(struct arm_cmn_dtm *dtm, struct arm_cmn_node *xp, int idx)
2035 dtm->base = xp->pmu_base + CMN_DTM_OFFSET(idx);
2036 dtm->pmu_config_low = CMN_DTM_PMU_CONFIG_PMU_EN;
2037 writeq_relaxed(dtm->pmu_config_low, dtm->base + CMN_DTM_PMU_CONFIG);
2039 dtm->wp_event[i] = -1;
2040 writeq_relaxed(0, dtm->base + CMN_DTM_WPn_MASK(i));
2041 writeq_relaxed(~0ULL, dtm->base + CMN_DTM_WPn_VAL(i));
2094 dn->dtm = xp->dtm;
2096 dn->dtm += arm_cmn_nid(cmn, dn->id).port / 2;
2171 struct arm_cmn_dtm *dtm;
2238 dtm = devm_kcalloc(cmn->dev, i, sizeof(*dtm), GFP_KERNEL);
2239 if (!dtm)
2244 cmn->dtms = dtm;
2265 xp->dtm = dtm - cmn->dtms;
2266 arm_cmn_init_dtm(dtm++, xp, 0);
2279 arm_cmn_init_dtm(dtm++, xp, 1);
2281 arm_cmn_init_dtm(dtm++, xp, 2);
2377 sz = (void *)dtm - (void *)cmn->dtms;
2378 dtm = devm_krealloc(cmn->dev, cmn->dtms, sz, GFP_KERNEL);
2379 if (dtm)
2380 cmn->dtms = dtm;