Skip to content

Commit 552f0f2

Browse files
ktrzcinxkv2019i
authored andcommitted
ASoC: SOF: ext_manifest: Parse debug ABI version
The debug ABI can be extracted from the extended manifest content. This information known at build time does not need to be provided in a mailbox. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
1 parent bc72534 commit 552f0f2

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

include/sound/sof/ext_manifest.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ enum sof_ext_man_elem_type {
6060
SOF_EXT_MAN_ELEM_FW_VERSION = 0,
6161
SOF_EXT_MAN_ELEM_WINDOW = SOF_IPC_EXT_WINDOW,
6262
SOF_EXT_MAN_ELEM_CC_VERSION = SOF_IPC_EXT_CC_INFO,
63+
SOF_EXT_MAN_ELEM_DBG_ABI = SOF_IPC_EXT_USER_ABI_INFO,
6364
};
6465

6566
/* extended manifest element header */
@@ -92,4 +93,10 @@ struct sof_ext_man_cc_version {
9293
struct sof_ipc_cc_version cc_version;
9394
} __packed;
9495

96+
struct ext_man_dbg_abi {
97+
struct sof_ext_man_elem_header hdr;
98+
/* use sof_ipc struct because of code re-use */
99+
struct sof_ipc_user_abi_version dbg_abi;
100+
} __packed;
101+
95102
#endif /* __SOF_FIRMWARE_EXT_MANIFEST_H__ */

sound/soc/sof/loader.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,22 @@ static int ext_man_get_cc_info(struct snd_sof_dev *sdev,
176176
return get_cc_info(sdev, &cc->cc_version.ext_hdr);
177177
}
178178

179+
static int ext_man_get_dbg_abi_info(struct snd_sof_dev *sdev,
180+
const struct sof_ext_man_elem_header *hdr)
181+
{
182+
const struct ext_man_dbg_abi *dbg_abi =
183+
container_of(hdr, struct ext_man_dbg_abi, hdr);
184+
185+
if (sdev->first_boot)
186+
dev_dbg(sdev->dev,
187+
"Firmware: DBG_ABI %d:%d:%d\n",
188+
SOF_ABI_VERSION_MAJOR(dbg_abi->dbg_abi.abi_dbg_version),
189+
SOF_ABI_VERSION_MINOR(dbg_abi->dbg_abi.abi_dbg_version),
190+
SOF_ABI_VERSION_PATCH(dbg_abi->dbg_abi.abi_dbg_version));
191+
192+
return 0;
193+
}
194+
179195
static ssize_t snd_sof_ext_man_size(const struct firmware *fw)
180196
{
181197
const struct sof_ext_man_header *head;
@@ -255,6 +271,9 @@ static int snd_sof_fw_ext_man_parse(struct snd_sof_dev *sdev,
255271
case SOF_EXT_MAN_ELEM_CC_VERSION:
256272
ret = ext_man_get_cc_info(sdev, elem_hdr);
257273
break;
274+
case SOF_EXT_MAN_ELEM_DBG_ABI:
275+
ret = ext_man_get_dbg_abi_info(sdev, elem_hdr);
276+
break;
258277
default:
259278
dev_warn(sdev->dev, "warning: unknown sof_ext_man header type %d size 0x%X\n",
260279
elem_hdr->type, elem_hdr->size);

0 commit comments

Comments
 (0)