14cb3653dSAlexander Shishkin.. SPDX-License-Identifier: GPL-2.0 24cb3653dSAlexander Shishkin 34cb3653dSAlexander Shishkin=================== 44cb3653dSAlexander ShishkinMIPI SyS-T over STP 54cb3653dSAlexander Shishkin=================== 64cb3653dSAlexander Shishkin 74cb3653dSAlexander ShishkinThe MIPI SyS-T protocol driver can be used with STM class devices to 84cb3653dSAlexander Shishkingenerate standardized trace stream. Aside from being a standard, it 94cb3653dSAlexander Shishkinprovides better trace source identification and timestamp correlation. 104cb3653dSAlexander Shishkin 114cb3653dSAlexander ShishkinIn order to use the MIPI SyS-T protocol driver with your STM device, 124cb3653dSAlexander Shishkinfirst, you'll need CONFIG_STM_PROTO_SYS_T. 134cb3653dSAlexander Shishkin 144cb3653dSAlexander ShishkinNow, you can select which protocol driver you want to use when you create 154cb3653dSAlexander Shishkina policy for your STM device, by specifying it in the policy name: 164cb3653dSAlexander Shishkin 174cb3653dSAlexander Shishkin# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/ 184cb3653dSAlexander Shishkin 194cb3653dSAlexander ShishkinIn other words, the policy name format is extended like this: 204cb3653dSAlexander Shishkin 214cb3653dSAlexander Shishkin <device_name>:<protocol_name>.<policy_name> 224cb3653dSAlexander Shishkin 234cb3653dSAlexander ShishkinWith Intel TH, therefore it can look like "0-sth:p_sys-t.my-policy". 244cb3653dSAlexander Shishkin 254cb3653dSAlexander ShishkinIf the protocol name is omitted, the STM class will chose whichever 264cb3653dSAlexander Shishkinprotocol driver was loaded first. 274cb3653dSAlexander Shishkin 284cb3653dSAlexander ShishkinYou can also double check that everything is working as expected by 294cb3653dSAlexander Shishkin 304cb3653dSAlexander Shishkin# cat /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/protocol 314cb3653dSAlexander Shishkinp_sys-t 324cb3653dSAlexander Shishkin 334cb3653dSAlexander ShishkinNow, with the MIPI SyS-T protocol driver, each policy node in the 344cb3653dSAlexander Shishkinconfigfs gets a few additional attributes, which determine per-source 354cb3653dSAlexander Shishkinparameters specific to the protocol: 364cb3653dSAlexander Shishkin 374cb3653dSAlexander Shishkin# mkdir /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default 384cb3653dSAlexander Shishkin# ls /config/stp-policy/dummy_stm.0:p_sys-t.my-policy/default 394cb3653dSAlexander Shishkinchannels 404cb3653dSAlexander Shishkinclocksync_interval 414cb3653dSAlexander Shishkindo_len 424cb3653dSAlexander Shishkinmasters 434cb3653dSAlexander Shishkints_interval 444cb3653dSAlexander Shishkinuuid 454cb3653dSAlexander Shishkin 464cb3653dSAlexander ShishkinThe most important one here is the "uuid", which determines the UUID 474cb3653dSAlexander Shishkinthat will be used to tag all data coming from this source. It is 484cb3653dSAlexander Shishkinautomatically generated when a new node is created, but it is likely 494cb3653dSAlexander Shishkinthat you would want to change it. 504cb3653dSAlexander Shishkin 514cb3653dSAlexander Shishkindo_len switches on/off the additional "payload length" field in the 524cb3653dSAlexander ShishkinMIPI SyS-T message header. It is off by default as the STP already 534cb3653dSAlexander Shishkinmarks message boundaries. 544cb3653dSAlexander Shishkin 554cb3653dSAlexander Shishkints_interval and clocksync_interval determine how much time in milliseconds 564cb3653dSAlexander Shishkincan pass before we need to include a protocol (not transport, aka STP) 574cb3653dSAlexander Shishkintimestamp in a message header or send a CLOCKSYNC packet, respectively. 584cb3653dSAlexander Shishkin 594cb3653dSAlexander ShishkinSee Documentation/ABI/testing/configfs-stp-policy-p_sys-t for more 604cb3653dSAlexander Shishkindetails. 614cb3653dSAlexander Shishkin 624cb3653dSAlexander Shishkin* [1] https://www.mipi.org/specifications/sys-t 63