mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/3] misc: amd-sbi: Add TBAI trace-buffer access over I3C
@ 2026-11-11  5:40 Akshay Gupta
  2026-11-11  5:40 ` [PATCH v1 1/3] misc: amd-sbi: use sized DMA-safe I3C tx/rx buffers Akshay Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Akshay Gupta @ 2026-11-11  5:40 UTC (permalink / raw)
  To: linux-kernel, linux-doc
  Cc: arnd, gregkh, corbet, skhan, rdunlap, linux,
	naveenkrishna.chatradhi, Anand.Umarji, Akshay Gupta

The Trace Buffer Acquire Interface (TBAI) in the Thermal Management
(THM) block lets a Board Management Controller (BMC) read
microprocessor (MP) trace data over SB-TSI. The BMC does not program
the trace-buffer destination address space. It selects a look-up
table (LUT) index and an entry offset, and the SoC returns the
payload.

amd-sbi already exposes SB-TSI register transfers on /dev/sbtsi-* for
both I2C and I3C. TBAI is a second protocol on that same I3C target:
a 5-byte request and up to 32 bytes of read data. It is not available
over I2C. This series adds it as a new ioctl and does not change the
existing register-transfer ABI.

Userspace interface:

SBTBAI_IOCTL_CMD is

    _IOWR(SB_BASE_IOCTL_NR, 5, struct apml_tbai_msg)

on the same /dev/sbtsi-* node as SBTSI_IOCTL_REG_XFER_CMD.

- I3C only. On an I2C SB-TSI device the ioctl returns -EOPNOTSUPP.
- Acquire (command 0x31) reads 1 to 32 dwords from a LUT index and a
  16-bit entry offset. One transaction carries at most 8 dwords, so
  the driver splits a larger read and advances the offset between
  chunks.
- Flush (command 0x32) resets the TBAI logic. The acquire fields in
  the request are ignored, and the 4-byte flush status is returned
  in data_out.
- A trace-buffer target error is returned as -EPROTOTYPE. fw_ret_code
  holds the status word (AMD_SBI_TBAI_TBT_ERR*) and data_out is
  cleared. A 1-dword reply equal to one of those status values is
  always reported as an error, because it cannot be told apart from
  trace data.
- A short read returns -EMSGSIZE. The partial buffer is not copied
  back to userspace.
- logging_en and the padding bytes must be zero.
- TBAI and TSI register transfers share the device lock, so the two
  ioctls cannot interleave on the bus.

Series:

1. Name and size the I3C DMA buffers. Register access still uses
   2 transmit bytes and 1 receive byte. Both buffers stay aligned to
   ARCH_DMA_MINALIGN.
2. Add SBTBAI_IOCTL_CMD, the UAPI in include/uapi/misc/amd-apml.h, and
   grow the shared I3C buffers to 5 transmit bytes and 32 receive
   bytes.
3. Document the ioctl in Documentation/misc-devices/amd-sbi.rst.

Testing:

- Built the driver and checked that I3C SB-TSI register reads and
  writes still work after the buffer change.
- On I3C hardware: acquire, flush, short read, and a trace-buffer
  target error.
- On I2C, SBTBAI_IOCTL_CMD returns -EOPNOTSUPP.
- Built the amd-sbi documentation, including the new kernel-doc
  reference, with no new warnings.

Akshay Gupta (1):
  misc: amd-sbi: Add TBAI trace-buffer access over I3C

Prathima (2):
  misc: amd-sbi: use sized DMA-safe I3C tx/rx buffers
  docs: amd-sbi: document TBAI trace-buffer ioctl

 Documentation/misc-devices/amd-sbi.rst |  60 +++++++-
 drivers/misc/amd-sbi/tsi-core.c        | 198 ++++++++++++++++++++++++-
 drivers/misc/amd-sbi/tsi-core.h        |  15 +-
 include/uapi/misc/amd-apml.h           |  78 ++++++++++
 4 files changed, 344 insertions(+), 7 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-11  5:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11  5:40 [PATCH v1 0/3] misc: amd-sbi: Add TBAI trace-buffer access over I3C Akshay Gupta
2026-11-11  5:40 ` [PATCH v1 1/3] misc: amd-sbi: use sized DMA-safe I3C tx/rx buffers Akshay Gupta
2026-11-11  5:40 ` [PATCH v1 2/3] misc: amd-sbi: Add TBAI trace-buffer access over I3C Akshay Gupta
2026-11-11  5:40 ` [PATCH v1 3/3] docs: amd-sbi: document TBAI trace-buffer ioctl Akshay Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®