From dae5be07b76e5361593d8c2fa4717970c2a5fc19 Mon Sep 17 00:00:00 2001 From: Bhavik Patel Date: Thu, 18 Jun 2020 15:25:15 +0200 Subject: MLBEDSW-2378 Set NPU base address in ethosu_init Change-Id: I1145834000ff81d6e497a8fa77bf997478a80372 --- src/ethosu_common.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/ethosu_common.h') 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 -- cgit v1.2.1