diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index e95b18d97169..d2721cdbdbb1 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -74,6 +74,7 @@ CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=38400000 CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 +CONFIG_ACE_V1X_RTC_COUNTER=n # Zephyr / power settings CONFIG_ADSP_IDLE_CLOCK_GATING=y diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index beb441d6e6c6..f97530527c37 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -52,6 +52,7 @@ CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=38400000 CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 +CONFIG_ACE_V1X_RTC_COUNTER=n # Zephyr / power settings CONFIG_ADSP_IDLE_CLOCK_GATING=y diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index 12aa78162c06..065a2cd00136 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -56,6 +56,7 @@ CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 CONFIG_XTENSA_MMU_NUM_L2_TABLES=128 CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 +CONFIG_ACE_V1X_RTC_COUNTER=n # Zephyr / power settings CONFIG_ADSP_IMR_CONTEXT_SAVE=y diff --git a/app/boards/intel_adsp_ace30_wcl.conf b/app/boards/intel_adsp_ace30_wcl.conf index 621eb719de9f..0704d60a4800 100644 --- a/app/boards/intel_adsp_ace30_wcl.conf +++ b/app/boards/intel_adsp_ace30_wcl.conf @@ -52,6 +52,7 @@ CONFIG_MEMORY_WIN_2_SIZE=12288 CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 +CONFIG_ACE_V1X_RTC_COUNTER=n # Zephyr / power settings CONFIG_ADSP_IMR_CONTEXT_SAVE=y diff --git a/app/boards/intel_adsp_ace40_nvl.conf b/app/boards/intel_adsp_ace40_nvl.conf index 75652f508d53..a145b4e6d6c6 100644 --- a/app/boards/intel_adsp_ace40_nvl.conf +++ b/app/boards/intel_adsp_ace40_nvl.conf @@ -44,6 +44,7 @@ CONFIG_DMA_INTEL_ADSP_GPDMA=n CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 +CONFIG_ACE_V1X_RTC_COUNTER=n # Zephyr / power settings CONFIG_ADSP_IMR_CONTEXT_SAVE=y diff --git a/app/boards/intel_adsp_ace40_nvls.conf b/app/boards/intel_adsp_ace40_nvls.conf index 75652f508d53..a145b4e6d6c6 100644 --- a/app/boards/intel_adsp_ace40_nvls.conf +++ b/app/boards/intel_adsp_ace40_nvls.conf @@ -44,6 +44,7 @@ CONFIG_DMA_INTEL_ADSP_GPDMA=n CONFIG_MM_DRV_INTEL_ADSP_TLB_REMAP_UNUSED_RAM=y CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=2 CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 +CONFIG_ACE_V1X_RTC_COUNTER=n # Zephyr / power settings CONFIG_ADSP_IMR_CONTEXT_SAVE=y diff --git a/src/include/sof/lib/fast-get.h b/src/include/sof/lib/fast-get.h index 36232cfbb3d6..fa34ecea128d 100644 --- a/src/include/sof/lib/fast-get.h +++ b/src/include/sof/lib/fast-get.h @@ -12,17 +12,7 @@ struct k_heap; -#if defined(__ZEPHYR__) && defined(CONFIG_SOF_FULL_ZEPHYR_APPLICATION) -#include - -__syscall const void *fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size); -__syscall void fast_put(struct k_heap *heap, const void *sram_ptr); -#include -#else -const void *z_impl_fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size); -void z_impl_fast_put(struct k_heap *heap, const void *sram_ptr); -#define fast_get z_impl_fast_get -#define fast_put z_impl_fast_put -#endif /* __ZEPHYR__ */ +const void *fast_get(struct k_heap *heap, const void * const dram_ptr, size_t size); +void fast_put(struct k_heap *heap, const void *sram_ptr); #endif /* __SOF_LIB_FAST_GET_H__ */ diff --git a/zephyr/lib/fast-get.c b/zephyr/lib/fast-get.c index 4f08d111e8b9..9a31265fed5c 100644 --- a/zephyr/lib/fast-get.c +++ b/zephyr/lib/fast-get.c @@ -16,6 +16,15 @@ #include #include +#ifdef __ZEPHYR__ +#include +#else +#define LOG_DBG(...) do {} while (0) +#define LOG_INF(...) do {} while (0) +#define LOG_WRN(...) do {} while (0) +#define LOG_ERR(...) do {} while (0) +#endif + struct sof_fast_get_entry { const void *dram_ptr; void *sram_ptr; @@ -81,7 +90,7 @@ static struct sof_fast_get_entry *fast_get_find_entry(struct sof_fast_get_data * return NULL; } -const void *z_impl_fast_get(struct k_heap *heap, const void *dram_ptr, size_t size) +const void *fast_get(struct k_heap *heap, const void *dram_ptr, size_t size) { struct sof_fast_get_data *data = &fast_get_data; struct sof_fast_get_entry *entry; @@ -101,7 +110,7 @@ const void *z_impl_fast_get(struct k_heap *heap, const void *dram_ptr, size_t si if (entry->sram_ptr) { if (entry->size != size || entry->dram_ptr != dram_ptr) { - tr_err(fast_get, "size %u != %u or ptr %p != %p mismatch", + LOG_ERR("size %u != %u or ptr %p != %p mismatch", entry->size, size, entry->dram_ptr, dram_ptr); ret = NULL; goto out; @@ -128,12 +137,11 @@ const void *z_impl_fast_get(struct k_heap *heap, const void *dram_ptr, size_t si entry->refcount = 1; out: k_spin_unlock(&data->lock, key); - tr_dbg(fast_get, "get %p, %p, size %u, refcnt %u", dram_ptr, ret, size, - entry ? entry->refcount : 0); + LOG_DBG("get %p, %p, size %u, refcnt %u", dram_ptr, ret, size, entry ? entry->refcount : 0); return ret; } -EXPORT_SYMBOL(z_impl_fast_get); +EXPORT_SYMBOL(fast_get); static struct sof_fast_get_entry *fast_put_find_entry(struct sof_fast_get_data *data, const void *sram_ptr) @@ -148,7 +156,7 @@ static struct sof_fast_get_entry *fast_put_find_entry(struct sof_fast_get_data * return NULL; } -void z_impl_fast_put(struct k_heap *heap, const void *sram_ptr) +void fast_put(struct k_heap *heap, const void *sram_ptr) { struct sof_fast_get_data *data = &fast_get_data; struct sof_fast_get_entry *entry; @@ -157,7 +165,7 @@ void z_impl_fast_put(struct k_heap *heap, const void *sram_ptr) key = k_spin_lock(&fast_get_data.lock); entry = fast_put_find_entry(data, sram_ptr); if (!entry) { - tr_err(fast_get, "Put called to unknown address %p", sram_ptr); + LOG_ERR("Put called to unknown address %p", sram_ptr); goto out; } entry->refcount--; @@ -166,33 +174,8 @@ void z_impl_fast_put(struct k_heap *heap, const void *sram_ptr) memset(entry, 0, sizeof(*entry)); } out: - tr_dbg(fast_get, "put %p, DRAM %p size %u refcnt %u", sram_ptr, entry ? entry->dram_ptr : 0, - entry ? entry->size : 0, entry ? entry->refcount : 0); + LOG_DBG("put %p, DRAM %p size %u refcnt %u", sram_ptr, entry ? entry->dram_ptr : 0, + entry ? entry->size : 0, entry ? entry->refcount : 0); k_spin_unlock(&data->lock, key); } -EXPORT_SYMBOL(z_impl_fast_put); - -#ifdef CONFIG_USERSPACE -#include -void z_vrfy_fast_put(struct k_heap *heap, const void *sram_ptr) -{ - K_OOPS(K_SYSCALL_MEMORY_WRITE(heap, sizeof(*heap))); - /* - * FIXME: we don't know how much SRAM has been allocated, so cannot - * check. Should fast_put() be changed to pass a size argument? - */ - - z_impl_fast_put(heap, sram_ptr); -} -#include - -const void *z_vrfy_fast_get(struct k_heap *heap, const void *dram_ptr, size_t size) -{ - K_OOPS(K_SYSCALL_MEMORY_WRITE(heap, sizeof(*heap))); - /* We cannot (easily) verify the actual heapp memory */ - K_OOPS(K_SYSCALL_MEMORY_READ(dram_ptr, size)); - - return z_impl_fast_get(heap, dram_ptr, size); -} -#include -#endif +EXPORT_SYMBOL(fast_put);