Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108303772
D47422.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D47422.diff
View Options
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
@@ -128,8 +128,8 @@
};
static int scmi_transport_configure(device_t,
- struct scmi_transport_desc *);
-static int scmi_transport_init(struct scmi_softc *);
+ struct scmi_transport_desc *, phandle_t);
+static int scmi_transport_init(struct scmi_softc *, phandle_t);
static void scmi_transport_cleanup(struct scmi_softc *);
static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int);
static void scmi_reqs_pool_free(struct scmi_reqs_pool *);
@@ -167,7 +167,7 @@
simplebus_init(dev, node);
- error = scmi_transport_init(sc);
+ error = scmi_transport_init(sc, node);
if (error != 0)
return (error);
@@ -251,19 +251,35 @@
}
static int
-scmi_transport_configure(device_t dev, struct scmi_transport_desc *tdesc)
+scmi_transport_configure(device_t dev, struct scmi_transport_desc *tdesc, phandle_t node)
{
+ int ret;
+
/* Initialize to default values at first ... */
tdesc->max_msg = SCMI_DEF_MAX_MSG;
tdesc->max_payld_sz = SCMI_DEF_MAX_MSG_PAYLD_SIZE;
tdesc->reply_timo_ms = SCMI_DEF_MAX_RX_TIMEOUT_MS;
+ /*...lookup any optional DT properties*/
+ OF_getencprop(node, "arm,max-msg", &tdesc->max_msg,
+ sizeof(tdesc->max_msg));
+ OF_getencprop(node, "arm,max-msg-size", &tdesc->max_payld_sz,
+ sizeof(tdesc->max_payld_sz));
+
/* ... check against per-transport needs */
- return SCMI_TRANSPORT_CONFIGURE(dev);
+ ret = SCMI_TRANSPORT_CONFIGURE(dev);
+ if (ret != 0)
+ return (ret);
+
+ /* optional max_timeout should NOT be overwritten by trasnport defaults */
+ OF_getencprop(node, "arm,max-rx-timeout-ms", &tdesc->reply_timo_ms,
+ sizeof(tdesc->reply_timo_ms));
+
+ return (ret);
}
static int
-scmi_transport_init(struct scmi_softc *sc)
+scmi_transport_init(struct scmi_softc *sc, phandle_t node)
{
struct scmi_transport_desc *tdesc = &sc->trs_desc;
struct scmi_transport *trs;
@@ -272,7 +288,7 @@
trs = malloc(sizeof(*trs), M_DEVBUF, M_ZERO | M_WAITOK);
sc->trs = trs;
- ret = scmi_transport_configure(sc->dev, tdesc);
+ ret = scmi_transport_configure(sc->dev, tdesc, node);
if (ret != 0) {
free(trs, M_DEVBUF);
return (ret);
@@ -308,6 +324,7 @@
return (0);
}
+
static void
scmi_transport_cleanup(struct scmi_softc *sc)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 5:21 PM (20 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14783598
Default Alt Text
D47422.diff (2 KB)
Attached To
Mode
D47422: scmi: Add devicetree transport properties
Attached
Detach File
Event Timeline
Log In to Comment