aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-02-07 11:22:26 +0100
committerMikael Olsson <mikael.olsson@arm.com>2024-02-12 13:04:41 +0100
commitd4ad9e55cb8e17a4a42b3a94c64e6bc48529b26e (patch)
tree9084d770574bc2a278ddfa121985ac030f711daa
parent09cdc30b3b3a52176cd02518c07d5f44c1ce8dd1 (diff)
downloadethos-u-linux-driver-stack-d4ad9e55cb8e17a4a42b3a94c64e6bc48529b26e.tar.gz
Restructure kernel driver source tree
As a first step to have a clearer separation of the different parts of the kernel driver, the source files have been placed into separate directories according to their purpose and the different parts are only allowed to use headers from another part in the include folder. Files have been renamed accordingly to namespace them by their purpose. Change-Id: I75e09ebf0002c99a22b6d4b09d34504d186c32b3 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md31
-rw-r--r--kernel/CMakeLists.txt4
-rw-r--r--kernel/Kbuild26
-rw-r--r--kernel/common/ethosu_buffer.c (renamed from kernel/ethosu_buffer.c)10
-rw-r--r--kernel/common/ethosu_device.c (renamed from kernel/ethosu_device.c)24
-rw-r--r--kernel/common/ethosu_dma_mem.c (renamed from kernel/ethosu_dma_mem.c)4
-rw-r--r--kernel/common/ethosu_driver.c (renamed from kernel/ethosu_driver.c)11
-rw-r--r--kernel/include/common/ethosu_buffer.h (renamed from kernel/ethosu_buffer.h)2
-rw-r--r--kernel/include/common/ethosu_device.h (renamed from kernel/ethosu_device.h)9
-rw-r--r--kernel/include/common/ethosu_dma_mem.h (renamed from kernel/ethosu_dma_mem.h)2
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg.h (renamed from kernel/ethosu_core_rpmsg.h)5
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h (renamed from kernel/ethosu_cancel_inference.h)9
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_capabilities.h (renamed from kernel/ethosu_capabilities.h)7
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_inference.h (renamed from kernel/ethosu_inference.h)9
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_mailbox.h (renamed from kernel/ethosu_mailbox.h)4
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_network.h (renamed from kernel/ethosu_network.h)2
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_network_info.h (renamed from kernel/ethosu_network_info.h)7
-rw-r--r--kernel/include/rpmsg/ethosu_rpmsg_version.h (renamed from kernel/ethosu_version.h)7
-rw-r--r--kernel/include/uapi/ethosu.h (renamed from kernel/uapi/ethosu.h)2
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_cancel_inference.c (renamed from kernel/ethosu_cancel_inference.c)8
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_capabilities.c (renamed from kernel/ethosu_capabilities.c)8
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_inference.c (renamed from kernel/ethosu_inference.c)14
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_mailbox.c (renamed from kernel/ethosu_mailbox.c)15
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_network.c (renamed from kernel/ethosu_network.c)14
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_network_info.c (renamed from kernel/ethosu_network_info.c)11
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_version.c (renamed from kernel/ethosu_version.c)10
27 files changed, 131 insertions, 129 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2a121d..e7ebc1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
#
-# Copyright (c) 2020-2022 Arm Limited. All rights reserved.
-#
+# SPDX-FileCopyrightText: Copyright 2020-2022, 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the License); you may
@@ -39,7 +38,7 @@ string(REGEX REPLACE "(.*)gcc$" "\\1" CROSS_COMPILE "${CMAKE_C_COMPILER}")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# Add include directory
-include_directories("kernel")
+include_directories("kernel/include")
# Add sub directories
if(BUILD_KERNEL)
diff --git a/README.md b/README.md
index 82be485..f28414a 100644
--- a/README.md
+++ b/README.md
@@ -63,9 +63,19 @@ include the rpmsg virtio message queues, memory resources and trace buffers.
The [ethosu_remoteproc.c](remoteproc/ethosu_remoteproc.c) is provided for
reference, but could be replaced by any remoteproc driver.
-## Ethos-U rpmsg driver
+## Ethos-U driver
-The [Ethos-U rpmsg driver](kernel/ethosu_driver.c) uses dynamic name resolution,
+The purpose of the Ethos-U driver is to enable user space applications to
+dispatch inferences to the NPU. The driver presents a
+[Userspace API (UAPI)](kernel/include/uapi/ethosu.h), which applications use
+IOCTL on to allocate buffers, create networks and dispatch inferences.
+
+To enable the kernel driver to be extended to support other setups, the source
+files for the driver are placed in separate common and rpmsg directories.
+
+### Rpmsg driver
+
+The [Ethos-U rpmsg driver](kernel/common/ethosu_driver.c) uses dynamic name resolution,
which requires a Linux kernel version of 5.12 or later. This means that when the
firmware boots up it calls `rpmsg_create_ept()` to create a dynamic endpoint
with a name of maximum 32 characters. The service name must be unique and is
@@ -81,16 +91,19 @@ driver will consequently only allocate resources while the firmware is running.
The
[message handler openamp](https://git.mlplatform.org/ml/ethos-u/ethos-u-core-platform.git/tree/applications/message_handler_openamp)
creates a new endpoint named `ethos-u-0.0`, which is serviced by the
-[Ethos-U rpmsg driver](kernel/ethosu_driver.c). It is important that firmware
+[Ethos-U rpmsg driver](kernel/common/ethosu_driver.c). It is important that firmware
and rpmsg driver use the same endpoint name, or else the endpoint will not be
successfully created.
-The purpose of the Ethos-U rpmsg driver is to enable user space applications to
-dispatch inferences to the the Ethos-U subsystem. The driver presents a
-[Userspace API (UAPI)](kernel/uapi/ethosu.h), which applications use IOCTL on to
-allocate buffers, create networks and dispatch inferences. The types for the
-rpmsg communication between Linux and the firmware are defined in
-[ethosu_core_rpmsg.h](kernel/ethosu_core_rpmsg.h).
+The messages used for the rpmsg communication between Linux and the firmware
+are defined in [ethosu_core_rpmsg.h](kernel/include/rpmsg/ethosu_rpmsg.h).
+
+### Folder structure
+
+To make a clear separation between the different parts of the driver, the
+source files are placed into separate directories according to their purpose
+and the different parts are only allowed to use headers from another part
+in the include folder.
# DTB
diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt
index 0192bdc..b5ce944 100644
--- a/kernel/CMakeLists.txt
+++ b/kernel/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+# SPDX-FileCopyrightText: Copyright 2020-2024 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
@@ -41,4 +41,4 @@ add_custom_target(kernel ALL
# Install the kernel object and headers
install(FILES ethosu.ko DESTINATION "modules")
-install(FILES "uapi/ethosu.h" DESTINATION "include/uapi")
+install(FILES "include/uapi/ethosu.h" DESTINATION "include/uapi")
diff --git a/kernel/Kbuild b/kernel/Kbuild
index 98bece3..88ce756 100644
--- a/kernel/Kbuild
+++ b/kernel/Kbuild
@@ -1,5 +1,5 @@
#
-# SPDX-FileCopyrightText: Copyright 2020,2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+# SPDX-FileCopyrightText: Copyright 2020, 2022-2024 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
@@ -17,18 +17,18 @@
# http://www.gnu.org/licenses/gpl-2.0.html.
#
-ccflags-y += -Werror
+ccflags-y += -Werror -I$(src)/include
obj-$(CONFIG_ETHOSU) = ethosu.o
-ethosu-objs := ethosu_driver.o \
- ethosu_buffer.o \
- ethosu_dma_mem.o \
- ethosu_device.o \
- ethosu_inference.o \
- ethosu_mailbox.o \
- ethosu_network.o \
- ethosu_network_info.o \
- ethosu_capabilities.o \
- ethosu_cancel_inference.o \
- ethosu_version.o
+ethosu-objs := common/ethosu_driver.o \
+ common/ethosu_buffer.o \
+ common/ethosu_dma_mem.o \
+ common/ethosu_device.o \
+ rpmsg/ethosu_rpmsg_cancel_inference.o \
+ rpmsg/ethosu_rpmsg_network.o \
+ rpmsg/ethosu_rpmsg_network_info.o \
+ rpmsg/ethosu_rpmsg_capabilities.o \
+ rpmsg/ethosu_rpmsg_inference.o \
+ rpmsg/ethosu_rpmsg_mailbox.o \
+ rpmsg/ethosu_rpmsg_version.o
diff --git a/kernel/ethosu_buffer.c b/kernel/common/ethosu_buffer.c
index 69b5007..cf41b8d 100644
--- a/kernel/ethosu_buffer.c
+++ b/kernel/common/ethosu_buffer.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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
@@ -21,11 +21,11 @@
* Includes
****************************************************************************/
-#include "ethosu_buffer.h"
+#include <common/ethosu_buffer.h>
-#include "ethosu_device.h"
-#include "ethosu_dma_mem.h"
-#include "uapi/ethosu.h"
+#include <common/ethosu_device.h>
+#include <common/ethosu_dma_mem.h>
+#include <uapi/ethosu.h>
#include <linux/anon_inodes.h>
#include <linux/dma-mapping.h>
diff --git a/kernel/ethosu_device.c b/kernel/common/ethosu_device.c
index 32fb012..f1e00ab 100644
--- a/kernel/ethosu_device.c
+++ b/kernel/common/ethosu_device.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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
@@ -21,17 +21,17 @@
* Includes
****************************************************************************/
-#include "ethosu_device.h"
-
-#include "ethosu_buffer.h"
-#include "ethosu_core_rpmsg.h"
-#include "ethosu_capabilities.h"
-#include "ethosu_inference.h"
-#include "ethosu_cancel_inference.h"
-#include "ethosu_network.h"
-#include "ethosu_network_info.h"
-#include "ethosu_version.h"
-#include "uapi/ethosu.h"
+#include <common/ethosu_device.h>
+
+#include <common/ethosu_buffer.h>
+#include <rpmsg/ethosu_rpmsg.h>
+#include <rpmsg/ethosu_rpmsg_cancel_inference.h>
+#include <rpmsg/ethosu_rpmsg_capabilities.h>
+#include <rpmsg/ethosu_rpmsg_inference.h>
+#include <rpmsg/ethosu_rpmsg_network.h>
+#include <rpmsg/ethosu_rpmsg_network_info.h>
+#include <rpmsg/ethosu_rpmsg_version.h>
+#include <uapi/ethosu.h>
#include <linux/dma-mapping.h>
#include <linux/errno.h>
diff --git a/kernel/ethosu_dma_mem.c b/kernel/common/ethosu_dma_mem.c
index cb63081..0e05978 100644
--- a/kernel/ethosu_dma_mem.c
+++ b/kernel/common/ethosu_dma_mem.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2023-2024 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
@@ -21,7 +21,7 @@
* Includes
****************************************************************************/
-#include "ethosu_dma_mem.h"
+#include <common/ethosu_dma_mem.h>
#include <linux/err.h>
#include <linux/dma-mapping.h>
diff --git a/kernel/ethosu_driver.c b/kernel/common/ethosu_driver.c
index 48d2155..15f13b5 100644
--- a/kernel/ethosu_driver.c
+++ b/kernel/common/ethosu_driver.c
@@ -1,5 +1,6 @@
/*
- * Copyright 2020-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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,10 +15,11 @@
* 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
*/
+#include <common/ethosu_device.h>
+#include <uapi/ethosu.h>
+
#include <linux/bitmap.h>
#include <linux/fs.h>
#include <linux/module.h>
@@ -26,9 +28,6 @@
#include <linux/of_address.h>
#include <linux/rpmsg.h>
-#include "ethosu_device.h"
-#include "uapi/ethosu.h"
-
/****************************************************************************
* Defines
****************************************************************************/
diff --git a/kernel/ethosu_buffer.h b/kernel/include/common/ethosu_buffer.h
index 8bef2d2..868e783 100644
--- a/kernel/ethosu_buffer.h
+++ b/kernel/include/common/ethosu_buffer.h
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020,2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020, 2022-2024 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
diff --git a/kernel/ethosu_device.h b/kernel/include/common/ethosu_device.h
index af14c85..e96543e 100644
--- a/kernel/ethosu_device.h
+++ b/kernel/include/common/ethosu_device.h
@@ -1,5 +1,6 @@
/*
- * Copyright 2020-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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
*/
#ifndef ETHOSU_DEVICE_H
@@ -25,8 +24,8 @@
* Includes
****************************************************************************/
-#include "uapi/ethosu.h"
-#include "ethosu_mailbox.h"
+#include <uapi/ethosu.h>
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
#include <linux/device.h>
#include <linux/cdev.h>
diff --git a/kernel/ethosu_dma_mem.h b/kernel/include/common/ethosu_dma_mem.h
index 11cdd39..eac4b42 100644
--- a/kernel/ethosu_dma_mem.h
+++ b/kernel/include/common/ethosu_dma_mem.h
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2023-2024 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
diff --git a/kernel/ethosu_core_rpmsg.h b/kernel/include/rpmsg/ethosu_rpmsg.h
index 0b7feab..c1923c2 100644
--- a/kernel/ethosu_core_rpmsg.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg.h
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2020-2023 Arm Limited.
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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
*/
#ifndef ETHOSU_CORE_RPMSG_H
diff --git a/kernel/ethosu_cancel_inference.h b/kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h
index a3982dd..1d6cc03 100644
--- a/kernel/ethosu_cancel_inference.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_cancel_inference.h
@@ -1,5 +1,6 @@
/*
- * Copyright 2022-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2022-2024 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
*/
#ifndef ETHOSU_CANCEL_INFERENCE_H
@@ -25,8 +24,8 @@
* Includes
****************************************************************************/
-#include "ethosu_mailbox.h"
-#include "uapi/ethosu.h"
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
+#include <uapi/ethosu.h>
#include <linux/types.h>
#include <linux/completion.h>
diff --git a/kernel/ethosu_capabilities.h b/kernel/include/rpmsg/ethosu_rpmsg_capabilities.h
index 30bf475..aefdbaa 100644
--- a/kernel/ethosu_capabilities.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_capabilities.h
@@ -1,5 +1,6 @@
/*
- * Copyright 2022-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2022-2024 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
*/
#ifndef ETHOSU_CAPABILITIES_H
@@ -25,7 +24,7 @@
* Includes
****************************************************************************/
-#include "ethosu_mailbox.h"
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
#include <linux/types.h>
#include <linux/completion.h>
diff --git a/kernel/ethosu_inference.h b/kernel/include/rpmsg/ethosu_rpmsg_inference.h
index 5040ef1..8bdfb8a 100644
--- a/kernel/ethosu_inference.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_inference.h
@@ -1,5 +1,6 @@
/*
- * Copyright 2020,2022-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2020, 2022-2024 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
*/
#ifndef ETHOSU_INFERENCE_H
@@ -25,8 +24,8 @@
* Includes
****************************************************************************/
-#include "ethosu_mailbox.h"
-#include "uapi/ethosu.h"
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
+#include <uapi/ethosu.h>
#include <linux/kref.h>
#include <linux/types.h>
diff --git a/kernel/ethosu_mailbox.h b/kernel/include/rpmsg/ethosu_rpmsg_mailbox.h
index ab19613..66eb172 100644
--- a/kernel/ethosu_mailbox.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_mailbox.h
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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
@@ -23,7 +23,7 @@
/****************************************************************************
* Includes
****************************************************************************/
-#include "ethosu_core_rpmsg.h"
+#include <rpmsg/ethosu_rpmsg.h>
#include <linux/types.h>
#include <linux/mailbox_client.h>
diff --git a/kernel/ethosu_network.h b/kernel/include/rpmsg/ethosu_rpmsg_network.h
index 5484bac..269018a 100644
--- a/kernel/ethosu_network.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_network.h
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020,2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020, 2022-2024 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
diff --git a/kernel/ethosu_network_info.h b/kernel/include/rpmsg/ethosu_rpmsg_network_info.h
index 8c2e659..aaa3733 100644
--- a/kernel/ethosu_network_info.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_network_info.h
@@ -1,5 +1,6 @@
/*
- * Copyright 2022-2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2022-2024 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
*/
#ifndef ETHOSU_NETWORK_INFO_H
@@ -25,7 +24,7 @@
* Includes
****************************************************************************/
-#include "ethosu_mailbox.h"
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
#include <linux/types.h>
#include <linux/completion.h>
diff --git a/kernel/ethosu_version.h b/kernel/include/rpmsg/ethosu_rpmsg_version.h
index c5c02ad..755a3d5 100644
--- a/kernel/ethosu_version.h
+++ b/kernel/include/rpmsg/ethosu_rpmsg_version.h
@@ -1,5 +1,6 @@
/*
- * Copyright 2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2023-2024 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
*/
#ifndef ETHOSU_VERSION_H
@@ -25,7 +24,7 @@
* Includes
****************************************************************************/
-#include "ethosu_mailbox.h"
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
#include <linux/types.h>
#include <linux/completion.h>
diff --git a/kernel/uapi/ethosu.h b/kernel/include/uapi/ethosu.h
index 8240ad9..58b9c34 100644
--- a/kernel/uapi/ethosu.h
+++ b/kernel/include/uapi/ethosu.h
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note
*
* This program is free software and is provided to you under the terms of the
diff --git a/kernel/ethosu_cancel_inference.c b/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
index 47687b8..5d46434 100644
--- a/kernel/ethosu_cancel_inference.c
+++ b/kernel/rpmsg/ethosu_rpmsg_cancel_inference.c
@@ -22,11 +22,11 @@
* Includes
****************************************************************************/
-#include "ethosu_cancel_inference.h"
+#include <rpmsg/ethosu_rpmsg_cancel_inference.h>
-#include "ethosu_core_rpmsg.h"
-#include "ethosu_device.h"
-#include "ethosu_inference.h"
+#include <common/ethosu_device.h>
+#include <rpmsg/ethosu_rpmsg.h>
+#include <rpmsg/ethosu_rpmsg_inference.h>
#include <linux/remoteproc.h>
#include <linux/wait.h>
diff --git a/kernel/ethosu_capabilities.c b/kernel/rpmsg/ethosu_rpmsg_capabilities.c
index 2c2d23a..73ce2dc 100644
--- a/kernel/ethosu_capabilities.c
+++ b/kernel/rpmsg/ethosu_rpmsg_capabilities.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2022-2024 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
@@ -22,10 +22,10 @@
* Includes
****************************************************************************/
-#include "ethosu_capabilities.h"
+#include <rpmsg/ethosu_rpmsg_capabilities.h>
-#include "ethosu_core_rpmsg.h"
-#include "ethosu_device.h"
+#include <common/ethosu_device.h>
+#include <rpmsg/ethosu_rpmsg.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
diff --git a/kernel/ethosu_inference.c b/kernel/rpmsg/ethosu_rpmsg_inference.c
index 3238d7e..b721fb7 100644
--- a/kernel/ethosu_inference.c
+++ b/kernel/rpmsg/ethosu_rpmsg_inference.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020,2022-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020, 2022-2024 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
@@ -21,13 +21,13 @@
* Includes
****************************************************************************/
-#include "ethosu_inference.h"
+#include <rpmsg/ethosu_rpmsg_inference.h>
-#include "ethosu_buffer.h"
-#include "ethosu_core_rpmsg.h"
-#include "ethosu_device.h"
-#include "ethosu_network.h"
-#include "ethosu_cancel_inference.h"
+#include <common/ethosu_buffer.h>
+#include <common/ethosu_device.h>
+#include <rpmsg/ethosu_rpmsg.h>
+#include <rpmsg/ethosu_rpmsg_cancel_inference.h>
+#include <rpmsg/ethosu_rpmsg_network.h>
#include <linux/anon_inodes.h>
#include <linux/file.h>
diff --git a/kernel/ethosu_mailbox.c b/kernel/rpmsg/ethosu_rpmsg_mailbox.c
index 005e83e..11ac414 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/rpmsg/ethosu_rpmsg_mailbox.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020-2024 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
@@ -21,13 +21,14 @@
* Includes
****************************************************************************/
-#include "ethosu_mailbox.h"
+#include <rpmsg/ethosu_rpmsg_mailbox.h>
-#include "ethosu_buffer.h"
-#include "ethosu_core_rpmsg.h"
-#include "ethosu_device.h"
-#include "ethosu_dma_mem.h"
-#include "ethosu_network.h"
+#include <common/ethosu_buffer.h>
+#include <common/ethosu_device.h>
+#include <common/ethosu_dma_mem.h>
+#include <rpmsg/ethosu_rpmsg.h>
+
+#include <rpmsg/ethosu_rpmsg_network.h>
#include <linux/atomic.h>
#include <linux/jiffies.h>
diff --git a/kernel/ethosu_network.c b/kernel/rpmsg/ethosu_rpmsg_network.c
index 58d5c77..f5b8265 100644
--- a/kernel/ethosu_network.c
+++ b/kernel/rpmsg/ethosu_rpmsg_network.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2020,2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2020, 2022-2024 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
@@ -21,13 +21,13 @@
* Includes
****************************************************************************/
-#include "ethosu_network.h"
+#include <rpmsg/ethosu_rpmsg_network.h>
-#include "ethosu_device.h"
-#include "ethosu_dma_mem.h"
-#include "ethosu_inference.h"
-#include "ethosu_network_info.h"
-#include "uapi/ethosu.h"
+#include <common/ethosu_device.h>
+#include <common/ethosu_dma_mem.h>
+#include <rpmsg/ethosu_rpmsg_inference.h>
+#include <rpmsg/ethosu_rpmsg_network_info.h>
+#include <uapi/ethosu.h>
#include <linux/anon_inodes.h>
#include <linux/file.h>
diff --git a/kernel/ethosu_network_info.c b/kernel/rpmsg/ethosu_rpmsg_network_info.c
index 011a0b4..0e54d87 100644
--- a/kernel/ethosu_network_info.c
+++ b/kernel/rpmsg/ethosu_rpmsg_network_info.c
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2022-2024 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
@@ -21,12 +21,11 @@
* Includes
****************************************************************************/
-#include "ethosu_network_info.h"
+#include <rpmsg/ethosu_rpmsg_network_info.h>
-#include "ethosu_device.h"
-#include "ethosu_network.h"
-#include "ethosu_mailbox.h"
-#include "uapi/ethosu.h"
+#include <common/ethosu_device.h>
+#include <rpmsg/ethosu_rpmsg_network.h>
+#include <uapi/ethosu.h>
#include <linux/bug.h>
diff --git a/kernel/ethosu_version.c b/kernel/rpmsg/ethosu_rpmsg_version.c
index 1a92dc2..03e164b 100644
--- a/kernel/ethosu_version.c
+++ b/kernel/rpmsg/ethosu_rpmsg_version.c
@@ -1,5 +1,6 @@
/*
- * Copyright 2023 Arm Limited and/or its affiliates
+ * SPDX-FileCopyrightText: Copyright 2023-2024 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,17 +15,14 @@
* 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
*/
/****************************************************************************
* Includes
****************************************************************************/
-#include "ethosu_version.h"
-
-#include "ethosu_core_rpmsg.h"
+#include <rpmsg/ethosu_rpmsg_version.h>
+#include <rpmsg/ethosu_rpmsg.h>
#include <linux/errno.h>