Add support for UltraSoc System Memory Buffer
v16 cover Add support for UltraSoc System Memory Buffer
Add support for UltraSoc System Memory Buffer.
Change since v15:
- Modify document based on Bagas and Suzuki's comments.
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v14:
- Add some helpers to the buffer and simplify dumping data according to Jonathan's comment.
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v13:
- Modify document and the patches description according to Bagas's comment.
- Add dependency on config ACPI, drop redundant enable hw in smb_update_buffer(), Modify smb_purge_data() description according to Suzuki's comment.
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v12:
- Modify the code style and add "#ifdef CONFIG_ACPI" according to Jonathan's comment.
- Address the comments from Yicong, included drop "buf_base"__iomem attribute, modify the "reading" type to bool and fix FIELD_PREP.
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v11:
- Modify the code style and rename the macro according to Jonathan's comment.
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v10:
- Rebase onto v6.1-rc4, included similar sysfs register accessors (as same as James's patch)
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v9:
- Update the Contact tag in SMB document.
- Replace the spinlock with mutex.
- Do some clean-ups in "smb_enable()" and "smb_release()".
- Use classic memory mapped interface.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Change since v8:
- Insert a blank line at the end of the config tag in Kconfig according to Randy's comment.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Change since v7:
- Use the macros for register bit flags and numbers of resource.
- Cleanup punctuation.
- Update the Date tag and the KernelVersion tag in the document.
- Link: https://lore.kernel.org/lkml/[email protected]/
Change since v6:
- Modify the code style and driver description according to Suzuki's comment.
- Modify configuration of "drvdata->reading", to void problems in open/read concurrency scenario.
- Rename the macro of "SMB_FLOW_MASK".
- Use the "handle->head" to determine the page number and offset.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Change since v5:
- Address the comments from Suzuki, add some comments in SMB document, and modify configuration of "drvdata->reading", to void problems in multi-core concurrency scenario
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Change since v4:
- Add a simple document of SMB driver according to Suzuki's comment.
- Address the comments from Suzuki.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Change since v3:
- Modify the file header according to community specifications.
- Address the comments from Mathieu.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Change since v2:
- Move ultrasoc driver to drivers/hwtracing/coresight by Mathieu's comment.
- Link: https://lists.linaro.org/pipermail/coresight/2021-November/007310.html
Change since v1:
- Drop the document of UltraSoc according to Mathieu's comment.
- Add comments to explain some private hardware settings.
- Address the comments from Mathieu.
- Link: https://lists.linaro.org/pipermail/coresight/2021-August/006842.html
Change since RFC:
- Move driver to drivers/hwtracing/coresight/ultrasoc.
- Remove ultrasoc-axi-com.c, as AXI-COM doesn't need to be configured in basic tracing function.
- Remove ultrasoc.c as SMB does not need to register with the ultrasoc core.
- Address the comments from Mathieu and Suzuki.
- Link: https://lists.linaro.org/pipermail/coresight/2021-June/006535.html
Qi Liu (2):
drivers/coresight: Add UltraSoc System Memory Buffer driver
Documentation: Add document for UltraSoc SMB driver
.../sysfs-bus-coresight-devices-ultra_smb | 31 + .../trace/coresight/ultrasoc-smb.rst | 83 +++ drivers/hwtracing/coresight/Kconfig | 12 + drivers/hwtracing/coresight/Makefile | 1 + drivers/hwtracing/coresight/ultrasoc-smb.c | 648 ++++++++++++++++++ drivers/hwtracing/coresight/ultrasoc-smb.h | 125 ++++ 6 files changed, 900 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb create mode 100644 Documentation/trace/coresight/ultrasoc-smb.rst create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.c create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.h
Signature · 1 line
2.33.0
PATCH v16 1/2 drivers/coresight: Add UltraSoc System Memory Buffer driver
From: Qi Liu <[email protected]>
Add driver for UltraSoc SMB(System Memory Buffer) device. SMB provides a way to buffer messages from ETM, and store these "CPU instructions trace" in system memory. The SMB device is identifier as ACPI HID "HISI03A1". Device system memory address resources are allocated using the _CRS method and buffer modes is the circular buffer mode.
SMB is developed by UltraSoc technology, which is acquired by Siemens, and we still use "UltraSoc" to name driver.
--- drivers/hwtracing/coresight/Kconfig | 12 + drivers/hwtracing/coresight/Makefile | 1 + drivers/hwtracing/coresight/ultrasoc-smb.c | 648 +++++++++++++++++++++ drivers/hwtracing/coresight/ultrasoc-smb.h | 125 ++++ 4 files changed, 786 insertions(+) create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.c create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.h
drivers/hwtracing/coresight/Kconfig +12 -0
@@ -201,4 +201,16 @@ config CORESIGHT_TRBE To compile this driver as a module, choose M here: the module will be called coresight-trbe. + +config ULTRASOC_SMB + tristate "Ultrasoc system memory buffer drivers" + depends on ACPI || COMPILE_TEST + depends on ARM64 && CORESIGHT_LINKS_AND_SINKS + help + This driver provides support for the Ultrasoc system memory buffer (SMB). + SMB is responsible for receiving the trace data from Coresight ETM devices + and storing them to a system buffer. + + To compile this driver as a module, choose M here: the module will be + called ultrasoc-smb. endif
drivers/hwtracing/coresight/Makefile +1 -0
@@ -27,3 +27,4 @@ obj-$(CONFIG_CORESIGHT_CTI) += coresight-cti.o obj-$(CONFIG_CORESIGHT_TRBE) += coresight-trbe.o coresight-cti-y := coresight-cti-core.o coresight-cti-platform.o \ coresight-cti-sysfs.o +obj-$(CONFIG_ULTRASOC_SMB) += ultrasoc-smb.o
drivers/hwtracing/coresight/ultrasoc-smb.c new file +648 -0
648 lines not on this page · raw message
drivers/hwtracing/coresight/ultrasoc-smb.h new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
2.33.0
PATCH v16 2/2 Documentation: Add document for UltraSoc SMB driver
In reply to Junhao HeFrom: Qi Liu <[email protected]>
Bring in documentation for UltraSoc SMB driver. It simply describes the device, sysfs interface and the firmware bindings.
--- .../sysfs-bus-coresight-devices-ultra_smb | 31 +++++++ .../trace/coresight/ultrasoc-smb.rst | 83 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb create mode 100644 Documentation/trace/coresight/ultrasoc-smb.rst
Documentation/ABI/testing/sysfs-bus-coresight-devices-ultra_smb new file +31 -0
@@ -0,0 +1,31 @@ +What: /sys/bus/coresight/devices/ultra_smb<N>/enable_sink +Date: January 2023 +KernelVersion: 6.3 +Contact: Junhao He <[email protected]> +Description: (RW) Add/remove a SMB device from a trace path. There can be + multiple sources for a single SMB device. + +What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_size +Date: January 2023 +KernelVersion: 6.3 +Contact: Junhao He <[email protected]> +Description: (RO) Shows the buffer size of each UltraSoc SMB device. + +What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_status +Date: January 2023 +KernelVersion: 6.3 +Contact: Junhao He <[email protected]> +Description: (RO) Shows the value of UltraSoc SMB status register. + BIT(0) is zero means buffer is empty. + +What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/read_pos +Date: January 2023 +KernelVersion: 6.3 +Contact: Junhao He <[email protected]> +Description: (RO) Shows the value of UltraSoc SMB Read Pointer register. + +What: /sys/bus/coresight/devices/ultra_smb<N>/mgmt/write_pos +Date: January 2023 +KernelVersion: 6.3 +Contact: Junhao He <[email protected]> +Description: (RO) Shows the value of UltraSoc SMB Write Pointer register.
Documentation/trace/coresight/ultrasoc-smb.rst new file +83 -0
83 lines not on this page · raw message
Signature · 1 line
2.33.0
Quoted 88 lines · Junhao He
Add support for UltraSoc System Memory Buffer.
Change since v15:
- Modify document based on Bagas and Suzuki's comments.
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v14:
- Add some helpers to the buffer and simplify dumping data according to Jonathan's comment.
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v13:
- Modify document and the patches description according to Bagas's comment.
- Add dependency on config ACPI, drop redundant enable hw insmb_update_buffer(), Modifysmb_purge_data()description according to Suzuki's comment.
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v12:
- Modify the code style and add "#ifdefCONFIG_ACPI" according to Jonathan's comment.
- Address the comments from Yicong, included drop "buf_base"__iomem attribute, modify the "reading" type to bool and fixFIELD_PREP.
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v11:
- Modify the code style and rename the macro according to Jonathan's comment.
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v10:
- Rebase onto v6.1-rc4, included similar sysfs register accessors (as same as James's patch)
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v9:
- Update the Contact tag in SMB document.
- Replace the spinlock with mutex.
- Do some clean-ups in "smb_enable()" and "smb_release()".
- Use classic memory mapped interface.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/Change since v8:
- Insert a blank line at the end of the config tag inKconfigaccording to Randy's comment.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/Change since v7:
- Use the macros for register bit flags and numbers of resource.
- Cleanup punctuation.
- Update the Date tag and the KernelVersion tag in the document.
- Link: https://lore.kernel.org/lkml/[email protected]/Change since v6:
- Modify the code style and driver description according to Suzuki's comment.
- Modify configuration of "drvdata->reading", to void problems in open/read concurrency scenario.
- Rename the macro of "SMB_FLOW_MASK".
- Use the "handle->head" to determine the page number and offset.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/Change since v5:
- Address the comments from Suzuki, add some comments in SMB document, and modify configuration of "drvdata->reading", to void problems in multi-core concurrency scenario
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/Change since v4:
- Add a simple document of SMB driver according to Suzuki's comment.
- Address the comments from Suzuki.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/Change since v3:
- Modify the file header according to community specifications.
- Address the comments from Mathieu.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/Change since v2:
- Move ultrasoc driver todrivers/hwtracing/coresightby Mathieu's comment.
- Link: https://lists.linaro.org/pipermail/coresight/2021-November/007310.htmlChange since v1:
- Drop the document of UltraSoc according to Mathieu's comment.
- Add comments to explain some private hardware settings.
- Address the comments from Mathieu.
- Link: https://lists.linaro.org/pipermail/coresight/2021-August/006842.htmlChange since RFC:
- Move driver todrivers/hwtracing/coresight/ultrasoc.
- Removeultrasoc-axi-com.c, as AXI-COM doesn't need to be configured in basic tracing function.
- Removeultrasoc.cas SMB does not need to register with the ultrasoc core.
- Address the comments from Mathieu and Suzuki.
- Link: https://lists.linaro.org/pipermail/coresight/2021-June/006535.html
Quoted 3 lines
Qi Liu (2):
drivers/coresight: Add UltraSoc System Memory Buffer driver
Documentation: Add document for UltraSoc SMB driver
Queued to coresight next tree
https://git.kernel.org/coresight/c/06f5c2926aaa
https://git.kernel.org/coresight/c/2d4103ae31aa
Thanks for the patches
Suzuki