Age | Commit message (Collapse) | Author |
|
To ensure that no compilation warnings goes unnoticed, the kernel
modules are now built with the -Werror flag so all warnings are treated
as errors.
Change-Id: Id688052bd297e366ab7ca07c508ca697ca03431e
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
A "declaration-after-statement" warning is generated when building the
remoteproc driver because C90 doesn't allow variables to be declared
after a statement in a scope.
To resolve this, the order of the variables at the start of the
problematic scope have been reordered to comply with C90.
Change-Id: Id7fec564858168fd71cd10af9c99340691484b89
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
Currently, when the NPU driver allocates buffers for the NPU subsystem,
it does not provide DMA addresses that can be used by the subsystem.
Instead, the DMA address is set to the Linux Kernel physical address and
must be translated by the firmware before use.
The correct DMA address is not provided because the device instance
created by the NPU driver has not been DMA configured so it does not
know about the subsystem's address requirements.
To resolve this, the device will now inherit the DMA configuration from
the parent rproc device.
Change-Id: Ibcbf30e812e72ebf8672bbe9dde3a9f9abdaa417
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
To avoid having to use a hardcoded memory map to translate between the
Linux physical addresses to device addresses in the firmware, a new
entry type has been added to the resource table that allows the NPU
remoteproc driver to provide the memory map to the firmware.
With this change, the device tree layout has been changed to wrap the
ethosu-rproc node with an ethosu parent node that represents the NPU
subsystem. This makes it possible to use the APIs provided by the Linux
kernel to perform address translation etc.
The "ethosu,dma-ranges" property has been removed from ethosu-proc
because the ethosu parent node provides information for how to translate
between the Linux Kernel physical addresses and device addresses with a
"dma-ranges" property.
Change-Id: I48719ee808a5e9391c5a3e967042d26dd92d5026
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
Support for a new reset controller that identifies itself with ID
0x20113 has been added in the Juno FPGA reset driver.
The driver version has been given a minor version bump to indicate the
new support.
Change-Id: Ife21d8b2c97d68eea3c4780c4124aac136b36c0b
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
There were some places in the Juno FPGA reset driver that did not follow
the Linux kernel code style which have now been fixed.
Change-Id: I0316b23b99fde05068ba5e50442a6cb5b5ea8214
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
Currently, the mailbox uses the rpmsg_send function to send messages,
which will block for up to 15 seconds if there is no TX buffer available
for the message. This is an issue because the device mutex is locked
while waiting and the receive callback for messages uses the same mutex
to prevent concurrent access so no received messages can be handled
while waiting for a TX buffer.
To resolve this, the mailbox has been changed to use the rpmsg_trysend
function, which will return directly if there is no TX buffer available,
together with a wait queue. While waiting in the queue to send the
message, the device mutex is released to not block the receive callback
and other users of the mutex.
Change-Id: I34fbfd21167b49fb83744ab2473ab02632a809ee
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
Instead of locking the device mutex for all IOCTL calls to the NPU
device, the mutex will now only be locked for the calls that have
resources that must be protected from concurrent access. IOCTL calls
that only copy static data do not need to lock the mutex.
The same device mutex is used for all concurrent access protection in
the driver, including the mailbox handling, so removing unnecessary
locking decreases the need to wait for the mutex.
Change-Id: Ic606fe0e1db4aa2e3d4e579ada74418491546468
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
When an inference request fails, the mailbox message registered for the
request is not unregistered, causing the mailbox's IDR to be left with
an entry for the message with a dangling pointer to the freed inference.
The dangling pointer later causes the mailbox clean up to crash when it
attempts to call the fail callback for the IDR entry.
The clean up for a failed inference request has now been fixed so it
unregisters the message from the mailbox.
Change-Id: Ida8015c88afee9cad074289be4d65947854c9e6b
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
To not leak any information from kernel space when IOCTL calls copy data
from kernel space to user space, the source struct in the IOCTL calls is
now initialized.
Change-Id: I0825e82ccdb51ced747e160dd7385fa1ed227eaf
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
The network info IOCTL call doesn't use any information from the user
provided struct so there is no need to copy the struct to kernel space.
Change-Id: I3f58a80ab9377e4ae39fc29068de6fd6bc3d539c
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
In some cases, the IOCTL functions didn't update the return value
variable so the wrong value was returned from the IOCTL calls.
Change-Id: I56529f8fb03cec52dbc555d5ed3d4e68e4bfab70
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
When an IOCTL call fails in the driver library, the failure exception
only states "IOCTL failed" without any further information. To make it
easier to see what IOCTL call failed and why, the exception will now
include the command that failed and the reason for the failure.
Change-Id: Ife4957d2c0d692b3fcdbdc72538690d50385d365
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
To make it easier to detect why a network info request failed, logs have
been added to the network info response error handling.
Change-Id: I88d98e08501711912d10068344cef62634ac3889
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
To ensure that the description string in the network info response is
correctly null-terminated and that the string will fit into the UAPI
struct. The kernel will now check for the null-termination and verify
that the UAPI struct can hold the expected string size.
Change-Id: I8097a04c6ee4e80f1ab62a66e7323d2462c2c23a
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
The variable used for the return value from the rpmsg callback to handle
mailbox messages isn't initialized when handling some message types.
To resolve this, the variable is now initialized by default.
Change-Id: I7862a6bc3479f03ca06536d94eb4478263e49b70
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
To not leave behind any data in memory from buffers, inferences and
networks, the memory allocated for them is now cleared before it is
freed.
Change-Id: I68c221b190e78f9b4c5022016c38f4ced5e78166
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
A version has been added to the driver library so users can check if
they are compatible with the driver library in use.
The Python wrapper has been updated accordingly to make the version
information available.
Change-Id: I8affbf7068c057f7103adf14c9e4a331d547fbcc
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
The driver library will now check that it's compatible with the kernel
driver in use by checking the kernel driver's version.
The kernel driver version has also been made available to the library
users and the Python wrapper has been updated accordingly.
Change-Id: Ieae8c0bfc323f945038e7264eceeab90c833f76d
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
The kernel driver's version is now exposed in the UAPI so the UAPI user
can validate that they are compatible with the kernel driver in use.
Change-Id: I52d096dfaedb8c3c1889d27a907626be96779ee7
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
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>
|
|
The current implementation of the protocol version request IOCTL call
doesn't return any version information and the protocol version is not
needed by any userspace program as it's for the communication between
the Linux kernel NPU driver and firmware. The IOCTL call has therefore
been removed from the UAPI and the inference runner has been updated
accordingly.
Change-Id: I9ed09e55d9522996a182f237c8a6db2f45bc40a9
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
The IDR instance must be protected against concurrent access and the
device mutex in the kernel driver should be used to protect it. However,
the device mutex is not locked when an inference is released or when the
mailbox is cleared which means the IDR is not protected in these
instances.
To resolve this, the missing mutex locks have been added and the
functions using the IDR instance have been updated to make it clearer
that the device mutex is expected to be locked when called.
Change-Id: Id0b314db556836c36663d6481806b7c113e55e5f
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
Add missing `WITH Linux-syscall-note` to the ethosu.h UAPI header file
Change-Id: Ie7abf81108d85faab963a262a27f93c02064e4dd
Signed-off-by: Jonny Svärd <jonny.svaerd@arm.com>
|
|
If an error occurs after the kernel driver probe has created a rpmsg
endpoint, the endpoint is not freed during the clean up.
Clean up code for the endpoint has now been added to resolve this.
Change-Id: I9259713f2b7dcf4926e6f317c57f2791ab3463de
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
If the probe function is past the NPU device registration when a failure
occurs, the device instance will be freed twice causing a crash. This
occurs because the device's release callback will free the device
instance when the device is unregistered and then the probe clean up
will attempt to free it again.
To resolve this, the probe will now only directly free the device
instance if the registration fails and otherwise let the device's
release callback handle it.
Change-Id: Iafe87e7ca44b91f8e0e2e870106a4b8c2a69dd8f
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
If the rpmsg channel to communicate with the subsystem is not available
until after the NPU kernel driver has been registered, the driver's
probe function will be called from the rpmsg message receive callback
and block handling of any other messages until the probing is done.
To avoid blocking the callback while performing the probing and to allow
the probe to communicate with the subsystem, the kernel driver will now
request that its probe function is called asynchronously.
Change-Id: Iaeaa4a2322f6a76c0acd202e69b91a8beeb6114b
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
|
|
When the kernel driver handles incoming rpmsg messages, it uses the ID
in the message header to find the corresponding mailbox message. The
mailbox messages are stored as a generic message struct that is later
cast to the specific message type.
There is currently no type information stored in the generic message
struct so only the ID is used to distinguish between the mailbox
messages. This means if an incorrect ID is received that matches a
mailbox message with a different type, the kernel driver will cast the
message struct to the wrong type.
Type information has now been added to the generic message struct and
will be checked when trying to find the corresponding mailbox message so
both the ID and type must be correct to find a matching message.
Change-Id: Ifdbceea6ec4ae7078f424a32ce1ff5474bd22fef
|
|
To not have to fetch the capabilities from the device for each time they
are requested with the UAPI, the kernel driver will now fetch and save
the capabilities during the device initialization and use the saved copy
for the UAPI requests.
With this change, the character device creation in the device
initialization has been moved to be the last step so the capabilities
are fetched and saved before the character device is created.
Change-Id: I57956aedb983fbc1765d45906a1c6182e2cd5b96
|
|
When IOCTL calls are handled and when sending messages to the mailbox,
the device mutex is locked. However, when received mailbox messages are
handled, the mutex is not locked so there are possible concurrent access
races in shared states e.g. an inference's status may be updated while
another IOCTL caller is reading it.
To avoid these races, the mutex is now locked while messages received
from the mailbox are handled.
Change-Id: I4d51da542410ab02fb0f890c939269c642176b2c
|
|
The kernel driver will now verify the magic value in an incoming
message's header before any further processing of the message is
performed to avoid trying to handle an invalid message.
Change-Id: I7ae1cac19a6fe4b78316decff4ca2147175ee07a
|
|
When the kernel driver creates the Ethos-U device, it doesn't setup the
coherent DMA mask. This causes the kernel to generate a warning the
first time any of the coherent DMA functions are used and the kernel
will end up using a default DMA mask.
To ensure that the device uses the correct DMA mask and to no longer get
the warning, the kernel driver will now setup the DMA mask for the
device.
Change-Id: I92c67c85be1754970412da92161dbf1ec993bca3
|
|
To support cross-compilation of the driver library Swig C wrapper for
the Python API, the CMake file must pass on the C and CXX flags that
have been setup by the build environment so that the correct flags,
include paths etc are used when building the wrapper.
Change-Id: I6288016056c5a4eeef1162ea2a9afb1e3ab4b86a
|
|
The ETHOS_U_DRIVER_LIB environment variable in the Python API CMake file
specifies that the driver library archive will be found in a lib
subdirectory in the build directory. This is incorrect as the archive
will be put directly into the driver library directory and the CMake
file has been updated accordingly.
Change-Id: Ie296f89f7669d69f193d96d994ad8e1918e3d1eb
|
|
The CMake file for the Python API, currently fails to copy the license
file to the build directory because it incorrectly assumes that the file
is in the Python API folder.
The license file that should be used is in the top of the repository and
the CMake file has been updated accordingly.
Change-Id: Ia0131cc27abdf28d355c69a556229691901971e5
|
|
Change-Id: I64151321ac4a020045de5802beb29fe0013a5c3f
|
|
Add aarch64-none-linux-gnu toolchain file
Change-Id: I04742a8e0478f31087ea9c0d5a7d62c7e07bf4f4
|
|
Change-Id: Id5349a7668ff7ce4d23730d98aa9bd5032a1ece2
|
|
Change-Id: I3d7926cb16b613f588ef33944546df394193160e
|
|
The Ethos-U kernel driver has been converted into a rpmsg driver and
the ethosu_core_interface.h has been replaced by ethsou_core_rpmsg.h.
Change-Id: If6db8c20cd88e950545eed561ed95c067157d061
|
|
When the Ethos-U kernel driver is probed it creates a /dev/ethosu<nr>
device node, which user space use ioctl to communicate with. When
the driver is removed the Ethos-U resources must live on until all
open file handles have been closed.
The rpmsg device can be removed for a number of reasons, for example
if the firmware is stopped or the remoteproc driver is removed. To
allow the remove to complete without waiting for all file handles to
close, a new 'struct device' is created by the kernel driver. This
device will be used to memory allocations and will live on until the
last file handle has been closed.
Change-Id: I790d8219960f25fe64f58c11a865eb65c7b08974
|
|
The 'struct ethosu_device' has been passed as argument to classes.
This creates a circular dependency dependency and it gives all
classes full visibility to all resources in the device struct. This
patch removes the circular dependency.
Using device_lock() and device_unlock() to for synchronization.
Change-Id: I8322e6530c72d7bd67f48f411b4f14b612be2706
|
|
The Ethos-U kernel driver has been converted from a
platform driver with a custom firmware interface into a
rpmsg driver.
Change-Id: I9ae449f5e79eb02924e6630611d0893e5fec86be
|
|
Removing watchdog and firmware reset as a preparations for the
migrations to rpmsg.
Change-Id: Ic1053e3f4301ecadbde8c59dbaed437625a0a5ea
|
|
Tie in mbox and reset driver and add support for virtio carveouts.
Also move the reserved mem for device mem to the remoteproc node.
Change-Id: I7e8878d32ae7c02d5b43198e45652e77f8ff79ca
|
|
Change-Id: If27999db4f18355b571b67e5e5d663a703c3f6a3
|
|
Change-Id: Id70e249448cea13cb9273d68c91080342d5c5973
|
|
Change-Id: I1ab89146bf897c4c35180ab09f08064511f573f8
|
|
Change-Id: I69d0acf67327424809397f5fcf236b99bc980d71
|
|
Python `ethosu_driver` could be built as part of Arm Ethos-U Linux
driver library CMake flow.
See driver_library/python/README.md for more details.
Change-Id: I177a890add5c13df9a839f4f43621f972afe5ab1
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
|