ultrasoc-smb.rst 3.6 KB

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