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 <peng.fan@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
#include "smt.h"
-#define TIMEOUT_US_30MS 30000
+#define TIMEOUT_30MS 30
/**
* struct scmi_mbox_channel - Description of an SCMI mailbox transport
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);
return ret;
}
- chan->timeout_us = TIMEOUT_US_30MS;
+ chan->timeout_us = base_chan->timeout_us;
return 0;
}
{
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);
}