Skip to content

Commit 17dea29

Browse files
kv2019ilgirdwood
authored andcommitted
Revert "audio: use zephyr/cache.h for cache flush/invalidate"
This reverts commit f78acf4. Fixes build regression with testbuild. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 951a27c commit 17dea29

4 files changed

Lines changed: 15 additions & 18 deletions

File tree

src/audio/buffers/comp_buffer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <sof/common.h>
1616
#include <rtos/interrupt.h>
1717
#include <rtos/alloc.h>
18+
#include <rtos/cache.h>
1819
#include <sof/lib/notifier.h>
1920
#include <sof/list.h>
2021
#include <rtos/spinlock.h>
@@ -23,7 +24,6 @@
2324
#include <errno.h>
2425
#include <stddef.h>
2526
#include <stdint.h>
26-
#include <zephyr/cache.h>
2727

2828
LOG_MODULE_REGISTER(buffer, CONFIG_SOF_LOG_LEVEL);
2929

@@ -307,9 +307,9 @@ void buffer_zero(struct comp_buffer *buffer)
307307

308308
bzero(audio_stream_get_addr(&buffer->stream), audio_stream_get_size(&buffer->stream));
309309
if (buffer->flags & SOF_MEM_FLAG_DMA)
310-
sys_cache_data_flush_range((__sparse_force void __sparse_cache *)
311-
audio_stream_get_addr(&buffer->stream),
312-
audio_stream_get_size(&buffer->stream));
310+
dcache_writeback_region((__sparse_force void __sparse_cache *)
311+
audio_stream_get_addr(&buffer->stream),
312+
audio_stream_get_size(&buffer->stream));
313313
}
314314

315315
int buffer_set_size(struct comp_buffer *buffer, uint32_t size, uint32_t alignment)

src/audio/buffers/ring_buffer.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <rtos/alloc.h>
1414
#include <ipc/topology.h>
1515

16-
#include <zephyr/cache.h>
17-
1816
LOG_MODULE_REGISTER(ring_buffer, CONFIG_SOF_LOG_LEVEL);
1917

2018
SOF_DEFINE_REG_UUID(ring_buffer);
@@ -58,13 +56,13 @@ static inline void ring_buffer_invalidate_shared(struct ring_buffer *ring_buffer
5856
/* wrap-around? */
5957
if ((uintptr_t)ptr + size > (uintptr_t)ring_buffer_buffer_end(ring_buffer)) {
6058
/* writeback till the end of circular buffer */
61-
sys_cache_data_invd_range
59+
dcache_invalidate_region
6260
(ptr, (uintptr_t)ring_buffer_buffer_end(ring_buffer) - (uintptr_t)ptr);
6361
size -= (uintptr_t)ring_buffer_buffer_end(ring_buffer) - (uintptr_t)ptr;
6462
ptr = ring_buffer->_data_buffer;
6563
}
6664
/* invalidate rest of data */
67-
sys_cache_data_invd_range(ptr, size);
65+
dcache_invalidate_region(ptr, size);
6866
}
6967

7068
static inline void ring_buffer_writeback_shared(struct ring_buffer *ring_buffer,
@@ -77,13 +75,13 @@ static inline void ring_buffer_writeback_shared(struct ring_buffer *ring_buffer,
7775
/* wrap-around? */
7876
if ((uintptr_t)ptr + size > (uintptr_t)ring_buffer_buffer_end(ring_buffer)) {
7977
/* writeback till the end of circular buffer */
80-
sys_cache_data_flush_range
78+
dcache_writeback_region
8179
(ptr, (uintptr_t)ring_buffer_buffer_end(ring_buffer) - (uintptr_t)ptr);
8280
size -= (uintptr_t)ring_buffer_buffer_end(ring_buffer) - (uintptr_t)ptr;
8381
ptr = ring_buffer->_data_buffer;
8482
}
8583
/* writeback rest of data */
86-
sys_cache_data_flush_range(ptr, size);
84+
dcache_writeback_region(ptr, size);
8785
}
8886

8987

src/audio/copier/copier_ipcgtw.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <sof/lib/uuid.h>
99
#include <sof/ut.h>
1010
#include <rtos/init.h>
11-
#include <zephyr/cache.h>
1211
#include "copier.h"
1312
#include "ipcgtw_copier.h"
1413

@@ -95,8 +94,8 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd,
9594
uint32_t data_size;
9695
struct ipc4_ipc_gateway_cmd_data_reply *out;
9796

98-
sys_cache_data_invd_range((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE,
99-
sizeof(struct ipc4_ipc_gateway_cmd_data));
97+
dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE,
98+
sizeof(struct ipc4_ipc_gateway_cmd_data));
10099
in = (const struct ipc4_ipc_gateway_cmd_data *)MAILBOX_HOSTBOX_BASE;
101100

102101
dev = find_ipcgtw_by_node_id(in->node_id);
@@ -139,7 +138,7 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd,
139138
if (buf) {
140139
data_size = MIN(cmd->extension.r.data_size,
141140
audio_stream_get_free_bytes(&buf->stream));
142-
sys_cache_data_invd_range((__sparse_force void __sparse_cache *)
141+
dcache_invalidate_region((__sparse_force void __sparse_cache *)
143142
MAILBOX_HOSTBOX_BASE,
144143
data_size +
145144
offsetof(struct ipc4_ipc_gateway_cmd_data,

src/include/sof/audio/audio_stream.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <sof/math/numbers.h>
2323
#include <sof/lib/dma.h>
2424
#include <rtos/alloc.h>
25-
#include <zephyr/cache.h>
25+
#include <rtos/cache.h>
2626
#include <ipc/stream.h>
2727
#include <ipc4/base-config.h>
2828
#include <module/audio/audio_stream.h>
@@ -756,10 +756,10 @@ static inline void audio_stream_writeback(struct audio_stream *buffer, uint32_t
756756
tail_size = bytes - head_size;
757757
}
758758

759-
sys_cache_data_flush_range((__sparse_force void __sparse_cache *)buffer->w_ptr, head_size);
759+
dcache_writeback_region((__sparse_force void __sparse_cache *)buffer->w_ptr, head_size);
760760
if (tail_size)
761-
sys_cache_data_flush_range((__sparse_force void __sparse_cache *)buffer->addr,
762-
tail_size);
761+
dcache_writeback_region((__sparse_force void __sparse_cache *)buffer->addr,
762+
tail_size);
763763
}
764764

765765
/**

0 commit comments

Comments
 (0)