Skip to content

drivers: misc: Add driver for Silicon Labs Packet Trace Interface #88035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

asmellby
Copy link
Collaborator

@asmellby asmellby commented Apr 2, 2025

The Packet Trace Interface is a debug interface within the radio subsystem that emits TX and RX packet data over a serial connection in real time.

Add bindings and DTS nodes for the Packet Trace Interface of the radio, and a misc driver to initialize it. Add pinctrl configuration to boards that have PTI pins wired to the on-board debugger. Add a snippet that can be used to enable packet trace output from Silicon Labs Series 2 devices for any application.

jerome-pouiller
jerome-pouiller previously approved these changes Apr 2, 2025
jhedberg
jhedberg previously approved these changes Apr 2, 2025
@nordicjm
Copy link
Collaborator

nordicjm commented Apr 4, 2025

New driver classes need architecture review, will add label

@nordicjm nordicjm added the Architecture Review Discussion in the Architecture WG required label Apr 4, 2025
@jhedberg jhedberg requested a review from carlescufi April 4, 2025 06:47
@carlescufi
Copy link
Member

Without wanting to block this directly, is this a driver that could be generalized in any way or placed under an existing category? Should we have a quick discussion in the Arch WG?

@asmellby
Copy link
Collaborator Author

asmellby commented Apr 4, 2025

I'd be happy to present for the Arch WG.

I didn't find any existing driver category that made sense, hence the choice of a misc driver. However, this is technically also something that could be done through a SoC or board init hook.

When it comes to generalization, it would be useful to discuss the general concept of "trace init". There are several instances of this on Silicon Labs SoCs (and ARM in general), where "something" needs to be done to initialize a stream of data from the device:

  • ARM ETM -- instruction trace, needs pinctrl config ++
  • ARM SWO -- PC sampling and exception trace (in addition to general-purpose ITM-as-a-serial-pipe usage), needs pinctrl config ++
  • Silicon Labs PTI -- packet trace, needs pinctrl config ++

@carlescufi
Copy link
Member

I'd be happy to present for the Arch WG.

Could you do next Tuesday, April 8th?

@carlescufi carlescufi requested a review from nordic-krch April 4, 2025 08:35
@carlescufi
Copy link
Member

Architecture WG:

  • @asmellby presents the potential sharing of infrastructure among existing and future drivers that deal with loggin/tracing/debugging
  • An open question, perhaps higher-level is whether you actually need something in drivers/ when there is no API at all, because this could just technically be in soc.c, given hat it only initializes the hardware
    • @nashif and @carlescufi agree that this should be in drivers/, no objections
    • memc and power_domain are already such drivers
  • @carlescufi suggests moving this and the coresight driver (cc @nordic-krch) to drivers/debug so we have those drivers grouped and we can find common parts
  • @nashif suggests also looking through the tree to find additional debug-related code to this folder

@asmellby asmellby force-pushed the feature/series2-pti branch from fc44629 to 8868b03 Compare April 16, 2025 10:19
@github-actions github-actions bot requested a review from 57300 April 16, 2025 10:20
@github-actions github-actions bot requested a review from jeremybettis April 16, 2025 10:20
@asmellby
Copy link
Collaborator Author

Created a new drivers/debug class, guarded by the DEBUG_DRIVER Kconfig option (since DEBUG is already taken).
Moved the PTI driver into drivers/debug.
Added a MAINTAINERS entry for the new driver class. Tentatively added @nordic-krch as collaborator, are you OK with that? There is also the option to reuse the existing Debug entry (currently used for subsys/debug), input on this would be appreciated.

@carlescufi carlescufi moved this from Todo to In Progress in Architecture Review May 12, 2025
@asmellby
Copy link
Collaborator Author

@carlescufi What are the next steps to progress this PR?

tejlmand
tejlmand previously approved these changes May 20, 2025
nordic-krch
nordic-krch previously approved these changes May 20, 2025
@asmellby asmellby dismissed stale reviews from nordic-krch, jerome-pouiller, and tejlmand via 65e4999 May 20, 2025 09:59
@asmellby asmellby force-pushed the feature/series2-pti branch from 8868b03 to 65e4999 Compare May 20, 2025 09:59
@asmellby
Copy link
Collaborator Author

Resolved merge conflicts after #89946

tejlmand
tejlmand previously approved these changes May 20, 2025
@carlescufi carlescufi removed the Architecture Review Discussion in the Architecture WG required label Jun 2, 2025
@asmellby asmellby force-pushed the feature/series2-pti branch from 65e4999 to 69a5357 Compare June 4, 2025 08:53
asmellby added 5 commits June 5, 2025 10:14
Add a new driver class for drivers related to debugging, such as
trace hardware, performance counters etc.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add bindings and DTS nodes for the Packet Trace Interface of the radio.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
The Packet Trace Interface is a debug interface that emits TX and RX packet
data over a serial connection in real time.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Configure Packet Trace Interface pinout on Series 2 boards.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add snippet that can be used to enable packet trace output from
Silicon Labs Series 2 devices.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
@asmellby asmellby force-pushed the feature/series2-pti branch from 69a5357 to d0ece23 Compare June 5, 2025 08:17
Copy link

sonarqubecloud bot commented Jun 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

8 participants