Peter Ujfalusi
fd2cea169c
ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path
...
The cl_dsp_init() returns 0 on success or negative errno on error.
Replace the 'if (ret >= 0)' checks with correct 'if (!ret)` to check for
success.
Fixes: 2a68ff8461 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220427115159.26177-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-04-27 14:15:29 +01:00
Peter Ujfalusi
2a68ff8461
ASoC: SOF: Intel: hda: Revisit IMR boot sequence
...
The sequence for IMR boot is essentially the same as normal boot with the
difference that instead of DMA from host the firmware is loaded from IMR.
Re-structure the code to use the existing sequence and also add fallback
handling in case the IMR boot fails.
Introduce a new flag to make the IMR boot support check simpler.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220421202031.1548362-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-04-23 00:16:27 +01:00
Ranjani Sridharan
b4e4c0b963
ASoC: SOF: Intel: hda: expose some codeloader functions
...
Expose the code loader functions for re-use in new platforms
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220414184817.362215-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-04-19 12:03:45 +01:00
Ranjani Sridharan
71778f7940
ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc
...
Add the rom_status_reg field to struct sof_intel_dsp_desc and define
it for HDA platforms. This will be used to check the ROM status during
FW boot.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220414184817.362215-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-04-19 12:03:44 +01:00
Ranjani Sridharan
406fed8092
ASoC: SOF: Intel: move HDA_CL_STREAM_FORMAT definition to header
...
Use the definition of the HDA_CL_STREAM_FORMAT macro from the header
file.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220414184817.362215-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-04-19 12:03:41 +01:00
Peter Ujfalusi
ea5ffef079
ASoC: SOF: Intel: hda-loader: Use local snd_dma_buffer
...
There is no reason to use the sdev->dmab and sdev->dmab_bdl as the buffers
are only used locally: allocated used and freed in the same function.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20220330201926.1330402-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-04-04 08:39:01 +01:00
Takashi Iwai
646b907e15
Merge tag 'asoc-v5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
...
ASoC: Updates for v5.18
Quite a quiet release for ASoC, lots of work on drivers and platforms
but nothing too groundbreaking but not much on the core itself:
- Start of moving SoF to support multiple IPC mechanisms.
- Use of NHLT ACPI table to reduce the amount of quirking required for
Intel systems.
- Some building blocks for use in forthcoming Intel AVS driver for
legacy Intel DSP firmwares.
- Support for AMD PDM, Atmel PDMC, Awinic AW8738, i.MX cards with
TLV320AIC31xx, Intel machines with CS35L41 and ESSX8336, Mediatek
MT8181 wideband bluetooth, nVidia Tegra234, Qualcomm SC7280, Renesas
RZ/V2L, Texas Instruments TAS585M
2022-03-21 16:19:21 +01:00
Ammar Faizi
b7fb0ae090
ASoC: SOF: Intel: Fix NULL ptr dereference when ENOMEM
...
Do not call snd_dma_free_pages() when snd_dma_alloc_pages() returns
-ENOMEM because it leads to a NULL pointer dereference bug.
The dmesg says:
[ T1387] sof-audio-pci-intel-tgl 0000:00:1f.3: error: memory alloc failed: -12
[ T1387] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ T1387] #PF: supervisor read access in kernel mode
[ T1387] #PF: error_code(0x0000) - not-present page
[ T1387] PGD 0 P4D 0
[ T1387] Oops: 0000 [#1 ] PREEMPT SMP NOPTI
[ T1387] CPU: 6 PID: 1387 Comm: alsa-sink-HDA A Tainted: G W 5.17.0-rc4-superb-owl-00055-g80d47f5de5e3
[ T1387] Hardware name: HP HP Laptop 14s-dq2xxx/87FD, BIOS F.15 09/15/2021
[ T1387] RIP: 0010:dma_free_noncontiguous+0x37/0x80
[ T1387] Code: [... snip ...]
[ T1387] RSP: 0000:ffffc90002b87770 EFLAGS: 00010246
[ T1387] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[ T1387] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888101db30d0
[ T1387] RBP: 00000000fffffff4 R08: 0000000000000000 R09: 0000000000000000
[ T1387] R10: 0000000000000000 R11: ffffc90002b874d0 R12: 0000000000000001
[ T1387] R13: 0000000000058000 R14: ffff888105260c68 R15: ffff888105260828
[ T1387] FS: 00007f42e2ffd640(0000) GS:ffff888466b80000(0000) knlGS:0000000000000000
[ T1387] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ T1387] CR2: 0000000000000000 CR3: 000000014acf0003 CR4: 0000000000770ee0
[ T1387] PKRU: 55555554
[ T1387] Call Trace:
[ T1387] <TASK>
[ T1387] cl_stream_prepare+0x10a/0x120 [snd_sof_intel_hda_common 146addf995b9279ae7f509621078cccbe4f875e1]
[... snip ...]
[ T1387] </TASK>
Cc: Daniel Baluta <daniel.baluta@nxp.com >
Cc: Jaroslav Kysela <perex@perex.cz >
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Cc: Keyon Jie <yang.jie@linux.intel.com >
Cc: Liam Girdwood <lgirdwood@gmail.com >
Cc: Mark Brown <broonie@kernel.org >
Cc: Rander Wang <rander.wang@intel.com >
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Cc: Takashi Iwai <tiwai@suse.com >
Cc: sound-open-firmware@alsa-project.org
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # v5.2+
Fixes: d16046ffa6 ("ASoC: SOF: Intel: Add Intel specific HDA firmware loader")
Link: https://lore.kernel.org/lkml/20220224145124.15985-1-ammarfaizi2@gnuweeb.org/ # v1
Link: https://lore.kernel.org/lkml/20220224180850.34592-1-ammarfaizi2@gnuweeb.org/ # v2
Link: https://lore.kernel.org/lkml/20220224182818.40301-1-ammarfaizi2@gnuweeb.org/ # v3
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org >
Link: https://lore.kernel.org/r/20220224185836.44907-1-ammarfaizi2@gnuweeb.org
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-02-24 20:21:33 +00:00
Pierre-Louis Bossart
7d88b96081
ASoC: SOF: Intel: hdac_ext_stream: consistent prefixes for variables/members
...
The existing code maximizes confusion by using 'stream' and 'hstream'
variables of different types, e.g:
struct hdac_stream *stream;
struct hdac_ext_stream *stream;
struct hdac_stream *hstream;
struct hdac_ext_stream *hstream;
This confusion is partly inherited from legacy code but SOF
contributors added their own creative spin, e.g.
struct hdac_ext_stream *link_dev;
struct hdac_ext_stream *dsp_stream;
struct hdac_ext_stream hda_stream;
and my personal favorite:
stream = &hda_stream->hda_stream;
This patch suggests a consistent naming across all Intel code related
to HDAudio stream management. The convention is - by hierarchical
order:
struct sof_intel_hda_stream *hda_stream;
struct hdac_ext_stream *hext_stream;
struct hdac_stream *hstream;
No functionality change - just renaming of variables/members.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@intel.com >
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Link: https://lore.kernel.org/r/20220209063104.9971-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-02-09 14:36:14 +00:00
Keyon Jie
d7a8fbd17b
ASoC: SOF: add flag to disable IMR restore to sof_debug
...
Add flag _IGNORE_D3_PERSISTENT to disable IMR restore feature to
the sof_debug module parameter.
The IMR restore feature will be enabled for all Intel cAVS platforms by
default, but setting the flag _IGNORE_D3_PERSISTENT can help to disable
the feature for debug purpose, to rule out any possible regression
introduced by the change of not re-downloading firmware to the DSP at
resuming from suspended state.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220120231532.196926-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-01-24 13:31:18 +00:00
Keyon Jie
5fb5f51185
ASoC: SOF: Intel: hda-loader: add IMR restore support
...
If the firmware declares the IMR restore feature, we only need to do a
simple powering up to resume from D3, no firmware re-downloading
needed - the context is saved/restored to/from IMR without needing
driver support.
Add a hda_dsp_boot_imr() helper for this simple DSP reboot, and use it
when it is available.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220120231532.196926-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-01-24 13:31:17 +00:00
Keyon Jie
a749d74456
ASoC: SOF: Intel: hda-loader: add SSP helper
...
Move the SSP clock configuration to the hda_set_ssp_cbp_cfp() helper,
to be used in follow-up patches
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220120231532.196926-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-01-24 13:31:16 +00:00
Pierre-Louis Bossart
bd586a0292
ASoC: SOF: Intel: use inclusive language for SSP clocks
...
We introduced provider/consumer terms, and CBP_CFP acronyms for codec
drivers, let's use them as well in SOF.
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20220120231532.196926-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2022-01-24 13:31:15 +00:00
Peter Ujfalusi
2f148430b9
ASoC: SOF: Add a 'message' parameter to snd_sof_dsp_dbg_dump()
...
When snd_sof_dsp_dbg_dump() is called we have an explanatory message to
give some hint on the reason why we have the dump on the caller level.
Pass this message to snd_sof_dsp_dbg_dump() and handle the print according
to the dump rules.
This way we can finally print information on the HDA boot iteration if all
dumps are enabled.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20211223113628.18582-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-12-23 13:38:14 +00:00
Peter Ujfalusi
b2b10aa79f
ASoC: SOF: Add 'non_recoverable' parameter to snd_sof_dsp_panic()
...
Some platforms use retries during firmware boot to overcome DSP startup
issues.
In these cases we might receive a DSP panic message which should not be
treated as fatal if it happens during boot.
Pass this information to snd_sof_dsp_panic() and omit the panic print if
it is not fatal or the user does not want to see all dumps.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20211223113628.18582-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-12-23 13:38:13 +00:00
Peter Ujfalusi
b2539ef00e
ASoC: SOF: Intel: hda-loader: Avoid re-defining the HDA_FW_BOOT_ATTEMPTS
...
HDA_FW_BOOT_ATTEMPTS is defined in hda.h, do not define it again locally
in hda-loader.c
At the same time correct the indentation for the define in hda.h
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20211223113628.18582-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-12-23 13:38:09 +00:00
Ranjani Sridharan
c697ef868f
ASoC: SOF: Intel: ICL: move ICL-specific ops to icl.c
...
Move the ICL specific ops to icl.c. Also introduce a
macro ICL_DSP_HPRO_CORE_ID to define the core that
should be powered up when HPRO is enabled.
Reviewed-by: Bard Liao <bard.liao@intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20211207193947.71080-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-12-13 19:32:44 +00:00
Ranjani Sridharan
d416519982
ASoC: SOF: hda: don't use the core op for power up/power down
...
The core_power_up/down() ops will be deprecated. Use the
HDA platform-specific functions for powering up/down
the cores during probe/suspend/remove. The enabled_cores_mask
and the core ref_count's are manually updated in each of
these functions.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20211119192621.4096077-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-11-22 15:40:22 +00:00
Peter Ujfalusi
7511b0edf1
ASoC: SOF: Intel: hda-loader: Drop SOF_DBG_DUMP_REGS flag from dbg_dump calls
...
In cl_dsp_init() we are powering up the DSP, register dump is not valid.
In hda_dsp_cl_boot_firmware() we are downloading the firmware to DSP, again
the register dump is not a valid concept.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20211006110645.26679-19-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-10-07 15:45:40 +01:00
Peter Ujfalusi
23013335bc
ASoC: SOF: Drop SOF_DBG_DUMP_FORCE_ERR_LEVEL and sof_dev_dbg_or_err
...
The sof_dev_dbg_or_err() is only used by intel/hda.c when dumping dsp
debug information.
It was used to print the extended rom status in either dev_dbg (during
retries) and finally with dev_err, but other lines were printed with
dev_err regardless.
Since we now only print the dump once, the flag and the macros is no longer
needed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20211006110645.26679-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-10-07 15:45:31 +01:00
Peter Ujfalusi
0ecaa2fff2
ASoC: SOF: intel: hda-loader: Use snd_sof_dsp_dbg_dump() for DSP dump
...
Do not call directly the hda_dsp_dump(), use the generic wrapper instead
to provide consistent output.
Mark the DSP dumps as optional to not spam the kernel log with the
exception of the last dump in case the DSP fails to run.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20211006110645.26679-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-10-07 15:45:30 +01:00
Ranjani Sridharan
d95eca7e3b
ASoC: SOF: Intel: hda: don't print ROM status if cl_dsp_init() fails
...
cl_dsp_init() dumps the ROM status if it fails after max
attempts before powering off the DSP. Remove the duplicate
log to print the ROM status and error in
hda_dsp_cl_boot_firmware(). These values are invalid anyway
as the DSP is already powered off.
Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Bard Liao <bard.liao@intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210528160551.10145-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-06-01 14:05:18 +01:00
Curtis Malainey
ce1f55bac5
ASoC: SOF: fix string format for errors
...
These are negative error return values, printing them as hex is annoying
and not beneficial. Switch back to signed type to make error lookup
simpler.
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20210208232149.58899-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-02-10 17:17:11 +00:00
Bard Liao
92c6ec606c
ASoC: SOF: intel: hda-loader: use snd_sof_dsp_core_power_down/up APIs
...
To manage enabled_cores_mask flag, we should always use snd_sof_dsp_
core_power_down/up APIs to power up/down dsp cores. The APIs do
a little bit more than the original functions, but it is harmless.
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210128093850.1041387-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-01-28 17:11:38 +00:00
Bard Liao
cedd502d18
ASoC: SOF: Intel: hda-loader: keep init cores alive
...
init_core_mask should be the available cores mask after fw boot. So we
should keep not core 0 but init cores alive.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210128093850.1041387-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-01-28 17:11:35 +00:00
Bard Liao
f6c246eacb
ASoC: SOF: Intel: hda: use snd_sof_dsp_core_power_up/down API
...
To implement common logic in SOF core, core power up/down flows should
use common SOF API and not directly use low-level platform specific
helper functions.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20210128093850.1041387-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-01-28 17:11:34 +00:00
Ranjani Sridharan
89a400bdeb
ASoC: SOF: Intel: hda: enable DMI L1 for D0i3-compatible streams
...
DMI L1 entry is currently disabled whenever any capture stream is
opened to prevent xruns during pause/release. But, in
order to maximise power savings for the wake-on-voice usecase,
DMI L1 entry should be enabled for D0i3-compatible capture streams.
Introduce a new field, flags in struct sof_intel_hda_stream
that stores whether a stream is dmi_l1_compatible. All playback streams,
and D0i3-compatible capture streams are DMI L1 compatible.
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20210127020737.1088960-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2021-01-27 13:06:49 +00:00
Ranjani Sridharan
8f7ef6fca0
ASoC: SOF: Intel: hda: fix the condition passed to sof_dev_dbg_or_err
...
The condition boot_iteration == HDA_FW_BOOT_ATTEMPTS to determine
the log level for the DSP status dump would only work in the case of DSP
init failure after maximum number of attempts to initialize the DSP. If
DSP init succeeds in less than HDA_FW_BOOT_ATTEMPTS attempts and FW
loading fails, the ROM status dump would end up getting logged as debug
instead of an error.
So, add a new flag, SOF_DBG_DUMP_LOG_ERROR, to explicitly specify
the log level for DSP status dump.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20201211100743.3188821-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-12-11 13:22:58 +00:00
Ranjani Sridharan
fbfa22ec4b
ASoC: SOF: modify the SOF_DBG flags
...
The SOF_DBG_* macros are used for dual purposes right now, for the
sof_core_debug module parameter and for the dbg_dump() ops. So, separate
these two types of flags into different types to avoid confusion.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20201211100743.3188821-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-12-11 13:22:57 +00:00
Ranjani Sridharan
b278fc55b4
ASoC: SOF: Intel: hda: remove duplicated status dump
...
Remove the duplicate status dump in case DSP init fails. The core will
be powered down in this case and the status dump will be invalid anyway.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20201211100743.3188821-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-12-11 13:22:56 +00:00
Fred Oh
0cde3e9f02
ASoC: SOF: Intel: hda: add sof_icl_ops for ICL platforms
...
Separate the dsp ops for ICL ops to specify the use of ICCMAX
FW boot sequence in the run op. All other ops are identical with TGL
except post_fw_run. The recommended HW programming sequence for ICL
is to power up core 3 and keep it in stall if HPRO is enabled.
Signed-off-by: Fred Oh <fred.oh@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20201127164022.2498406-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-11-27 17:23:07 +00:00
Fred Oh
e3a85dbe30
ASoC: SOF: ext_manifest: parse cavs extra config data elem
...
OUTBOX_SIZE, INBOX_SIZE are defined but not being used yet. Handle
these elements to avoid warning about unknown token type.
Signed-off-by: Fred Oh <fred.oh@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20201127164022.2498406-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-11-27 17:23:05 +00:00
Fred Oh
edbaaada5c
ASoC: SOF: Intel: hda: define parse_platform_ext_manifest op
...
Define the parse_platform_ext_manifest() op for HDA platforms to parse
the SOF_EXT_MAN_CAVS_CONFIG_CAVS_LPRO config item to determine if the FW
is configured for LPRO. The default clock configuration is assumed to be
HPRO in the absence of this item in the extended manifest.
New member clk_config_lpro is added to struct sof_intel_hda_dev to store
the FW clock config information and that this will be used later to perform
platform-specific operations in the post_fw_run op.
Signed-off-by: Fred Oh <fred.oh@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20201127164022.2498406-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-11-27 17:23:04 +00:00
Pierre-Louis Bossart
776100a4ce
ASoC: SOF: Intel: hda: reduce verbosity of boot error logs
...
Previous commits reduced the verbosity of errors during boot
iterations, but there are still a couple remaining which generate
false positives. Errors should only be logged when after last attempt
to download firmware failed.
Duplicating logs and assigning them different levels based on the
iteration number isn't really elegant, use macro as suggested by
Guennadi.
Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200917105633.2579047-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-17 15:53:21 +01:00
Pierre-Louis Bossart
52e4d0ae62
ASoC: SOF: Intel: hda-loader: s/master/primary
...
Use inclusive language for DSP cores.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Jaska Uimonen <jaska.uimonen@intel.com >
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200910164125.2033062-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-11 15:29:32 +01:00
Ranjani Sridharan
fde1065528
ASoC: SOF: Intel: remove the HDA_DSP_CORE_MASK() macro
...
Remove the HDA_DSP_CORE_MASK() macro and use BIT() and GENMASK()
macros directly for more clarity.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200910164125.2033062-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-11 15:29:31 +01:00
Ranjani Sridharan
64b969177c
ASoC: SOF: rename cores_mask to host_managed_cores_mask
...
Rename the cores_mask in struct sof_intel_dsp_desc to
host_managed_cores_mask to be more indicative of the fact that
only these cores can be powered up/down by the host.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Rander Wang <rander.wang@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200910164125.2033062-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-09-11 15:29:29 +01:00
Ranjani Sridharan
01d42d5a0a
ASoC: SOF: Intel: hda: Simplify error handling during FW boot
...
Modify cl_stream_prepare() to return a pointer to the prepared stream
if successful or ERR_PTR() otherwise. This would simplify the error
paths in hda_dsp_cl_boot_firmware() and hda_dsp_cl_boot_firmware_iccmax()
to perform the stream cleanup after FW boot. This change also renders
the function get_stream_with_tag() redundant.
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/20200826184532.1612070-9-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-27 14:22:24 +01:00
Ranjani Sridharan
acf705a425
ASoC: SOF: Intel: hda: Define FW boot sequence with ICCMAX
...
Define the FW boot sequence for platforms that are recommended
to use ICCMAX. This function uses the existing prepare and cleanup
functions for creating a specially crafted capture stream before
powering up the DSP cores.
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20200826184532.1612070-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-27 14:22:22 +01:00
Ranjani Sridharan
d43e381390
ASoC: SOF: Intel: hda: define macro for code loader stream format
...
This will be used for the ICCMAX stream as well.
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20200826184532.1612070-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-27 14:22:21 +01:00
Ranjani Sridharan
c07fa3fcbd
ASoC: SOF: Intel: hda: modify the signature of get_stream_with_tag()
...
Modify the signature of get_stream_with_tag() to add the direction
as an argument to extend it for using with capture streams.
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20200826184532.1612070-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-27 14:22:20 +01:00
Yong Zhi
0ff06df0be
ASoC: SOF: Intel: hda: Remove unused parameters in cl_dsp_init()
...
cl_dsp_init() doesn't use the fwdata and fwsize parameters.
Remove it, and update caller accordingly.
Signed-off-by: Yong Zhi <yong.zhi@intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20200826184532.1612070-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-27 14:22:18 +01:00
Ranjani Sridharan
53ec753137
ASoC: SOF: Intel: hda: report error only for the last ROM init iteration
...
The FW boot sequence includes multiple attempts for ROM init.
When it does take more than one attempt, we should not log the
errors encountered during the failed attempts and only log them
during the final iteration.
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20200825235040.1586478-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-08-26 13:19:11 +01:00
Karol Trzcinski
523773b9ea
ASoC: SOF: loader: Adjust validation condition for fw_offset
...
Condition in if statement should be same as trace message
and FW size equal to zero (after skipping offset) should
be marked as invalid.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com >
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Link: https://lore.kernel.org/r/20200520165911.21696-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-25 14:59:33 +01:00
Pierre-Louis Bossart
e149ca29f3
ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only
...
Remove the ambiguity with GPL-2.0 and use an explicit GPL-2.0-only
tag.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Link: https://lore.kernel.org/r/20200501145850.15178-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-01 17:45:24 +01:00
Karol Trzcinski
92be17a559
ASoC: SOF: Introduce offset in firmware data
...
It makes possible to provide extra information to host
before downloading firmware. Extra data should be put
at the beginning of firmware binary.
Exchange is done without any effort on DSP side.
This mechanism will be used in extended manifest.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Link: https://lore.kernel.org/r/20200415202816.934-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-04-16 00:23:00 +01:00
Rander Wang
bbd19cdca8
ASoC: SOF: Intel: hda: add WAKEEN interrupt support for SoundWire
...
When a SoundWire link is in clock stop state, a Slave device may wake
up the Master for some events such as jack detection. The WAKEEN
interrupt will be triggered and processed by the audio pci device.
If audio device is in D3, the interrupt will be routed to PME, or
aggregated at cAVS level as interrupt when audio device is in D0. This
patch only supports D3 case, where the audio pci device will be
resumed by a PME event and the WAKEEN interrupt will be processed
after audio pci device is powered up and ROM is initialized
successfully.
The WAKEEN handling is only enabled after the first boot due to
dependencies on a shim_lock mutex being initialized.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Rander Wang <rander.wang@intel.com >
Link: https://lore.kernel.org/r/20200325215027.28716-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-03-27 15:16:35 +00:00
Pierre-Louis Bossart
51dfed1e17
ASoC: SOF: Intel: add SoundWire configuration interface
...
Now that the SoundWire core supports the multi-step initialization,
call the relevant APIs.
The actual hardware enablement can be done in two places, ideally we'd
want to startup the SoundWire IP as soon as possible (while still
taking power rail dependencies into account)
However when suspend/resume is implemented, the DSP device will be
resumed first, and only when the DSP firmware is downloaded/booted
would the SoundWire child devices be resumed, so there are only
marginal benefits in starting the IP earlier for the first probe.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200325215027.28716-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-03-27 15:16:29 +00:00
Amery Song
828c2f7871
ASoC: SOF: Intel: remove unnecessary waitq before loading firmware
...
The HDA_DSP_IPC_PURGE_FW IPC from ROM is already handled in
cl_dsp_init(), and it will never be received in the IRQ thread,
so the wait condition on this IPC will never be satisfied. The
wait before loading firmware is redundant and can be removed safely.
Signed-off-by: Amery Song <chao.song@intel.com >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com >
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com >
Reviewed-by: Pierre Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com >
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com >
Link: https://lore.kernel.org/r/20200312200622.24477-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-03-13 15:13:25 +00:00
Keyon Jie
8354d9b445
ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done
...
Set DONE bit after the FW_PURGE IPC is polled successfully, to clear the
interrupt and avoid the arrival of the confusing unexpected ipc.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com >
Link: https://lore.kernel.org/r/20200228231850.9226-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-03-02 14:13:49 +00:00