diff options
author | Per Åstrand <per.astrand@arm.com> | 2020-11-09 15:33:12 +0100 |
---|---|---|
committer | Per Åstrand <per.astrand@arm.com> | 2020-11-20 15:09:28 +0100 |
commit | e6498f0aa2e51b652a40b5f27e5991bd65422326 (patch) | |
tree | 471367c8676eee387a1651ad9990cd91b8388548 /include | |
parent | 3c8afccabc4622a5e16a2a75474c8c9bb82f248c (diff) | |
download | ethos-u-core-driver-e6498f0aa2e51b652a40b5f27e5991bd65422326.tar.gz |
Add API to set secure and privilege level of NPU20.11-rc2
Change-Id: I8ca309ea4e5885865d5c9cf848500f45f83e08a2
Diffstat (limited to 'include')
-rw-r--r-- | include/ethosu_device.h | 7 | ||||
-rw-r--r-- | include/ethosu_driver.h | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/include/ethosu_device.h b/include/ethosu_device.h index 91aa877..dd34201 100644 --- a/include/ethosu_device.h +++ b/include/ethosu_device.h @@ -63,6 +63,8 @@ struct ethosu_device uint32_t pmccntr_cfg; uint32_t pmu_evcntr[ETHOSU_PMU_NCOUNTERS]; uint32_t pmu_evtypr[ETHOSU_PMU_NCOUNTERS]; + uint32_t secure; + uint32_t privileged; }; struct ethosu_id @@ -143,7 +145,10 @@ enum ethosu_power_q_request /** * Initialize the device. */ -enum ethosu_error_codes ethosu_dev_init(struct ethosu_device *dev, const void *base_address); +enum ethosu_error_codes ethosu_dev_init(struct ethosu_device *dev, + const void *base_address, + uint32_t secure_enable, + uint32_t privilege_enable); /** * Get device id. diff --git a/include/ethosu_driver.h b/include/ethosu_driver.h index 433ad06..345f82f 100644 --- a/include/ethosu_driver.h +++ b/include/ethosu_driver.h @@ -89,9 +89,15 @@ extern struct ethosu_driver ethosu_drv; /** * Initialize the Ethos-U driver. */ -int ethosu_init_v2(const void *base_address, const void *fast_memory, const size_t fast_memory_size); - -#define ethosu_init(base_address) ethosu_init_v2(base_address, NULL, 0) +int ethosu_init_v3(const void *base_address, + const void *fast_memory, + const size_t fast_memory_size, + uint32_t secure_enable, + uint32_t privilege_enable); + +#define ethosu_init(base_address) ethosu_init_v3(base_address, NULL, 0, 1, 1) +#define ethosu_init_v2(base_address, fast_memory, fast_memory_size) \ + ethosu_init_v3(base_address, fast_memory, fast_memory_size, 1, 1) /** * Get Ethos-U version. |