2019-03-29 14:12:17 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-16 02:05:43 +08:00
|
|
|
From: "Shaik, Kareem M" <kareem.m.shaik@intel.com>
|
|
|
|
Date: Fri, 1 Dec 2017 00:46:21 +0530
|
2019-03-29 14:12:17 +08:00
|
|
|
Subject: [PATCH] ASoC: Intel: BXT: Retry FW download sequence
|
2018-10-16 02:05:43 +08:00
|
|
|
|
|
|
|
In FW download failure case, the recommended solution is to repeat
|
|
|
|
complete download sequence in multiple iterations.FW download
|
|
|
|
sequence is:
|
|
|
|
|
|
|
|
1. ROM initialization
|
|
|
|
2. BaseFW download
|
|
|
|
|
|
|
|
During FW download failure, repeat the entire download sequence in
|
|
|
|
three iteration and give-up.
|
|
|
|
|
|
|
|
Change-Id: Ib29d3b0208c91d959ca1df0fc963e3e9f1d2b994
|
|
|
|
Tracked-On:
|
|
|
|
Signed-off-by: Kareem,Shaik <kareem.m.shaik@intel.com>
|
|
|
|
Reviewed-on:
|
|
|
|
Reviewed-on:
|
|
|
|
Reviewed-by: Shaik, ShahinaX <shahinax.shaik@intel.com>
|
|
|
|
Reviewed-by: Gogineni, GiribabuX <giribabux.gogineni@intel.com>
|
|
|
|
Reviewed-by: Sinha, Mohit <mohit.sinha@intel.com>
|
|
|
|
Reviewed-by: Singh, Guneshwor O <guneshwor.o.singh@intel.com>
|
|
|
|
Reviewed-by: Kp, Jeeja <jeeja.kp@intel.com>
|
|
|
|
Tested-by: Madiwalar, MadiwalappaX <madiwalappax.madiwalar@intel.com>
|
|
|
|
---
|
|
|
|
sound/soc/intel/skylake/bxt-sst.c | 46 ++++++++++++++++++-------------
|
|
|
|
1 file changed, 27 insertions(+), 19 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/sound/soc/intel/skylake/bxt-sst.c b/sound/soc/intel/skylake/bxt-sst.c
|
2019-03-29 14:12:17 +08:00
|
|
|
index 2eb57d7..47b2a24 100644
|
2018-10-16 02:05:43 +08:00
|
|
|
--- a/sound/soc/intel/skylake/bxt-sst.c
|
|
|
|
+++ b/sound/soc/intel/skylake/bxt-sst.c
|
|
|
|
@@ -59,7 +59,7 @@
|
|
|
|
/* Delay before scheduling D0i3 entry */
|
|
|
|
#define BXT_D0I3_DELAY 5000
|
|
|
|
|
|
|
|
-#define BXT_FW_ROM_INIT_RETRY 3
|
|
|
|
+#define BXT_FW_INIT_RETRY 3
|
|
|
|
|
|
|
|
#define GET_SSP_BASE(N) (N > 4 ? 0x2000 : 0x4000)
|
|
|
|
|
|
|
|
@@ -270,30 +270,38 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx)
|
|
|
|
stripped_fw.size = ctx->fw->size;
|
|
|
|
skl_dsp_strip_extended_manifest(&stripped_fw);
|
|
|
|
|
|
|
|
-
|
|
|
|
- for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) {
|
|
|
|
+ for (i = 0; i < BXT_FW_INIT_RETRY; i++) {
|
|
|
|
ret = sst_bxt_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ dev_err(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
|
|
|
|
+ sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
|
|
|
|
+ sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
|
|
|
|
+
|
|
|
|
+ dev_err(ctx->dev, "Itertion %d Core En/ROM load fail:%d\n", i,ret);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ dev_dbg(ctx->dev, "Itertion %d ROM load Success:%d,%d\n", i,ret);
|
|
|
|
+
|
|
|
|
+ ret = sst_transfer_fw_host_dma(ctx);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ dev_err(ctx->dev, "Itertion %d Transfer firmware failed %d\n", i,ret);
|
|
|
|
+ dev_info(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
|
|
|
|
+ sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
|
|
|
|
+ sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
|
|
|
|
+
|
|
|
|
+ skl_dsp_core_power_down(ctx, SKL_DSP_CORE_MASK(1));
|
|
|
|
+ skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ dev_dbg(ctx->dev, "Itertion %d FW transfer Success:%d,%d\n", i,ret);
|
|
|
|
+
|
|
|
|
if (ret == 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (ret < 0) {
|
|
|
|
- dev_err(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
|
|
|
|
- sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
|
|
|
|
- sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
|
|
|
|
-
|
|
|
|
- dev_err(ctx->dev, "Core En/ROM load fail:%d\n", ret);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ dev_err(ctx->dev, "Firmware download failed\n");
|
|
|
|
goto sst_load_base_firmware_failed;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ret = sst_transfer_fw_host_dma(ctx);
|
|
|
|
- if (ret < 0) {
|
|
|
|
- dev_err(ctx->dev, "Transfer firmware failed %d\n", ret);
|
|
|
|
- dev_info(ctx->dev, "Error code=0x%x: FW status=0x%x\n",
|
|
|
|
- sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE),
|
|
|
|
- sst_dsp_shim_read(ctx, BXT_ADSP_FW_STATUS));
|
|
|
|
-
|
|
|
|
- skl_dsp_disable_core(ctx, SKL_DSP_CORE0_MASK);
|
|
|
|
} else {
|
|
|
|
dev_dbg(ctx->dev, "Firmware download successful\n");
|
|
|
|
ret = wait_event_timeout(skl->boot_wait, skl->boot_complete,
|
|
|
|
--
|
2019-03-29 14:12:17 +08:00
|
|
|
2.21.0
|
2018-10-16 02:05:43 +08:00
|
|
|
|