Lines Matching full:cmn

3 // CMN-600 Coherent Mesh Network PMU driver
218 /* CMN-600 r0px shouldn't exist in silicon, thankfully */
372 static int arm_cmn_xyidbits(const struct arm_cmn *cmn) in arm_cmn_xyidbits() argument
374 return fls((cmn->mesh_x - 1) | (cmn->mesh_y - 1)); in arm_cmn_xyidbits()
386 static struct arm_cmn_node *arm_cmn_node_to_xp(const struct arm_cmn *cmn, in arm_cmn_node_to_xp() argument
390 int bits = arm_cmn_xyidbits(cmn); in arm_cmn_node_to_xp()
394 return cmn->xps + cmn->mesh_x * y + x; in arm_cmn_node_to_xp()
396 static struct arm_cmn_node *arm_cmn_node(const struct arm_cmn *cmn, in arm_cmn_node() argument
401 for (dn = cmn->dns; dn->type; dn++) in arm_cmn_node()
407 static enum cmn_model arm_cmn_model(const struct arm_cmn *cmn) in arm_cmn_model() argument
409 switch (cmn->part) { in arm_cmn_model()
425 static int arm_cmn_pmu_offset(const struct arm_cmn *cmn, const struct arm_cmn_node *dn) in arm_cmn_pmu_offset() argument
427 if (cmn->part == PART_CMN_S3) { in arm_cmn_pmu_offset()
435 static u32 arm_cmn_device_connect_info(const struct arm_cmn *cmn, in arm_cmn_device_connect_info() argument
438 int offset = CMN_MXP__CONNECT_INFO(port) - arm_cmn_pmu_offset(cmn, xp); in arm_cmn_device_connect_info()
441 if (cmn->part == PART_CMN600 || cmn->part == PART_CMN650) in arm_cmn_device_connect_info()
447 if (cmn->part == PART_CI700) in arm_cmn_device_connect_info()
499 struct arm_cmn *cmn = s->private; in arm_cmn_show_logid() local
503 for (dn = cmn->dns; dn->type; dn++) { in arm_cmn_show_logid()
523 struct arm_cmn *cmn = s->private; in arm_cmn_map_show() local
524 int x, y, p, pmax = fls(cmn->ports_used); in arm_cmn_map_show()
527 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
530 y = cmn->mesh_y; in arm_cmn_map_show()
532 int xp_base = cmn->mesh_x * y; in arm_cmn_map_show()
533 struct arm_cmn_node *xp = cmn->xps + xp_base; in arm_cmn_map_show()
536 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
540 for (x = 0; x < cmn->mesh_x; x++) { in arm_cmn_map_show()
542 port[p][x] = arm_cmn_device_connect_info(cmn, xp + x, p); in arm_cmn_map_show()
547 for (x = 0; x < cmn->mesh_x; x++) { in arm_cmn_map_show()
556 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
561 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
564 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
567 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
572 for (x = 0; x < cmn->mesh_x; x++) in arm_cmn_map_show()
579 static void arm_cmn_debugfs_init(struct arm_cmn *cmn, int id) in arm_cmn_debugfs_init() argument
584 name = devm_kasprintf(cmn->dev, GFP_KERNEL, "map_%d", id); in arm_cmn_debugfs_init()
588 cmn->debug = debugfs_create_file(name, 0444, arm_cmn_debugfs, cmn, &arm_cmn_map_fops); in arm_cmn_debugfs_init()
591 static void arm_cmn_debugfs_init(struct arm_cmn *cmn, int id) {} in arm_cmn_debugfs_init() argument
700 struct arm_cmn *cmn = to_cmn(dev_get_drvdata(dev)); in arm_cmn_event_attr_is_visible() local
707 if (!(eattr->model & arm_cmn_model(cmn))) in arm_cmn_event_attr_is_visible()
722 if ((intf & 4) && !(cmn->ports_used & BIT(intf & 3))) in arm_cmn_event_attr_is_visible()
725 if (chan == 4 && cmn->part == PART_CMN600) in arm_cmn_event_attr_is_visible()
728 if ((chan == 5 && cmn->rsp_vc_num < 2) || in arm_cmn_event_attr_is_visible()
729 (chan == 6 && cmn->dat_vc_num < 2) || in arm_cmn_event_attr_is_visible()
730 (chan == 7 && cmn->snp_vc_num < 2) || in arm_cmn_event_attr_is_visible()
731 (chan == 8 && cmn->req_vc_num < 2)) in arm_cmn_event_attr_is_visible()
736 if (cmn->part == PART_CMN600) { in arm_cmn_event_attr_is_visible()
737 if (cmn->rev < REV_CMN600_R1P3) { in arm_cmn_event_attr_is_visible()
741 if (cmn->rev < REV_CMN600_R1P2) { in arm_cmn_event_attr_is_visible()
747 } else if (cmn->part == PART_CMN650) { in arm_cmn_event_attr_is_visible()
748 if (cmn->rev < REV_CMN650_R2P0 || cmn->rev == REV_CMN650_R1P2) { in arm_cmn_event_attr_is_visible()
756 } else if (cmn->part == PART_CMN700) { in arm_cmn_event_attr_is_visible()
757 if (cmn->rev < REV_CMN700_R2P0) { in arm_cmn_event_attr_is_visible()
765 if (cmn->rev < REV_CMN700_R1P0) { in arm_cmn_event_attr_is_visible()
771 if (!arm_cmn_node(cmn, type)) in arm_cmn_event_attr_is_visible()
1325 struct arm_cmn *cmn = to_cmn(dev_get_drvdata(dev)); in arm_cmn_cpumask_show() local
1327 return cpumap_print_to_pagebuf(true, buf, cpumask_of(cmn->cpu)); in arm_cmn_cpumask_show()
1336 struct arm_cmn *cmn = to_cmn(dev_get_drvdata(dev)); in arm_cmn_identifier_show() local
1338 return sysfs_emit(buf, "%03x%02x\n", cmn->part, cmn->rev); in arm_cmn_identifier_show()
1401 /* CMN-600 supports only primary and secondary matching groups */ in arm_cmn_wp_config()
1420 static void arm_cmn_set_state(struct arm_cmn *cmn, u32 state) in arm_cmn_set_state() argument
1422 if (!cmn->state) in arm_cmn_set_state()
1423 writel_relaxed(0, CMN_DT_PMCR(&cmn->dtc[0])); in arm_cmn_set_state()
1424 cmn->state |= state; in arm_cmn_set_state()
1427 static void arm_cmn_clear_state(struct arm_cmn *cmn, u32 state) in arm_cmn_clear_state() argument
1429 cmn->state &= ~state; in arm_cmn_clear_state()
1430 if (!cmn->state) in arm_cmn_clear_state()
1432 CMN_DT_PMCR(&cmn->dtc[0])); in arm_cmn_clear_state()
1445 static u64 arm_cmn_read_dtm(struct arm_cmn *cmn, struct arm_cmn_hw_event *hw, in arm_cmn_read_dtm() argument
1455 if (dtm != &cmn->dtms[dn->dtm]) { in arm_cmn_read_dtm()
1456 dtm = &cmn->dtms[dn->dtm] + hw->dtm_offset; in arm_cmn_read_dtm()
1485 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_init_counter() local
1490 writel_relaxed(CMN_COUNTER_INIT, CMN_DT_PMEVCNT(&cmn->dtc[i], idx)); in arm_cmn_init_counter()
1491 cmn->dtc[i].counters[idx] = event; in arm_cmn_init_counter()
1494 count = arm_cmn_read_dtm(cmn, hw, false); in arm_cmn_init_counter()
1500 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_event_read() local
1506 delta = arm_cmn_read_cc(cmn->dtc + hw->dtc_idx[0]); in arm_cmn_event_read()
1510 new = arm_cmn_read_dtm(cmn, hw, false); in arm_cmn_event_read()
1517 new = arm_cmn_read_counter(cmn->dtc + i, idx); in arm_cmn_event_read()
1566 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_event_start() local
1573 struct arm_cmn_dtc *dtc = cmn->dtc + hw->dtc_idx[0]; in arm_cmn_event_start()
1600 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_event_stop() local
1607 struct arm_cmn_dtc *dtc = cmn->dtc + hw->dtc_idx[0]; in arm_cmn_event_stop()
1649 static void arm_cmn_val_add_event(struct arm_cmn *cmn, struct arm_cmn_val *val, in arm_cmn_val_add_event() argument
1686 static int arm_cmn_validate_group(struct arm_cmn *cmn, struct perf_event *event) in arm_cmn_validate_group() argument
1705 arm_cmn_val_add_event(cmn, val, leader); in arm_cmn_validate_group()
1708 arm_cmn_val_add_event(cmn, val, sibling); in arm_cmn_validate_group()
1748 static enum cmn_filter_select arm_cmn_filter_sel(const struct arm_cmn *cmn, in arm_cmn_filter_sel() argument
1753 enum cmn_model model = arm_cmn_model(cmn); in arm_cmn_filter_sel()
1766 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_event_init() local
1779 event->cpu = cmn->cpu; in arm_cmn_event_init()
1786 return arm_cmn_validate_group(cmn, event); in arm_cmn_event_init()
1796 if (cmn->multi_dtm) in arm_cmn_event_init()
1799 (cmn->part == PART_CMN700 || cmn->part == PART_CMN_S3)) { in arm_cmn_event_init()
1804 hw->filter_sel = arm_cmn_filter_sel(cmn, type, eventid); in arm_cmn_event_init()
1809 hw->dn = arm_cmn_node(cmn, type); in arm_cmn_event_init()
1821 memset(hw->dtc_idx, 0, cmn->num_dtcs); in arm_cmn_event_init()
1830 dev_dbg(cmn->dev, "invalid node 0x%x type 0x%x\n", nodeid, type); in arm_cmn_event_init()
1834 return arm_cmn_validate_group(cmn, event); in arm_cmn_event_init()
1837 static void arm_cmn_event_clear(struct arm_cmn *cmn, struct perf_event *event, in arm_cmn_event_clear() argument
1844 struct arm_cmn_dtm *dtm = &cmn->dtms[hw->dn[i].dtm] + hw->dtm_offset; in arm_cmn_event_clear()
1863 cmn->dtc[j].counters[idx] = NULL; in arm_cmn_event_clear()
1868 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_event_add() local
1875 while (cmn->dtc[i].cycles) in arm_cmn_event_add()
1876 if (++i == cmn->num_dtcs) in arm_cmn_event_add()
1879 cmn->dtc[i].cycles = event; in arm_cmn_event_add()
1889 if (cmn->part == PART_CMN600 && j > 0) { in arm_cmn_event_add()
1893 while (cmn->dtc[j].counters[idx]) in arm_cmn_event_add()
1902 struct arm_cmn_dtm *dtm = &cmn->dtms[dn->dtm] + hw->dtm_offset; in arm_cmn_event_add()
1925 CMN_EVENT_WP_COMBINE(cmn->dtc[d].counters[tmp])) in arm_cmn_event_add()
1935 if (cmn->multi_dtm) in arm_cmn_event_add()
1965 arm_cmn_event_clear(cmn, event, i); in arm_cmn_event_add()
1971 struct arm_cmn *cmn = to_cmn(event->pmu); in arm_cmn_event_del() local
1978 cmn->dtc[hw->dtc_idx[0]].cycles = NULL; in arm_cmn_event_del()
1980 arm_cmn_event_clear(cmn, event, hw->num_dns); in arm_cmn_event_del()
2005 static void arm_cmn_migrate(struct arm_cmn *cmn, unsigned int cpu) in arm_cmn_migrate() argument
2009 perf_pmu_migrate_context(&cmn->pmu, cmn->cpu, cpu); in arm_cmn_migrate()
2010 for (i = 0; i < cmn->num_dtcs; i++) in arm_cmn_migrate()
2011 irq_set_affinity(cmn->dtc[i].irq, cpumask_of(cpu)); in arm_cmn_migrate()
2012 cmn->cpu = cpu; in arm_cmn_migrate()
2017 struct arm_cmn *cmn; in arm_cmn_pmu_online_cpu() local
2020 cmn = hlist_entry_safe(cpuhp_node, struct arm_cmn, cpuhp_node); in arm_cmn_pmu_online_cpu()
2021 node = dev_to_node(cmn->dev); in arm_cmn_pmu_online_cpu()
2022 if (cpu_to_node(cmn->cpu) != node && cpu_to_node(cpu) == node) in arm_cmn_pmu_online_cpu()
2023 arm_cmn_migrate(cmn, cpu); in arm_cmn_pmu_online_cpu()
2029 struct arm_cmn *cmn; in arm_cmn_pmu_offline_cpu() local
2033 cmn = hlist_entry_safe(cpuhp_node, struct arm_cmn, cpuhp_node); in arm_cmn_pmu_offline_cpu()
2034 if (cpu != cmn->cpu) in arm_cmn_pmu_offline_cpu()
2037 node = dev_to_node(cmn->dev); in arm_cmn_pmu_offline_cpu()
2044 arm_cmn_migrate(cmn, target); in arm_cmn_pmu_offline_cpu()
2085 /* We can reasonably accommodate DTCs of the same CMN sharing IRQs */
2086 static int arm_cmn_init_irqs(struct arm_cmn *cmn) in arm_cmn_init_irqs() argument
2090 for (i = 0; i < cmn->num_dtcs; i++) { in arm_cmn_init_irqs()
2091 irq = cmn->dtc[i].irq; in arm_cmn_init_irqs()
2093 if (cmn->dtc[j].irq == irq) { in arm_cmn_init_irqs()
2094 cmn->dtc[j].irq_friend = i - j; in arm_cmn_init_irqs()
2098 err = devm_request_irq(cmn->dev, irq, arm_cmn_handle_irq, in arm_cmn_init_irqs()
2100 dev_name(cmn->dev), &cmn->dtc[i]); in arm_cmn_init_irqs()
2104 err = irq_set_affinity(irq, cpumask_of(cmn->cpu)); in arm_cmn_init_irqs()
2127 static int arm_cmn_init_dtc(struct arm_cmn *cmn, struct arm_cmn_node *dn, int idx) in arm_cmn_init_dtc() argument
2129 struct arm_cmn_dtc *dtc = cmn->dtc + idx; in arm_cmn_init_dtc()
2132 dtc->base = dtc->pmu_base - arm_cmn_pmu_offset(cmn, dn); in arm_cmn_init_dtc()
2133 dtc->irq = platform_get_irq(to_platform_device(cmn->dev), idx); in arm_cmn_init_dtc()
2156 static int arm_cmn_init_dtcs(struct arm_cmn *cmn) in arm_cmn_init_dtcs() argument
2161 cmn->dtc = devm_kcalloc(cmn->dev, cmn->num_dtcs, sizeof(cmn->dtc[0]), GFP_KERNEL); in arm_cmn_init_dtcs()
2162 if (!cmn->dtc) in arm_cmn_init_dtcs()
2165 sort(cmn->dns, cmn->num_dns, sizeof(cmn->dns[0]), arm_cmn_node_cmp, NULL); in arm_cmn_init_dtcs()
2167 cmn->xps = arm_cmn_node(cmn, CMN_TYPE_XP); in arm_cmn_init_dtcs()
2169 if (cmn->part == PART_CMN600 && cmn->num_dtcs > 1) { in arm_cmn_init_dtcs()
2171 dn = arm_cmn_node(cmn, CMN_TYPE_DTC); in arm_cmn_init_dtcs()
2172 for (int i = 0; i < cmn->num_dtcs; i++) in arm_cmn_init_dtcs()
2173 arm_cmn_node_to_xp(cmn, dn + i)->dtc = i; in arm_cmn_init_dtcs()
2176 for (dn = cmn->dns; dn->type; dn++) { in arm_cmn_init_dtcs()
2180 xp = arm_cmn_node_to_xp(cmn, dn); in arm_cmn_init_dtcs()
2185 if (cmn->multi_dtm) in arm_cmn_init_dtcs()
2189 int err = arm_cmn_init_dtc(cmn, dn, dtc_idx++); in arm_cmn_init_dtcs()
2204 arm_cmn_set_state(cmn, CMN_STATE_DISABLED); in arm_cmn_init_dtcs()
2209 static unsigned int arm_cmn_dtc_domain(struct arm_cmn *cmn, void __iomem *xp_region) in arm_cmn_dtc_domain() argument
2213 if (cmn->part == PART_CMN650 || cmn->part == PART_CI700) in arm_cmn_dtc_domain()
2219 static void arm_cmn_init_node_info(struct arm_cmn *cmn, u32 offset, struct arm_cmn_node *node) in arm_cmn_init_node_info() argument
2222 u64 reg = readq_relaxed(cmn->base + offset + CMN_NODE_INFO); in arm_cmn_init_node_info()
2228 node->pmu_base = cmn->base + offset + arm_cmn_pmu_offset(cmn, node); in arm_cmn_init_node_info()
2237 dev_dbg(cmn->dev, "node%*c%#06hx%*ctype:%-#6x id:%-4hd off:%#x\n", in arm_cmn_init_node_info()
2254 static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset) in arm_cmn_discover() argument
2266 arm_cmn_init_node_info(cmn, rgn_offset, &cfg); in arm_cmn_discover()
2270 cfg_region = cmn->base + rgn_offset; in arm_cmn_discover()
2275 if (cmn->part && cmn->part != part) in arm_cmn_discover()
2276 dev_warn(cmn->dev, in arm_cmn_discover()
2278 cmn->part, part); in arm_cmn_discover()
2279 cmn->part = part; in arm_cmn_discover()
2280 if (!arm_cmn_model(cmn)) in arm_cmn_discover()
2281 dev_warn(cmn->dev, "Unknown part number: 0x%x\n", part); in arm_cmn_discover()
2284 cmn->rev = FIELD_GET(CMN_CFGM_PID2_REVISION, reg); in arm_cmn_discover()
2294 dev_err(cmn->dev, "Device isolation enabled, not continuing due to risk of lockup\n"); in arm_cmn_discover()
2297 cmn->multi_dtm = reg & CMN_INFO_MULTIPLE_DTM_EN; in arm_cmn_discover()
2298 cmn->rsp_vc_num = FIELD_GET(CMN_INFO_RSP_VC_NUM, reg); in arm_cmn_discover()
2299 cmn->dat_vc_num = FIELD_GET(CMN_INFO_DAT_VC_NUM, reg); in arm_cmn_discover()
2302 cmn->snp_vc_num = FIELD_GET(CMN_INFO_SNP_VC_NUM, reg); in arm_cmn_discover()
2303 cmn->req_vc_num = FIELD_GET(CMN_INFO_REQ_VC_NUM, reg); in arm_cmn_discover()
2309 cmn->num_xps = child_count; in arm_cmn_discover()
2310 cmn->num_dns = cmn->num_xps; in arm_cmn_discover()
2313 for (i = 0; i < cmn->num_xps; i++) { in arm_cmn_discover()
2317 reg = readq_relaxed(cmn->base + xp_offset[i] + CMN_CHILD_INFO); in arm_cmn_discover()
2318 cmn->num_dns += FIELD_GET(CMN_CI_CHILD_COUNT, reg); in arm_cmn_discover()
2326 dn = devm_kcalloc(cmn->dev, cmn->num_dns * 2 - cmn->num_xps, in arm_cmn_discover()
2332 i = cmn->num_xps; in arm_cmn_discover()
2333 if (cmn->multi_dtm) in arm_cmn_discover()
2334 i += cmn->num_xps + 1; in arm_cmn_discover()
2335 dtm = devm_kcalloc(cmn->dev, i, sizeof(*dtm), GFP_KERNEL); in arm_cmn_discover()
2340 cmn->dns = dn; in arm_cmn_discover()
2341 cmn->dtms = dtm; in arm_cmn_discover()
2342 for (i = 0; i < cmn->num_xps; i++) { in arm_cmn_discover()
2343 void __iomem *xp_region = cmn->base + xp_offset[i]; in arm_cmn_discover()
2347 arm_cmn_init_node_info(cmn, xp_offset[i], xp); in arm_cmn_discover()
2355 cmn->mesh_x = xp->logid; in arm_cmn_discover()
2357 if (cmn->part == PART_CMN600) in arm_cmn_discover()
2360 xp->dtc = arm_cmn_dtc_domain(cmn, xp_region); in arm_cmn_discover()
2362 xp->dtm = dtm - cmn->dtms; in arm_cmn_discover()
2370 if (arm_cmn_device_connect_info(cmn, xp, p)) in arm_cmn_discover()
2373 if (cmn->num_xps == 1) { in arm_cmn_discover()
2384 if (cmn->multi_dtm && (xp_ports > 0x3)) in arm_cmn_discover()
2386 if (cmn->multi_dtm && (xp_ports > 0xf)) in arm_cmn_discover()
2389 cmn->ports_used |= xp_ports; in arm_cmn_discover()
2400 * As of CMN-600r1 these could only be RN-SAMs or CXLAs, in arm_cmn_discover()
2407 dev_dbg(cmn->dev, "ignoring external node %llx\n", reg); in arm_cmn_discover()
2413 * A child offset of 0 can only occur on CMN-600; otherwise it in arm_cmn_discover()
2417 if (reg == 0 && cmn->part != PART_CMN600) { in arm_cmn_discover()
2418 dev_dbg(cmn->dev, "bogus child pointer?\n"); in arm_cmn_discover()
2422 arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn); in arm_cmn_discover()
2426 cmn->num_dtcs++; in arm_cmn_discover()
2472 dev_err(cmn->dev, "invalid device node type: 0x%x\n", dn->type); in arm_cmn_discover()
2479 cmn->num_dns = dn - cmn->dns; in arm_cmn_discover()
2482 sz = (void *)(dn + 1) - (void *)cmn->dns; in arm_cmn_discover()
2483 dn = devm_krealloc(cmn->dev, cmn->dns, sz, GFP_KERNEL); in arm_cmn_discover()
2485 cmn->dns = dn; in arm_cmn_discover()
2487 sz = (void *)dtm - (void *)cmn->dtms; in arm_cmn_discover()
2488 dtm = devm_krealloc(cmn->dev, cmn->dtms, sz, GFP_KERNEL); in arm_cmn_discover()
2490 cmn->dtms = dtm; in arm_cmn_discover()
2496 if (!cmn->mesh_x) in arm_cmn_discover()
2497 cmn->mesh_x = cmn->num_xps; in arm_cmn_discover()
2498 cmn->mesh_y = cmn->num_xps / cmn->mesh_x; in arm_cmn_discover()
2501 if (cmn->num_xps == 1) in arm_cmn_discover()
2502 dev_warn(cmn->dev, "1x1 config not fully supported, translate XP events manually\n"); in arm_cmn_discover()
2504 dev_dbg(cmn->dev, "periph_id part 0x%03x revision %d\n", cmn->part, cmn->rev); in arm_cmn_discover()
2505 reg = cmn->ports_used; in arm_cmn_discover()
2506 dev_dbg(cmn->dev, "mesh %dx%d, ID width %d, ports %6pbl%s\n", in arm_cmn_discover()
2507 cmn->mesh_x, cmn->mesh_y, arm_cmn_xyidbits(cmn), &reg, in arm_cmn_discover()
2508 cmn->multi_dtm ? ", multi-DTM" : ""); in arm_cmn_discover()
2513 static int arm_cmn600_acpi_probe(struct platform_device *pdev, struct arm_cmn *cmn) in arm_cmn600_acpi_probe() argument
2533 cmn->base = devm_ioremap(cmn->dev, cfg->start, resource_size(cfg)); in arm_cmn600_acpi_probe()
2534 if (!cmn->base) in arm_cmn600_acpi_probe()
2549 struct arm_cmn *cmn; in arm_cmn_probe() local
2554 cmn = devm_kzalloc(&pdev->dev, sizeof(*cmn), GFP_KERNEL); in arm_cmn_probe()
2555 if (!cmn) in arm_cmn_probe()
2558 cmn->dev = &pdev->dev; in arm_cmn_probe()
2559 cmn->part = (unsigned long)device_get_match_data(cmn->dev); in arm_cmn_probe()
2560 platform_set_drvdata(pdev, cmn); in arm_cmn_probe()
2562 if (cmn->part == PART_CMN600 && has_acpi_companion(cmn->dev)) { in arm_cmn_probe()
2563 rootnode = arm_cmn600_acpi_probe(pdev, cmn); in arm_cmn_probe()
2566 cmn->base = devm_platform_ioremap_resource(pdev, 0); in arm_cmn_probe()
2567 if (IS_ERR(cmn->base)) in arm_cmn_probe()
2568 return PTR_ERR(cmn->base); in arm_cmn_probe()
2569 if (cmn->part == PART_CMN600) in arm_cmn_probe()
2575 err = arm_cmn_discover(cmn, rootnode); in arm_cmn_probe()
2579 err = arm_cmn_init_dtcs(cmn); in arm_cmn_probe()
2583 err = arm_cmn_init_irqs(cmn); in arm_cmn_probe()
2587 cmn->cpu = cpumask_local_spread(0, dev_to_node(cmn->dev)); in arm_cmn_probe()
2588 cmn->pmu = (struct pmu) { in arm_cmn_probe()
2590 .parent = cmn->dev, in arm_cmn_probe()
2608 name = devm_kasprintf(cmn->dev, GFP_KERNEL, "arm_cmn_%d", this_id); in arm_cmn_probe()
2612 err = cpuhp_state_add_instance(arm_cmn_hp_state, &cmn->cpuhp_node); in arm_cmn_probe()
2616 err = perf_pmu_register(&cmn->pmu, name, -1); in arm_cmn_probe()
2618 cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); in arm_cmn_probe()
2620 arm_cmn_debugfs_init(cmn, this_id); in arm_cmn_probe()
2627 struct arm_cmn *cmn = platform_get_drvdata(pdev); in arm_cmn_remove() local
2629 writel_relaxed(0, cmn->dtc[0].base + CMN_DT_DTC_CTL); in arm_cmn_remove()
2631 perf_pmu_unregister(&cmn->pmu); in arm_cmn_remove()
2632 cpuhp_state_remove_instance_nocalls(arm_cmn_hp_state, &cmn->cpuhp_node); in arm_cmn_remove()
2633 debugfs_remove(cmn->debug); in arm_cmn_remove()
2638 { .compatible = "arm,cmn-600", .data = (void *)PART_CMN600 },
2639 { .compatible = "arm,cmn-650" },
2640 { .compatible = "arm,cmn-700" },
2641 { .compatible = "arm,cmn-s3" },
2660 .name = "arm-cmn",
2673 "perf/arm/cmn:online", in arm_cmn_init()
2680 arm_cmn_debugfs = debugfs_create_dir("arm-cmn", NULL); in arm_cmn_init()
2701 MODULE_DESCRIPTION("Arm CMN-600 PMU driver");