Commit graph

118 commits

Author SHA1 Message Date
Kai Vehmanen aa5b66be5f intel_adsp: cavs25: configure access to ALH
For Intel cavs2.5, access from LPGPDMAC to Audio Link Hub
RX/TX registers needs to be explicitly enabled before use.

The logic follow hardware initialization done in
SOF project sof/src/platform/intel/cavs/platform.c

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-05-30 10:50:02 -04:00
Kai Vehmanen e59e65dc75 drivers: dai: ssp: fix power-up flow for Intel cAVS platforms
A recent commit broke the power-up sequences for other Intel
platforms.

Fixes: 1e5550d262 ("intel_adsp: ace20_lnl: ssp: Program new HW registers")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-21 14:02:02 -04:00
Kai Vehmanen 6403c9414b drivers: dai: intel: dmic: fix dmic power-up on cAVS2.5 and ACE1.5
The logic to poll on CPA bit is not working on non-ACE2.0
platforms. This is causing regressions in SOF test suite with
dmic.

Fixes: 2547948544 ("intel_adsp: ace20_lnl: dmic: Program new HW registers for dmic")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-21 14:02:02 -04:00
Ranjani Sridharan 03a91ccc39 drivers: intel: ssp: Fix checked expression in WAIT_FOR()
The function dai_ssp_poll_for_register_delay() is meant to poll the
register until the value of the mask bits is equal to the "val"
argument or until poll timeout has occured. WAIT_FOR() returns the value
of the checked expression, so the check should be modified accordingly.
This should prevent the errors seen during every SSP trigger as below:

<err> dai_intel_ssp: dai_ssp_poll_for_register_delay poll timeout reg 487432 mask 4 val 4 us 125
<err> dai_intel_ssp: dai_ssp_poll_for_register_delay poll timeout reg 487496 mask 63 val 0 us 937

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 07:26:14 -04:00
Gerard Marull-Paretas 1eb683a514 device: remove redundant init functions
Remove all init functions that do nothing, and provide a `NULL` to
*DEVICE*DEFINE* macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-19 10:00:25 +02:00
Pierre-Louis Bossart 6d9afd36af drivers: dai: intel: ssp: don't set ACE2.x LCTL::OFLEN
The OFLEN bit has to be set by the host driver for ACE2.x. The
ownership of the IP is now handled at the host driver level, no longer
the firmware.

Setting it at the firmware level is a no-op if the bit is already set
by the host driver, and will fail it isn't already set.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2023-04-18 10:48:18 -04:00
Jaroslaw Stelter 1659aa2e0c intel_adsp: ace20_lnl: Fix i2svss DT field initialization
This patch fixes i2svss field initialisation in Device Tree for LNL
platform. It fixes this bug: #482

Problem is observed only when using SSP_BLOB_VER_1_5 version.
Unfortunatelly this version is not tested in FW validation tests.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-04-18 10:48:18 -04:00
Jaroslaw Stelter b75b4153d6 intel_adsp: ace20_lnl: Add I2S clock source configuration
Add I2CLCTL_MLCS programming in SSP driver.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-04-18 10:48:18 -04:00
Jaroslaw Stelter b252673f13 intel_adsp: ace20_lnl: Fix hang issue on SSP power off
Clearing SPA bit together with OFFLEN bit causes FW hang.
This patch changes sequence to avoid that situation.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-18 10:48:18 -04:00
Jaroslaw Stelter 3b518743d2 drivers: ssp: Program slot number basing on blob
The upper ssp slot number should be retrieved from configuration
blob to support all possible settings. This patch fix this issue.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-18 10:48:18 -04:00
Jaroslaw Stelter 99d5d9aaa8 drivers: ssp: Repleace shim2 with hdamlssp
Repleace usage of shim2 device tree field with hdamlssp.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-18 10:48:18 -04:00
Jaroslaw Stelter 1e5550d262 intel_adsp: ace20_lnl: ssp: Program new HW registers
In LNL platform GPDMA and ALH is no longer used. SSP uses LINK HDA
as a DMA engine. Therefore new shim, new register definitions and new
programming flows were defined.

This patch implements new SSP programming requirements for LNL.
Since HDA is shared between Host and DSP, link_config field was added to
dai_config structure. This one is provided by Host in new IPC4 fields
during interface configuration.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-04-18 10:48:18 -04:00
Pierre-Louis Bossart a744e8eaf3 drivers: dai: intel: dmic: don't set ACE2.x LCTL::OFLEN
The OFLEN bit has to be set by the host driver for ACE2.x. The
ownership of the IP is now handled at the host driver level, no longer
the firmware.

