xref: /openbmc/linux/Documentation/trace/sys-t.rst (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1*4cb3653dSAlexander Shishkin.. SPDX-License-Identifier: GPL-2.0
2*4cb3653dSAlexander Shishkin
3*4cb3653dSAlexander Shishkin===================
4*4cb3653dSAlexander ShishkinMIPI SyS-T over STP
5*4cb3653dSAlexander Shishkin===================
6*4cb3653dSAlexander Shishkin
7*4cb3653dSAlexander ShishkinThe MIPI SyS-T protocol driver can be used with STM class devices to
8*4cb3653dSAlexander Shishkingenerate standardized trace stream. Aside from being a standard, it
9*4cb3653dSAlexander Shishkinprovides better trace source identification and timestamp correlation.
10*4cb3653dSAlexander Shishkin
11*4cb3653dSAlexander ShishkinIn order to use the MIPI SyS-T protocol driver with your STM device,
12*4cb3653dSAlexander Shishkinfirst, you'll need CONFIG_STM_PROTO_SYS_T.
13*4cb3653dSAlexander Shishkin
14*4cb3653dSAlexander ShishkinNow, you can select which protocol driver you want to use when you create
15*4cb3653dSAlexander Shishkina policy for your STM device, by specifying it in the policy name:
16*4cb3653dSAlexander Shishkin
17*4cb3653dSAlexander Shishkin# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/
18*4cb3653dSAlexander Shishkin
19*4cb3653dSAlexander ShishkinIn other words, the policy name format is extended like this:
20*4cb3653dSAlexander Shishkin
21*4cb3653dSAlexander Shishkin  <device_name>:<protocol_name>.<policy_name>
22*4cb3653dSAlexander Shishkin
23*4cb3653dSAlexander ShishkinWith Intel TH, therefore it can look like "0-sth:p_sys-t.my-policy".
24*4cb3653dSAlexander Shishkin
25*4cb3653dSAlexander ShishkinIf the protocol name is omitted, the STM class will chose whichever
26*4cb3653dSAlexander Shishkinprotocol driver was loaded first.
27*4cb3653dSAlexander Shishkin
28*4cb3653dSAlexander ShishkinYou can also double check that everything is working as expected by
29*4cb3653dSAlexander Shishkin
30*4cb3653dSAlexander Shishkin# cat /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/protocol
31*4cb3653dSAlexander Shishkinp_sys-t
32*4cb3653dSAlexander Shishkin
33*4cb3653dSAlexander ShishkinNow, with the MIPI SyS-T protocol driver, each policy node in the
34*4cb3653dSAlexander Shishkinconfigfs gets a few additional attributes, which determine per-source
35*4cb3653dSAlexander Shishkinparameters specific to the protocol:
36*4cb3653dSAlexander Shishkin
37*4cb3653dSAlexander Shishkin# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
38*4cb3653dSAlexander Shishkin# ls /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default
39*4cb3653dSAlexander Shishkinchannels
40*4cb3653dSAlexander Shishkinclocksync_interval
41*4cb3653dSAlexander Shishkindo_len
42*4cb3653dSAlexander Shishkinmasters
43*4cb3653dSAlexander Shishkints_interval
44*4cb3653dSAlexander Shishkinuuid
45*4cb3653dSAlexander Shishkin
46*4cb3653dSAlexander ShishkinThe most important one here is the "uuid", which determines the UUID
47*4cb3653dSAlexander Shishkinthat will be used to tag all data coming from this source. It is
48*4cb3653dSAlexander Shishkinautomatically generated when a new node is created, but it is likely
49*4cb3653dSAlexander Shishkinthat you would want to change it.
50*4cb3653dSAlexander Shishkin
51*4cb3653dSAlexander Shishkindo_len switches on/off the additional "payload length" field in the
52*4cb3653dSAlexander ShishkinMIPI SyS-T message header. It is off by default as the STP already
53*4cb3653dSAlexander Shishkinmarks message boundaries.
54*4cb3653dSAlexander Shishkin
55*4cb3653dSAlexander Shishkints_interval and clocksync_interval determine how much time in milliseconds
56*4cb3653dSAlexander Shishkincan pass before we need to include a protocol (not transport, aka STP)
57*4cb3653dSAlexander Shishkintimestamp in a message header or send a CLOCKSYNC packet, respectively.
58*4cb3653dSAlexander Shishkin
59*4cb3653dSAlexander ShishkinSee Documentation/ABI/testing/configfs-stp-policy-p_sys-t for more
60*4cb3653dSAlexander Shishkindetails.
61*4cb3653dSAlexander Shishkin
62*4cb3653dSAlexander Shishkin* [1] https://www.mipi.org/specifications/sys-t
63