diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -35,6 +35,7 @@ #include #include "scmi_if.h" +#include "scmi_raw.h" #define SCMI_DEF_MAX_MSG 32 #define SCMI_DEF_MAX_MSG_PAYLD_SIZE 128 diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -53,6 +53,7 @@ #include #include "scmi.h" +#include "scmi_raw.h" #include "scmi_protocols.h" SDT_PROVIDER_DEFINE(scmi); @@ -223,6 +224,13 @@ SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_rx_timeout_ms", CTLFLAG_RD, &sc->trs_desc.reply_timo_ms, 0, "SCMI Max message RX timeout ms"); + error = scmi_raw_init(dev); + if (error != 0) + device_printf(dev, "Failed to initialize SCMI RAW. Carry-on.\n"); + + if (sc->drivers_disabled) + return (0); + /* * Allow devices to identify. */ @@ -245,6 +253,7 @@ struct scmi_softc *sc; sc = device_get_softc(dev); + scmi_raw_cleanup(dev); scmi_transport_cleanup(sc); return (0); @@ -663,10 +672,13 @@ } mtx_unlock_spin(&req->mtx); - if (timed_out) + if (timed_out) { device_printf(sc->dev, "Late reply for timed-out request - token: 0x%X. Ignore.\n", req->token); + if (req->is_raw) + scmi_raw_error_report(sc->dev, &req->msg.hdr, req->msg.rx_len); + } /* * In case of a late reply to a timed-out transaction this will @@ -808,6 +820,8 @@ req = tsk_to_req(ta); sc = device_get_softc(req->dev); scmi_wait_for_response(sc, req, NULL); + if (!req->timed_out && req->is_raw) + scmi_raw_reply_report(req->dev, &req->msg.hdr, req->msg.rx_len); scmi_msg_put(req->dev, &req->msg); }