Setting it at the firmware level is a no-op if the bit is already set
by the host driver, and will fail it isn't already set.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2023-04-13 20:51:10 -04:00
Jaroslaw Stelter b8d9b833a2 intel_adsp: ace20_lnl: dmic: Add HDA channel map programming
Add new field to dai_config structure and function that
program it in HW register.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-04-13 20:51:10 -04:00
Jaroslaw Stelter 2547948544 intel_adsp: ace20_lnl: dmic: Program new HW registers for dmic
In LNL platform GPDMA and ALH is no longer used. DMIC uses LINK HDA
as a DMA engine. Therefore new shims, new register definitions and new
programming flows were defined.

This patch implements new DMIC programming requirements for LNL.
Since HDA is shared between Host and DSP, link_config field was added to
dai_config structure. This one is provided by Host in new IPC4 fields
during interface configuration.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-04-13 20:51:10 -04:00
Jaroslaw Stelter dc9f7b44fe intel_adsp: ace20_lnl: dmic: Add new DMIC shims to driver
Add initialization of new DMIC shims to driver for LNL
platform only.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-04-13 20:51:10 -04:00
Anas Nashif 402ac9e409 drivers: remove references to old CAVS platforms
Remove reference to all dropped CAVS platforms in drivers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-06 18:51:56 +02:00
Ranjani Sridharan c56f5d53b7 drivers: ssp: Ignore link clock_source for non-ACE platforms
Ignore the link clock_source for non-ACE platforms instead of throwing
an error when it is set in the topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-06 11:50:27 +02:00
Tomasz Leman 98b89d5f9a drivers: dmic: set initial state as off
With this patch DMIC device after init will be in OFF state. When power
domain will be powered-up device will switch into suspended state and
change it to active only when is used.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-05 08:31:16 +02:00
Tomasz Leman 0a00253313 driver: ssp: set initial state as off
Since the device need to be first powered-up by the power domain, it has
more sense that device is in off state at the beginning.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-05 08:31:16 +02:00
Fred Oh 1851950977 drivers: dmic: clear MIC_MUTE bit for ACE
When releasing a paused stream, clearing MIC_MUTE bit is necessary.
Without unmuting there will be no input data after resume.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-03-28 16:34:40 -04:00
Fred Oh 98bf16a569 drivers: dmic: clear SOFT_RESET bit for ACE as well
Clearing SOFT_RESET bit applies to ACE as well. In case of ACE,
this should be done before setting start bits for CIC and FIR.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-03-28 16:34:40 -04:00
Henrik Brix Andersen c41dd36de2 drivers: kconfig: unify menuconfig title strings
Unify the drivers/*/Kconfig menuconfig title strings to the format
"<class> [(acronym)] [bus] drivers".

Including both the full name of the driver class and an acronym makes
menuconfig more user friendly as some of the acronyms are less well-known
than others. It also improves Kconfig search, both via menuconfig and via
the generated Kconfig documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-03-28 15:06:06 +02:00
Seppo Ingalsuo 8ef2cd20d9 Drivers: DAI: Intel: DMIC: Shorten unmute ramp time
This change produces more quickly in the stream valid
audio samples. The start fade-in ramp can be shortened to
100 ms for 48 kHz and 200 ms for 16 kHz. It was before 200 ms
and 400 ms. The updated DMIC hardware in allows to do this
change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@intel.com>
2023-02-28 11:43:14 +01:00
Jaska Uimonen 26e4da9511 drivers: dai: intel: ssp: add aux data support
Intel SSP configuration can have auxiliary data embedded after it in a
variable length tlv array. Enable the parsing of this data and add the
data structs to describe the contents.

For now add support only for new version 1.5 blob. This is because
legacy blob doesn't have size field to describe its variable size.
Auxiliary data parsing has currently only 1 setting for link clock
needed in ACE platforms.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2023-02-19 20:43:34 -05:00
Jaska Uimonen c64f91de1a drivers: dai: intel: ssp: add blob 1.5 support
Add support for newer data blob version 1.5. Refactor the code to re-use
the common register setting. Clock setting will be handled differently
with legacy and version 1.5 blob.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2023-02-19 20:43:34 -05:00
Jaska Uimonen 3b7f9c320d drivers: dai: modify dai_config_get API func
Modify dai_config_get function to have the config struct as argument.
This was not a showstopper but a request in the API review.

In the same patch modify all Intel dai drivers using the API to preserve
bisect/compile.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2023-02-19 20:43:14 -05:00
Kai Vehmanen 8374325062 drivers: dai: intel: dmic: don't use assert for error handling
The dai.h interface does not prohibit calling dai_config_get()
with different direction values. The dmic driver should handle
invalid direction value explicitly and not rely on an assert.

Link: https://github.com/thesofproject/sof/issues/6896
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-01-12 10:01:41 +01:00
Hein Wessels 3210541c86 toolchain: gcc: rename popcount to avoid conflict with C++20
The macro conflicts with the C++20 feature std::popcount

fixes zephyrproject-rtos/zephyr#53421

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-01-03 11:06:45 +01:00
Tomasz Leman 56284d7017 drivers: dmic: add dependency for runtime pm
Adding dependency for runtime power management needed by power domains.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-11-30 17:46:17 -05:00
Tomasz Leman f659d46e9d drivers: dmic: enable runtime power mgmt in intel dmic
Enable Zephyr device runtime power management mechanisms in Intel DMIC
driver. This allows Zephyr to track usage reference for power domain
gating.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-11-30 17:46:17 -05:00
Adrian Bonislawski a45caf868f drivers: dai: add Intel HDA dai
add Intel HDA DAI driver
Long device list in dtsi needs to be refactored in the future

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-11-29 19:42:33 -05:00
Jaska Uimonen f13b6bc125 drivers: dai: intel: dmic: fix periodic start
This fixes an issue with periodic_start feature that is only
present in newest dmic hw (starting from ACE).

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-11-28 17:43:58 +01:00
Adrian Bonislawski fa57cd613b drivers: dai: ssp: clear RSE bits on ACE
On ACE RSE bits should be cleared unconditionally
if ssp is no longer in use

This will allow to successfully disable SSP in
dai_ssp_pm_runtime_dis_ssp_power()
and enable it correctly in the next run

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-11-18 12:01:24 +00:00
Ranjani Sridharan 33687cd403 drivers: dai: intel: ssp: Fix log level typo
Print all SSP registers at level info.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-16 11:21:32 +01:00
Ranjani Sridharan 5f9c20db5a drivers/dai/intel/ssp: Skip setting config when playback/capture is active
The reference count, dp->sref, is never incremented for the SSP DAI as
we use the runtime PM API's to probe/remove the DAI during
resume/suspend. Therefore, use the DAI state to check if the DAI is
active in any direction before proceesing to set the config. This fixes
the IO errors seen during simultaenous playback and capture on the same
SSP.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-09 09:27:51 +00:00
Kai Vehmanen 2dc9257ae1 drivers: dmic: remove invalid assert on dmic->created
struct dai_intel_dmic never had a "created" member, so this assert seems
to be accidentally left in the code. Remove it to allow building builds
with dmic driver with asserts enabled.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-11-04 08:59:11 +00:00
Damian Nikodem b953ff1418 drivers: dmic: enable dmic mono configuration
DMIC configuration should allow to use mono source mode.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2022-10-28 13:42:28 +02:00
Damian Nikodem bedc2e7ab4 drivers: dmic: remove soft_reset from dmic init flow
DMIC does not need to use SOFT_RESET bit to start collecting data if
periodic_start bit is enabled.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2022-10-28 09:51:35 +02:00
Damian Nikodem 39c2007b04 drivers: dmic: update dmic flow initialization
DMIC configuration should allow the use of periodic start.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2022-10-28 09:51:35 +02:00
Gerard Marull-Paretas 178bdc4afc include: add missing zephyr/irq.h include
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-17 22:57:39 +09:00
Adrian Warecki ed661a6c69 dai: dmic: Add missing include header
The code was missing #include <zephyr/kernel.h> which
caused a compilation error. Missing header has been added.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-10-12 10:08:54 -04:00
Jaska Uimonen ec0ec72428 drivers: dai: intel: dmic: misc fixes and changes
Fix misc issues and warnings found with sof native drivers compilation.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-10-05 12:41:45 +02:00
Jaska Uimonen 88941a1f71 drivers: dai: intel: dmic: add cavs15 and 25 support
Add support for older platforms like cavs15 and 25 into intel dmic dai.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-10-05 12:41:45 +02:00
Jaska Uimonen 4ee1386fd2 drivers: dai: intel: dmic: use fifo address from devicetree
Use fifo address from device tree to create the device structs.
Also modify shim initialization as it was changed from array to
int. Fix cosmetic tab in device init macro.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-10-05 12:41:45 +02:00
Adrian Bonislawski 87954ad12f drivers: dai: alh: fill fifo depth in dai properties
This will fill missing field in dai properties

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-10-01 14:54:43 -04:00
Adrian Bonislawski 4968b687c0 drivers: dai: dmic: fill fifo depth in dai properties
This will fill missing field in dai properties

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-10-01 14:54:43 -04:00
Adrian Bonislawski c3659da65a drivers: dai: alh: set rate and channels from config blob
This will use config blob to set rate and channels params

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-10-01 14:54:43 -04:00
Adrian Bonislawski e7f32329ba drivers: dai: alh: enable ownership control for ACE
Enable ownership control for ACE by default

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-10-01 14:54:43 -04:00
Adrian Bonislawski 40db94b8a4 drivers: dai: ssp: enable power control for ACE
Enable power control for ACE by default

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-10-01 14:54:43 -04:00
Adrian Bonislawski 62b01ff061 drivers: dai: ssp: fix mdivr register for ACE platform
Set correct offsets for CAVS&ACE

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-28 14:07:19 +00:00
Ederson de Souza c1dc2683b9 drivers/dai/intel/ssp: Get number of SSP ports from Kconfig
Instead of using SoC versions, define the information about base and
extended ports on Kconfig, and use this information from there.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-09-08 18:03:33 -04:00
Ederson de Souza 79980f250c drivers/dai/intel/ssp: Decide about clock gating based on Kconfig
Instead of using version of the SoC, declare on Kconfig the need for it,
and use this information to decide upon enabling the code or not.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-09-08 18:03:33 -04:00
Kumar Gala 1bee3326ad drivers: dai: Update drivers to use devicetree Kconfig symbol
Update dai drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-09-01 10:26:06 +02:00
Jaska Uimonen 108b76eb16 drivers: dai: intel: ssp: add dai index to config
Dai index should be added to config as it can be queried by the
application like sof. Also check for dynamically allocated params
when returning the config.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-08-19 12:09:14 +02:00
Jaska Uimonen 6b8c387246 drivers: dai: intel: dmic: use dai dir enum
Use dai direction enum instead of internal define.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-08-19 12:09:14 +02:00
Jaska Uimonen 7299e1798f drivers: dai: intel: alh: add dai index to config
Dai index should be added to config as it can be queried by the
application like sof.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-08-19 12:09:14 +02:00
Krzysztof Frydryk 8dd57467cc drivers: dai: Enable Zephyr runtime power mgmt in Intel SSP driver
Enable Zephyr device runtime power management mechanisms in Intel SSP
driver. This allows Zephyr to track usage reference for power
domain gating.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-08-10 11:58:45 +02:00
Kai Vehmanen 0aa116a914 drivers: dai: intel: reduce log clutter in ssp_trigger
With addition of DAI_TRIGGER_COPY, the trigger callback may
be called at a very high rate.

Reduce the logging level from INF to DBG for the logs in
dai_ssp_trigger().

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-02 07:11:51 -04:00
Krzysztof Frydryk 6254274420 ssp: Use sampling rate from config
Use sampling rate passed in config instead of a default one when using
config blob.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-08-01 10:31:42 +02:00
Anas Nashif 43371d0414 intel_adsp: move cavs to be a series
Intel ADSP CAVS is now a proper series with all CAVS SoCs running under
it. This will give us to Intel ADSP series:
- CAVS
- ACE v1.x

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-25 16:50:24 -04:00
Adrian Bonislawski 0f90e8ed58 drivers: dmic: add gain ramping and unmute delay
This will add dmic gain ramping and unmute delay using
DAI's pre_copy trigger

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-07-14 16:25:39 -04:00
Marcin Szkudlinski ae8b17d2bb Drivers: dmic-dai: Driver for Intel DMIC
This is a driver for Intel Digital Microphone

TODO:
 - volume rampup
 - TPLG config

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-07-14 16:25:39 -04:00
Arsen Eloglian d4c1c1ebef ssp: SSCR reset - hardware specific flow
hardware specific flow using bit 20 (SSCR2_SFRMEN)  for reset

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-06-05 14:45:59 +02:00
Adrian Bonislawski 638cfbbdbf drivers: dai: add ALH dai driver
The ALH is an intermediary device, which acts as a hub and provides an
abstracted support for numerous sound interfaces (e.g. SoundWire).

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-06-05 14:27:15 +02:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Maureen Helm f4a0854481 drivers: dai: Use dt_compat_enabled for Intel SSP driver default
Enables the Intel SSP driver by default when the DAI driver class is
enabled (CONFIG_DAI=y) and a compatible devicetree node
("intel,ssp-dai") is enabled.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-05-06 11:32:04 +02:00
Jaska Uimonen 8d38b64fdc drivers: dai: add dai driver subdir and ssp driver
Add Intel ssp driver using dai interface.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-04-14 11:42:08 -04:00