aboutsummaryrefslogtreecommitdiff
path: root/src/ethosu_driver.c
diff options
context:
space:
mode:
authorPer Åstrand <per.astrand@arm.com>2020-11-09 15:33:12 +0100
committerPer Åstrand <per.astrand@arm.com>2020-11-20 15:09:28 +0100
commite6498f0aa2e51b652a40b5f27e5991bd65422326 (patch)
tree471367c8676eee387a1651ad9990cd91b8388548 /src/ethosu_driver.c
parent3c8afccabc4622a5e16a2a75474c8c9bb82f248c (diff)
downloadethos-u-core-driver-e6498f0aa2e51b652a40b5f27e5991bd65422326.tar.gz
Add API to set secure and privilege level of NPU20.11-rc2
Change-Id: I8ca309ea4e5885865d5c9cf848500f45f83e08a2
Diffstat (limited to 'src/ethosu_driver.c')
-rw-r--r--src/ethosu_driver.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c
index 014fb54..fcb3fbb 100644
--- a/src/ethosu_driver.c
+++ b/src/ethosu_driver.c
@@ -233,20 +233,26 @@ static void dump_npu_register(struct ethosu_driver *drv, int npu_reg, int npu_re
static void dump_command_stream(const uint32_t *cmd_stream, const int cms_length, int qread);
static void npu_axi_init(struct ethosu_driver *drv);
-int ethosu_init_v2(const void *base_address, const void *fast_memory, const size_t fast_memory_size)
+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)
{
int return_code = 0;
- LOG_INFO("%s. base_address=%p, fast_memory=%p, fast_memory_size=%zu\n",
+ LOG_INFO("%s. base_address=%p, fast_memory=%p, fast_memory_size=%zu, secure=%u, privileged=%u\n",
__FUNCTION__,
base_address,
fast_memory,
- fast_memory_size);
+ fast_memory_size,
+ secure_enable,
+ privilege_enable);
ethosu_drv.fast_memory = (uint32_t)fast_memory;
ethosu_drv.fast_memory_size = fast_memory_size;
- if (ETHOSU_SUCCESS != ethosu_dev_init(&ethosu_drv.dev, base_address))
+ if (ETHOSU_SUCCESS != ethosu_dev_init(&ethosu_drv.dev, base_address, secure_enable, privilege_enable))
{
LOG_ERR("Failed in ethosu_dev_init");
return -1;