summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorPeng Fan <[email protected]>2025-09-27 00:06:20 +0800
committerTom Rini <[email protected]>2025-10-09 14:16:11 -0600
commit5e9fb0e5835ace9f9f7c6eceb3dd4cabc17487d4 (patch)
tree0748bfc553453fda2f7b28dc31b255dedc76acf3 /drivers/firmware
parentf116ec5b9105ffa4792bfced12aab822e492ff5f (diff)
firmware: scmi: mailbox: Support arm,max_rx_timeout_ms
Per devicetree bindings: arm,max-rx-timeout-ms indicates an optional time value, expressed in milliseconds, representing the transport maximum timeout value for the receive channel. The value should be a non-zero value if set. Support this property if platform set it to a non-default value. This property is a per SCMI property, so all channels share same value. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Tom Rini <[email protected]>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/scmi/mailbox_agent.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/firmware/scmi/mailbox_agent.c b/drivers/firmware/scmi/mailbox_agent.c
index 32b0fd9f589..16a82f55ab7 100644
--- a/drivers/firmware/scmi/mailbox_agent.c
+++ b/drivers/firmware/scmi/mailbox_agent.c
@@ -16,7 +16,7 @@
#include "smt.h"
-#define TIMEOUT_US_30MS 30000
+#define TIMEOUT_30MS 30
/**
* struct scmi_mbox_channel - Description of an SCMI mailbox transport
@@ -73,6 +73,7 @@ out:
static int setup_channel(struct udevice *dev, struct scmi_mbox_channel *chan)
{
+ struct scmi_mbox_channel *base_chan = dev_get_plat(dev);
int ret;
ret = mbox_get_by_index(dev, 0, &chan->mbox);
@@ -87,7 +88,7 @@ static int setup_channel(struct udevice *dev, struct scmi_mbox_channel *chan)
return ret;
}
- chan->timeout_us = TIMEOUT_US_30MS;
+ chan->timeout_us = base_chan->timeout_us;
return 0;
}
@@ -127,6 +128,9 @@ int scmi_mbox_of_to_plat(struct udevice *dev)
{
struct scmi_mbox_channel *chan = dev_get_plat(dev);
+ chan->timeout_us = dev_read_u32_default(dev, "arm,max-rx-timeout-ms",
+ TIMEOUT_30MS) * 1000;
+
return setup_channel(dev, chan);
}