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>
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 @@
 	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));
 }