Commit a8f858d9 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

ASoC: Intel: avs: Prefix SKL/APL-specific members

Prefix members that are platform-specific with 'avs_' to improve code
cohesiveness and reduce the chance for naming-conflics with other
drivers.
Reviewed-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-4-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e1a0cbae
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
#include "topology.h" #include "topology.h"
static int __maybe_unused static int __maybe_unused
apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period, avs_apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities) u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
{ {
struct apl_log_state_info *info; struct avs_apl_log_state_info *info;
u32 size, num_cores = adev->hw_cfg.dsp_cores; u32 size, num_cores = adev->hw_cfg.dsp_cores;
int ret, i; int ret, i;
...@@ -48,9 +48,9 @@ apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri ...@@ -48,9 +48,9 @@ apl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri
return 0; return 0;
} }
static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg) static int avs_apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
{ {
struct apl_log_buffer_layout layout; struct avs_apl_log_buffer_layout layout;
void __iomem *addr, *buf; void __iomem *addr, *buf;
addr = avs_log_buffer_addr(adev, msg->log.core); addr = avs_log_buffer_addr(adev, msg->log.core);
...@@ -63,11 +63,11 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg ...@@ -63,11 +63,11 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
/* consume the logs regardless of consumer presence */ /* consume the logs regardless of consumer presence */
goto update_read_ptr; goto update_read_ptr;
buf = apl_log_payload_addr(addr); buf = avs_apl_log_payload_addr(addr);
if (layout.read_ptr > layout.write_ptr) { if (layout.read_ptr > layout.write_ptr) {
avs_dump_fw_log(adev, buf + layout.read_ptr, avs_dump_fw_log(adev, buf + layout.read_ptr,
apl_log_payload_size(adev) - layout.read_ptr); avs_apl_log_payload_size(adev) - layout.read_ptr);
layout.read_ptr = 0; layout.read_ptr = 0;
} }
avs_dump_fw_log_wakeup(adev, buf + layout.read_ptr, layout.write_ptr - layout.read_ptr); avs_dump_fw_log_wakeup(adev, buf + layout.read_ptr, layout.write_ptr - layout.read_ptr);
...@@ -77,7 +77,8 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg ...@@ -77,7 +77,8 @@ static int apl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg
return 0; return 0;
} }
static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buffer_layout *layout) static int avs_apl_wait_log_entry(struct avs_dev *adev, u32 core,
struct avs_apl_log_buffer_layout *layout)
{ {
unsigned long timeout; unsigned long timeout;
void __iomem *addr; void __iomem *addr;
...@@ -99,11 +100,11 @@ static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buf ...@@ -99,11 +100,11 @@ static int apl_wait_log_entry(struct avs_dev *adev, u32 core, struct apl_log_buf
} }
/* reads log header and tests its type */ /* reads log header and tests its type */
#define apl_is_entry_stackdump(addr) ((readl(addr) >> 30) & 0x1) #define avs_apl_is_entry_stackdump(addr) ((readl(addr) >> 30) & 0x1)
static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg) static int avs_apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
{ {
struct apl_log_buffer_layout layout; struct avs_apl_log_buffer_layout layout;
void __iomem *addr, *buf; void __iomem *addr, *buf;
size_t dump_size; size_t dump_size;
u16 offset = 0; u16 offset = 0;
...@@ -124,9 +125,9 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg) ...@@ -124,9 +125,9 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
if (!addr) if (!addr)
goto exit; goto exit;
buf = apl_log_payload_addr(addr); buf = avs_apl_log_payload_addr(addr);
memcpy_fromio(&layout, addr, sizeof(layout)); memcpy_fromio(&layout, addr, sizeof(layout));
if (!apl_is_entry_stackdump(buf + layout.read_ptr)) { if (!avs_apl_is_entry_stackdump(buf + layout.read_ptr)) {
union avs_notify_msg lbs_msg = AVS_NOTIFICATION(LOG_BUFFER_STATUS); union avs_notify_msg lbs_msg = AVS_NOTIFICATION(LOG_BUFFER_STATUS);
/* /*
...@@ -142,11 +143,11 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg) ...@@ -142,11 +143,11 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
do { do {
u32 count; u32 count;
if (apl_wait_log_entry(adev, msg->ext.coredump.core_id, &layout)) if (avs_apl_wait_log_entry(adev, msg->ext.coredump.core_id, &layout))
break; break;
if (layout.read_ptr > layout.write_ptr) { if (layout.read_ptr > layout.write_ptr) {
count = apl_log_payload_size(adev) - layout.read_ptr; count = avs_apl_log_payload_size(adev) - layout.read_ptr;
memcpy_fromio(pos + offset, buf + layout.read_ptr, count); memcpy_fromio(pos + offset, buf + layout.read_ptr, count);
layout.read_ptr = 0; layout.read_ptr = 0;
offset += count; offset += count;
...@@ -165,7 +166,7 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg) ...@@ -165,7 +166,7 @@ static int apl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
return 0; return 0;
} }
static bool apl_lp_streaming(struct avs_dev *adev) static bool avs_apl_lp_streaming(struct avs_dev *adev)
{ {
struct avs_path *path; struct avs_path *path;
...@@ -201,7 +202,7 @@ static bool apl_lp_streaming(struct avs_dev *adev) ...@@ -201,7 +202,7 @@ static bool apl_lp_streaming(struct avs_dev *adev)
return true; return true;
} }
static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake) static bool avs_apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
{ {
/* wake in all cases */ /* wake in all cases */
if (wake) if (wake)
...@@ -215,10 +216,10 @@ static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool w ...@@ -215,10 +216,10 @@ static bool apl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool w
* Note: for cAVS 1.5+ and 1.8, D0IX is LP-firmware transition, * Note: for cAVS 1.5+ and 1.8, D0IX is LP-firmware transition,
* not the power-gating mechanism known from cAVS 2.0. * not the power-gating mechanism known from cAVS 2.0.
*/ */
return apl_lp_streaming(adev); return avs_apl_lp_streaming(adev);
} }
static int apl_set_d0ix(struct avs_dev *adev, bool enable) static int avs_apl_set_d0ix(struct avs_dev *adev, bool enable)
{ {
bool streaming = false; bool streaming = false;
int ret; int ret;
...@@ -231,7 +232,7 @@ static int apl_set_d0ix(struct avs_dev *adev, bool enable) ...@@ -231,7 +232,7 @@ static int apl_set_d0ix(struct avs_dev *adev, bool enable)
return AVS_IPC_RET(ret); return AVS_IPC_RET(ret);
} }
const struct avs_dsp_ops apl_dsp_ops = { const struct avs_dsp_ops avs_apl_dsp_ops = {
.power = avs_dsp_core_power, .power = avs_dsp_core_power,
.reset = avs_dsp_core_reset, .reset = avs_dsp_core_reset,
.stall = avs_dsp_core_stall, .stall = avs_dsp_core_stall,
...@@ -241,10 +242,10 @@ const struct avs_dsp_ops apl_dsp_ops = { ...@@ -241,10 +242,10 @@ const struct avs_dsp_ops apl_dsp_ops = {
.load_basefw = avs_hda_load_basefw, .load_basefw = avs_hda_load_basefw,
.load_lib = avs_hda_load_library, .load_lib = avs_hda_load_library,
.transfer_mods = avs_hda_transfer_modules, .transfer_mods = avs_hda_transfer_modules,
.log_buffer_offset = skl_log_buffer_offset, .log_buffer_offset = avs_skl_log_buffer_offset,
.log_buffer_status = apl_log_buffer_status, .log_buffer_status = avs_apl_log_buffer_status,
.coredump = apl_coredump, .coredump = avs_apl_coredump,
.d0ix_toggle = apl_d0ix_toggle, .d0ix_toggle = avs_apl_d0ix_toggle,
.set_d0ix = apl_set_d0ix, .set_d0ix = avs_apl_set_d0ix,
AVS_SET_ENABLE_LOGS_OP(apl) AVS_SET_ENABLE_LOGS_OP(apl)
}; };
...@@ -64,8 +64,8 @@ struct avs_dsp_ops { ...@@ -64,8 +64,8 @@ struct avs_dsp_ops {
#define avs_dsp_op(adev, op, ...) \ #define avs_dsp_op(adev, op, ...) \
((adev)->spec->dsp_ops->op(adev, ## __VA_ARGS__)) ((adev)->spec->dsp_ops->op(adev, ## __VA_ARGS__))
extern const struct avs_dsp_ops skl_dsp_ops; extern const struct avs_dsp_ops avs_skl_dsp_ops;
extern const struct avs_dsp_ops apl_dsp_ops; extern const struct avs_dsp_ops avs_apl_dsp_ops;
#define AVS_PLATATTR_CLDMA BIT_ULL(0) #define AVS_PLATATTR_CLDMA BIT_ULL(0)
#define AVS_PLATATTR_IMR BIT_ULL(1) #define AVS_PLATATTR_IMR BIT_ULL(1)
...@@ -249,7 +249,7 @@ void avs_ipc_block(struct avs_ipc *ipc); ...@@ -249,7 +249,7 @@ void avs_ipc_block(struct avs_ipc *ipc);
int avs_dsp_disable_d0ix(struct avs_dev *adev); int avs_dsp_disable_d0ix(struct avs_dev *adev);
int avs_dsp_enable_d0ix(struct avs_dev *adev); int avs_dsp_enable_d0ix(struct avs_dev *adev);
int skl_log_buffer_offset(struct avs_dev *adev, u32 core); int avs_skl_log_buffer_offset(struct avs_dev *adev, u32 core);
/* Firmware resources management */ /* Firmware resources management */
...@@ -343,21 +343,21 @@ static inline int avs_log_buffer_status_locked(struct avs_dev *adev, union avs_n ...@@ -343,21 +343,21 @@ static inline int avs_log_buffer_status_locked(struct avs_dev *adev, union avs_n
return ret; return ret;
} }
struct apl_log_buffer_layout { struct avs_apl_log_buffer_layout {
u32 read_ptr; u32 read_ptr;
u32 write_ptr; u32 write_ptr;
u8 buffer[]; u8 buffer[];
} __packed; } __packed;
#define apl_log_payload_size(adev) \ #define avs_apl_log_payload_size(adev) \
(avs_log_buffer_size(adev) - sizeof(struct apl_log_buffer_layout)) (avs_log_buffer_size(adev) - sizeof(struct avs_apl_log_buffer_layout))
#define apl_log_payload_addr(addr) \ #define avs_apl_log_payload_addr(addr) \
(addr + sizeof(struct apl_log_buffer_layout)) (addr + sizeof(struct avs_apl_log_buffer_layout))
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#define AVS_SET_ENABLE_LOGS_OP(name) \ #define AVS_SET_ENABLE_LOGS_OP(name) \
.enable_logs = name##_enable_logs .enable_logs = avs_##name##_enable_logs
bool avs_logging_fw(struct avs_dev *adev); bool avs_logging_fw(struct avs_dev *adev);
void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len); void avs_dump_fw_log(struct avs_dev *adev, const void __iomem *src, unsigned int len);
......
...@@ -738,7 +738,7 @@ static const struct avs_spec skl_desc = { ...@@ -738,7 +738,7 @@ static const struct avs_spec skl_desc = {
.hotfix = 0, .hotfix = 0,
.build = 4732, .build = 4732,
}, },
.dsp_ops = &skl_dsp_ops, .dsp_ops = &avs_skl_dsp_ops,
.core_init_mask = 1, .core_init_mask = 1,
.attributes = AVS_PLATATTR_CLDMA, .attributes = AVS_PLATATTR_CLDMA,
.sram_base_offset = SKL_ADSP_SRAM_BASE_OFFSET, .sram_base_offset = SKL_ADSP_SRAM_BASE_OFFSET,
...@@ -754,7 +754,7 @@ static const struct avs_spec apl_desc = { ...@@ -754,7 +754,7 @@ static const struct avs_spec apl_desc = {
.hotfix = 1, .hotfix = 1,
.build = 4323, .build = 4323,
}, },
.dsp_ops = &apl_dsp_ops, .dsp_ops = &avs_apl_dsp_ops,
.core_init_mask = 3, .core_init_mask = 3,
.attributes = AVS_PLATATTR_IMR, .attributes = AVS_PLATATTR_IMR,
.sram_base_offset = APL_ADSP_SRAM_BASE_OFFSET, .sram_base_offset = APL_ADSP_SRAM_BASE_OFFSET,
......
...@@ -359,21 +359,21 @@ enum avs_skl_log_priority { ...@@ -359,21 +359,21 @@ enum avs_skl_log_priority {
AVS_SKL_LOG_VERBOSE, AVS_SKL_LOG_VERBOSE,
}; };
struct skl_log_state { struct avs_skl_log_state {
u32 enable; u32 enable;
u32 min_priority; u32 min_priority;
} __packed; } __packed;
struct skl_log_state_info { struct avs_skl_log_state_info {
u32 core_mask; u32 core_mask;
struct skl_log_state logs_core[]; struct avs_skl_log_state logs_core[];
} __packed; } __packed;
struct apl_log_state_info { struct avs_apl_log_state_info {
u32 aging_timer_period; u32 aging_timer_period;
u32 fifo_full_timer_period; u32 fifo_full_timer_period;
u32 core_mask; u32 core_mask;
struct skl_log_state logs_core[]; struct avs_skl_log_state logs_core[];
} __packed; } __packed;
int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size); int avs_ipc_set_enable_logs(struct avs_dev *adev, u8 *log_info, size_t size);
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
#include "messages.h" #include "messages.h"
static int __maybe_unused static int __maybe_unused
skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period, avs_skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_period,
u32 fifo_full_period, unsigned long resource_mask, u32 *priorities) u32 fifo_full_period, unsigned long resource_mask, u32 *priorities)
{ {
struct skl_log_state_info *info; struct avs_skl_log_state_info *info;
u32 size, num_cores = adev->hw_cfg.dsp_cores; u32 size, num_cores = adev->hw_cfg.dsp_cores;
int ret, i; int ret, i;
...@@ -45,7 +45,7 @@ skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri ...@@ -45,7 +45,7 @@ skl_enable_logs(struct avs_dev *adev, enum avs_log_enable enable, u32 aging_peri
return 0; return 0;
} }
int skl_log_buffer_offset(struct avs_dev *adev, u32 core) int avs_skl_log_buffer_offset(struct avs_dev *adev, u32 core)
{ {
return core * avs_log_buffer_size(adev); return core * avs_log_buffer_size(adev);
} }
...@@ -53,8 +53,7 @@ int skl_log_buffer_offset(struct avs_dev *adev, u32 core) ...@@ -53,8 +53,7 @@ int skl_log_buffer_offset(struct avs_dev *adev, u32 core)
/* fw DbgLogWp registers */ /* fw DbgLogWp registers */
#define FW_REGS_DBG_LOG_WP(core) (0x30 + 0x4 * core) #define FW_REGS_DBG_LOG_WP(core) (0x30 + 0x4 * core)
static int static int avs_skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
{ {
void __iomem *buf; void __iomem *buf;
u16 size, write, offset; u16 size, write, offset;
...@@ -74,7 +73,7 @@ skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg) ...@@ -74,7 +73,7 @@ skl_log_buffer_status(struct avs_dev *adev, union avs_notify_msg *msg)
return 0; return 0;
} }
static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg) static int avs_skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
{ {
u8 *dump; u8 *dump;
...@@ -88,20 +87,19 @@ static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg) ...@@ -88,20 +87,19 @@ static int skl_coredump(struct avs_dev *adev, union avs_notify_msg *msg)
return 0; return 0;
} }
static bool static bool avs_skl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
skl_d0ix_toggle(struct avs_dev *adev, struct avs_ipc_msg *tx, bool wake)
{ {
/* unsupported on cAVS 1.5 hw */ /* unsupported on cAVS 1.5 hw */
return false; return false;
} }
static int skl_set_d0ix(struct avs_dev *adev, bool enable) static int avs_skl_set_d0ix(struct avs_dev *adev, bool enable)
{ {
/* unsupported on cAVS 1.5 hw */ /* unsupported on cAVS 1.5 hw */
return 0; return 0;
} }
const struct avs_dsp_ops skl_dsp_ops = { const struct avs_dsp_ops avs_skl_dsp_ops = {
.power = avs_dsp_core_power, .power = avs_dsp_core_power,
.reset = avs_dsp_core_reset, .reset = avs_dsp_core_reset,
.stall = avs_dsp_core_stall, .stall = avs_dsp_core_stall,
...@@ -111,10 +109,10 @@ const struct avs_dsp_ops skl_dsp_ops = { ...@@ -111,10 +109,10 @@ const struct avs_dsp_ops skl_dsp_ops = {
.load_basefw = avs_cldma_load_basefw, .load_basefw = avs_cldma_load_basefw,
.load_lib = avs_cldma_load_library, .load_lib = avs_cldma_load_library,
.transfer_mods = avs_cldma_transfer_modules, .transfer_mods = avs_cldma_transfer_modules,
.log_buffer_offset = skl_log_buffer_offset, .log_buffer_offset = avs_skl_log_buffer_offset,
.log_buffer_status = skl_log_buffer_status, .log_buffer_status = avs_skl_log_buffer_status,
.coredump = skl_coredump, .coredump = avs_skl_coredump,
.d0ix_toggle = skl_d0ix_toggle, .d0ix_toggle = avs_skl_d0ix_toggle,
.set_d0ix = skl_set_d0ix, .set_d0ix = avs_skl_set_d0ix,
AVS_SET_ENABLE_LOGS_OP(skl) AVS_SET_ENABLE_LOGS_OP(skl)
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment