aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/firmware
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2025-01-23 13:24:39 +0000
committerAndrew Turner <andrew@FreeBSD.org>2025-01-23 17:26:27 +0000
commit341d8fd90fa084d074059051478657cb45e53402 (patch)
treee1989775fccb4c8a6a2ce235f2671e1cd2d4d0f0 /sys/dev/firmware
parentc508841dfc5923ef81ed8ea61da364fb20616bbf (diff)
Diffstat (limited to 'sys/dev/firmware')
-rw-r--r--sys/dev/firmware/arm/scmi.c24
-rw-r--r--sys/dev/firmware/arm/scmi.h1
2 files changed, 23 insertions, 2 deletions
diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c
index c24768a5668a..950bbf94eeb6 100644
--- a/sys/dev/firmware/arm/scmi.c
+++ b/sys/dev/firmware/arm/scmi.c
@@ -717,7 +717,7 @@ scmi_msg_put(device_t dev, struct scmi_msg *msg)
}
int
-scmi_request(device_t dev, void *in, void **out)
+scmi_request_tx(device_t dev, void *in)
{
struct scmi_softc *sc;
struct scmi_req *req;
@@ -732,8 +732,11 @@ scmi_request(device_t dev, void *in, void **out)
/* Set inflight and send using transport specific method - refc-2 */
error = scmi_req_track_inflight(sc, req);
- if (error != 0)
+ if (error != 0) {
+ device_printf(dev, "Failed to build req with HDR |%0X|\n",
+ req->msg.hdr);
return (error);
+ }
error = SCMI_XFER_MSG(sc->dev, &req->msg);
if (error != 0) {
@@ -741,5 +744,22 @@ scmi_request(device_t dev, void *in, void **out)
return (error);
}
+ return (0);
+}
+
+int
+scmi_request(device_t dev, void *in, void **out)
+{
+ struct scmi_softc *sc;
+ struct scmi_req *req;
+ int error;
+
+ error = scmi_request_tx(dev, in);
+ if (error != 0)
+ return (error);
+
+ sc = device_get_softc(dev);
+ req = buf_to_req(in);
+
return (scmi_wait_for_response(sc, req, out));
}
diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h
index f6aa072caeca..f5b4173272bb 100644
--- a/sys/dev/firmware/arm/scmi.h
+++ b/sys/dev/firmware/arm/scmi.h
@@ -83,6 +83,7 @@ void scmi_buf_put(device_t dev, void *buf);
struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz);
void scmi_msg_put(device_t dev, struct scmi_msg *msg);
int scmi_request(device_t dev, void *in, void **);
+int scmi_request_tx(device_t dev, void *in);
void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len);
DECLARE_CLASS(scmi_driver);