ASoC: Intel: sst: only use sst-firmware when DW DMAC is available
Subsystems (4)
PATCH 1/1 ASoC: Intel: sst: only use sst-firmware when DW DMAC is available
Currentlly, we use Synopsys DesignWare DMA Controller for baytrail/haswell/broadwell ADSP firmware loading, but for skylake, we don't use it, compiling sst-firmware.c may introduce error when CONFIG_DW_DMAC_CORE is not enabled:
sound/built-in.o: In function `sst_dma_new':
(.text+0xd7b38): undefined reference to dw_dma_probe' sound/built-in.o: In function sst_dma_free':
(.text+0xd7c0a): undefined reference to `dw_dma_remove'
Here we only compile sst-firmware when CONFIG_DW_DMAC_CORE is selected, to fix the linking error issue.
--- sound/soc/intel/common/Makefile | 3 ++- sound/soc/intel/common/sst-dsp.c | 2 ++ sound/soc/intel/common/sst-dsp.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-)
sound/soc/intel/common/Makefile +2 -1
@@ -1,4 +1,5 @@ -snd-soc-sst-dsp-objs := sst-dsp.o sst-firmware.o +snd-soc-sst-dsp-objs := sst-dsp.o +snd-soc-sst-dsp-$(CONFIG_DW_DMAC_CORE) += sst-firmware.o snd-soc-sst-acpi-objs := sst-acpi.o snd-soc-sst-ipc-objs := sst-ipc.o
sound/soc/intel/common/sst-dsp.c +2 -0
@@ -420,6 +420,7 @@ void sst_dsp_inbox_read(struct sst_dsp *sst, void *message, size_t bytes) }EXPORT_SYMBOL_GPL (sst_dsp_inbox_read); +#ifdef CONFIG_DW_DMAC_CORE struct sst_dsp *sst_dsp_new (struct device *dev,struct sst_dsp_device *sst_dev,struct sst_pdata *pdata) {
@@ -484,6 +485,7 @@ void sst_dsp_free(struct sst_dsp *sst) sst_dma_free(sst->dma); }EXPORT_SYMBOL_GPL (sst_dsp_free); +#endif /* Module information */ MODULE_AUTHOR ("Liam Girdwood" );
sound/soc/intel/common/sst-dsp.h +2 -0
@@ -216,10 +216,12 @@ struct sst_pdata {void *dsp; }; +#ifdef CONFIG_DW_DMAC_CORE /* Initialization */ struct sst_dsp *sst_dsp_new (struct device *dev,struct sst_dsp_device *sst_dev,struct sst_pdata *pdata);void sst_dsp_free (struct sst_dsp *sst); +#endif /* SHIM Read / Write */ void sst_dsp_shim_write (struct sst_dsp *sst,u32 offset,u32 value);
Signature · 1 line
2.1.4
kbuild test robot
build botreproduce:
Hi Jie,
[auto build test ERROR on asoc/for-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]
url: https://github.com/0day-ci/linux/commits/Jie-Yang/ASoC-Intel-sst-only-use-sst-firmware-when-DW-DMAC-is-available/20151021-203247 config: i386-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386
All error/warnings (new ones prefixed by >>):
sound/soc/intel/baytrail/sst-baytrail-ipc.c: In function 'sst_byt_dsp_init':
>> sound/soc/intel/baytrail/sst-baytrail-ipc.c:725:13: error: implicit declaration of function 'sst_dsp_new' [-Werror=implicit-function-declaration]
byt->dsp = sst_dsp_new(dev, &byt_dev, pdata);
^
>> sound/soc/intel/baytrail/sst-baytrail-ipc.c:725:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
byt->dsp = sst_dsp_new(dev, &byt_dev, pdata);
^
>> sound/soc/intel/baytrail/sst-baytrail-ipc.c:771:2: error: implicit declaration of function 'sst_dsp_free' [-Werror=implicit-function-declaration]
sst_dsp_free(byt->dsp);
^
cc1: some warnings being treated as errors
--
sound/soc/intel/haswell/sst-haswell-ipc.c: In function 'sst_hsw_dsp_init':
>> sound/soc/intel/haswell/sst-haswell-ipc.c:2148:13: error: implicit declaration of function 'sst_dsp_new' [-Werror=implicit-function-declaration]
hsw->dsp = sst_dsp_new(dev, &hsw_dev, pdata);
^
>> sound/soc/intel/haswell/sst-haswell-ipc.c:2148:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hsw->dsp = sst_dsp_new(dev, &hsw_dev, pdata);
^
>> sound/soc/intel/haswell/sst-haswell-ipc.c:2218:2: error: implicit declaration of function 'sst_dsp_free' [-Werror=implicit-function-declaration]
sst_dsp_free(hsw->dsp);
^cc1: some warnings being treated as errors
vim +/sst_dsp_new +725 sound/soc/intel/baytrail/sst-baytrail-ipc.c
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 719
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 720 INIT_LIST_HEAD(&byt->stream_list);
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 721 init_waitqueue_head(&byt->boot_wait);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 722 byt_dev.thread_context = byt;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 723
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 724 /* init SST shim */
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 @725 byt->dsp = sst_dsp_new(dev, &byt_dev, pdata);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 726 if (byt->dsp == NULL) {
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 727 err = -ENODEV;
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 728 goto dsp_new_err;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 729 }
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 730
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 731 ipc->dsp = byt->dsp;
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 732
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 733 /* keep the DSP in reset state for base FW loading */
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 734 sst_dsp_reset(byt->dsp);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 735
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 736 byt_sst_fw = sst_fw_new(byt->dsp, pdata->fw, byt);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 737 if (byt_sst_fw == NULL) {
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 738 err = -ENODEV;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 739 dev_err(dev, "error: failed to load firmware\n");
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 740 goto fw_err;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 741 }
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 742
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 743 /* wait for DSP boot completion */
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 744 sst_dsp_boot(byt->dsp);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 745 err = wait_event_timeout(byt->boot_wait, byt->boot_complete,
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 746 msecs_to_jiffies(IPC_BOOT_MSECS));
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 747 if (err == 0) {
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 748 err = -EIO;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 749 dev_err(byt->dev, "ipc: error DSP boot timeout\n");
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 750 goto boot_err;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 751 }
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 752
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 753 /* show firmware information */
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 754 sst_dsp_inbox_read(byt->dsp, &init, sizeof(init));
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 755 dev_info(byt->dev, "FW version: %02x.%02x.%02x.%02x\n",
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 756 init.fw_version.major, init.fw_version.minor,
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 757 init.fw_version.build, init.fw_version.type);
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 758 dev_info(byt->dev, "Build type: %x\n", init.fw_version.type);
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 759 dev_info(byt->dev, "Build date: %s %s\n",
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 760 init.build_info.date, init.build_info.time);
4131eceb sound/soc/intel/sst-baytrail-ipc.c Jarkko Nikula 2014-06-06 761
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 762 pdata->dsp = byt;
af94aa55 sound/soc/intel/sst-baytrail-ipc.c Liam Girdwood 2014-05-08 763 byt->fw = byt_sst_fw;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 764
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 765 return 0;
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 766
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 767 boot_err:
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 768 sst_dsp_reset(byt->dsp);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 769 sst_fw_free(byt_sst_fw);
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 770 fw_err:
a4b12990 sound/soc/intel/sst-baytrail-ipc.c Mark Brown 2014-03-12 @771 sst_dsp_free(byt->dsp);
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 772 dsp_new_err:
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 773 sst_ipc_fini(ipc);
48cec59b sound/soc/intel/baytrail/sst-baytrail-ipc.c Jin Yao 2015-04-07 774 ipc_init_err::::::: The code at line 725 was first introduced by commit
:::::: a4b12990b68079290ab62799035afe175b4bdc23 Merge remote-tracking branches 'asoc/topic/ml26124', 'asoc/topic/of', 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next
:::::: TO: Mark Brown <[email protected]>
:::::: CC: Mark Brown <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation