0001 =============================
0002 Arm Coherent Mesh Network PMU
0003 =============================
0004
0005 CMN-600 is a configurable mesh interconnect consisting of a rectangular
0006 grid of crosspoints (XPs), with each crosspoint supporting up to two
0007 device ports to which various AMBA CHI agents are attached.
0008
0009 CMN implements a distributed PMU design as part of its debug and trace
0010 functionality. This consists of a local monitor (DTM) at every XP, which
0011 counts up to 4 event signals from the connected device nodes and/or the
0012 XP itself. Overflow from these local counters is accumulated in up to 8
0013 global counters implemented by the main controller (DTC), which provides
0014 overall PMU control and interrupts for global counter overflow.
0015
0016 PMU events
0017 ----------
0018
0019 The PMU driver registers a single PMU device for the whole interconnect,
0020 see /sys/bus/event_source/devices/arm_cmn_0. Multi-chip systems may link
0021 more than one CMN together via external CCIX links - in this situation,
0022 each mesh counts its own events entirely independently, and additional
0023 PMU devices will be named arm_cmn_{1..n}.
0024
0025 Most events are specified in a format based directly on the TRM
0026 definitions - "type" selects the respective node type, and "eventid" the
0027 event number. Some events require an additional occupancy ID, which is
0028 specified by "occupid".
0029
0030 * Since RN-D nodes do not have any distinct events from RN-I nodes, they
0031 are treated as the same type (0xa), and the common event templates are
0032 named "rnid_*".
0033
0034 * The cycle counter is treated as a synthetic event belonging to the DTC
0035 node ("type" == 0x3, "eventid" is ignored).
0036
0037 * XP events also encode the port and channel in the "eventid" field, to
0038 match the underlying pmu_event0_id encoding for the pmu_event_sel
0039 register. The event templates are named with prefixes to cover all
0040 permutations.
0041
0042 By default each event provides an aggregate count over all nodes of the
0043 given type. To target a specific node, "bynodeid" must be set to 1 and
0044 "nodeid" to the appropriate value derived from the CMN configuration
0045 (as defined in the "Node ID Mapping" section of the TRM).
0046
0047 Watchpoints
0048 -----------
0049
0050 The PMU can also count watchpoint events to monitor specific flit
0051 traffic. Watchpoints are treated as a synthetic event type, and like PMU
0052 events can be global or targeted with a particular XP's "nodeid" value.
0053 Since the watchpoint direction is otherwise implicit in the underlying
0054 register selection, separate events are provided for flit uploads and
0055 downloads.
0056
0057 The flit match value and mask are passed in config1 and config2 ("val"
0058 and "mask" respectively). "wp_dev_sel", "wp_chn_sel", "wp_grp" and
0059 "wp_exclusive" are specified per the TRM definitions for dtm_wp_config0.
0060 Where a watchpoint needs to match fields from both match groups on the
0061 REQ or SNP channel, it can be specified as two events - one for each
0062 group - with the same nonzero "combine" value. The count for such a
0063 pair of combined events will be attributed to the primary match.
0064 Watchpoint events with a "combine" value of 0 are considered independent
0065 and will count individually.