Commit Graph

6980 Commits

Author SHA1 Message Date
Kai Vehmanen 0d9a0c112c xtensa-build-zephyr: disable XCC build for Intel APL
The BSS usage exceeds available memory when building for
APL/cavs15 hardware with XCC, so disable it for now. Issue
tracked as https://github.com/thesofproject/sof/issues/4645

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-18 13:54:17 +01:00
Fred Oh ce97fc7128 topology1: sof-tgl-sdw-max98373-rt5682: use a mockup of the smart amp
Remove 3rd party library dependency.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-08-18 13:10:45 +01:00
ShriramShastry 14e7993979 WIP: Add cmocka tests for trigonometry function
Added cmocka tests for trigonometry asin,acos and
     complex exponential functions . cmocka tests verifies
     32 and 16 bit accuracy.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2021-08-18 13:08:32 +01:00
Keyon Jie aeda0158b0 dw-dma: set LLI alignment to platform specific
It is observed that on different platforms, the LLI need to be aligned
different, e.g. it is 128 Bytes on TGL, otherwise, the LLI struct might
be clobbered and the DMA channel might get unexpected stopped, which
will eventually lead to Xrun.

Here make the LLI alignment to platform specific and use 128 Bytes for
TGL.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-08-17 16:28:45 +01:00
Ming Jen Tai bbc5209c4f Support RTNR on Tigerlake platform
This PR adds RTNR Noise Reduction/Suppression(NR/NS) component by
Realtek Semiconductor Corp. This feature links to proprietary libraries.
Please contact antz0525@realtek.com for any question about the library.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-08-17 16:18:21 +01:00
balapati 8703937c11 Add AMD platform specific changes
Update hd->local_pos instead of wrapping it to zero
for amd/renoir platform.
Update trace dma channel number specific to platform
instead of default channel 0.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati 8dee4e4262 platform: amd: renoir: Add BT mode based on flags
By default SP mode was enable. BT mode will be
enable based on CONFIG_AMD_BT flag.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati 83cd8d8c5c dai: support for amd specific dai id's
Add AMD supported dai's for usecases.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati 7453e3d571 scripts: add renoir support
Add renoir build support.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati 92b04717e9 renoir: Add support for AMD renoir platform
Add renoir platform support to build fw image.
Add renoir_defconfig for renoir platform.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati b444c336f6 drivers: amd: renoir: Add dmic driver support
Add drivers for:
	* DMIC DAI, for Audio interface
	* DMIC DMA, controller
Dai changes for dmic to register to platform.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati fa93c111de drivers: amd: renoir: Add SP driver support
Add drivers for:
	* SP DAI, for Audio interface
	* SP I2S DMA, controller
Dai changes for sp mode to register to platform.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati 1019bd6a0b platform: Add build support for amd renoir platform
Add CMakefile and Kconfig for amd renoir platform
to build.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati aeeba76651 platform: renoir : Add xtensa headers
Add xtensa headers for renoir based amd platform.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati 452a699042 platform: Add support for amd renoir platform
This adds support for platform drivers (dai, dma, clk)
and general platform initialization.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
balapati ad7a4b2d7b drivers: amd: renoir: Add drivers for amd/renoir
Add drivers for:
	* timer, ipc, interrupt - amd specific implementation
	* DMA, for copying data between HOST and DSP
	* BT DAI, for Audio interface
	* BT I2S DMA, Controller

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
Kai Vehmanen 997972c558 xtensa-build-zephyr: clean up XTENSA_TOOLS_ROOT parsing
Remove the unnecessary assumption that Xtensa tools are installed under
'XtDevTools'.

