Commit 170b1e12 authored by Wen Shi's avatar Wen Shi Committed by Mark Brown

ASoC: wm_adsp: Add support for new Halo core DSPs

The Halo core is a new generation of audio DSP architecture from
Cirrus Logic. A new iteration of the WMFW file format (v3) is also
added, for this new architecture. Currently this format is not
supported on the old ADSP2 architecture however support may be
added for it in the future.
Signed-off-by: default avatarWen Shi <wenshi@opensource.cirrus.com>
Signed-off-by: default avatarPiotr Stankiewicz <piotrs@opensource.cirrus.com>
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c6839641
This diff is collapsed.
...@@ -70,6 +70,7 @@ struct wm_adsp { ...@@ -70,6 +70,7 @@ struct wm_adsp {
struct wm_adsp_ops *ops; struct wm_adsp_ops *ops;
unsigned int base; unsigned int base;
unsigned int base_sysinfo;
unsigned int sysclk_reg; unsigned int sysclk_reg;
unsigned int sysclk_mask; unsigned int sysclk_mask;
unsigned int sysclk_shift; unsigned int sysclk_shift;
...@@ -78,6 +79,7 @@ struct wm_adsp { ...@@ -78,6 +79,7 @@ struct wm_adsp {
unsigned int fw_id; unsigned int fw_id;
unsigned int fw_id_version; unsigned int fw_id_version;
unsigned int fw_vendor_id;
const struct wm_adsp_region *mem; const struct wm_adsp_region *mem;
int num_mems; int num_mems;
...@@ -110,12 +112,16 @@ struct wm_adsp { ...@@ -110,12 +112,16 @@ struct wm_adsp {
}; };
struct wm_adsp_ops { struct wm_adsp_ops {
unsigned int sys_config_size;
bool (*validate_version)(struct wm_adsp *dsp, unsigned int version); bool (*validate_version)(struct wm_adsp *dsp, unsigned int version);
unsigned int (*parse_sizes)(struct wm_adsp *dsp, unsigned int (*parse_sizes)(struct wm_adsp *dsp,
const char * const file, const char * const file,
unsigned int pos, unsigned int pos,
const struct firmware *firmware); const struct firmware *firmware);
int (*setup_algs)(struct wm_adsp *dsp); int (*setup_algs)(struct wm_adsp *dsp);
unsigned int (*region_to_reg)(struct wm_adsp_region const *mem,
unsigned int offset);
void (*show_fw_status)(struct wm_adsp *dsp); void (*show_fw_status)(struct wm_adsp *dsp);
void (*stop_watchdog)(struct wm_adsp *dsp); void (*stop_watchdog)(struct wm_adsp *dsp);
...@@ -160,6 +166,8 @@ int wm_adsp2_init(struct wm_adsp *dsp); ...@@ -160,6 +166,8 @@ int wm_adsp2_init(struct wm_adsp *dsp);
void wm_adsp2_remove(struct wm_adsp *dsp); void wm_adsp2_remove(struct wm_adsp *dsp);
int wm_adsp2_component_probe(struct wm_adsp *dsp, struct snd_soc_component *component); int wm_adsp2_component_probe(struct wm_adsp *dsp, struct snd_soc_component *component);
int wm_adsp2_component_remove(struct wm_adsp *dsp, struct snd_soc_component *component); int wm_adsp2_component_remove(struct wm_adsp *dsp, struct snd_soc_component *component);
int wm_halo_init(struct wm_adsp *dsp);
int wm_adsp1_event(struct snd_soc_dapm_widget *w, int wm_adsp1_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event); struct snd_kcontrol *kcontrol, int event);
......
...@@ -73,6 +73,14 @@ struct wmfw_id_hdr { ...@@ -73,6 +73,14 @@ struct wmfw_id_hdr {
__be32 ver; __be32 ver;
} __packed; } __packed;
struct wmfw_v3_id_hdr {
__be32 core_id;
__be32 block_rev;
__be32 vendor_id;
__be32 id;
__be32 ver;
} __packed;
struct wmfw_adsp1_id_hdr { struct wmfw_adsp1_id_hdr {
struct wmfw_id_hdr fw; struct wmfw_id_hdr fw;
__be32 zm; __be32 zm;
...@@ -88,6 +96,15 @@ struct wmfw_adsp2_id_hdr { ...@@ -88,6 +96,15 @@ struct wmfw_adsp2_id_hdr {
__be32 n_algs; __be32 n_algs;
} __packed; } __packed;
struct wmfw_halo_id_hdr {
struct wmfw_v3_id_hdr fw;
__be32 xm_base;
__be32 xm_size;
__be32 ym_base;
__be32 ym_size;
__be32 n_algs;
} __packed;
struct wmfw_alg_hdr { struct wmfw_alg_hdr {
__be32 id; __be32 id;
__be32 ver; __be32 ver;
...@@ -106,6 +123,14 @@ struct wmfw_adsp2_alg_hdr { ...@@ -106,6 +123,14 @@ struct wmfw_adsp2_alg_hdr {
__be32 ym; __be32 ym;
} __packed; } __packed;
struct wmfw_halo_alg_hdr {
struct wmfw_alg_hdr alg;
__be32 xm_base;
__be32 xm_size;
__be32 ym_base;
__be32 ym_size;
} __packed;
struct wmfw_adsp_alg_data { struct wmfw_adsp_alg_data {
__le32 id; __le32 id;
u8 name[WMFW_MAX_ALG_NAME]; u8 name[WMFW_MAX_ALG_NAME];
...@@ -154,6 +179,7 @@ struct wmfw_coeff_item { ...@@ -154,6 +179,7 @@ struct wmfw_coeff_item {
#define WMFW_ADSP1 1 #define WMFW_ADSP1 1
#define WMFW_ADSP2 2 #define WMFW_ADSP2 2
#define WMFW_HALO 4
#define WMFW_ABSOLUTE 0xf0 #define WMFW_ABSOLUTE 0xf0
#define WMFW_ALGORITHM_DATA 0xf2 #define WMFW_ALGORITHM_DATA 0xf2
...@@ -169,4 +195,8 @@ struct wmfw_coeff_item { ...@@ -169,4 +195,8 @@ struct wmfw_coeff_item {
#define WMFW_ADSP2_XM 5 #define WMFW_ADSP2_XM 5
#define WMFW_ADSP2_YM 6 #define WMFW_ADSP2_YM 6
#define WMFW_HALO_PM_PACKED 0x10
#define WMFW_HALO_XM_PACKED 0x11
#define WMFW_HALO_YM_PACKED 0x12
#endif #endif
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