Skip to content
Snippets Groups Projects
Commit f609df9b authored by Weiguang Kong's avatar Weiguang Kong Committed by Leonard Crestez
Browse files

MLK-16468-2: ASoC: fsl_hifi4: add multi-codec support for hifi4


The previous hifi4 driver and framework code can't support
multi-codec decoding or encoding together, so change the driver
code to support this feature.
Currently, the hifi4 driver and framework can support at most
5 codec working together.

Signed-off-by: default avatarWeiguang Kong <weiguang.kong@nxp.com>
Reviewed-by: default avatarMihai Serban <mihai.serban@nxp.com>
Signed-off-by: default avatarVipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: default avatarSrikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
parent 973cd65a
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -21,6 +21,7 @@ typedef void (*memcpy_func) (void *dest, const void *src, size_t n); ...@@ -21,6 +21,7 @@ typedef void (*memcpy_func) (void *dest, const void *src, size_t n);
typedef void (*memset_func) (void *s, int c, size_t n); typedef void (*memset_func) (void *s, int c, size_t n);
struct xtlib_packaged_library; struct xtlib_packaged_library;
#define MULTI_CODEC_NUM 5
enum { enum {
XTLIB_NO_ERR = 0, XTLIB_NO_ERR = 0,
...@@ -61,8 +62,6 @@ struct icm_cdc_iobuf_t { ...@@ -61,8 +62,6 @@ struct icm_cdc_iobuf_t {
struct icm_cdc_uinp_t { struct icm_cdc_uinp_t {
u32 proc_id; /* audio id */ u32 proc_id; /* audio id */
u32 codec_id; /* codec identifier */ u32 codec_id; /* codec identifier */
u32 pcm_wd_sz; /* pcm word size; only 16 or 24 */
u32 crc_check; /* 0: disable, 1: enable */
}; };
struct icm_pcm_prop_t { struct icm_pcm_prop_t {
...@@ -134,6 +133,8 @@ enum icm_action_t { ...@@ -134,6 +133,8 @@ enum icm_action_t {
ICM_CORE_EXIT, ICM_CORE_EXIT,
ICM_EXT_MSG_ADDR, ICM_EXT_MSG_ADDR,
ICM_SWITCH_CODEC,
}; };
enum aud_status_t { enum aud_status_t {
...@@ -150,6 +151,11 @@ struct icm_open_resp_info_t { ...@@ -150,6 +151,11 @@ struct icm_open_resp_info_t {
s32 ret; s32 ret;
}; };
struct icm_switch_info_t {
u32 proc_id; /* audio id */
u32 status; /* codec status */
};
struct lib_dnld_info_t { struct lib_dnld_info_t {
unsigned long pbuf_code; unsigned long pbuf_code;
unsigned long pbuf_data; unsigned long pbuf_data;
...@@ -166,6 +172,18 @@ struct icm_pilib_size_t { ...@@ -166,6 +172,18 @@ struct icm_pilib_size_t {
u32 data_size; u32 data_size;
}; };
struct icm_process_info {
unsigned int process_id;
unsigned int codec_id;
unsigned int proc_id;
void *data_buf_virt;
dma_addr_t data_buf_phys;
struct xtlib_pil_info pil_info_info;
unsigned int status;
};
struct fsl_hifi4 { struct fsl_hifi4 {
struct device *dev; struct device *dev;
const char *fw_name; const char *fw_name;
...@@ -214,6 +232,18 @@ struct fsl_hifi4 { ...@@ -214,6 +232,18 @@ struct fsl_hifi4 {
struct xtlib_pil_info pil_info; struct xtlib_pil_info pil_info;
struct xtlib_loader_globals xtlib_globals; struct xtlib_loader_globals xtlib_globals;
struct timestamp_info_t *dpu_tstamp; struct timestamp_info_t *dpu_tstamp;
struct mutex hifi4_mutex;
unsigned int process_id;
unsigned int process_id_count;
unsigned int size_code;
unsigned int size_data;
struct icm_process_info process_info[MULTI_CODEC_NUM];
unsigned int available_resource;
unsigned int cur_res_id;
}; };
struct fsl_hifi4_engine { struct fsl_hifi4_engine {
...@@ -234,6 +264,8 @@ struct hifi4_mem_msg { ...@@ -234,6 +264,8 @@ struct hifi4_mem_msg {
u32 data_size; u32 data_size;
u32 scratch_phys; u32 scratch_phys;
u32 scratch_size; u32 scratch_size;
u32 system_input_buf_phys;
u32 system_input_buf_size;
}; };
#define IRAM_OFFSET 0x10000 #define IRAM_OFFSET 0x10000
...@@ -257,8 +289,8 @@ struct hifi4_mem_msg { ...@@ -257,8 +289,8 @@ struct hifi4_mem_msg {
#define MSG_BUF_SIZE 4096 #define MSG_BUF_SIZE 4096
#define INPUT_BUF_SIZE 4096 #define INPUT_BUF_SIZE 4096
#define OUTPUT_BUF_SIZE 16384 #define OUTPUT_BUF_SIZE 16384
#define FIRMWARE_DATA_BUF_SIZE 0x100000 #define FIRMWARE_DATA_BUF_SIZE (MULTI_CODEC_NUM * 0x80000)
#define SCRATCH_DATA_BUF_SIZE 0x100000 #define SCRATCH_DATA_BUF_SIZE (MULTI_CODEC_NUM * 0x80000)
#define MEMORY_REMAP_OFFSET 0x39000000 #define MEMORY_REMAP_OFFSET 0x39000000
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment