Lines Matching full:ni
3 // NI-700 Network-on-Chip PMU driver
232 struct arm_ni *ni = cd_to_ni(pmu_to_cd(dev_get_drvdata(dev))); in arm_ni_identifier_show() local
233 u32 reg = readl_relaxed(ni->base + NI_PERIPHERAL_ID2); in arm_ni_identifier_show()
236 return sysfs_emit(buf, "%03x%02x\n", ni->part, version); in arm_ni_identifier_show()
471 static int arm_ni_init_cd(struct arm_ni *ni, struct arm_ni_node *node, u64 res_start) in arm_ni_init_cd() argument
473 struct arm_ni_cd *cd = ni->cds + node->id; in arm_ni_init_cd()
479 cd->units = devm_kcalloc(ni->dev, cd->num_units, sizeof(*(cd->units)), GFP_KERNEL); in arm_ni_init_cd()
485 void __iomem *unit_base = ni->base + reg; in arm_ni_init_cd()
496 dev_info(ni->dev, "No access to PMU %d\n", cd->id); in arm_ni_init_cd()
497 devm_kfree(ni->dev, cd->units); in arm_ni_init_cd()
511 dev_info(ni->dev, "No access to node 0x%04x%04x\n", unit->id, unit->type); in arm_ni_init_cd()
520 dev_dbg(ni->dev, "Mystery node 0x%04x%04x\n", unit->id, unit->type); in arm_ni_init_cd()
525 res_start += cd->pmu_base - ni->base; in arm_ni_init_cd()
526 if (!devm_request_mem_region(ni->dev, res_start, SZ_4K, dev_name(ni->dev))) { in arm_ni_init_cd()
527 dev_err(ni->dev, "Failed to request PMU region 0x%llx\n", res_start); in arm_ni_init_cd()
537 cd->irq = platform_get_irq(to_platform_device(ni->dev), cd->id); in arm_ni_init_cd()
541 err = devm_request_irq(ni->dev, cd->irq, arm_ni_handle_irq, in arm_ni_init_cd()
543 dev_name(ni->dev), cd); in arm_ni_init_cd()
547 cd->cpu = cpumask_local_spread(0, dev_to_node(ni->dev)); in arm_ni_init_cd()
550 .parent = ni->dev, in arm_ni_init_cd()
564 name = devm_kasprintf(ni->dev, GFP_KERNEL, "arm_ni_%d_cd_%d", ni->id, cd->id); in arm_ni_init_cd()
592 struct arm_ni *ni; in arm_ni_probe() local
638 ni = devm_kzalloc(&pdev->dev, struct_size(ni, cds, num_cds), GFP_KERNEL); in arm_ni_probe()
639 if (!ni) in arm_ni_probe()
642 ni->dev = &pdev->dev; in arm_ni_probe()
643 ni->base = base; in arm_ni_probe()
644 ni->num_cds = num_cds; in arm_ni_probe()
645 ni->part = part; in arm_ni_probe()
646 ni->id = atomic_fetch_inc(&id); in arm_ni_probe()
659 ret = arm_ni_init_cd(ni, &cd, res->start); in arm_ni_probe()
671 struct arm_ni *ni = platform_get_drvdata(pdev); in arm_ni_remove() local
673 for (int i = 0; i < ni->num_cds; i++) { in arm_ni_remove()
674 struct arm_ni_cd *cd = ni->cds + i; in arm_ni_remove()
688 { .compatible = "arm,ni-700" },
704 .name = "arm-ni",
756 "perf/arm/ni:online", in arm_ni_init()
780 MODULE_DESCRIPTION("Arm NI-700 PMU driver");