From 5f8dad185b3e3a381fe2e3d16580a8a8e99f9db0 Mon Sep 17 00:00:00 2001 From: Bhavik Patel Date: Wed, 30 Sep 2020 09:06:52 +0200 Subject: MLBEDSW-3094 Improve soft reset of ETHOSU when running jobs 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 --- include/ethosu_device.h | 9 +++++++++ include/ethosu_driver.h | 1 + 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/ethosu_device.h b/include/ethosu_device.h index e08aa3d..5edba94 100644 --- a/include/ethosu_device.h +++ b/include/ethosu_device.h @@ -55,6 +55,7 @@ enum ethosu_error_codes struct ethosu_device { uintptr_t base_address; + uint32_t reset; uint32_t pmcr; uint64_t pmccntr; uint32_t pmcnten; @@ -392,6 +393,14 @@ enum ethosu_error_codes ethosu_save_pmu_config(struct ethosu_device *dev); */ enum ethosu_error_codes ethosu_restore_pmu_config(struct ethosu_device *dev); +/** + * Check if the STATUS register has any error bits set or not. + * \param[in] dev Ethos-U device to check. + * \return true if any error bits set, + * false otherwise. + */ +bool ethosu_status_has_error(struct ethosu_device *dev); + #ifdef __cplusplus } #endif diff --git a/include/ethosu_driver.h b/include/ethosu_driver.h index d6e9c6d..2594fbe 100644 --- a/include/ethosu_driver.h +++ b/include/ethosu_driver.h @@ -43,6 +43,7 @@ struct ethosu_driver bool abort_inference; uint64_t fast_memory; size_t fast_memory_size; + bool status_error; }; struct ethosu_version_id -- cgit v1.2.1