Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

stm class: Document the MIPI SyS-T protocol usage

Add a document describing MIPI SyS-T protocol driver usage.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Shishkin and committed by
Greg Kroah-Hartman
4cb3653d 95323943

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