aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_mailbox.c
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-10-17 13:05:38 +0200
committerMikael Olsson <mikael.olsson@arm.com>2023-11-06 09:36:00 +0100
commit075451507cda3e8f543caecacfadf226a69e5a05 (patch)
treed12ec47fa73c61a7bec3543a29c5dd2ae6b66c93 /kernel/ethosu_mailbox.c
parent45d47991f745094e328f32e769c22d811d397b1d (diff)
downloadethos-u-linux-driver-stack-075451507cda3e8f543caecacfadf226a69e5a05.tar.gz
Remove buffer capacity, offset and resize in UAPI
The UAPI no longer supports the buffer capacity, offset and resize functionality. Instead, the UAPI now only accepts a fixed size given at the creation of the buffer. This change was made because the features were not used and made the buffer handling more complicated. The user knows how big buffers they need for their networks so they don't need resize support or partial buffer usage support by having separate size and capacity with an offset. Without these features, the buffer instance no longer needs any IOCTL call support so it has been removed. However, to still be able to check the size of a buffer from its file descriptor, seek support has been implemented so lseek and similar functions can be used to get the size. The driver library's clear function that previously only reset the size and offset values of the buffer will now clear the buffer content instead. These are breaking changes so the Linux kernel NPU driver version and the driver library version have been given major version bumps. All the tests and other applications affected by these changes have been updated accordingly. Change-Id: Ifc34cf04724a95853ad23fd7398dd286f73bcdab Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel/ethosu_mailbox.c')
-rw-r--r--kernel/ethosu_mailbox.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index 5cc2465..e499860 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -1,5 +1,6 @@
/*
- * Copyright 2020-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-License-Identifier: GPL-2.0-only
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -14,8 +15,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can access it online at
* http://www.gnu.org/licenses/gpl-2.0.html.
- *
- * SPDX-License-Identifier: GPL-2.0-only
*/
/****************************************************************************
@@ -125,17 +124,10 @@ static int ethosu_send_locked(struct ethosu_mailbox *mbox,
static void ethosu_core_set_size(struct ethosu_buffer *buf,
struct ethosu_core_buffer *cbuf)
{
- cbuf->ptr = (uint32_t)buf->dma_addr + buf->offset;
+ cbuf->ptr = (uint32_t)buf->dma_addr;
cbuf->size = (uint32_t)buf->size;
}
-static void ethosu_core_set_capacity(struct ethosu_buffer *buf,
- struct ethosu_core_buffer *cbuf)
-{
- cbuf->ptr = (uint32_t)buf->dma_addr + buf->offset + buf->size;
- cbuf->size = (uint32_t)buf->capacity - buf->offset - buf->size;
-}
-
int ethosu_mailbox_register(struct ethosu_mailbox *mbox,
struct ethosu_mailbox_msg *msg)
{
@@ -278,7 +270,7 @@ int ethosu_mailbox_inference(struct ethosu_mailbox *mbox,
ethosu_core_set_size(ifm[i], &inf_req->ifm[i]);
for (i = 0; i < ofm_count; i++)
- ethosu_core_set_capacity(ofm[i], &inf_req->ofm[i]);
+ ethosu_core_set_size(ofm[i], &inf_req->ofm[i]);
for (i = 0; i < ETHOSU_CORE_PMU_MAX; i++)
inf_req->pmu_event_config[i] = pmu_event_config[i];