diff options
author | Bhavik Patel <bhavik.patel@arm.com> | 2020-06-18 15:25:15 +0200 |
---|---|---|
committer | Bhavik Patel <bhavik.patel@arm.com> | 2020-07-03 09:06:03 +0200 |
commit | dae5be07b76e5361593d8c2fa4717970c2a5fc19 (patch) | |
tree | bf051793cce3899f249522a8449c40432f11ef4b /src/ethosu_common.h | |
parent | 8e32b0b72be3b109a921bcb33778eb515d27ef70 (diff) | |
download | ethos-u-core-driver-dae5be07b76e5361593d8c2fa4717970c2a5fc19.tar.gz |
MLBEDSW-2378 Set NPU base address in ethosu_init
Change-Id: I1145834000ff81d6e497a8fa77bf997478a80372
Diffstat (limited to 'src/ethosu_common.h')
-rw-r--r-- | src/ethosu_common.h | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/ethosu_common.h b/src/ethosu_common.h index 7c33470..ce7a663 100644 --- a/src/ethosu_common.h +++ b/src/ethosu_common.h @@ -20,6 +20,7 @@ #define ETHOSU_COMMON_H #include "ethosu55_interface.h" +#include "ethosu_device.h" #if !defined(LOG_ENABLED) #define LOG_INFO(format, ...) @@ -38,11 +39,6 @@ #define ASSERT(args) assert(args) #endif -#if defined(CPU_CORTEX_M55) -#define NPU_BASE ((uint32_t)0x41700000) -#else -#define NPU_BASE ((uint32_t)0x41105000) -#endif #define UNUSED(x) ((void)x) #define VER_STR(X) VNUM_STR(X) @@ -57,16 +53,4 @@ static const __attribute__((section("npu_driver_version"))) char driver_version_ static const __attribute__((section("npu_driver_arch_version"))) char driver_arch_version_str[] = VER_STR(NNX_ARCH_VERSION_MAJOR) "." VER_STR(NNX_ARCH_VERSION_MINOR) "." VER_STR(NNX_ARCH_VERSION_PATCH); -static inline uint32_t read_reg(uint32_t address) -{ - volatile uint32_t *reg = (uint32_t *)(uintptr_t)(NPU_BASE + address); - return *reg; -} - -static inline void write_reg(uint32_t address, uint32_t value) -{ - volatile uint32_t *reg = (uint32_t *)(uintptr_t)(NPU_BASE + address); - *reg = value; -} - #endif // ETHOSU_COMMON_H |