diff options
author | Jie Yang <yang.jie@intel.com> | 2014-07-14 20:51:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-16 17:26:57 -0400 |
commit | 249adddb1a3155718876c8473ef57717d5208e37 (patch) | |
tree | f734f5252c63187eaf448e720a54ec698f0cb8ea | |
parent | 1d34f3ef4b6cd33c74b414df74b41a4606d1a306 (diff) |
ASoC: Intel: Update FW version readback
Update FW version readback. IPC_GLB_GET_FW_VERSION reads back
the ABI version whilst the release version is in the mailbox.
Update to use mailbox version for info logging.
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/intel/sst-haswell-ipc.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index 434236343ddf..96373ab46f8c 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c | |||
@@ -183,7 +183,7 @@ struct sst_hsw_ipc_fw_ready { | |||
183 | u32 inbox_size; | 183 | u32 inbox_size; |
184 | u32 outbox_size; | 184 | u32 outbox_size; |
185 | u32 fw_info_size; | 185 | u32 fw_info_size; |
186 | u8 fw_info[1]; | 186 | u8 fw_info[IPC_MAX_MAILBOX_BYTES - 5 * sizeof(u32)]; |
187 | } __attribute__((packed)); | 187 | } __attribute__((packed)); |
188 | 188 | ||
189 | struct ipc_message { | 189 | struct ipc_message { |
@@ -569,6 +569,9 @@ static void hsw_fw_ready(struct sst_hsw *hsw, u32 header) | |||
569 | { | 569 | { |
570 | struct sst_hsw_ipc_fw_ready fw_ready; | 570 | struct sst_hsw_ipc_fw_ready fw_ready; |
571 | u32 offset; | 571 | u32 offset; |
572 | u8 fw_info[IPC_MAX_MAILBOX_BYTES - 5 * sizeof(u32)]; | ||
573 | char *tmp[5], *pinfo; | ||
574 | int i = 0; | ||
572 | 575 | ||
573 | offset = (header & 0x1FFFFFFF) << 3; | 576 | offset = (header & 0x1FFFFFFF) << 3; |
574 | 577 | ||
@@ -589,6 +592,19 @@ static void hsw_fw_ready(struct sst_hsw *hsw, u32 header) | |||
589 | fw_ready.inbox_offset, fw_ready.inbox_size); | 592 | fw_ready.inbox_offset, fw_ready.inbox_size); |
590 | dev_dbg(hsw->dev, " mailbox downstream 0x%x - size 0x%x\n", | 593 | dev_dbg(hsw->dev, " mailbox downstream 0x%x - size 0x%x\n", |
591 | fw_ready.outbox_offset, fw_ready.outbox_size); | 594 | fw_ready.outbox_offset, fw_ready.outbox_size); |
595 | if (fw_ready.fw_info_size < sizeof(fw_ready.fw_info)) { | ||
596 | fw_ready.fw_info[fw_ready.fw_info_size] = 0; | ||
597 | dev_dbg(hsw->dev, " Firmware info: %s \n", fw_ready.fw_info); | ||
598 | |||
599 | /* log the FW version info got from the mailbox here. */ | ||
600 | memcpy(fw_info, fw_ready.fw_info, fw_ready.fw_info_size); | ||
601 | pinfo = &fw_info[0]; | ||
602 | for (i = 0; i < sizeof(tmp) / sizeof(char *); i++) | ||
603 | tmp[i] = strsep(&pinfo, " "); | ||
604 | dev_info(hsw->dev, "FW loaded, mailbox readback FW info: type %s, - " | ||
605 | "version: %s.%s, build %s, source commit id: %s\n", | ||
606 | tmp[0], tmp[1], tmp[2], tmp[3], tmp[4]); | ||
607 | } | ||
592 | } | 608 | } |
593 | 609 | ||
594 | static void hsw_notification_work(struct work_struct *work) | 610 | static void hsw_notification_work(struct work_struct *work) |
@@ -1775,8 +1791,6 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata) | |||
1775 | 1791 | ||
1776 | /* get the FW version */ | 1792 | /* get the FW version */ |
1777 | sst_hsw_fw_get_version(hsw, &version); | 1793 | sst_hsw_fw_get_version(hsw, &version); |
1778 | dev_info(hsw->dev, "FW loaded: type %d - version: %d.%d build %d\n", | ||
1779 | version.type, version.major, version.minor, version.build); | ||
1780 | 1794 | ||
1781 | /* get the globalmixer */ | 1795 | /* get the globalmixer */ |
1782 | ret = sst_hsw_mixer_get_info(hsw); | 1796 | ret = sst_hsw_mixer_get_info(hsw); |