Lines Matching refs:dn

258 	struct arm_cmn_node *dn;  member
265 #define for_each_hw_dn(hw, dn, i) \ argument
266 for (i = 0, dn = hw->dn; i < hw->num_dns; i++, dn++)
303 struct arm_cmn_node *dn) in arm_cmn_init_node_to_xp() argument
306 int x = CMN_NODEID_X(dn->id, bits); in arm_cmn_init_node_to_xp()
307 int y = CMN_NODEID_Y(dn->id, bits); in arm_cmn_init_node_to_xp()
310 dn->to_xp = (cmn->xps + xp_idx) - dn; in arm_cmn_init_node_to_xp()
313 static struct arm_cmn_node *arm_cmn_node_to_xp(struct arm_cmn_node *dn) in arm_cmn_node_to_xp() argument
315 return dn->type == CMN_TYPE_XP ? dn : dn + dn->to_xp; in arm_cmn_node_to_xp()
682 struct arm_cmn_node *dn; in arm_cmn_read_dtm() local
687 for_each_hw_dn(hw, dn, i) { in arm_cmn_read_dtm()
688 struct arm_cmn_node *xp = arm_cmn_node_to_xp(dn); in arm_cmn_read_dtm()
763 struct arm_cmn_node *dn; in arm_cmn_event_start() local
776 for_each_hw_dn(hw, dn, i) { in arm_cmn_event_start()
777 writeq_relaxed(val, dn->pmu_base + CMN_DTM_WPn_VAL(wp_idx)); in arm_cmn_event_start()
778 writeq_relaxed(mask, dn->pmu_base + CMN_DTM_WPn_MASK(wp_idx)); in arm_cmn_event_start()
780 } else for_each_hw_dn(hw, dn, i) { in arm_cmn_event_start()
783 dn->event[dtm_idx] = CMN_EVENT_EVENTID(event); in arm_cmn_event_start()
784 writel_relaxed(le32_to_cpu(dn->event_sel), dn->pmu_base + CMN_PMU_EVENT_SEL); in arm_cmn_event_start()
792 struct arm_cmn_node *dn; in arm_cmn_event_stop() local
802 for_each_hw_dn(hw, dn, i) { in arm_cmn_event_stop()
803 writeq_relaxed(0, dn->pmu_base + CMN_DTM_WPn_MASK(wp_idx)); in arm_cmn_event_stop()
804 writeq_relaxed(~0ULL, dn->pmu_base + CMN_DTM_WPn_VAL(wp_idx)); in arm_cmn_event_stop()
806 } else for_each_hw_dn(hw, dn, i) { in arm_cmn_event_stop()
809 dn->event[dtm_idx] = 0; in arm_cmn_event_stop()
810 writel_relaxed(le32_to_cpu(dn->event_sel), dn->pmu_base + CMN_PMU_EVENT_SEL); in arm_cmn_event_stop()
827 struct arm_cmn_node *dn; in arm_cmn_val_add_event() local
847 for_each_hw_dn(hw, dn, i) { in arm_cmn_val_add_event()
848 int wp_idx, xp = arm_cmn_node_to_xp(dn)->logid; in arm_cmn_val_add_event()
864 struct arm_cmn_node *dn; in arm_cmn_validate_group() local
895 for_each_hw_dn(hw, dn, i) { in arm_cmn_validate_group()
896 int wp_idx, wp_cmb, xp = arm_cmn_node_to_xp(dn)->logid; in arm_cmn_validate_group()
955 hw->dn = arm_cmn_node(cmn, type); in arm_cmn_event_init()
956 for (i = hw->dn - cmn->dns; i < cmn->num_dns && cmn->dns[i].type == type; i++) { in arm_cmn_event_init()
960 hw->dn++; in arm_cmn_event_init()
991 struct arm_cmn_node *xp = arm_cmn_node_to_xp(hw->dn + i); in arm_cmn_event_clear()
995 hw->dn[i].wp_event[arm_cmn_wp_idx(event)] = -1; in arm_cmn_event_clear()
998 hw->dn[i].occupid_count--; in arm_cmn_event_clear()
1014 struct arm_cmn_node *dn; in arm_cmn_event_add() local
1042 for_each_hw_dn(hw, dn, i) { in arm_cmn_event_add()
1043 struct arm_cmn_node *xp = arm_cmn_node_to_xp(dn); in arm_cmn_event_add()
1058 if (dn->wp_event[wp_idx] >= 0) in arm_cmn_event_add()
1061 tmp = dn->wp_event[wp_idx ^ 1]; in arm_cmn_event_add()
1067 dn->wp_event[wp_idx] = dtc_idx; in arm_cmn_event_add()
1068 writel_relaxed(cfg, dn->pmu_base + CMN_DTM_WPn_CONFIG(wp_idx)); in arm_cmn_event_add()
1070 unsigned int port = CMN_NODEID_PID(dn->id); in arm_cmn_event_add()
1071 unsigned int dev = CMN_NODEID_DEVID(dn->id); in arm_cmn_event_add()
1079 if (dn->occupid_count == 0) { in arm_cmn_event_add()
1080 dn->occupid_val = occupid; in arm_cmn_event_add()
1082 dn->pmu_base + CMN_PMU_EVENT_SEL + 4); in arm_cmn_event_add()
1083 } else if (dn->occupid_val != occupid) { in arm_cmn_event_add()
1086 dn->occupid_count++; in arm_cmn_event_add()
1247 static int arm_cmn_init_dtc(struct arm_cmn *cmn, struct arm_cmn_node *dn, int idx) in arm_cmn_init_dtc() argument
1252 dtc->base = dn->pmu_base - CMN_PMU_OFFSET; in arm_cmn_init_dtc()
1262 xp = arm_cmn_node_to_xp(dn); in arm_cmn_init_dtc()
1281 struct arm_cmn_node *dn; in arm_cmn_init_dtcs() local
1292 for (dn = cmn->dns; dn < cmn->dns + cmn->num_dns; dn++) { in arm_cmn_init_dtcs()
1293 if (dn->type != CMN_TYPE_XP) in arm_cmn_init_dtcs()
1294 arm_cmn_init_node_to_xp(cmn, dn); in arm_cmn_init_dtcs()
1296 dn->dtc = 0; in arm_cmn_init_dtcs()
1298 if (dn->type == CMN_TYPE_DTC) in arm_cmn_init_dtcs()
1299 arm_cmn_init_dtc(cmn, dn, dtc_idx++); in arm_cmn_init_dtcs()
1302 if (dn->type == CMN_TYPE_RND) in arm_cmn_init_dtcs()
1303 dn->type = CMN_TYPE_RNI; in arm_cmn_init_dtcs()
1337 struct arm_cmn_node cfg, *dn; in arm_cmn_discover() local
1375 dn = cmn->dns; in arm_cmn_discover()
1378 struct arm_cmn_node *xp = dn++; in arm_cmn_discover()
1411 arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn); in arm_cmn_discover()
1413 switch (dn->type) { in arm_cmn_discover()
1416 dn++; in arm_cmn_discover()
1427 dn++; in arm_cmn_discover()
1435 dev_err(cmn->dev, "invalid device node type: 0x%x\n", dn->type); in arm_cmn_discover()
1442 cmn->num_dns = dn - cmn->dns; in arm_cmn_discover()