Page MenuHomeFreeBSD

scmi: Introduce a new SCMI API and port CLK SCMI driver to it
ClosedPublic

Authored by cristian.marussi_arm.com on Dec 13 2023, 6:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 10:26 PM
Unknown Object (File)
Mon, Nov 4, 10:26 PM
Unknown Object (File)
Mon, Nov 4, 10:26 PM
Unknown Object (File)
Mon, Nov 4, 10:26 PM
Unknown Object (File)
Mon, Nov 4, 10:26 PM
Unknown Object (File)
Mon, Nov 4, 10:10 PM
Unknown Object (File)
Fri, Nov 1, 5:47 PM
Unknown Object (File)
Oct 13 2024, 6:19 AM
Subscribers

Details

Summary

Expose new scmi_buf_get/put API methods to build and send messages;
command request descriptors are now pre-allocated when the SCMI core is
initialized and kept in a free list, instead of being allocated on the
stack of the caller of the SCMI request.

Dynamically allocated descriptors enable the SCMI core to keep around
and track outstanding transactions for as long as needed, outliving the
lifetime of the caller stack: this allows tracking of late or missing
replies and it will be needed when adding support for SCMI transports
that allows for more messages to be inflight concurrently.

Move the existing CLK SCMI driver to the new API.

Tested on: ARM Morello Board
Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/firmware/arm/scmi.c
221–222

No need for this check

228–229

No need for this check

sys/dev/firmware/arm/scmi_clk.c
254–267

Is this needed? error is already non-zero.

Removed needless malloc checks

malloc M_WAITOK xannot fail so removed a few checks on that and consequently
simplified the error paths of scmi_clk_attr() and scmi_reqs_poll_allocate()

This revision is now accepted and ready to land.Mar 5 2024, 2:34 PM

Reworked to rebase cleanly on other series changes

Needed to be rebased after I shuffled around the sc->trs initialization.

This revision now requires review to proceed.Mar 7 2024, 5:43 PM
This revision is now accepted and ready to land.Mar 8 2024, 2:48 PM