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

Documentation: Add document for UltraSoc SMB driver

Bring in documentation for UltraSoc SMB driver.
It simply describes the device, sysfs interface and the
firmware bindings.

Signed-off-by: Qi Liu <liuqi115@huawei.com>
Signed-off-by: Junhao He <hejunhao3@huawei.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230114101302.62320-3-hejunhao3@huawei.com

authored by

Qi Liu and committed by
Suzuki K Poulose
2d4103ae 06f5c292

+114
+31
Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb
··· 1 + What: /sys/bus/coresight/devices/ultra_smb<N>/enable_sink 2 + Date: January 2023 3 + KernelVersion: 6.3 4 + Contact: Junhao He <hejunhao3@huawei.com> 5 + Description: (RW) Add/remove a SMB device from a trace path. There can be 6 + multiple sources for a single SMB device. 7 + 8 + What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_size 9 + Date: January 2023 10 + KernelVersion: 6.3 11 + Contact: Junhao He <hejunhao3@huawei.com> 12 + Description: (RO) Shows the buffer size of each UltraSoc SMB device. 13 + 14 + What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_status 15 + Date: January 2023 16 + KernelVersion: 6.3 17 + Contact: Junhao He <hejunhao3@huawei.com> 18 + Description: (RO) Shows the value of UltraSoc SMB status register. 19 + BIT(0) is zero means buffer is empty. 20 + 21 + What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/read_pos 22 + Date: January 2023 23 + KernelVersion: 6.3 24 + Contact: Junhao He <hejunhao3@huawei.com> 25 + Description: (RO) Shows the value of UltraSoc SMB Read Pointer register. 26 + 27 + What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/write_pos 28 + Date: January 2023 29 + KernelVersion: 6.3 30 + Contact: Junhao He <hejunhao3@huawei.com> 31 + Description: (RO) Shows the value of UltraSoc SMB Write Pointer register.
+83
Documentation/trace/coresight/ultrasoc-smb.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ====================================== 4 + UltraSoc - HW Assisted Tracing on SoC 5 + ====================================== 6 + :Author: Qi Liu <liuqi115@huawei.com> 7 + :Date: January 2023 8 + 9 + Introduction 10 + ------------ 11 + 12 + UltraSoc SMB is a per SCCL (Super CPU Cluster) hardware. It provides a 13 + way to buffer and store CPU trace messages in a region of shared system 14 + memory. The device acts as a coresight sink device and the 15 + corresponding trace generators (ETM) are attached as source devices. 16 + 17 + Sysfs files and directories 18 + --------------------------- 19 + 20 + The SMB devices appear on the existing coresight bus alongside other 21 + devices:: 22 + 23 + $# ls /sys/bus/coresight/devices/ 24 + ultra_smb0 ultra_smb1 ultra_smb2 ultra_smb3 25 + 26 + The ``ultra_smb<N>`` names SMB device associated with SCCL.:: 27 + 28 + $# ls /sys/bus/coresight/devices/ultra_smb0 29 + enable_sink mgmt 30 + $# ls /sys/bus/coresight/devices/ultra_smb0/mgmt 31 + buf_size buf_status read_pos write_pos 32 + 33 + Key file items are: 34 + 35 + * ``read_pos``: Shows the value on the read pointer register. 36 + * ``write_pos``: Shows the value on the write pointer register. 37 + * ``buf_status``: Shows the value on the status register. 38 + BIT(0) is zero value which means the buffer is empty. 39 + * ``buf_size``: Shows the buffer size of each device. 40 + 41 + Firmware Bindings 42 + ----------------- 43 + 44 + The device is only supported with ACPI. Its binding describes device 45 + identifier, resource information and graph structure. 46 + 47 + The device is identified as ACPI HID "HISI03A1". Device resources are allocated 48 + using the _CRS method. Each device must present two base address; the first one 49 + is the configuration base address of the device, the second one is the 32-bit 50 + base address of shared system memory. 51 + 52 + Example:: 53 + 54 + Device(USMB) { \ 55 + Name(_HID, "HISI03A1") \ 56 + Name(_CRS, ResourceTemplate() { \ 57 + QWordMemory (ResourceConsumer, , MinFixed, MaxFixed, NonCacheable, \ 58 + ReadWrite, 0x0, 0x95100000, 0x951FFFFF, 0x0, 0x100000) \ 59 + QWordMemory (ResourceConsumer, , MinFixed, MaxFixed, Cacheable, \ 60 + ReadWrite, 0x0, 0x50000000, 0x53FFFFFF, 0x0, 0x4000000) \ 61 + }) \ 62 + Name(_DSD, Package() { \ 63 + ToUUID("ab02a46b-74c7-45a2-bd68-f7d344ef2153"), \ 64 + /* Use CoreSight Graph ACPI bindings to describe connections topology */ 65 + Package() { \ 66 + 0, \ 67 + 1, \ 68 + Package() { \ 69 + 1, \ 70 + ToUUID("3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd"), \ 71 + 8, \ 72 + Package() {0x8, 0, \_SB.S00.SL11.CL28.F008, 0}, \ 73 + Package() {0x9, 0, \_SB.S00.SL11.CL29.F009, 0}, \ 74 + Package() {0xa, 0, \_SB.S00.SL11.CL2A.F010, 0}, \ 75 + Package() {0xb, 0, \_SB.S00.SL11.CL2B.F011, 0}, \ 76 + Package() {0xc, 0, \_SB.S00.SL11.CL2C.F012, 0}, \ 77 + Package() {0xd, 0, \_SB.S00.SL11.CL2D.F013, 0}, \ 78 + Package() {0xe, 0, \_SB.S00.SL11.CL2E.F014, 0}, \ 79 + Package() {0xf, 0, \_SB.S00.SL11.CL2F.F015, 0}, \ 80 + } \ 81 + } \ 82 + }) \ 83 + }