Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: amd: Enable signed firmware image loading for Vangogh platform

Enable signed firmware loading for Vangogh platform using dmi quirks.

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230809123534.287707-3-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Venkata Prasad Potturu and committed by
Mark Brown
f7da8800 6a69b724

+40
+31
sound/soc/sof/amd/acp.c
··· 20 20 #include "acp.h" 21 21 #include "acp-dsp-offset.h" 22 22 23 + #define SECURED_FIRMWARE 1 24 + 25 + const struct dmi_system_id acp_sof_quirk_table[] = { 26 + { 27 + /* Valve Jupiter device */ 28 + .matches = { 29 + DMI_MATCH(DMI_SYS_VENDOR, "Valve"), 30 + DMI_MATCH(DMI_PRODUCT_NAME, "Galileo"), 31 + DMI_MATCH(DMI_PRODUCT_FAMILY, "Sephiroth"), 32 + }, 33 + .driver_data = (void *)SECURED_FIRMWARE, 34 + }, 35 + {} 36 + }; 37 + EXPORT_SYMBOL_GPL(acp_sof_quirk_table); 38 + 23 39 static int smn_write(struct pci_dev *dev, u32 smn_addr, u32 data) 24 40 { 25 41 pci_write_config_dword(dev, 0x60, smn_addr); ··· 484 468 int amd_sof_acp_probe(struct snd_sof_dev *sdev) 485 469 { 486 470 struct pci_dev *pci = to_pci_dev(sdev->dev); 471 + struct snd_sof_pdata *plat_data = sdev->pdata; 487 472 struct acp_dev_data *adata; 488 473 const struct sof_amd_acp_desc *chip; 474 + const struct dmi_system_id *dmi_id; 489 475 unsigned int addr; 490 476 int ret; 491 477 ··· 549 531 sdev->debug_box.size = BOX_SIZE_1024; 550 532 551 533 adata->signed_fw_image = false; 534 + dmi_id = dmi_first_match(acp_sof_quirk_table); 535 + if (dmi_id && dmi_id->driver_data) { 536 + adata->fw_code_bin = kasprintf(GFP_KERNEL, "%s/sof-%s-code.bin", 537 + plat_data->fw_filename_prefix, 538 + chip->name); 539 + adata->fw_data_bin = kasprintf(GFP_KERNEL, "%s/sof-%s-data.bin", 540 + plat_data->fw_filename_prefix, 541 + chip->name); 542 + adata->signed_fw_image = dmi_id->driver_data; 543 + 544 + dev_dbg(sdev->dev, "fw_code_bin:%s, fw_data_bin:%s\n", adata->fw_code_bin, 545 + adata->fw_data_bin); 546 + } 552 547 acp_memory_init(sdev); 553 548 554 549 acp_dsp_stream_init(sdev);
+3
sound/soc/sof/amd/acp.h
··· 11 11 #ifndef __SOF_AMD_ACP_H 12 12 #define __SOF_AMD_ACP_H 13 13 14 + #include <linux/dmi.h> 15 + 14 16 #include "../sof-priv.h" 15 17 #include "../sof-audio.h" 16 18 ··· 299 297 void acp_probes_unregister(struct snd_sof_dev *sdev); 300 298 301 299 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[]; 300 + extern const struct dmi_system_id acp_sof_quirk_table[]; 302 301 #endif
+6
sound/soc/sof/amd/vangogh.c
··· 142 142 143 143 int sof_vangogh_ops_init(struct snd_sof_dev *sdev) 144 144 { 145 + const struct dmi_system_id *dmi_id; 146 + 145 147 /* common defaults */ 146 148 memcpy(&sof_vangogh_ops, &sof_acp_common_ops, sizeof(struct snd_sof_dsp_ops)); 147 149 148 150 sof_vangogh_ops.drv = vangogh_sof_dai; 149 151 sof_vangogh_ops.num_drv = ARRAY_SIZE(vangogh_sof_dai); 152 + 153 + dmi_id = dmi_first_match(acp_sof_quirk_table); 154 + if (dmi_id && dmi_id->driver_data) 155 + sof_vangogh_ops.load_firmware = acp_sof_load_signed_firmware; 150 156 151 157 return 0; 152 158 }