]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: SOF: ext_manifest: Parse debug ABI version
authorKarol Trzcinski <karolx.trzcinski@linux.intel.com>
Tue, 25 Aug 2020 23:58:53 +0000 (16:58 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 26 Aug 2020 11:44:08 +0000 (12:44 +0100)
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>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200825235854.1588034-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sof/ext_manifest.h
sound/soc/sof/loader.c

index 04359cda92dc25cad7edacb7a8ef291b1075a2c8..342e86e54db5608035171acd43b7e78e330ecd4e 100644 (file)
@@ -60,6 +60,7 @@ enum sof_ext_man_elem_type {
        SOF_EXT_MAN_ELEM_FW_VERSION             = 0,
        SOF_EXT_MAN_ELEM_WINDOW                 = SOF_IPC_EXT_WINDOW,
        SOF_EXT_MAN_ELEM_CC_VERSION             = SOF_IPC_EXT_CC_INFO,
+       SOF_EXT_MAN_ELEM_DBG_ABI                = SOF_IPC_EXT_USER_ABI_INFO,
 };
 
 /* extended manifest element header */
@@ -92,4 +93,10 @@ struct sof_ext_man_cc_version {
        struct sof_ipc_cc_version cc_version;
 } __packed;
 
+struct ext_man_dbg_abi {
+       struct sof_ext_man_elem_header hdr;
+       /* use sof_ipc struct because of code re-use */
+       struct sof_ipc_user_abi_version dbg_abi;
+} __packed;
+
 #endif /* __SOF_FIRMWARE_EXT_MANIFEST_H__ */
index 42e0e3e58869a5021857eb32406b8591817f4392..b8e72084dfebc871aa7f74c481f4db3b3a9ab2ab 100644 (file)
@@ -176,6 +176,22 @@ static int ext_man_get_cc_info(struct snd_sof_dev *sdev,
        return get_cc_info(sdev, &cc->cc_version.ext_hdr);
 }
 
+static int ext_man_get_dbg_abi_info(struct snd_sof_dev *sdev,
+                                   const struct sof_ext_man_elem_header *hdr)
+{
+       const struct ext_man_dbg_abi *dbg_abi =
+               container_of(hdr, struct ext_man_dbg_abi, hdr);
+
+       if (sdev->first_boot)
+               dev_dbg(sdev->dev,
+                       "Firmware: DBG_ABI %d:%d:%d\n",
+                       SOF_ABI_VERSION_MAJOR(dbg_abi->dbg_abi.abi_dbg_version),
+                       SOF_ABI_VERSION_MINOR(dbg_abi->dbg_abi.abi_dbg_version),
+                       SOF_ABI_VERSION_PATCH(dbg_abi->dbg_abi.abi_dbg_version));
+
+       return 0;
+}
+
 static ssize_t snd_sof_ext_man_size(const struct firmware *fw)
 {
        const struct sof_ext_man_header *head;
@@ -255,6 +271,9 @@ static int snd_sof_fw_ext_man_parse(struct snd_sof_dev *sdev,
                case SOF_EXT_MAN_ELEM_CC_VERSION:
                        ret = ext_man_get_cc_info(sdev, elem_hdr);
                        break;
+               case SOF_EXT_MAN_ELEM_DBG_ABI:
+                       ret = ext_man_get_dbg_abi_info(sdev, elem_hdr);
+                       break;
                default:
                        dev_warn(sdev->dev, "warning: unknown sof_ext_man header type %d size 0x%X\n",
                                 elem_hdr->type, elem_hdr->size);