Skip to content

Commit b2fea78

Browse files
rmurphy-armwilldeacon
authored andcommitted
perf/arm-cmn: Add CI-700 Support
Add the identifiers and events for the CI-700 coherent interconnect. Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/28f566ab23a83733c6c9ef9414c010b760b4549c.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent e310644 commit b2fea78

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

drivers/perf/arm-cmn.c

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
enum cmn_model {
176176
CMN_ANY = -1,
177177
CMN600 = 1,
178+
CI700 = 2,
178179
};
179180

180181
/* CMN-600 r0px shouldn't exist in silicon, thankfully */
@@ -186,6 +187,9 @@ enum cmn_revision {
186187
CMN600_R2P0,
187188
CMN600_R3P0,
188189
CMN600_R3P1,
190+
CI700_R0P0 = 0,
191+
CI700_R1P0,
192+
CI700_R2P0,
189193
};
190194

191195
enum cmn_node_type {
@@ -401,8 +405,10 @@ struct arm_cmn_format_attr {
401405
static bool arm_cmn_is_occup_event(enum cmn_model model,
402406
enum cmn_node_type type, unsigned int id)
403407
{
404-
return (type == CMN_TYPE_DVM && id == 0x05) ||
405-
(type == CMN_TYPE_HNF && id == 0x0f);
408+
if (type == CMN_TYPE_DVM)
409+
return (model == CMN600 && id == 0x05) ||
410+
(model == CI700 && id == 0x0c);
411+
return type == CMN_TYPE_HNF && id == 0x0f;
406412
}
407413

408414
static ssize_t arm_cmn_event_show(struct device *dev,
@@ -497,14 +503,19 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj,
497503
__CMN_EVENT_XP(n_##_name, (_event) | (2 << 2)), \
498504
__CMN_EVENT_XP(s_##_name, (_event) | (3 << 2)), \
499505
__CMN_EVENT_XP(p0_##_name, (_event) | (4 << 2)), \
500-
__CMN_EVENT_XP(p1_##_name, (_event) | (5 << 2))
506+
__CMN_EVENT_XP(p1_##_name, (_event) | (5 << 2)), \
507+
__CMN_EVENT_XP(p2_##_name, (_event) | (6 << 2)), \
508+
__CMN_EVENT_XP(p3_##_name, (_event) | (7 << 2))
501509

502510
/* Good thing there are only 3 fundamental XP events... */
503511
#define CMN_EVENT_XP(_name, _event) \
504512
_CMN_EVENT_XP(req_##_name, (_event) | (0 << 5)), \
505513
_CMN_EVENT_XP(rsp_##_name, (_event) | (1 << 5)), \
506514
_CMN_EVENT_XP(snp_##_name, (_event) | (2 << 5)), \
507-
_CMN_EVENT_XP(dat_##_name, (_event) | (3 << 5))
515+
_CMN_EVENT_XP(dat_##_name, (_event) | (3 << 5)), \
516+
_CMN_EVENT_XP(pub_##_name, (_event) | (4 << 5)), \
517+
_CMN_EVENT_XP(rsp2_##_name, (_event) | (5 << 5)), \
518+
_CMN_EVENT_XP(dat2_##_name, (_event) | (6 << 5))
508519

509520

510521
static struct attribute *arm_cmn_event_attrs[] = {
@@ -522,6 +533,20 @@ static struct attribute *arm_cmn_event_attrs[] = {
522533
_CMN_EVENT_DVM(CMN600, rxreq_trk_occupancy_all, 0x05, 0),
523534
_CMN_EVENT_DVM(CMN600, rxreq_trk_occupancy_dvmop, 0x05, 1),
524535
_CMN_EVENT_DVM(CMN600, rxreq_trk_occupancy_dvmsync, 0x05, 2),
536+
CMN_EVENT_DVM(CI700, dvmop_tlbi, 0x01),
537+
CMN_EVENT_DVM(CI700, dvmop_bpi, 0x02),
538+
CMN_EVENT_DVM(CI700, dvmop_pici, 0x03),
539+
CMN_EVENT_DVM(CI700, dvmop_vici, 0x04),
540+
CMN_EVENT_DVM(CI700, dvmsync, 0x05),
541+
CMN_EVENT_DVM(CI700, vmid_filtered, 0x06),
542+
CMN_EVENT_DVM(CI700, rndop_filtered, 0x07),
543+
CMN_EVENT_DVM(CI700, retry, 0x08),
544+
CMN_EVENT_DVM(CI700, txsnp_flitv, 0x09),
545+
CMN_EVENT_DVM(CI700, txsnp_stall, 0x0a),
546+
CMN_EVENT_DVM(CI700, trkfull, 0x0b),
547+
_CMN_EVENT_DVM(CI700, trk_occupancy_all, 0x0c, 0),
548+
_CMN_EVENT_DVM(CI700, trk_occupancy_dvmop, 0x0c, 1),
549+
_CMN_EVENT_DVM(CI700, trk_occupancy_dvmsync, 0x0c, 2),
525550

526551
CMN_EVENT_HNF(CMN_ANY, cache_miss, 0x01),
527552
CMN_EVENT_HNF(CMN_ANY, slc_sf_cache_access, 0x02),
@@ -558,6 +583,9 @@ static struct attribute *arm_cmn_event_attrs[] = {
558583
CMN_EVENT_HNF(CMN_ANY, stash_snp_sent, 0x1d),
559584
CMN_EVENT_HNF(CMN_ANY, stash_data_pull, 0x1e),
560585
CMN_EVENT_HNF(CMN_ANY, snp_fwded, 0x1f),
586+
CMN_EVENT_HNF(CI700, atomic_fwd, 0x20),
587+
CMN_EVENT_HNF(CI700, mpam_hardlim, 0x21),
588+
CMN_EVENT_HNF(CI700, mpam_softlim, 0x22),
561589

562590
CMN_EVENT_HNI(rrt_rd_occ_cnt_ovfl, 0x20),
563591
CMN_EVENT_HNI(rrt_wr_occ_cnt_ovfl, 0x21),
@@ -598,6 +626,7 @@ static struct attribute *arm_cmn_event_attrs[] = {
598626
CMN_EVENT_SBSX(CMN_ANY, wdb_occ_cnt_ovfl, 0x14),
599627
CMN_EVENT_SBSX(CMN_ANY, rd_axi_trkr_occ_cnt_ovfl, 0x15),
600628
CMN_EVENT_SBSX(CMN_ANY, cmo_axi_trkr_occ_cnt_ovfl, 0x16),
629+
CMN_EVENT_SBSX(CI700, rdb_occ_cnt_ovfl, 0x17),
601630
CMN_EVENT_SBSX(CMN_ANY, arvalid_no_arready, 0x21),
602631
CMN_EVENT_SBSX(CMN_ANY, awvalid_no_awready, 0x22),
603632
CMN_EVENT_SBSX(CMN_ANY, wvalid_no_wready, 0x23),
@@ -624,6 +653,25 @@ static struct attribute *arm_cmn_event_attrs[] = {
624653
CMN_EVENT_RNID(CMN600, rdb_replay, 0x12),
625654
CMN_EVENT_RNID(CMN600, rdb_hybrid, 0x13),
626655
CMN_EVENT_RNID(CMN600, rdb_ord, 0x14),
656+
CMN_EVENT_RNID(CI700, padb_occ_ovfl, 0x11),
657+
CMN_EVENT_RNID(CI700, rpdb_occ_ovfl, 0x12),
658+
CMN_EVENT_RNID(CI700, rrt_occup_ovfl_slice1, 0x13),
659+
CMN_EVENT_RNID(CI700, rrt_occup_ovfl_slice2, 0x14),
660+
CMN_EVENT_RNID(CI700, rrt_occup_ovfl_slice3, 0x15),
661+
CMN_EVENT_RNID(CI700, wrt_throttled, 0x16),
662+
663+
CMN_EVENT_MTSX(tc_lookup, 0x01),
664+
CMN_EVENT_MTSX(tc_fill, 0x02),
665+
CMN_EVENT_MTSX(tc_miss, 0x03),
666+
CMN_EVENT_MTSX(tdb_forward, 0x04),
667+
CMN_EVENT_MTSX(tcq_hazard, 0x05),
668+
CMN_EVENT_MTSX(tcq_rd_alloc, 0x06),
669+
CMN_EVENT_MTSX(tcq_wr_alloc, 0x07),
670+
CMN_EVENT_MTSX(tcq_cmo_alloc, 0x08),
671+
CMN_EVENT_MTSX(axi_rd_req, 0x09),
672+
CMN_EVENT_MTSX(axi_wr_req, 0x0a),
673+
CMN_EVENT_MTSX(tcq_occ_cnt_ovfl, 0x0b),
674+
CMN_EVENT_MTSX(tdb_occ_cnt_ovfl, 0x0c),
627675

628676
NULL
629677
};
@@ -1773,6 +1821,7 @@ static int arm_cmn_remove(struct platform_device *pdev)
17731821
#ifdef CONFIG_OF
17741822
static const struct of_device_id arm_cmn_of_match[] = {
17751823
{ .compatible = "arm,cmn-600", .data = (void *)CMN600 },
1824+
{ .compatible = "arm,ci-700", .data = (void *)CI700 },
17761825
{}
17771826
};
17781827
MODULE_DEVICE_TABLE(of, arm_cmn_of_match);

0 commit comments

Comments
 (0)