aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
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
2021-03-19Make IRQ handler weakKristofer Jonsson
Allow the IRQ handler to be overridden for test cases that operate directly on top of the device driver. Change-Id: Iddf7aec041a3183583e6e4d8521d5a637c379689
2021-03-16Use event enum for configuring cycle counterPer Åstrand
The pmu configuration API expects the internal configuration values, and not the exported enum. Update the API to instead use the enums to be able to configure them correctly. Change-Id: I038b1841f2459baec4a62a6a4389ea4b5f4822f2
2021-02-19MLBEDSW-3868 - Driver multiNPU lockingAnton Moberg
Added: Weak linked symbols for locking if RTOS overrides Added: Semaphore Producer (release a reserved driver) Added: Semaphore Consumer (all drivers reserved and waiting for returned driver) Added: Mutex protect thread sensitive driver access Added: Weak linked symbols for yielding & resuming thread/task while waiting for IRQ Added: static inline function of ethosu_invoke_v2(...) for backwards compatibility Change-Id: If415a73b01b2357b31bb6da86f3038344c4245c6
2021-01-27MLBEDSW-3796 Ethos-U driver interface multiple NPUs21.02-rc221.02-rc1Anton Moberg
---ethosu_driver--- Modified: Declarations for the driver interfaces to support multiNPU (takes *drv) Added: ethosu_register_driver(...) to allow for a specific NPU driver to be instantiated Added: ethosu_deregister_Driver(...) to allow for a specific NPU driver to be de-registered Added: ethosu_reserve_driver(...) to reserve & return the first NPU driver instance available Added: ethosu_release_driver(...) to release a specific NPU driver instance and make it available again Added: *registered_drivers - A static linked list of drivers ready be used ---ethosu_pmu--- Modified: Declarations for pmu interfaces to support multiNPU (takes *drv) ---ethosu_device--- Modified: Resolved a circular include dependency (Remove include and add ETHOSU_PMU_NCOUNTERS macro) Change-Id: Iede41cd41bb0d5d483bd9d929d1b6c9ca5d3c48e
2021-01-20Update arch version comparisonDouglas Troha
* Allow driver to run cmdstreams that are compiled for older arch versions Change-Id: Ia49fc6c34b118bd91ce24bd0c34d95abc4c25d6a Signed-off-by: Douglas Troha <douglas.troha@arm.com>
2021-01-18Added simplified driver setupAnton Moberg
If NPU power is guaranteed always on parts of driver setup can be omitted to reduce the number of cycles required to setup the NPU drivers. By enabling dev_power_always_on, the setup cycles are reduced by approx. ~50%. (4462->2238 in prologue, 1167->642 in epilogue) Change-Id: I56d380c2571fedbc8888fb7c00fce0e4320f7fb7
2020-12-17MLBEDSW-3728 Resolve compiler warningsBhavik Patel
Change-Id: I3a8b88fb63aee8a4741ab1ca47bc49c663479e21
2020-12-02Remove CPU build flags from driverDaniel Anderberg
Using a cpu without proper interrupt handling is not really usefull in this context, so remove that option. Change-Id: Ie94fd9025c918eef72272e14ad5b0a95ea7dc4a4
2020-11-24Update handling of soft reset20.11Kristofer Jonsson
Change-Id: Ia22b2934b4c85e3c480931c8b92608365351a877
2020-11-24Restore default init values as init_v2Per Åstrand
The addition of init_v3 accidentely changed default values for soft resetting Ethos-U. Restore the default parameters to non-secure, user mode for init_v1 and init_v2 and also make sure to check return value from ethosu_soft_reset. Change-Id: If7377f11ad1db7ff988fdcba03320a54e6e0c0c1
2020-11-20Add API to set secure and privilege level of NPU20.11-rc2Per Åstrand
Change-Id: I8ca309ea4e5885865d5c9cf848500f45f83e08a2
2020-11-16Flush and invalidate data cachesPer Åstrand
Implement a weak linked function to handle the data cache. If the specific device is implementing a data cache the function should be overriden with device specific implementation of the flush/invalidate functions to make sure that the cache is properly maintained with regards to the NPU DMA transaction. Change-Id: I175644ef37bee62cc77d789d2b7bc3073e72ea5a
2020-11-10Fast memory error handling20.11-rc1Kristofer Jonsson
Return error if the fast memory area would be smaller than the spilling tensor. Change-Id: Ica89a3a933a3317a346e3479f5209ddc735d1c91
2020-10-23Incorrect PMU cycle counterKristofer Jonsson
The low and high PMU cycle counter registers were not combined correctly. Change-Id: I6b311b33527557f459fd87ebd5d4d3228625106a
2020-10-20PMU counter shadowKristofer Jonsson
Storing PMU counters in shadow variables, in case the PMU was powered off or soft reset. Change-Id: I64ccf3fb6195f9be2d8315891ec612bb75404885
2020-10-16MLBEDSW-3094 Improve soft reset of ETHOSU when running jobsBhavik Patel
The ETHOSU is soft-reset only if the previous job failed or if the current privilege level is not user or if the current security level is not secure. Change-Id: Id10b96058d67805d179ac693537606d55e10379b
2020-09-28Silence gcc > 7 type-limits warningPer Åstrand
GCC > 7 warns that the selected type of the enum makes the comparisson unneccesary. Since the selected enum fits in an integer, the input parameter is casted to an integer to make the comparison valid and asserts that the enum is within valid enum values (which we know are monotonically growing). Change-Id: Id81799e2ac43a83b998541ce7531d2039202cd62
2020-09-28Don't use NULL for integer variablesPer Åstrand
Avoid using NULL to initialize and compare with for integer variables. Change-Id: I1c370a9bb213dc93db845149d123915273411551
2020-09-28Avoid casting to integer of different sizePer Åstrand
Avoid casting pointers to integer types larger than the pointer itself, and let assignement handle the conversion. Change-Id: Icfd2401617f2cd0fc96c2a6a9ad8d2d8bec94c55
2020-09-28Add default switch statementPer Åstrand
Change-Id: I591284c1b06b660fc303bb5b4fa282d403ee42c0
2020-09-28Use inttypes format specifiers for logging valuesPer Åstrand
GCC and armclang uses different uint32_t types which makes it impossible to use standard format specifiers to satisfy both compilers. Move to inttypes.h macros to handle it in a portable way. Change-Id: If85e1148d302b64660af66d8f462efba9ac5d86b
2020-09-23Resetting cached cycle counterKristofer Jonsson
Change-Id: Ia2a0ac76fca0fd12efee305a2ea2ebd5b2055b2d
2020-09-04Move fast memory area to core driverKristofer Jonsson
Change-Id: Ie4186f5ab881d5c13021299404322ff582180d26
2020-08-26Save and restore PMU settings and counters20.08-rc220.08Kristofer Jonsson
Change-Id: I54a1927fef998bc97f5507f2de9faf7d4a7960f5
2020-08-25zero initialize stack allocated register structsPer Åstrand
Avoid writing unintentional bits when using stack allocated register structs. Change-Id: I427f8449f15a8118883cfd7214aabe30dd6372d6
2020-08-24Base pointer offset and soft resetKristofer Jonsson
Allow user to define a base pointer offset, if the CPU and the NPU have address spaces offseted from each other. Soft reset NPU before every inference. Added log prints. Change-Id: I98a746d20dc780fefa23ad68816f5ba2ba2e6c6e
2020-08-19Update to HI 1.0.620.08-rc1Stefan Nannesson
Change-Id: I0f127f7460be2a5d2eda5be2868c91f58cac03c0
2020-08-11Set default log severity in headersKristofer Jonsson
Change-Id: Ia984092db29cc5f1294ecdcf5c2b6b744c6d32b2
2020-08-05Header cleanupKristofer Jonsson
Change-Id: I84754f316ce940917516cb7f5c59189f523d4095
2020-07-22MLBEDSW-2594 Initialize the Ethos-U before every jobBhavik Patel
This includes resetting the Ethos-U and restoring the previosuly saved PMU configuration (if any). Change-Id: Id952fb6fef513468952b6a469e857510f8c0214c
2020-07-17MLBEDSW-2596 Add support to set driver log severityBhavik Patel
The driver can log at one of the following levels: 0=emerg, 1=alert, 2=crit, 3=err, 4=warning, 5=notice, 6=info, 7=debug. The logs at or below the set level are printed whereas the higher level logs are not printed. Change-Id: I05a498d4c8c78112207187d9dceaa2386b138c5d
2020-07-03MLBEDSW-2378 Set NPU base address in ethosu_initBhavik Patel
Change-Id: I1145834000ff81d6e497a8fa77bf997478a80372
2020-07-02Move PMU functions from pmu_ethosu.h to ethosu_pmu.cBhavik Patel
This change is done as a prerequisite to be able to set base address for NPU through ethosu_init(). So instead of using a mamory mapped struct we use the same functions to read/write PMU registers as the rest of the ethos-u driver. Change-Id: Ie1f6e6af4627cbe9375e2b2d079ba8017b6294d3
2020-07-02Update Clock and Power Q channel default values to 1Rakesh Gangarajaiah
- TICKET: MLEMBED-1616 Signed-off-by: Rakesh Gangarajaiah <rakesh.gangarajaiah@arm.com> Change-Id: Iea9e6869a1855b42bd8a0fda2986d099d0479a09
2020-06-26MLBEDSW-2447 Set clock_q_enable & power_q_enable correctlyBhavik Patel
Bit [2] in CMD register is used to enable clock off using clock q-interface and enable the master clock gate. Bit [3] is used to enable power off using power q-interface. The clock_q_enable bit is set when putting the Ethos-U into run state. The power_q_enable bit is set to 0 when running the command stream and set to 1 after command stream has finished running. Change-Id: Id9d1405376508e2af2ec0ddc2ebae8fb6c2f5cba
2020-06-22Update arch to 1.0.120.07-rc120.07Douglas Troha
* Includes npu_active event Signed-off-by: Douglas Troha <douglas.troha@arm.com> Change-Id: I2346707c26b7c3709bb844c7b21365d714e9a089
2020-06-16Allow differing arch patch versions20.06Douglas Troha
* Arch patch versions should be backward compatible Signed-off-by: Douglas Troha <douglas.troha@arm.com> Change-Id: I1b0d292d0885af90d5b39f2239e020af9181008b
2020-06-12Move command stream and base address alignment checksBhavik Patel
Moving the alignment checks for command stream and base addresses to handle_command_stream(). This is done so that applications which directly call ethosu_run_command_stream(), and don't have command stream & base addresses properly aligned can still run the command stream. Change-Id: Ie02e9952af027e3017e53ea7217698a33a33b418
2020-06-05MLBEDSW-2272 Reenable the version checker for optimizer configBhavik Patel
Also check that the command stream address and base address are aligned to 16 bytes. Return error in case they are not correctly aligned. Change-Id: I786d03f403d02d601ee74c53d2dede85b2b0e8a0
2020-06-02Rework AXI patch to not depend on CMakeJonny Svärd
Make ethosu_config.h define default macro's (with default values) unless the user overrides them. For CMake users, the macros can be defined on cmd line by specifying CMAKE_C_FLAGS for cmake, like: cmake ... -DCMAKE_C_FLAGS='-DFOO=1 -DBAR=2' Change-Id: I20fd3e07fdcfb7cba58da7198fd986f8821902bb
2020-05-26MLBEDSW-2288: Set default/configurable AXI valuesJonny Svärd
Change-Id: I2e72d26699e07b12b42832b59e23b3083c59d1d8
2020-05-18Include 0.180 in HI 1.0Douglas Troha
* Rename debug_addr to debug_address and update page names Signed-off-by: Douglas Troha <douglas.troha@arm.com> Change-Id: I1e4a820769dd00ec04e65e8027ae0d4b872c2d52
2020-05-15Log updatesKristofer Jonsson
Rename CMake log variable. Make logging default off. Remove CMake setting compile features. Remove FPGA flag around soft reset. Change-Id: Ia1f1c314ad19e9e05c59efe1a16d5670f6ec0f69
2020-05-13Update to HI 1.0Douglas Troha
* Includes updates for 0.179 Change-Id: I8ab8e9d67ed5dabf9684ed7576d302a0831c1647 Signed-off-by: Douglas Troha <douglas.troha@arm.com>