aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
43 hoursFix pointer-to-int-cast compiler warningHEADmainRajasekaran Kalidoss
A void pointer(fast_memory) was type casted to uint64_t. This resulted in a compiler warning [-Wpointer-to-int-cast]. This patch fixes the warning. Change-Id: I61d4a77664c7a2af7b9020f8a98c10d27c78334f Signed-off-by: Rajasekaran Kalidoss <rajasekaran.kalidoss@arm.com>
5 daysFix compiler warnings in core_drivermasterRajasekaran Kalidoss
This patch fixes warning messages reported by the compiler related to argument format and type mismatch. Change-Id: I0ed528649414555f3136e745f37a78344a2b0add Signed-off-by: Rajasekaran Kalidoss <rajasekaran.kalidoss@arm.com>
6 daysVerify return value of pmu_event_value() callsJonny Svärd
Make sure that pmu_event_value returns a valid PMU event value before writing to PMU HW registers. Change-Id: I546493a7870fc73ef2b7269cd4d7be4072c3cebf Signed-off-by: Jonny Svärd <jonny.svaerd@arm.com>
9 daysAdd missing mutex/semaphore prototypes to headerJonny Svärd
Add missing ethosu_semaphore_destroy and ethosu_mutex_destroy function prototypes to the driver header. Change-Id: I16f71637b624964bbd9281ce8ad984304fedb406 Signed-off-by: Jonny Svärd <jonny.svaerd@arm.com>
2023-12-19Support timeout for interrupt semaphore24.02-rc124.02Jonny Svärd
Introduce ETHOSU_INFERENCE_TIMEOUT CMake variable to set an arbitrary timeout value that will be sent as argument to ethosu_semaphore_take() for the interrupt semaphore. Adding the ability to have a timeout for an inference. (Defaults to no timeout/wait forever.) Implement a placeholder mutex for the baremetal example and add error checks for mutex_create() call. Change-Id: Ia74391620340a27c23dc3d15f9ba742c674c8bfa Signed-off-by: Jonny Svärd <jonny.svaerd@arm.com>
2023-10-11Add option to turn off logging completely23.11-rc223.11-rc123.11Jonny Svärd
Add new ETHOSU_LOG_ENABLE variable in the CMakeLists.txt to toggle logging completely off, or else by the desired severity level. Turning off the logging will also disable the LOG() macro. Change-Id: I313a97fb1569000ae22637734ef4a60eedc56f70 Signed-off-by: Jonny Svärd <jonny.svaerd@arm.com>
2023-04-04CMakeLists: Define ETHOSU macro23.08-rc223.08-rc123.0823.05-rc223.05-rc123.05Jonny Svärd
Change-Id: Iebbf8243fe97cc9195920e1ba3f4b35005e7c01a
2023-02-16Fix (part of) SEI CERT coding standard warning23.02-rc223.02Ledion Daja
Change-Id: Ic370f071eb4f3ed83cd9e5a6b587d7d527c37825
2023-01-20Rework mutex/semaphore code23.02-rc1Jonny Svärd
Improve the mutex protection around shared data Rework so that registering a driver gives a semaphore to the driver semaphore count, deregistering it takes it (removes one from the count) of available driver handles. Change-Id: I9b74ed87b9371490d0ffcc8516f65bcab56d05bb
2022-11-14Update header file documentation22.11-rc222.11Kristofer Jonsson
Update documentation in driver header file. Some functions were inconsistently returning boolean status. These functions have been updated to return integer status, with 0 on success and negative error code on failure. Change-Id: Ie044bf5b4f2daaff348e698fa6147472dbc582a9
2022-11-14Remapping command stream and base pointersKristofer Jonsson
Add new weak function ethosu_address_remap() that allows the addresses for QBASE and BASEP to be remapped. Change-Id: I36b0d71c57bfd293672b10c7b85f3b2415e9c839
2022-11-04Update README how to contributeKristofer Jonsson
Change-Id: I68660361c7af062ac76a38f86c118ddc74e1c0d6
2022-10-03Reading QREAD and STATUS register22.11-rc1Kristofer Jonsson
Allow the QREAD and STATUS registers to be read using the PMU interface. Change-Id: I7e349a0938404011588c1d5eb82b4a5dbc7c27e4
2022-05-25Clarify README regarding CPU choice22.08-rc222.08-rc122.0822.05Jonny Svärd
Currently TARGET_CPU should be used to set CPU+features, if using core_platform provided toolchain files. Change-Id: I053cc25de12501a2773238820daa150f9ea20fa7
2022-05-13Set default configuration22.05-rc322.05-rc2Kristofer Jonsson
Base address 1 points at the TFLM arena and is by default routed over AXI 0. For the spilling use case with both model and arena in DRAM it would make more sense to route base addresses 0 and 1 over AXI 1. For Ethos-U65 the default settings should correspond to the spilling use case. The AXI limits should have different max values depending on the NPU architecture. Change-Id: Icd317097e2cfdbfb39886e13c2cb2202651e5357
2022-05-05Refactor power handling22.05-rc1Jonny Svärd
Add reference counted ethosu_request_power(), ethosu_release_power() functions. While there are active requests, disable the Q-channel power gating of the Ethos-U device, leaving the device powered on. Note that clock gating is implemented to follow the state of the power gating. Add ethosu_soft_reset() function. Restore power- and clock gating state after reset. Refactor and simplify driver code to use the new functions. Change-Id: I9756572c5c3e51b2be244bcea856d88e890e2d40
2022-04-20Change mutex and semaphore handling weak functions prototypeLedion Daja
Changed mutex lock/unlock and semaphore take/give functions to return an int value instead of void. Change-Id: I619327b9e14a3c37697617cbe0cba358102bd6a0
2022-04-12Update the documentationDavide Grohmann
- Improve build section by describing new build options - Add a section about driver APIs and basic usage examples - Add a section about mutexes and semaphores - Add a section about begin/end inference callbacks - Add a brief section about driver implementation design - Fix markdown title/subtitles structure - Small fixing of typos and rewording Also add .gitignore Change-Id: I7216a2b72b0dfaa605620f4344da205235339ddb
2022-03-31Add driver async APIJonny Svärd
Add an asynchronous API to the driver. The current synchronous API is now using the new async API internally. The main new functions are ethosu_invoke_async() and ethosu_wait(). Every successfull call to ethosu_invoke_async() must be followed by a call to ethosu_wait() to get the status of the inference. The wait function can be called in a blocking or non-blocking mode by specifying the `block` argument to true/false. The regular synchronous invoke function is implemented as a invoke_async followed by a wait(block=true) call. Short sommary of changes: - Add an internal ethosu_job struct to keep track of inference data and job state. - Use async API in blocking mode for normal flow - Change default semaphore implementation to binary type - Move error prints out of interrupt context - Move ethosu_inference_begin() callback to right before HW invoke - Always call ethosu_inference_end() callback, even in case of errors - On NPU error, do not keep NPU powered after being reset Change-Id: If4c3c46e3c6732a669e17251bd848dea5765a490
2022-02-08Fixing compilation warning22.02-rc322.02-rc222.02-rc122.02Kristofer Jonsson
Change-Id: I155d79a87f9a9a0dc26c145415cc7cdd19533639
2022-02-08Renaming Zephyr module to hal_ethos_uKristofer Jonsson
Change-Id: If1bf2aa428bc906f8ba36a011fa3401151ce6b92
2022-01-28Inference begin and end user argumentKristofer Jonsson
Adding user argument parameter to invoke() which is passed on to the inference_begin() and inference_end() callbacks. Change-Id: I1372767c3a0dbd963aa395911bda7625bc6d6ee4
2022-01-18Add product type verificationJonny Svärd
Remove redundant shram_size check as its a function of product type and number of macs Change-Id: Ia3bac0cf38da51d0894c3f1f94b02c59823e6034
2021-12-22Add func to get nbr of PMU event countersJonny Svärd
Small bugfix to a print in driver Change-Id: I277a441a9f65c647c338b92af5a908176929102c
2021-12-08Minor bugfixes and clean upJonny Svärd
Change error message to LOG_ERR from LOG_DEBUG and simplify error checks Remove redundant code in driver Disable the PMU before enabling power/clock gating Change-Id: I3092113250c1b165d985194ca2da213622629488
2021-12-06Fixing compiler warningsKristofer Jonsson
Change-Id: I287eef0cff78109a66d132fad283cb910be67f63
2021-11-30Support of tflu application using ethosu and Zephyravishi01
move the zephyr basic files to zephyr/modules/ethos-u-core-driver and update the module name in module.yml to ethos-u-core-driver move relevant cmake configuration to the CMakeLists.txt (from the applications CMakeLists.txt). Change-Id: I5b801ed06ffcfeb618fdb375c0c81b59b8ee4b1e
2021-11-18Remove new line from log messages21.11-rc321.11-rc221.11Kristofer Jonsson
Remove new line from log messages to allow the log makros to format the output. Change-Id: Idc07d0ef1fb77530fa07279ae92b2c964ebb6287
2021-11-18Fix PMU event order to comply with interface filesJonny Svärd
Change-Id: I9e460e25e4c8ea4a86b460dbf4c634afb912b4de
2021-11-16Update Ethos-U55/U65 interface filesJonny Svärd
Change-Id: I33bb705ae0be282c071977d5077cdaf3093e90fe
2021-11-05Fix incorrect enum type used21.11-rc1Jonny Svärd
No functional change as they both evaluate to the same numerical value. Change-Id: Ia84c19e08defa63067755389857c967698127d8c
2021-11-01Autumn clean/refactor of NPU driverJonny Svärd
A continuation of the spring clean/refactor work. Create a better separation between driver and device(s). A short summary of what this commit contains: - Split device and driver - Simplify and hide the internal device interface - Remove (broken) abort inference functionality - Refactoring of structure - Optimizations and bugfixes Change-Id: I8988bc5f163f9ea62add2a933e4f100a82cc8d35
2021-09-07Remove unnecessary use of designated initializerJonny Svärd
Change-Id: I16de9223e59e46ad9fb25bd280a175cd50af913d
2021-08-31 Zephyr module files:Kristofer Jonsson
1. Update init.c: - Create a new flow using DT_INST_FOREACH_STATUS_OKAY() macro. This macro will: - parse each node in dtb file for each npu - run "init" function with dts params - run ethosu_init() - enable irq Change-Id: Iaf370d258e0521a133ae38f2df66f93c249754f9
2021-07-08Improved Logging - Core Driver logging clean up21.08-rc321.08-rc221.08-rc121.08Anton Moberg
Made a separate header file for logging specific content. Cleaned up logging messages. Change-Id: Id329b40977156ca5b954b3a222effaedbc6b2a2c
2021-06-28Revert "Remove static inline v2 function"Kristofer Jonsson
This reverts commit 49a81c148e3c55cf97d7eb79e22a1d1f5504a97d. Reason for revert: Dependency on other modules. Change-Id: Iac8e63144dce92c4fc07caffcb74b1ce9f26800c
2021-06-14Remove static inline v2 functionAnton Moberg
Updated tensorflow to use default entrypoint and so this static inline function is no longer necessary. Change-Id: I2cd4e9cc87a4e8cffd2f67e27149782ea9519c05
2021-06-14Add ethosu_deinit()Anton Moberg
Added ethosu_deinit method which calls ethosu_deregister_driver(). Change-Id: I12cb1b07169c06c011a80f66d26451431db3948a
2021-06-08Spring clean/refactor of NPU driverJonny Svärd
These changes mostly focus on creating a better structure for the driver. Creating a better separation between driver and device(s). A short summary of what this commit contains: - Move driver specific defines from device to driver - Prefix device functions with ethosu_dev - Remove device specific register access' from driver - Remove device specific debug/dump functions - Add function prototypes for weak functions - Remove legacy ARM_NPU_STUB support - Rename ethosu_device.c to ethosu_device_u55.c - Remove redundant irq handler prototype - Remove (deprecated) hardcoded instance ethosu_drv - Simplify versioning API Split driver version and hardware version/information so that driver version can be queried without a driver instance. - Improve and simplify logging Make warning the new default severity level to print and reduce severity levels to: err warning info debug - Add severity prefix to log lines. Error messages print file and line number, debug messages print function by default. - Clarify some log messages - Small optimizations and bugfixes Change-Id: I2dfbfc3a40d7eca133c82f187f422325e1e6d314
2021-05-27Fixing compilation warnings21.05Kristofer Jonsson
Change-Id: I5b7be2481c577b04f1e6b2804cd5147fcdfbaf92
2021-05-26Optimizations21.05-rc3Kristofer Jonsson
Removing the ASSERT() makro using assert() instead. assert() is better controlled with the NDEBUG define. Using uintptr_t instead of uint32_t * for the NPU base address. This saves a division by 4 in the register read and write functions. Change-Id: I65a91fe35dc63666e50bdf7a756ad15b56dc66e9
2021-05-24[Core Driver] Update and remove pmu "v2"-functionsAnton Moberg
NPU PMU interface currently have functions that have been stepped each time a compatibilty breaking changed has been introduced. Old entrypoints have been redefined with macro to use the latest version for backwards compatibility. This series of patches will remove any such functions and macro to unify the interface. Update: Remove all "_v2"-functions and make the latest version the base entrypoint Update: Remove all redefine macros to only allow base entrypoint Change-Id: Ie125e2428a0336fe797c7455014d269a981f6f92
2021-05-21Weak mutex_create returns NULLAnton Moberg
The weak linked symbol ethosu_mutex_create() should in the default case return NULL. Change-Id: Ia92ba8fb85137dc6d676b4d4ea050c9c14085472
2021-05-21Add weak definition of ethosu_inference_begin/end to driverJens Elofsson
Add ethosu_inference_begin/end calls to ethosu_invoke_v3. Change-Id: I52f08ab3e3524d4d8f73d8bca7dc9559438d4857
2021-05-03[Core driver] Update to support removal of "_v"-functions21.05-rc221.05-rc1Anton Moberg
NPU driver interface currently have functions which have been stepped each time a compatibilty breaking changed has been introduced. Old entrypoints have been redefined with macro to use the latest version for backwards compatibility. This series of patches will remove any such functions and macro to unify the interface. Update: Remove all "_v"-functions and make the latest version the base entrypoint Update: Remove all redefine macros to only allow base entrypoint Note: static inline ethosu_invoke_v2() is kept as it is needed for tensorflow backwards compatibility. Will be removed in later patches. Change-Id: Ifa331daab35af24dc29e0d0007096902b8efc319
2021-04-30Fix unused parameter compilation warningAnton Moberg
Change-Id: I947f52a83cc9352caf45a7b242e5a15fbdedf6e3
2021-04-13Power request bit fixAnton Moberg
Changed so that power_request bit will be set if ETHOSU_POWER_Q_DISABLE instead of ETHOSU_CLOCK_Q_DISABLE. Change-Id: I571ab165f8856ed71f6e932be401312d43e9cca8
2021-04-13MLBEDSW-4301 - Verification check custom_dmaAnton Moberg
Added: custom_dma bit to config structs Added: hardware verification check for custom_dma Change-Id: I31dca56063b3ca773d02f0adf30d21facfd0b80d
2021-04-12Clock request disabled when PMU enabledAnton Moberg
Currently clock request is enabled, which means NPU will only request clock when working. When NPU is going into idle it will no longer request clock and thus PMU won't be clocked either, and thus affect the cycle counter. Added: enum for request clients (PMU or INFERENCE). Added: clock_request added to driver struct (bit 0: PMU, bit 1: INFERENCE) which keeps track of which client requests clock. Added: power_request added to driver struct (bit 0: PMU, bit 1: INFERENCE) which keeps track of which client requests power. Added set_clock_and_power_request(...) updates clock_request and power_request depending on which client calls it. Sets clock and power if both PMU and INFERENCE requests it. Added: Call set_clock_and_power_request(...) from PMU. Changed: replace ethosu_set_clock_and_power(...) with set_clock_and_power_request(...) in ethosu_init and ethosu_invoke Change-Id: Ie7d8aee639d4abbf879b05e9a82035d7c0d40d40
2021-03-23Multi NPU update APIsAnton Moberg
Modifying mutex and semaphore APIs allowing the driver to create any number of mutexes and semaphores. Using semaphore when waiting for interrupt. Making irq_triggered a member of the driver struct. Change-Id: Ib0645c9c7c0c029795269ac4b18e6ec29159d0f8