mailbox: use uncached address to write sw regs

mailbox_sw_regs_write is used by dai to update llp node. In multi-core
test, the updated llp node is invisable to other cores although
dcache_writeback_region is used on both cavs & ace platforms. Now use
uncached address to write memory directly which is aligned with other
mailbox access functions.

Validated on cavs & ace platforms.

Signed-off-by: Rander Wang <rander.wang@intel.com>
This commit is contained in:
Rander Wang 2023-10-26 20:47:26 +08:00 committed by Liam Girdwood
parent ba2cfe3daa
commit 195fed7866
2 changed files with 10 additions and 10 deletions

View File

@ -80,12 +80,12 @@ static inline uint64_t mailbox_sw_reg_read64(size_t offset)
static inline void mailbox_sw_regs_write(size_t offset, const void *src, size_t bytes)
{
int regs_write_err __unused = memcpy_s((void *)(MAILBOX_SW_REG_BASE + offset),
MAILBOX_SW_REG_SIZE - offset, src, bytes);
uint32_t __sparse_cache *ptr_c;
uint32_t *ptr;
assert(!regs_write_err);
dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_SW_REG_BASE +
offset), bytes);
ptr_c = (uint32_t __sparse_cache *)(MAILBOX_SW_REG_BASE + offset);
ptr = cache_to_uncache(ptr_c);
memcpy_s(ptr, MAILBOX_SW_REG_SIZE - offset, src, bytes);
}
#endif /* __ACE_LIB_MAILBOX_H__ */

View File

@ -108,12 +108,12 @@ static inline uint64_t mailbox_sw_reg_read64(size_t offset)
static inline void mailbox_sw_regs_write(size_t offset, const void *src, size_t bytes)
{
int regs_write_err __unused = memcpy_s((void *)(MAILBOX_SW_REG_BASE + offset),
MAILBOX_SW_REG_SIZE - offset, src, bytes);
uint32_t __sparse_cache *ptr_c;
uint32_t *ptr;
assert(!regs_write_err);
dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_SW_REG_BASE +
offset), bytes);
ptr_c = (uint32_t __sparse_cache *)(MAILBOX_SW_REG_BASE + offset);
ptr = cache_to_uncache(ptr_c);
memcpy_s(ptr, MAILBOX_SW_REG_SIZE - offset, src, bytes);
}
#endif /* __CAVS_LIB_MAILBOX_H__ */