Change create network UAPI to take a user buffer

To not allow the buffer for a network instance to be changed after
creation, the create network UAPI will now take the network model data
as a user buffer. The content of the user buffer is copied into an
internally allocated DMA buffer that cannot be accessed by the user.

This breaks the current API so the Linux kernel NPU driver version and
the driver library version have been given major version bumps. All the
tests, documentation and other applications affected by the changes have
been updated accordingly.

Change-Id: I25c785d75a24794c3db632e4abe5cfbb1c7ac190
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index 9b9cd18..005e83e 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -239,8 +239,7 @@
 			     struct ethosu_buffer **ifm,
 			     uint32_t ofm_count,
 			     struct ethosu_buffer **ofm,
-			     struct ethosu_buffer *network,
-			     uint32_t network_index,
+			     struct ethosu_network *network,
 			     uint8_t *pmu_event_config,
 			     uint8_t pmu_event_config_count,
 			     uint8_t pmu_cycle_counter_enable)
@@ -279,13 +278,13 @@
 	for (i = 0; i < ETHOSU_CORE_PMU_MAX; i++)
 		inf_req->pmu_event_config[i] = pmu_event_config[i];
 
-	if (network != NULL) {
+	if (network->dma_mem != NULL) {
 		inf_req->network.type = ETHOSU_CORE_NETWORK_BUFFER;
 		ethosu_core_buffer_dma_mem_set(network->dma_mem,
 					       &inf_req->network.buffer);
 	} else {
 		inf_req->network.type = ETHOSU_CORE_NETWORK_INDEX;
-		inf_req->network.index = network_index;
+		inf_req->network.index = network->index;
 	}
 
 	return ethosu_send_locked(mbox, &rpmsg,
@@ -294,8 +293,7 @@
 
 int ethosu_mailbox_network_info_request(struct ethosu_mailbox *mbox,
 					struct ethosu_mailbox_msg *msg,
-					struct ethosu_buffer *network,
-					uint32_t network_index)
+					struct ethosu_network *network)
 {
 	struct ethosu_core_rpmsg rpmsg = {
 		.header         = {
@@ -308,13 +306,13 @@
 
 	msg->type = rpmsg.header.type;
 
-	if (network != NULL) {
+	if (network->dma_mem != NULL) {
 		info_req->network.type = ETHOSU_CORE_NETWORK_BUFFER;
 		ethosu_core_buffer_dma_mem_set(network->dma_mem,
 					       &info_req->network.buffer);
 	} else {
 		info_req->network.type = ETHOSU_CORE_NETWORK_INDEX;
-		info_req->network.index = network_index;
+		info_req->network.index = network->index;
 	}
 
 	return ethosu_send_locked(mbox, &rpmsg,