aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_mailbox.c
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-08-03 12:41:48 +0200
committerMikael Olsson <mikael.olsson@arm.com>2023-08-09 15:09:38 +0200
commit7c843dc763a175269e810510af57b658ae81c529 (patch)
treee43f8f848e642abb6d448a9ba6399007fbf81bc7 /kernel/ethosu_mailbox.c
parentfab31ebedaa0d2a3026ccb2de453d33780aed7c6 (diff)
downloadethos-u-linux-driver-stack-7c843dc763a175269e810510af57b658ae81c529.tar.gz
Add protocol version check during probing
To ensure that the Linux kernel NPU driver and the firmware used are compatible, the NPU driver will now request and verify the protocol version when setting up the device during the probing. Change-Id: I13bca96bf6f98ca90dc79e11ae637c269c2a5eec Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel/ethosu_mailbox.c')
-rw-r--r--kernel/ethosu_mailbox.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index 5b105d8..4f7f5b7 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -134,15 +134,19 @@ int ethosu_mailbox_pong(struct ethosu_mailbox *mbox)
return rpmsg_send(mbox->ept, &rpmsg, sizeof(rpmsg.header));
}
-int ethosu_mailbox_version_request(struct ethosu_mailbox *mbox)
+int ethosu_mailbox_version_request(struct ethosu_mailbox *mbox,
+ struct ethosu_mailbox_msg *msg)
{
struct ethosu_core_rpmsg rpmsg = {
- .header = {
- .magic = ETHOSU_CORE_MSG_MAGIC,
- .type = ETHOSU_CORE_MSG_VERSION_REQ,
+ .header = {
+ .magic = ETHOSU_CORE_MSG_MAGIC,
+ .type = ETHOSU_CORE_MSG_VERSION_REQ,
+ .msg_id = msg->id
}
};
+ msg->type = rpmsg.header.type;
+
return rpmsg_send(mbox->ept, &rpmsg, sizeof(rpmsg.header));
}