Skip to content
  1. Apr 23, 2024
  2. Apr 18, 2024
  3. Apr 16, 2024
    • Mikael's avatar
      Change remoteproc to map ROM as device memory · 4bfd9873
      Mikael authored
      
      
      The ROM is memory attached to the remote processor and should be mapped
      as device memory rather than normal memory to ensure memory transactions
      are handled correctly. To ensure this, the remoteproc driver will now
      map the ROM as device memory.
      
      Change-Id: I1b5f1dcd7af06bb9e1656f653d65813f7af424c3
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      4bfd9873
  4. Apr 08, 2024
  5. Apr 04, 2024
    • Mikael's avatar
      Add IOCTL command names to driver library logging · b2f4a2cd
      Mikael authored
      
      
      Currently the driver library will log IOCTL commands as hexadecimal
      values, which makes it hard to know what command is being logged unless
      you know the command values. To make this easier, the driver library
      will now translate the command values into their respective names when
      logging.
      
      Change-Id: I7ef2f411b0261ea7819c1a7a6825422859031a25
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      b2f4a2cd
  6. Feb 29, 2024
  7. Feb 21, 2024
    • Mikael's avatar
      Fix UAPI device type naming and validation · e43c8c26
      Mikael authored
      
      
      The device types in the UAPI have been renamed to follow the UAPI
      namespacing and driver library validation has been added to ensure the
      driver library and UAPI device enum values match.
      
      The kernel and driver library version have been given a major bump for
      the introduction of the device type in the capabilities.
      
      Change-Id: Ib782b0bd7a8641db88521f8be399f709d2d73816
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      e43c8c26
  8. Feb 19, 2024
  9. Feb 12, 2024
    • Mikael's avatar
      Rename macros and types to namespace their usage · 16be2855
      Mikael authored
      
      
      Macros and types have been renamed accordingly to namespace them by
      their usage in the new kernel driver source tree structure.
      
      This is done in a separate commit from the restructuring to avoid Git
      from seeing some of the moved files as new ones because they have been
      both moved and modified at the same time and thus losing the connection
      in the history.
      
      Change-Id: Icd4d8e8c76779479b5b46a55bf1d4f78a629c281
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      16be2855
    • Mikael's avatar
      Restructure kernel driver source tree · d4ad9e55
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      d4ad9e55
  10. Jan 16, 2024
    • Mikael's avatar
      Add Sparse and build test information to README · 09cdc30b
      Mikael authored
      
      
      To make it easier to build the driver stack, the README now specifies
      the minimum required Sparse version needed and how the driver stack has
      been build tested.
      
      Change-Id: I1676ff8333da0f752badbf366229bf3d65ee4657
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      2 tags
      09cdc30b
    • Mikael's avatar
      Fix inference cancellation behavior · 6d5e2d28
      Mikael authored
      
      
      There is currently a possible race when canceling an inference, where
      the inference may be the one currently running and a response will be
      sent later or the inference response is already in the mailbox queue. To
      handle these cases, the kernel will no longer process the inference
      response for an inference that has been marked as aborted or is in the
      process of being aborted.
      
      Change-Id: Ifcd86591b09075f994ed2e903cb11ba7c0ee0418
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      6d5e2d28
    • Mikael's avatar
      Remove reject inference test · 3918eeab
      Mikael authored
      
      
      Rejecting an inference is not supported so the test for rejecting an
      inference has been removed.
      
      Change-Id: Ia175559bb9945af0446aa8c3990760aa2208538b
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      3918eeab
  11. Dec 20, 2023
    • Mikael's avatar
      Change PMU event counter values to use 64-bit · e87446c9
      Mikael authored
      
      
      The PMU event counter value is an accumulation of 32-bit values during
      the inference and to ensure the total value fits in the rpmsg message
      and UAPI, the variable holding the value has been changed to 64-bit.
      
      The driver library, Python wrapper and inference runner have been
      changed accordingly to support the 64-bit values.
      
      Change-Id: I09a8e45eb75800c8a787f83abff5a3693148cc15
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      e87446c9
  12. Nov 20, 2023
  13. Nov 14, 2023
    • Mikael's avatar
      Make all kernel module Sparse warnings into errors · 47e9bd01
      Mikael authored
      
      
      The CMake files for the kernel modules have been updated to treat all
      Sparse warnings as errors so that warnings cause the build to fail.
      
      Change-Id: I3682afc3beea7244bb6e0831b2baf48b95611dbc
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      23.11-rc2
      47e9bd01
    • Mikael's avatar
      Fix NPU driver inference poll callback return type · b6824310
      Mikael authored
      
      
      The poll file operation function pointer is expected to return the
      __poll_t type but the currently implemented poll inference function
      returns an unsigned int. This breaks the type safety and causes Sparse
      to generate a warning.
      
      To resolve this, the return type has been changed to __poll_t and the
      function now uses with EPOLL constants that share the same type.
      
      Change-Id: I41dadb758c7c4b42b431d96a94c6b2cc9f960013
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      b6824310
    • Mikael's avatar
      Fix device id data ptr using 0 instead of NULL · c4ec925d
      Mikael authored
      
      
      In some of the kernel modules, 0 is used instead of NULL to indicate
      that there is no data in the of_device_id struct. These instances have
      now been replaced with NULL instead.
      
      Change-Id: I14f4aabf266bb5144107e101006e257bb7876782
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      c4ec925d
    • Mikael's avatar
      Make internal functions static in kernel modules · 404a536f
      Mikael authored
      
      
      Internal functions in some of the kernel modules were not marked as
      static and have now been fixed.
      
      Change-Id: Ibec000e4370f2438e7190a9178e05513fcccda26
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      404a536f
    • Mikael's avatar
      Fix iomem pointer usage with rproc_mem_entry_init · 9f176ba0
      Mikael authored
      
      
      The carveout memory is being mapped with one of the ioremap functions
      that returns a iomem pointer and should normally only be passed to
      functions that request iomem pointers because they shouldn't be
      dereferenced.
      
      Currently, the iomem pointer is passed to rproc_mem_entry_init that is
      expecting a normal pointer and Sparse is generating a warnings about
      this. However, rproc_mem_entry_init won't dereference the pointer and
      can handle any pointer type so the iomem attribute is cast away when
      setting up the mem entry and the io_mem flag is set to indicate a iomem
      pointer.
      
      To ensure that the mapping is correctly managed, the mapping and
      unmapping is now handled with the callback functions for
      rproc_mem_entry_init instead of holding onto the mapping forever.
      
      Change-Id: I511a9a16f110a23490141dd3db943244e0f978e2
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      9f176ba0
  14. Nov 06, 2023
    • Mikael's avatar
      Ensure rpmsg channel name is null-terminated · 9fdbf1e0
      Mikael authored
      
      
      Currently when the rpmsg channel name is copied from the rpmsg device,
      the full size of the name array is given to strncpy. This means if there
      is no null-terminator in that size, the name will be left unterminated.
      To ensure that the name is always null-terminated, the size given to
      strncpy is now decreased by one and the name array is zero initialized.
      
      Change-Id: I73b4b597f51a63e5dac23945735f307cb1035e25
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      23.11-rc1
      9fdbf1e0
    • Mikael's avatar
      Change create network UAPI to take a user buffer · c081e595
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      c081e595
    • Mikael's avatar
      Split DMA memory and buffer setup in kernel driver · 9c999fdd
      Mikael authored
      
      
      To allow the NPU kernel driver to allocate and use DMA memory internally
      without creating a buffer instance, the DMA memory management has been
      split out from the buffer code.
      
      Change-Id: I46fdeee51b5ef786a54b8e7c866d137d91222724
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      9c999fdd
    • Mikael's avatar
      Remove buffer capacity, offset and resize in UAPI · 07545150
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      07545150
    • Mikael's avatar
      Fix type validation in the network create UAPI · 45d47991
      Mikael authored
      
      
      Currently, the network create UAPI will assume that any network type
      that isn't a buffer is an index. This means that the Linux kernel NPU
      driver will accept any network type value and the user won't get any
      feedback that they have specified an incorrect type.
      
      To resolve this, the Linux kernel NPU driver will now return -EINVAL if
      an unknown network type is given and a test has been added to validate
      this behavior.
      
      Change-Id: Ib7d9f5d5451897787981aae61a4e0a6650a73e05
      Signed-off-by: Mikael's avatarMikael Olsson <mikael.olsson@arm.com>
      45d47991
  15. Nov 03, 2023
  16. Nov 01, 2023
  17. Oct 10, 2023
  18. Oct 06, 2023
    • Mikael's avatar
      Add -Werror to kernel module builds · 6e0778ab
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      6e0778ab
    • Mikael's avatar
      Fix C90 declaration order warning in remoteproc · f1b23f3b
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      f1b23f3b
  19. Sep 25, 2023
    • Mikael's avatar
      Fix DMA configuration in NPU Linux kernel driver · 53d224ab
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      53d224ab
    • Mikael's avatar
      Add resource table entry for address translation · 9d0ea8bc
      Mikael authored
      
      
      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's avatarMikael Olsson <mikael.olsson@arm.com>
      9d0ea8bc
  20. Sep 15, 2023
Loading