Skip to contentSkip to conversation

Add support for UltraSoc System Memory Buffer

PATCH Superseded Junhao He 2 participants 5 messages Aug 18, 2022 – Sep 1, 2022

Subsystems (3)

v9 of 16 Superseded Latest is v16 →

lore
Share & tools
lore

Junhao He

author
#0 lore raw

v9 cover Add support for UltraSoc System Memory Buffer

Add support for UltraSoc System Memory Buffer.

Change since v8:
- Insert a blank line at the end of the config tag in Kconfig.
- Fix the "llseek" initialization.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/

Change since v7:
- Use the macros for register bit flags and numbers of resource.
- Fix 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.
- 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 drivers

 .../sysfs-bus-coresight-devices-ultra_smb     |  31 +
 .../trace/coresight/ultrasoc-smb.rst          |  80 +++
 drivers/hwtracing/coresight/Kconfig           |  11 +
 drivers/hwtracing/coresight/Makefile          |   1 +
 drivers/hwtracing/coresight/ultrasoc-smb.c    | 636 ++++++++++++++++++
 drivers/hwtracing/coresight/ultrasoc-smb.h    | 115 ++++
 6 files changed, 874 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
author
#1 lore raw

PATCH v9 1/2 drivers/coresight: Add UltraSoc System Memory Buffer driver

From: Qi Liu <[email protected]>

This patch adds 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.

SMB is developed by UltraSoc technology, which is acquired by Siemens, and we still use "UltraSoc" to name driver.

---
 drivers/hwtracing/coresight/Kconfig        |  11 +
 drivers/hwtracing/coresight/Makefile       |   1 +
 drivers/hwtracing/coresight/ultrasoc-smb.c | 636 +++++++++++++++++++++
 drivers/hwtracing/coresight/ultrasoc-smb.h | 115 ++++
 4 files changed, 763 insertions(+)
 create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.c
 create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.h
drivers/hwtracing/coresight/Kconfig +11 -0
index 514a9b8086e3..85c148bddb2a 100644
@@ -201,4 +201,15 @@ 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 && 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
index b6c4a48140ec..344dba8d6ff8 100644
@@ -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 +636 -0

636 lines not on this page · raw message

drivers/hwtracing/coresight/ultrasoc-smb.h new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
2.33.0
author
#2 lore raw

PATCH v9 2/2 Documentation: Add document for UltraSoc SMB drivers

In reply to Junhao He

From: Qi Liu <[email protected]>

This patch bring in documentation for UltraSoc SMB drivers. It simply describes the device, sysfs interface and the firmware bindings.

---
 .../sysfs-bus-coresight-devices-ultra_smb     | 31 +++++++
 .../trace/coresight/ultrasoc-smb.rst          | 80 +++++++++++++++++++
 2 files changed, 111 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
new file mode 100644
index 000000000000..acc0f6e82c25
@@ -0,0 +1,31 @@
+What:		/sys/bus/coresight/devices/ultra_smb<N>/enable_sink
+Date:		August 2022
+KernelVersion:	6.0
+Contact:	Qi Liu <[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:		August 2022
+KernelVersion:	6.0
+Contact:	Qi Liu <[email protected]>
+Description:	(Read) Shows the buffer size of each UltraSoc SMB device.
+
+What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/buf_status
+Date:		August 2022
+KernelVersion:	6.0
+Contact:	Qi Liu <[email protected]>
+Description:	(Read) Shows the value held by UltraSoc SMB status register.
+		BIT(0) is zero means buffer is empty.
+
+What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/read_pos
+Date:		August 2022
+KernelVersion:	6.0
+Contact:	Qi Liu <[email protected]>
+Description:	(Read) Shows the value held by UltraSoc SMB Read Pointer register.
+
+What:		/sys/bus/coresight/devices/ultra_smb<N>/mgmt/write_pos
+Date:		August 2022
+KernelVersion:	6.0
+Contact:	Qi Liu <[email protected]>
+Description:	(Read) Shows the value held by UltraSoc SMB Write Pointer register.
Documentation/trace/coresight/ultrasoc-smb.rst new file +80 -0

80 lines not on this page · raw message

Signature · 1 line
2.33.0
author
#3 lore raw
In reply to Junhao He

Gentle ping. Any comment or suggestion is appreciated.

thanks.

Quoted 70 lines · Junhao He

Add support for UltraSoc System Memory Buffer.

Change since v8:
- Insert a blank line at the end of the config tag in Kconfig.
- Fix the "llseek" initialization.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/

Change since v7:
- Use the macros for register bit flags and numbers of resource.
- Fix 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.
- 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 drivers

  .../sysfs-bus-coresight-devices-ultra_smb     |  31 +
  .../trace/coresight/ultrasoc-smb.rst          |  80 +++
  drivers/hwtracing/coresight/Kconfig           |  11 +
  drivers/hwtracing/coresight/Makefile          |   1 +
  drivers/hwtracing/coresight/ultrasoc-smb.c    | 636 ++++++++++++++++++
  drivers/hwtracing/coresight/ultrasoc-smb.h    | 115 ++++
  6 files changed, 874 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

#4 lore raw
Quoted 3 lines · hejunhao

Gentle ping. Any comment or suggestion is appreciated.

There are a few patchset that are both substantial and complex to review on the log. As such reviewing will take longer than usual.

Quoted 74 lines

thanks.

Quoted 70 lines · Junhao He

Add support for UltraSoc System Memory Buffer.

Change since v8:
- Insert a blank line at the end of the config tag in Kconfig.
- Fix the "llseek" initialization.
- Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/

Change since v7:
- Use the macros for register bit flags and numbers of resource.
- Fix 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.
- 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 drivers

  .../sysfs-bus-coresight-devices-ultra_smb     |  31 +
  .../trace/coresight/ultrasoc-smb.rst          |  80 +++
  drivers/hwtracing/coresight/Kconfig           |  11 +
  drivers/hwtracing/coresight/Makefile          |   1 +
  drivers/hwtracing/coresight/ultrasoc-smb.c    | 636 ++++++++++++++++++
  drivers/hwtracing/coresight/ultrasoc-smb.h    | 115 ++++
  6 files changed, 874 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