Align indentation to use tabs as is used elsewhere in this file.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-17 08:57:43 +01:00
Kai Vehmanen 4b86f2429b xtensa-build-zephyr: add support to build with xtensa XCC
Add support to build with XCC compiler by setting XTENSA_TOOLS_ROOT
env variable. The interface follows xtensa-build-all.sh, so existing
CI scripts for SOF builds can easily update to build with XCC.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-16 09:25:32 +01:00
Yong Zhi 93e572050c topology1: tgl-max98357a-rt5682 fix ENDPOINT_NAME macro side effect
Without enclosing ENDPOINT_NAME with `', the generated tplg has
pcm id 0 named to "Headphones" instead of "Speakers".

$ ./tplgtool.py ~/work/sof/tools/build_tools/topology/sof-tgl-max98357a-rt5682.tplg
pcm=Headphones;id=0;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=Headset;id=1;type=both;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI1;id=2;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI2;id=3;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI3;id=4;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI4;id=5;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=EchoRef;id=6;type=capture;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=DMIC;id=99;type=capture;fmt=S32_LE;rate_min=48000;rate_max=48000;ch_min=4;ch_max=4;
pcm=DMIC16kHz;id=100;type=capture;fmt=S16_LE;rate_min=16000;rate_max=16000;ch_min=2;ch_max=2;

$ grep Headphones topology/sof-tgl-max98357a-rt5682.conf -n -B5

7071-# PCM Low Latency, id 0
7072:SectionPCM."Headphones" {
7073-
7074-	# used for binding to the PCM
7075-	id "0"
7076-
7077:	dai."Headphones 0" {
7078-		id "0"
7079-	}

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-08-16 09:05:01 +01:00
Vamshi Krishna Gopal 6713cace35 topology: sof-tgl-max9357a-rt5682: add support for ADL
For speakers SSP2 link is used.
For Headset SSP0 link is used.
Adding required macros to select SSP and Platform.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
2021-08-13 17:45:41 +01:00
Rander Wang e809243112 component: enhance macro definition of module initialization
Currently we can only define one moudule in a file. But
for IPC4 case, some modules share a large part of code,
so they will be defined in one file. to support this
case, add module name to differentiate local staic module
declaration.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-13 14:25:21 +01:00
Rander Wang 7f87398375 mailbox: add support for batch-data writing for SW REG
In IPC4 case, we need to write a batch of register data to SW REG
box, not just one 32bit data.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-13 14:25:21 +01:00
Kai Vehmanen 63eda919d3 zephyr: unify CTX_SAVE handling for Zephyr
Clean up the ifdefs for ipc_pm_context_save(). By implementing
platform_timer_stop() in the Zephyr wrapper, the original context
save sequence can be used also for Zephyr builds.

By doing this, we can fix issues with IPC timeout on CTX_SAVE.
Disabling all interrupts before the IPC reply is needed also on
Zephyr.

BugLink: https://github.com/thesofproject/sof/issues/4507
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-12 19:48:09 +01:00
Ranjani Sridharan dd14583c92 drivers: Intel: IDC: make core power down IDC blocking
make the core power down IDC blocking to ensure the core is
actually idle before notifying the host.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-08-12 17:21:26 +01:00
Iuliana Prodan 2ac6e7af28 imx: select COMPILER_WORKAROUND_CACHE_ATTR
To avoid buggy compiler optimization,
select COMPILER_WORKAROUND_CACHE_ATTR for all i.MX
platforms.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-12 15:04:41 +01:00
Iuliana Prodan b4165baeb3 refactor is_cached() to avoid buggy compiler optimization
For imx, is_cached() is implemented based on _memmap_cacheattr_reset.
This keeps the attributes for a 512MB region, therefore
we have the following address ranges:
 Address range       - hex digit
 0        - 1FFFFFFF - 0
 20000000 - 3FFFFFFF - 1
 40000000 - 5FFFFFFF - 2
 60000000 - 7FFFFFFF - 3
 80000000 - 9FFFFFFF - 4
 A0000000 - BFFFFFFF - 5
 C0000000 - DFFFFFFF - 6
 E0000000 - FFFFFFFF - 7

While testing on i.MX8ULP we discovered that addresses from
(0 – 1FFFFFFF) range where not correctly marked as cacheable,
because the compiler is optimizing the code incorrectly.

With macros, is_cached(address) expands to
(((((uint32_t)(&_memmap_cacheattr_reset_8ulp)) >> \
 ((((((uintptr_t)((void *)address) >> 29) & 0x7)) << 2))) \
 & 0xF) == 1)
When using _memmap_cacheattr_reset_8ulp = 0x22222221
and address = 0x1A801000 is_cached(0x1A801000)
should be true, but instead is false.

We want to avoid this buggy compiler optimization.
So we replaced the macros from cache.h with functions.

To make this generic, I created a cache_attr.c file in
src/arch/xtensa/drivers/ and a config option
- COMPILER_WORKAROUND_CACHE_ATTR, which must be selected
if the workaround is needed.

Also, we replaced the call to glb_addr_attr() from glb_is_cached()
with a function pointer that is initialized in
src/arch/xtensa/drivers/cache_attr.c.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-12 15:04:41 +01:00
Rander Wang e1dbb5b4fc ipc4: add copier module support for ipc4
Copier module can work as a host, a dai or just a converter module
to convert format. For host or dai cases, Copier will create a
corresponding component and dispatch module message to it. The key issue
is buffer connection. In the view of pipeline, a component is
connected to a buffer and pipeline message is dispatched when visiting
this connection. So buffer is relinked to host or dai component when
copier dispatches message to these two components and restored to
copier module when control flow returns to copier from host or dai.

Copier will convert format based on input & output format if it is a
converter module.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-12 15:01:06 +01:00
Oleh Titov 691c4e0587 topology: Add Waves codec to JSL topology
Modify sof-jsl-rt5682 topology so Waves codec can be added
to playback in case 'WAVES' is defined.
Small refactoring

Signed-off-by: Oleh Titov <Otitov@waves.com>
2021-08-12 14:51:38 +01:00
Chao Song 0673877881 github actions: update zephyr docker image to 0.18.1
The recent zephyr code add restriction to the SDK,
and requires the SDK version >= 0.13, we have to
update the docker image for zephyr SOF building.

As the default SDK version in docker image 0.18.1
is still 0.12.4, and the alternative SDK is 0.13.0,
we need to specify the SDK location with env.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2021-08-12 14:37:46 +01:00
Kai Vehmanen c8b759a806 topology1: fix error in LOCAL_CHANNELS_MIN definition
The patch to fix CHANNELS_MIN side effects had a bug in which caused
LOCAL_CHANNELS_MIN to slip into conf output. Example from
sof-adl-sdw-max98373-rt5682:

---cut--
SectionPCMCapabilities."Passthrough Capture 14" {
»       formats "S16_LE"
»       rate_min "8000"
»       rate_max "16000"
»       channels_min "LOCAL_CHANNELS_MIN"
--cut--

Fixes: 659266685b ("topology: remove side effects from macro definitions")
BugLink: https://github.com/thesofproject/sof/issues/4621
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-12 10:40:57 +03:00
Zhang Peng 62fc00a5fe drivers: sai: Set special config for imx8ulp
In order to match with bluetooth, set special configuration in xCR2
and xCR4 for imx8ulp.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-11 14:53:20 +03:00
Zhang Peng 8e84a40627 include: drivers: sai: Correct SAI_TDM_SLOTS for imx8ulp
We need make SAI_TDM_SLOTS is 2 to match bluetooth.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-11 14:53:20 +03:00
Zhang Peng 2ef9a2d8be include: drivers: sai: Correct SAI_CLOCK_DIV for imx8ulp
In order to work with bluetooth, set SAI_CLOCK_DIV is 0xB to get
fclk 16kHz.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-11 14:53:20 +03:00
Iuliana Prodan bee27fe258 topology1: i.MX: Add topology with DRC component
Dynamic range compression (DRC) or simply compression is an
audio signal processing operation that reduces the volume of
loud sounds or amplifies quiet sounds, thus reducing or
compressing an audio signal's dynamic range.

This enables the DRC component for i.MX8QM/i.MX8QXP/i.MX8MP
with wm8960 codec.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-11 13:47:54 +03:00
Curtis Malainey 9edfcfc036 Volume: delete invalid check
The ch < 0 check is invalid since the channel type being
passed is unsiged.

Signed-off-by: Curtis Malainey <curtis@malainey.com>
2021-08-10 21:23:48 +01:00
Liam Girdwood cd1bb03a5a ssp: make the trigger(START|STOP) wait delay in consumer mode only.
Git comments indicate the delay is for consumer mode only. Lets not delay
in SSP clock producer mode.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-08-10 08:40:05 +01:00
Liam Girdwood 23af4a1f93 idc: tell users which IDC message timed out.
Let the users know what message has timed out on other cores.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-08-10 08:40:05 +01:00
Bud Liviu-Alexandru cac3f7d2a4 drivers: imx: Compile SDMA support as separate driver
SDMA IP can be found only on I.MX8M so compile it only
on this platform to reduce the code size for the rest
of the platforms

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-08-10 10:05:21 +03:00
Bud Liviu-Alexandru 8a2ae0cdfd drivers: imx: Compile ESAI support as separate driver
ESAI Digital Audio Interface can be found only on I.MX8 and I.MX8X
so compile it only on this platforms to reduce the code size for the
rest of the platforms

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-08-10 10:05:21 +03:00
Bud Liviu-Alexandru 659266685b topology: remove side effects from macro definitions
This commit fixes the issue mentioned in #4583.

A temporary definition is introduced that takes it's value from
"CHANNELS_MIN" if it is already defined, otherwise it is set to
a default value. This temporary is used instead of "CHANNELS_MIN"
for the rest of the file. This avoids having the macro defined in
files where it shouldn't be.

In order to be completely sure it avoids side effects this temporary
is undefined after it is no longer needed.

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-08-09 21:28:40 +01:00
Liam Girdwood 6aa8f94945 cache: make sure all shared data is cache line size aligned.
Aligns all SHARED data on cache line size to ensure we dont clobber
data.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-08-09 21:17:04 +01:00
Zhang Peng 727447ea43 platform: imx8ulp: dai: Change capture offset
Change capture offset to "SAI_5_BASE + REG_SAI_RDR3" to match rx3
used in sai module.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-09 18:06:35 +03:00
Zhang Peng f7982d88e3 edma: add convert addr func
Local adress can't set to edma on some platform, then need to add
a convert function.

For example, the address from DSP can't send to EDMA directly on
imx8ulp, need convert the address to that EDMA can access.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-06 14:41:39 +01:00
Zhang Peng 2e8e756bb7 sof: Add address convert function on memory header for every platform
There are a mapping between LOCAL and HOST on platform, then add macro
local_to_host, host_to_local.

DSP memory region has mapped to Arm memory region on imx8ulp:
ARM: 0x8e000000~0x8fffffff --- DSP: 0x1a000000~0x1bffffff
Then if we want access the address from ARM, need to convert the
address.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-06 14:41:39 +01:00
Bud Liviu-Alexandru b40a2f7d36 docker: Add support for i.MX8ULP platform
This commit adds support for building i.MX8ULP toolchain support.

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-08-06 14:39:52 +01:00
Guennadi Liakhovetski ceabf319e1 compile: use __attribute__((fallthrough)) with GCC
Fix compiler warning by using the "fallthrough" attribute with GCC
as well.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-08-06 14:38:05 +01:00
Ranjani Sridharan 5a42c023d2 topology1: make all cavs nocodec topologies dynamic
All cAVS platforms can use dynamic pipelines with nocodec topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-08-05 22:45:35 +01:00
Anas Nashif d486a9ff98 kconfig: allow SOF Kconfig to be included in other projects
When the SOF Kconfig is included in other projects, the main menu should
not be that of SOF, rather it should be of the project including SOF.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-08-04 12:34:39 +01:00
Rander Wang 1f641729cd ipc4: add ipc4 message support
There are two types of ipc4 message: global message and module message.
Ipc message is first decoded in handler.c and processed with the help
of helper.c to deal with pipeline message and module message.
Pipeline and Module messages are converted to sof pipeline and
component message.

Ipc4 pipeline message <------> ipc3 pipeline message
RUNNING       <------->   TRIGGER START
INIT + PAUSED <------->   PIPELINE COMPLETE
PAUSED        <------->   TRIGER_PAUSE
RESET         <------->   TRIGER_STOP + RESET
EOS           <------->   TRIGER_RELEASE

Ipc4 Module message <------> ipc3 module message
init module             <------->   create component
bind modules            <------->   connect components
module set_large_config <------->   component cmd
delete module           <------->   free component

There is no buffer module in ipc4 design and FW manages buffer for each
module while buffer component is defined by topology and create by ipc
message for ipc3 design. For ipc4 path, FW will create buffer when two
modules are bound since the buffer format can be gathered from source
& sink modules and the buffer can be connected to both modules.

Currently only part of ipc4 messages are processed and others will be done
in future.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-03 15:17:37 +01:00
Rander Wang 23c0839e4a ipc: share some utility functions for ipc4 path
Ipc3 & Ipc4 will share some component operations.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-03 15:17:37 +01:00