Skip to contentSkip to conversation

Add support for UltraSoc System Memory Buffer

PATCH Superseded Junhao He 2 participants 5 messages Aug 16, 2022 – Aug 17, 2022

Subsystems (3)

v8 of 16 Superseded Latest is v16 →

lore
Share & tools
lore

Junhao He

author
#0 lore raw

v8 cover Add support for UltraSoc System Memory Buffer

Add support for UltraSoc System Memory Buffer.

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           |  10 +
 drivers/hwtracing/coresight/Makefile          |   1 +
 drivers/hwtracing/coresight/ultrasoc-smb.c    | 636 ++++++++++++++++++
 drivers/hwtracing/coresight/ultrasoc-smb.h    | 115 ++++
 6 files changed, 873 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 v8 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        |  10 +
 drivers/hwtracing/coresight/Makefile       |   1 +
 drivers/hwtracing/coresight/ultrasoc-smb.c | 636 +++++++++++++++++++++
 drivers/hwtracing/coresight/ultrasoc-smb.h | 115 ++++
 4 files changed, 762 insertions(+)
 create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.c
 create mode 100644 drivers/hwtracing/coresight/ultrasoc-smb.h
drivers/hwtracing/coresight/Kconfig +10 -0
index 514a9b8086e3..4380eb1a0a73 100644
@@ -201,4 +201,14 @@ 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
reviewer
#2 lore raw

Re: [PATCH v8 1/2] drivers/coresight: Add UltraSoc System Memory Buffer driver

Hi--

drivers/hwtracing/coresight/Kconfig config CORESIGHT_TRBE · line 203

Quoted 8 lines · Junhao He
drivers/hwtracing/coresight/Kconfig +0 -0
index 514a9b8086e3..4380eb1a0a73 100644
@@ -201,4 +201,14 @@ config CORESIGHT_TRBE
 
 	  To compile this driver as a module, choose M here: the module will be
 	  called coresight-trbe.

Please insert a blank line here like it is done elsewhere.

drivers/hwtracing/coresight/Kconfig config CORESIGHT_TRBE · line 214

Quoted 11 lines
drivers/hwtracing/coresight/Kconfig +10 -0
+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

thanks.

Signature · 1 line
~Randy
author
#3 lore raw

Re: [PATCH v8 1/2] drivers/coresight: Add UltraSoc System Memory Buffer driver

On 2022/8/17 2:00, Randy Dunlap wrote:

Hi Randy,

Thanks for your comments.

Quoted 9 lines

Hi--

Quoted 6 lines · Junhao He
drivers/hwtracing/coresight/Kconfig +0 -0
index 514a9b8086e3..4380eb1a0a73 100644
@@ -201,4 +201,14 @@ config CORESIGHT_TRBE
 
Quoted 3 lines

drivers/hwtracing/coresight/Kconfig config CORESIGHT_TRBE · line 203

Quoted 2 lines
drivers/hwtracing/coresight/Kconfig +0 -0
  	  To compile this driver as a module, choose M here: the module will be
  	  called coresight-trbe.

Please insert a blank line here like it is done elsewhere.

I will fix it in the next version.
Thanks.

Quoted 4 lines
Quoted 4 lines
drivers/hwtracing/coresight/Kconfig +4 -0
+config ULTRASOC_SMB
+	tristate "Ultrasoc system memory buffer drivers"
+	depends on ACPI && ARM64 && CORESIGHT_LINKS_AND_SINKS
+	help
Quoted 8 lines

drivers/hwtracing/coresight/Kconfig config CORESIGHT_TRBE · line 214

Quoted 7 lines
drivers/hwtracing/coresight/Kconfig +6 -0
+	  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

thanks.

Regards,
Junhao.

author
#4 lore raw

PATCH v8 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