@@ -82,7 +82,7 @@ static struct hdac_ext_stream *cl_stream_prepare(struct snd_sof_dev *sdev, unsig
8282 * status on core 1, so power up core 1 also momentarily, keep it in
8383 * reset/stall and then turn it off
8484 */
85- static int cl_dsp_init (struct snd_sof_dev * sdev , int stream_tag , int iteration )
85+ static int cl_dsp_init (struct snd_sof_dev * sdev , int stream_tag )
8686{
8787 struct sof_intel_hda_dev * hda = sdev -> pdata -> hw_pdata ;
8888 const struct sof_intel_dsp_desc * chip = hda -> desc ;
@@ -93,7 +93,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
9393 /* step 1: power up corex */
9494 ret = hda_dsp_core_power_up (sdev , chip -> host_managed_cores_mask );
9595 if (ret < 0 ) {
96- if (iteration == HDA_FW_BOOT_ATTEMPTS )
96+ if (hda -> boot_iteration == HDA_FW_BOOT_ATTEMPTS )
9797 dev_err (sdev -> dev , "error: dsp core 0/1 power up failed\n" );
9898 goto err ;
9999 }
@@ -116,7 +116,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
116116 /* step 3: unset core 0 reset state & unstall/run core 0 */
117117 ret = hda_dsp_core_run (sdev , BIT (0 ));
118118 if (ret < 0 ) {
119- if (iteration == HDA_FW_BOOT_ATTEMPTS )
119+ if (hda -> boot_iteration == HDA_FW_BOOT_ATTEMPTS )
120120 dev_err (sdev -> dev ,
121121 "error: dsp core start failed %d\n" , ret );
122122 ret = - EIO ;
@@ -132,7 +132,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
132132 HDA_DSP_INIT_TIMEOUT_US );
133133
134134 if (ret < 0 ) {
135- if (iteration == HDA_FW_BOOT_ATTEMPTS )
135+ if (hda -> boot_iteration == HDA_FW_BOOT_ATTEMPTS )
136136 dev_err (sdev -> dev ,
137137 "error: %s: timeout for HIPCIE done\n" ,
138138 __func__ );
@@ -148,7 +148,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
148148 /* step 5: power down corex */
149149 ret = hda_dsp_core_power_down (sdev , chip -> host_managed_cores_mask & ~(BIT (0 )));
150150 if (ret < 0 ) {
151- if (iteration == HDA_FW_BOOT_ATTEMPTS )
151+ if (hda -> boot_iteration == HDA_FW_BOOT_ATTEMPTS )
152152 dev_err (sdev -> dev ,
153153 "error: dsp core x power down failed\n" );
154154 goto err ;
@@ -168,7 +168,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag, int iteration)
168168 if (!ret )
169169 return 0 ;
170170
171- if (iteration == HDA_FW_BOOT_ATTEMPTS )
171+ if (hda -> boot_iteration == HDA_FW_BOOT_ATTEMPTS )
172172 dev_err (sdev -> dev ,
173173 "error: %s: timeout HDA_DSP_SRAM_REG_ROM_STATUS read\n" ,
174174 __func__ );
@@ -328,6 +328,7 @@ int hda_dsp_cl_boot_firmware_iccmax(struct snd_sof_dev *sdev)
328328
329329int hda_dsp_cl_boot_firmware (struct snd_sof_dev * sdev )
330330{
331+ struct sof_intel_hda_dev * hda = sdev -> pdata -> hw_pdata ;
331332 struct snd_sof_pdata * plat_data = sdev -> pdata ;
332333 const struct sof_dev_desc * desc = plat_data -> desc ;
333334 const struct sof_intel_dsp_desc * chip_info ;
@@ -364,7 +365,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
364365 dev_dbg (sdev -> dev ,
365366 "Attempting iteration %d of Core En/ROM load...\n" , i );
366367
367- ret = cl_dsp_init (sdev , stream -> hstream .stream_tag , i + 1 );
368+ hda -> boot_iteration = i ;
369+ ret = cl_dsp_init (sdev , stream -> hstream .stream_tag );
368370
369371 /* don't retry anymore if successful */
370372 if (!ret )
0 commit comments