Lines Matching refs:cpu_pmu
555 #define ARMV7_IDX_COUNTER_LAST(cpu_pmu) \ argument
556 (ARMV7_IDX_CYCLE_COUNTER + cpu_pmu->num_events - 1)
622 static inline int armv7_pmnc_counter_valid(struct arm_pmu *cpu_pmu, int idx) in armv7_pmnc_counter_valid() argument
625 idx <= ARMV7_IDX_COUNTER_LAST(cpu_pmu); in armv7_pmnc_counter_valid()
642 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_read_counter() local
647 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_read_counter()
662 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_write_counter() local
666 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_write_counter()
727 static void armv7_pmnc_dump_regs(struct arm_pmu *cpu_pmu) in armv7_pmnc_dump_regs() argument
753 cnt <= ARMV7_IDX_COUNTER_LAST(cpu_pmu); cnt++) { in armv7_pmnc_dump_regs()
769 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_enable_event() local
770 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_enable_event()
773 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_enable_event()
795 if (cpu_pmu->set_event_filter || idx != ARMV7_IDX_CYCLE_COUNTER) in armv7pmu_enable_event()
815 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_disable_event() local
816 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_disable_event()
819 if (!armv7_pmnc_counter_valid(cpu_pmu, idx)) { in armv7pmu_disable_event()
847 struct arm_pmu *cpu_pmu = (struct arm_pmu *)dev; in armv7pmu_handle_irq() local
848 struct pmu_hw_events *cpuc = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_handle_irq()
868 for (idx = 0; idx < cpu_pmu->num_events; ++idx) { in armv7pmu_handle_irq()
890 cpu_pmu->disable(event); in armv7pmu_handle_irq()
905 static void armv7pmu_start(struct arm_pmu *cpu_pmu) in armv7pmu_start() argument
908 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_start()
916 static void armv7pmu_stop(struct arm_pmu *cpu_pmu) in armv7pmu_stop() argument
919 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in armv7pmu_stop()
931 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in armv7pmu_get_event_idx() local
947 for (idx = ARMV7_IDX_COUNTER0; idx < cpu_pmu->num_events; ++idx) { in armv7pmu_get_event_idx()
984 struct arm_pmu *cpu_pmu = (struct arm_pmu *)info; in armv7pmu_reset() local
985 u32 idx, nb_cnt = cpu_pmu->num_events; in armv7pmu_reset()
1051 static void armv7pmu_init(struct arm_pmu *cpu_pmu) in armv7pmu_init() argument
1053 cpu_pmu->handle_irq = armv7pmu_handle_irq; in armv7pmu_init()
1054 cpu_pmu->enable = armv7pmu_enable_event; in armv7pmu_init()
1055 cpu_pmu->disable = armv7pmu_disable_event; in armv7pmu_init()
1056 cpu_pmu->read_counter = armv7pmu_read_counter; in armv7pmu_init()
1057 cpu_pmu->write_counter = armv7pmu_write_counter; in armv7pmu_init()
1058 cpu_pmu->get_event_idx = armv7pmu_get_event_idx; in armv7pmu_init()
1059 cpu_pmu->start = armv7pmu_start; in armv7pmu_init()
1060 cpu_pmu->stop = armv7pmu_stop; in armv7pmu_init()
1061 cpu_pmu->reset = armv7pmu_reset; in armv7pmu_init()
1062 cpu_pmu->max_period = (1LLU << 32) - 1; in armv7pmu_init()
1083 static int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a8_pmu_init() argument
1085 armv7pmu_init(cpu_pmu); in armv7_a8_pmu_init()
1086 cpu_pmu->name = "armv7_cortex_a8"; in armv7_a8_pmu_init()
1087 cpu_pmu->map_event = armv7_a8_map_event; in armv7_a8_pmu_init()
1088 return armv7_probe_num_events(cpu_pmu); in armv7_a8_pmu_init()
1091 static int armv7_a9_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a9_pmu_init() argument
1093 armv7pmu_init(cpu_pmu); in armv7_a9_pmu_init()
1094 cpu_pmu->name = "armv7_cortex_a9"; in armv7_a9_pmu_init()
1095 cpu_pmu->map_event = armv7_a9_map_event; in armv7_a9_pmu_init()
1096 return armv7_probe_num_events(cpu_pmu); in armv7_a9_pmu_init()
1099 static int armv7_a5_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a5_pmu_init() argument
1101 armv7pmu_init(cpu_pmu); in armv7_a5_pmu_init()
1102 cpu_pmu->name = "armv7_cortex_a5"; in armv7_a5_pmu_init()
1103 cpu_pmu->map_event = armv7_a5_map_event; in armv7_a5_pmu_init()
1104 return armv7_probe_num_events(cpu_pmu); in armv7_a5_pmu_init()
1107 static int armv7_a15_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a15_pmu_init() argument
1109 armv7pmu_init(cpu_pmu); in armv7_a15_pmu_init()
1110 cpu_pmu->name = "armv7_cortex_a15"; in armv7_a15_pmu_init()
1111 cpu_pmu->map_event = armv7_a15_map_event; in armv7_a15_pmu_init()
1112 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in armv7_a15_pmu_init()
1113 return armv7_probe_num_events(cpu_pmu); in armv7_a15_pmu_init()
1116 static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a7_pmu_init() argument
1118 armv7pmu_init(cpu_pmu); in armv7_a7_pmu_init()
1119 cpu_pmu->name = "armv7_cortex_a7"; in armv7_a7_pmu_init()
1120 cpu_pmu->map_event = armv7_a7_map_event; in armv7_a7_pmu_init()
1121 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in armv7_a7_pmu_init()
1122 return armv7_probe_num_events(cpu_pmu); in armv7_a7_pmu_init()
1125 static int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a12_pmu_init() argument
1127 armv7pmu_init(cpu_pmu); in armv7_a12_pmu_init()
1128 cpu_pmu->name = "armv7_cortex_a12"; in armv7_a12_pmu_init()
1129 cpu_pmu->map_event = armv7_a12_map_event; in armv7_a12_pmu_init()
1130 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in armv7_a12_pmu_init()
1131 return armv7_probe_num_events(cpu_pmu); in armv7_a12_pmu_init()
1134 static int armv7_a17_pmu_init(struct arm_pmu *cpu_pmu) in armv7_a17_pmu_init() argument
1136 int ret = armv7_a12_pmu_init(cpu_pmu); in armv7_a17_pmu_init()
1137 cpu_pmu->name = "armv7_cortex_a17"; in armv7_a17_pmu_init()
1353 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in krait_pmu_disable_event() local
1354 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in krait_pmu_disable_event()
1379 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in krait_pmu_enable_event() local
1380 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in krait_pmu_enable_event()
1413 struct arm_pmu *cpu_pmu = info; in krait_pmu_reset() local
1414 u32 idx, nb_cnt = cpu_pmu->num_events; in krait_pmu_reset()
1440 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in krait_event_to_bit() local
1452 bit += ARMV7_IDX_COUNTER_LAST(cpu_pmu) + 1; in krait_event_to_bit()
1508 static int krait_pmu_init(struct arm_pmu *cpu_pmu) in krait_pmu_init() argument
1510 armv7pmu_init(cpu_pmu); in krait_pmu_init()
1511 cpu_pmu->name = "armv7_krait"; in krait_pmu_init()
1513 if (of_property_read_bool(cpu_pmu->plat_device->dev.of_node, in krait_pmu_init()
1515 cpu_pmu->map_event = krait_map_event_no_branch; in krait_pmu_init()
1517 cpu_pmu->map_event = krait_map_event; in krait_pmu_init()
1518 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; in krait_pmu_init()
1519 cpu_pmu->reset = krait_pmu_reset; in krait_pmu_init()
1520 cpu_pmu->enable = krait_pmu_enable_event; in krait_pmu_init()
1521 cpu_pmu->disable = krait_pmu_disable_event; in krait_pmu_init()
1522 cpu_pmu->get_event_idx = krait_pmu_get_event_idx; in krait_pmu_init()
1523 cpu_pmu->clear_event_idx = krait_pmu_clear_event_idx; in krait_pmu_init()
1524 return armv7_probe_num_events(cpu_pmu); in krait_pmu_init()
1685 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in scorpion_pmu_disable_event() local
1686 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in scorpion_pmu_disable_event()
1711 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in scorpion_pmu_enable_event() local
1712 struct pmu_hw_events *events = this_cpu_ptr(cpu_pmu->hw_events); in scorpion_pmu_enable_event()
1745 struct arm_pmu *cpu_pmu = info; in scorpion_pmu_reset() local
1746 u32 idx, nb_cnt = cpu_pmu->num_events; in scorpion_pmu_reset()
1772 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu); in scorpion_event_to_bit() local
1784 bit += ARMV7_IDX_COUNTER_LAST(cpu_pmu) + 1; in scorpion_event_to_bit()
1837 static int scorpion_pmu_init(struct arm_pmu *cpu_pmu) in scorpion_pmu_init() argument
1839 armv7pmu_init(cpu_pmu); in scorpion_pmu_init()
1840 cpu_pmu->name = "armv7_scorpion"; in scorpion_pmu_init()
1841 cpu_pmu->map_event = scorpion_map_event; in scorpion_pmu_init()
1842 cpu_pmu->reset = scorpion_pmu_reset; in scorpion_pmu_init()
1843 cpu_pmu->enable = scorpion_pmu_enable_event; in scorpion_pmu_init()
1844 cpu_pmu->disable = scorpion_pmu_disable_event; in scorpion_pmu_init()
1845 cpu_pmu->get_event_idx = scorpion_pmu_get_event_idx; in scorpion_pmu_init()
1846 cpu_pmu->clear_event_idx = scorpion_pmu_clear_event_idx; in scorpion_pmu_init()
1847 return armv7_probe_num_events(cpu_pmu); in scorpion_pmu_init()
1850 static int scorpion_mp_pmu_init(struct arm_pmu *cpu_pmu) in scorpion_mp_pmu_init() argument
1852 armv7pmu_init(cpu_pmu); in scorpion_mp_pmu_init()
1853 cpu_pmu->name = "armv7_scorpion_mp"; in scorpion_mp_pmu_init()
1854 cpu_pmu->map_event = scorpion_map_event; in scorpion_mp_pmu_init()
1855 cpu_pmu->reset = scorpion_pmu_reset; in scorpion_mp_pmu_init()
1856 cpu_pmu->enable = scorpion_pmu_enable_event; in scorpion_mp_pmu_init()
1857 cpu_pmu->disable = scorpion_pmu_disable_event; in scorpion_mp_pmu_init()
1858 cpu_pmu->get_event_idx = scorpion_pmu_get_event_idx; in scorpion_mp_pmu_init()
1859 cpu_pmu->clear_event_idx = scorpion_pmu_clear_event_idx; in scorpion_mp_pmu_init()
1860 return armv7_probe_num_events(cpu_pmu); in scorpion_mp_pmu_init()