Skip to content

Commit 71778f7

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc
Add the rom_status_reg field to struct sof_intel_dsp_desc and define it for HDA platforms. This will be used to check the ROM status during FW boot. Signed-off-by: Ranjani Sridharan <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3dee239 commit 71778f7

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

sound/soc/sof/intel/apl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const struct sof_intel_dsp_desc apl_chip_info = {
7171
.ipc_ack = HDA_DSP_REG_HIPCIE,
7272
.ipc_ack_mask = HDA_DSP_REG_HIPCIE_DONE,
7373
.ipc_ctl = HDA_DSP_REG_HIPCCTL,
74+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
7475
.rom_init_timeout = 150,
7576
.ssp_count = APL_SSP_COUNT,
7677
.ssp_base_offset = APL_SSP_BASE_OFFSET,

sound/soc/sof/intel/cnl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ const struct sof_intel_dsp_desc cnl_chip_info = {
289289
.ipc_ack = CNL_DSP_REG_HIPCIDA,
290290
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
291291
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
292+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
292293
.rom_init_timeout = 300,
293294
.ssp_count = CNL_SSP_COUNT,
294295
.ssp_base_offset = CNL_SSP_BASE_OFFSET,
@@ -316,6 +317,7 @@ const struct sof_intel_dsp_desc jsl_chip_info = {
316317
.ipc_ack = CNL_DSP_REG_HIPCIDA,
317318
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
318319
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
320+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
319321
.rom_init_timeout = 300,
320322
.ssp_count = ICL_SSP_COUNT,
321323
.ssp_base_offset = CNL_SSP_BASE_OFFSET,

sound/soc/sof/intel/hda-loader.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
171171

172172
/* step 7: wait for ROM init */
173173
ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
174-
HDA_DSP_SRAM_REG_ROM_STATUS, status,
174+
chip->rom_status_reg, status,
175175
((status & HDA_DSP_ROM_STS_MASK)
176176
== HDA_DSP_ROM_INIT),
177177
HDA_DSP_REG_POLL_INTERVAL_US,
@@ -188,8 +188,8 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
188188

189189
if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
190190
dev_err(sdev->dev,
191-
"error: %s: timeout HDA_DSP_SRAM_REG_ROM_STATUS read\n",
192-
__func__);
191+
"%s: timeout with rom_status_reg (%#x) read\n",
192+
__func__, chip->rom_status_reg);
193193

194194
err:
195195
flags = SOF_DBG_DUMP_PCI | SOF_DBG_DUMP_MBOX | SOF_DBG_DUMP_OPTIONAL;
@@ -268,6 +268,8 @@ static int cl_cleanup(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
268268

269269
static int cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream)
270270
{
271+
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
272+
const struct sof_intel_dsp_desc *chip = hda->desc;
271273
unsigned int reg;
272274
int ret, status;
273275

@@ -278,7 +280,7 @@ static int cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_str
278280
}
279281

280282
status = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
281-
HDA_DSP_SRAM_REG_ROM_STATUS, reg,
283+
chip->rom_status_reg, reg,
282284
((reg & HDA_DSP_ROM_STS_MASK)
283285
== HDA_DSP_ROM_FW_ENTERED),
284286
HDA_DSP_REG_POLL_INTERVAL_US,
@@ -291,8 +293,8 @@ static int cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_str
291293

292294
if (status < 0) {
293295
dev_err(sdev->dev,
294-
"error: %s: timeout HDA_DSP_SRAM_REG_ROM_STATUS read\n",
295-
__func__);
296+
"%s: timeout with rom_status_reg (%#x) read\n",
297+
__func__, chip->rom_status_reg);
296298
}
297299

298300
ret = cl_trigger(sdev, hext_stream, SNDRV_PCM_TRIGGER_STOP);

sound/soc/sof/intel/hda.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,13 @@ static const struct hda_dsp_msg_code hda_dsp_rom_msg[] = {
406406

407407
static void hda_dsp_get_status(struct snd_sof_dev *sdev, const char *level)
408408
{
409+
const struct sof_intel_dsp_desc *chip;
409410
u32 status;
410411
int i;
411412

413+
chip = get_chip_info(sdev->pdata);
412414
status = snd_sof_dsp_read(sdev, HDA_DSP_BAR,
413-
HDA_DSP_SRAM_REG_ROM_STATUS);
415+
chip->rom_status_reg);
414416

415417
for (i = 0; i < ARRAY_SIZE(hda_dsp_rom_msg); i++) {
416418
if (status == hda_dsp_rom_msg[i].code) {
@@ -456,13 +458,15 @@ static void hda_dsp_get_registers(struct snd_sof_dev *sdev,
456458
static void hda_dsp_dump_ext_rom_status(struct snd_sof_dev *sdev, const char *level,
457459
u32 flags)
458460
{
461+
const struct sof_intel_dsp_desc *chip;
459462
char msg[128];
460463
int len = 0;
461464
u32 value;
462465
int i;
463466

467+
chip = get_chip_info(sdev->pdata);
464468
for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
465-
value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_ROM_STATUS + i * 0x4);
469+
value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4);
466470
len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
467471
}
468472

sound/soc/sof/intel/icl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const struct sof_intel_dsp_desc icl_chip_info = {
134134
.ipc_ack = CNL_DSP_REG_HIPCIDA,
135135
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
136136
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
137+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
137138
.rom_init_timeout = 300,
138139
.ssp_count = ICL_SSP_COUNT,
139140
.ssp_base_offset = CNL_SSP_BASE_OFFSET,

sound/soc/sof/intel/shim.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ struct sof_intel_dsp_desc {
164164
int ipc_ack;
165165
int ipc_ack_mask;
166166
int ipc_ctl;
167+
int rom_status_reg;
167168
int rom_init_timeout;
168169
int ssp_count; /* ssp count of the platform */
169170
int ssp_base_offset; /* base address of the SSPs */

sound/soc/sof/intel/tgl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const struct sof_intel_dsp_desc tgl_chip_info = {
105105
.ipc_ack = CNL_DSP_REG_HIPCIDA,
106106
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
107107
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
108+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
108109
.rom_init_timeout = 300,
109110
.ssp_count = ICL_SSP_COUNT,
110111
.ssp_base_offset = CNL_SSP_BASE_OFFSET,
@@ -125,6 +126,7 @@ const struct sof_intel_dsp_desc tglh_chip_info = {
125126
.ipc_ack = CNL_DSP_REG_HIPCIDA,
126127
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
127128
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
129+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
128130
.rom_init_timeout = 300,
129131
.ssp_count = ICL_SSP_COUNT,
130132
.ssp_base_offset = CNL_SSP_BASE_OFFSET,
@@ -145,6 +147,7 @@ const struct sof_intel_dsp_desc ehl_chip_info = {
145147
.ipc_ack = CNL_DSP_REG_HIPCIDA,
146148
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
147149
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
150+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
148151
.rom_init_timeout = 300,
149152
.ssp_count = ICL_SSP_COUNT,
150153
.ssp_base_offset = CNL_SSP_BASE_OFFSET,
@@ -165,6 +168,7 @@ const struct sof_intel_dsp_desc adls_chip_info = {
165168
.ipc_ack = CNL_DSP_REG_HIPCIDA,
166169
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
167170
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
171+
.rom_status_reg = HDA_DSP_SRAM_REG_ROM_STATUS,
168172
.rom_init_timeout = 300,
169173
.ssp_count = ICL_SSP_COUNT,
170174
.ssp_base_offset = CNL_SSP_BASE_OFFSET,

0 commit comments

Comments
 (0)