Commit Graph

7002 Commits

Author SHA1 Message Date
balapati ae0113287a platform: amd: renoir: Add debug support for renoir
Add panic code to dump required info during
firmware exceptions.

This patch enables to dump the call stack, debug info
and inform host driver for exceptions in firmware.

Signed-off-by: balapati <balakishore.pati@amd.com>
2021-09-20 10:47:11 +01:00
Liam Girdwood 509eef9c96 byt: align DMA mapping with closed source FW
Align the DMAC usage and channel mappings with the closed source firmware.
This may help with DMA stability when trace is disabled.

Compile tested only as I have no working BYT/CHT HW.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-09-17 17:18:45 +01:00
Liam Girdwood 7e042e9534 dma: bdw and byt dont have DMIC so remove from DMA caps.
Looks like a copy and paste error.

BDW also has SSP as target for DMAC0 which is forbidden by the
direction capability. Align with the direction cap to avoid confusion.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-09-17 17:18:45 +01:00
Marc Herbert df376963df cmake/github: do not download rimage when CONFIG_LIBRARY/testbench
Faster CI and will catch any accidental dependency sneaking in.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Marc Herbert bd01f6fad4 cmake: add the -Irimage #include path only for the modules that need it
Fixes 177d9bd073 ("cmake: defer the rimage build until it's actually
needed.") that corrected the rimage dependency but forgot about the
include.

This allows building the testbench without fetching rimage.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Marc Herbert fd1f631352 cmake: do not download submodules when BUILD_UNIT_TESTS
Faster CI.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Allen-KH Cheng ed5d2feaf6 dma-trace: send ipc msg after update host pointer
before copy section to host, the hist pointer should

be updated.

otherwise, there are some left data in dma buffer and

host don't know.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-17 15:00:39 +01:00
Keyon Jie 9fadef789e trace: Kconfig: disable filtering by default
The trace filtering will suppress useful logs and make debugging
difficult, disable it by default.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-16 16:02:29 +01:00
Keyon Jie 2a1f2c7efd alloc: trace error when allocation failed with no condition
No matter if CONFIG_DEBUG_HEAP selected or not, we need to print out
error message when allocation failed. Furthermore, dump the whold heap
usage in case under heap debugging or allocation failure.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-16 16:02:29 +01:00
Seppo Ingalsuo f47b823cfe Tools: Testbench: File write DAI needs data structures of DAI
Previously the file component stored component data to device
private data similarly as processing components. However the
pipeline treats file as DAI. Without this patch the missing driver
and DAI operation get_init_delay_ms() causes a segfault in pipeline
parameters walk. It is sufficient for the walk to pass to have just
rzalloc() cleared pointers in driver structure.

The file component data is now placed into DAI private data.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-15 14:41:47 +01:00
Rander Wang 93731c5072 ipc4: mixin & mixout: refine mixer behavior for state change
For ipc3 mixer, pipeline will stop at mixer for trigger
and prepare cases, but it is not fit for ipc4, since there
are more than 1 pipeline in the pcm stream, one for mixer and
following components and another one is for front-end components.

This patch divides prepare & trigger function to two parts: common
shared part and part for mixer.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang 15122b2d99 ipc4: mixin & mixout: set sink buffer format
This patch fixes zero-data issues to enable mixin & mixout
set sink buffer format for ipc4

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang b49a170caf ipc4: pipeline: fix dsp panic in multiple pipeline cases
source & sink components are set when pipeline is complete,
so skip these components check when pipeline is set to
complete.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang 97162cdc09 ipc4: pipeline: set schedule component for ipc4 pipeline
Unlike current ipc3 pipeline,  driver will not set schedule
component for ipc4 pipeline. This patch set the last component
of each pipeline as a schedule component.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang 168de3924f ipc4: dai: fix ssp loop-back issue when mixer is enabled
DMA buffer size is in fixed format of 32bit in IPC4 case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang d57286ba18 ipc4: pipeline: apply new pipeline status to ipc4
New pipeline status PRE_START and PRE_RELEASE made
ipc4 pipeline failed. Now integrate the patch to ipc4.
Since ipc3 & ipc4 have different msg reply method,
this reply method will be implemented on each version.

We can't reuse ipc->delayed_response since ipc msg
should be response immediately for ipc4 and fw will
send a fw ipc msg to reply the status of the last msg.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Curtis Malainey fec3666a4f pipeline: correct cleanup logic
Currently pipeline_xrun_set_limit cannot fail, but the TODO in the
function suggests that is not planned to be true for the future. Lets
fixup the error logic so when that happens we don't leak a pipeline
definition.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-15 14:29:51 +01:00
Curtis Malainey 4366f00249 pipeline: remove pipeline_schedule_config return type
The function cannot fail, so lets remove the extraneous logic

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-15 14:29:51 +01:00
Libin Yang 714518f5e9 topology1: fix a typo of a tplg name in CMakefile
sof-adl-rt1316-l2-mono-rt714-link0 should be
sof-adl-rt1316-l2-mono-rt714-l0

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-09-15 14:28:34 +01:00
Marc Herbert a487ca9441 Revert "dma-trace: add check to avoid dereference from NULL"
This reverts commit 89ec377cb5.

As commit 7df367451d ("trace: enable trace after it is ready") is
reverted this is not required anymore. See long previous commit message.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-15 14:26:36 +01:00
Marc Herbert f2c13f5e6d Revert "trace: enable trace after it is ready"
This reverts commit 7df367451d.

This restores the ability to use CONFIG_TRACEM (copy everything to
mailbox) without crashing, in other words it fixes #4699

This also fixes the other DSP panic #4676 and removes the need for
logical changes in #4678, which can be reverted too.

commit 7df367451d ("trace: enable trace after it is ready") was meant
to fix a crash when tr_xxx() was used early. However I've used very
early tracing for months and it never caused any crash (see #4334)

I tried adding a tr_err() statement immediately after trace_init(sof) in
primary_core_init() and it works just fine. primary_core_init() runs
extremely early so I don't think it's too demanding not to use an
tr_XXX() before the trace even exists.

The reverted commits confused initializing and enabling.

Reproduction #4683 did not seem to demonstrate anything obvious,
there's not even a link to a failed test run. I don't understand how
playing with spin locks is relevant to this.

Later, reproduction #4759 finally demonstrated the real issue: through
DEBUG_TRACE_PTR(), some tr_XXX() can indeed be called (in very unusal
debug circumstances specific to the original author) before the trace is
initialized. The previous commit in this series fixes that by simply
guarding it with if(trace_get())

     --------

I am _not_ pretending that these reverts make the tracing code bug-free
and perfect again, absolutely not and very far from it. I'm merely
saying that:

- The first reverted commit caused at least two regressions: #4676 and
  #4699

- These two commits added yet another variable (time) in an already
  complex situation with an already existing combinatorial "explosion":
  compile-time Kconfigs, run-time settings, platform-specific bugs
  (#4333, #4573, ...), various races, mbox + DMA, different DMA engines,
  Zephyr vs XTOS, etc.

- Last but not least, we don't want to invest in making the exist trace
  implementation better. We want to switch to the Zephyr implementation
  instead

So let's go back to a previous known good state, I mean _relatively_
good and stay there if we can.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-15 14:26:36 +01:00
Marc Herbert 3ff1dc0277 alloc.c: fix DEBUG_TRACE_PTR() not to trace before trace is initialized
As reported in #4759, #4636 and a few others linked from there.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-15 14:26:36 +01:00
Ranjani Sridharan 4f273961ab buffer: remove buffer core argument in comp_buffer_connect
It can be accessed with the buffer argument.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-09-15 14:19:52 +01:00
Marcin Rajwa 9be072fd7a rimage: remove -x option
This patch removes the unnecessary and unscalable -x option.
This option aims to add an offset to the .data section of
its parent .module section. This is horrible idea because this
offset will vary depend on the compiler used. It is better and
much easier to just store only the .data section so the offset
is always 0.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2021-09-15 14:11:54 +01:00
Allen-KH Cheng 0e71dba119 host: add dma buffer clear
Sometime, we could hear some noise after recording.

In host_prepare, reset dma buffer would be good
in general case to prevent reading uninitialized memory.

Add reset dma buffer zero to avoid unexpected noise

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-14 21:17:43 +01:00
Seppo Ingalsuo 4042959bde Audio: Add to volume component Windows fade ramp type
The new gain ramp type can be selected from topology with
SOF_VOLUME_WINDOWS_FADE (4). The ramp follows function (t/T)^1.75.
The same shape is applied for all transitions: unmute, mute, vol up
and down. Subjectively it sounds somewhat smoother that linear ramp
of same duration.

As optimize and clean up the ramp type error handling is moved to new()
where the ramp function pointer is set. Ramp type does not change after
that.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-14 11:04:42 +01:00
Curtis Malainey 66234f02c3 docker: add renoir to docker build
In order to support AMD as part of the docker image and CI we need to
include it in the build list as the overlays are already added to the
overlay repo.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-14 11:03:43 +01:00
Marc Herbert e3494f5662 xtensa-build-zephyr: make "tree" optional
"tree" is very useful but it's not critical, not worth failing the build
for.

Also remove a single quote from the help message as it breaks parsing
in one simple editor I use (jed) and possibly others.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-13 22:28:09 +01:00
Zhang Keqiao f6bc279da6 topology1: add a test topology sof-adl-nocodec-ci build support
We plan to test the CI test topology on ADL-P nocodec device, so
add the topology build support in cmake list.

Signed-off-by: Zhang Keqiao <keqiao.zhang@intel.com>
2021-09-13 15:44:52 +01:00
Allen-KH Cheng 7f2169201c kconfig: select XTENSA_EXCLUSIVE for mt8195
there is no s32c1i instructions in mt8195.

it will use exclusive instructions.
(XCHAL_HAVE_EXCLUSIVE is defined in core-isa.h)

Select CONFIG_XTENSA_EXCLUSIVE by default for mt8195.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-13 15:17:16 +01:00
Curtis Malainey a0acad3414 CMake: require version 3.13
Without CMP0079 we cannot conditionally include libraries against SOF in
sub directories without seriously restructuring the project. This is
because the old policy requires the link target must be created in the
same folder. This does not work well from a configuration standpoint for
3P audio libraries trying to keep their config in src/audio/*. Rather
than enable the policy, lets simply upgrade since 3.13 is widely
available.

With this upgrade we can also remove the two version dependent checks at
the top of our scripts.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-10 17:19:29 +01:00
Allen-KH Cheng 9a09b97c28 scripts: Add mt8195 to build script
Add mt8195 to build script.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:13:06 +01:00
Allen-KH Cheng a43193bb3f Kconfig: add mt8195 to Kconfig
add mt8195 to Kconfig
add mediatek config for mtk platform

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:13:06 +01:00
Allen-KH Cheng a944603502 build: remove unused files from build system
Removes the files added to build system by mistake.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:13:06 +01:00
Allen-KH Cheng 954149cdfb drivers: mtk: remove superfluous variable for mt8195
For GCC compile error,
error: variable 'ret' set but not use

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:13:06 +01:00
Allen-kh Cheng 83093dadea xtensa: add atomic and spinlock function with exclusive
In mp_asm.S, if XCHAL_HAVE_EXCLUSIVE is defined,
it will use exclusive instructions,
else it will use s32c1i instructions.

It supports S32C1I and exclusive instruction in xthal_compare_and_set() API.
Refer to xtos-simc-mutex.c, xtos_mutex_p structure is similar to spinlock_t.

For dsp design, we cannot use s32c1i intrcutions in mt8195.

In order to not affect other platform, add CONFIG_XTENSA_EXCLUSIVE and __XCC__
compile options.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:09:56 +01:00
Allen-KH Cheng 1e8feb2cf3 xtensa: add mt8195 MPU setup
Override the default MPU setup.
This table matches the mt8195 memory map

Add xtensa/mpuasm.h, for mpu_write_map opcode

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:09:56 +01:00
Allen-KH Cheng d15debf011 xtensa: exception: Add XCHAL_INTLEVEL5_MASK
This results in a compiler error
when xtensa configuration has no IRQ level 5.
Make it use core-isa.h.

Error:
invalid register 'EPC5' for 'rsr' instruction
Error:
invalid register 'EPS5' for 'rsr' instruction

For mt8195, we don't support those instrucations

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:09:56 +01:00
Marc Herbert 9452af0a5e xtensa-build-zephyr: add zephyr_fetch_and_switch() example
Add example that shows how to submit any Zephyr commit to SOF PR
testing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-10 13:35:36 +01:00
Marc Herbert 4d3192c266 xtensa-build-zephyr: add option to stop after cloning Zephyr
This is needed by CI to clone only once and then take control of the
iteration over platform builds. CI already does all that but by
copy/paste/diverge of this clone() function.

Once cloning Zephyr in CI code is de-duplicated and uses this new
clone-only feature instead, it will be possible to submit any Zephyr
commit to SOF testing.  In other words it will make failed attempt
https://github.com/thesofproject/sof/pull/4728 possible

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-10 13:35:36 +01:00
Keyon Jie a7367f4fc0 library: memory: align it to the latest cavs version
Make the size of buffer zone calculated at linking stage, to align to
the latest cavs version.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-10 12:07:59 +01:00
Keyon Jie ba95d8d306 cmocka: align to the new heap management
Align to the new heap memory map and allocator, smaller SYSTEM and
RUNTIME zones are used on apollolake now.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-10 12:07:59 +01:00
Keyon Jie fc255ac943 cavs: memory: make full use of HPSRAM
Make size of the buffer zone calculated at the linking stage, to make
full use of all HPSRAM memories.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-10 12:07:59 +01:00
Guennadi Liakhovetski 83e65d325a Revert "alloc: fix a wrong index calculation in heap buffer"
This reverts commit ffff0b0610.
Both heap and memmap->buffer are of type struct mm_heap so their
difference is already a number of struct mm_heap sized elements
between them. Dividing by sizeof(struct mm_heap) again is wrong.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-09-10 09:56:18 +08:00
Marc Herbert 9a231915ea .github/zephyr: add -Werror
Because we can. This would have caught this regression from
commit 287a5f9a2b ("ssp: mclk/bclk turned off unexpectedly")

-DEXTRA_CFLAGS is not very well documented but it is what Zephyr uses,
try `git -C zephyr grep -C 5 EXTRA_CFLAGS and see.

```
sof/src/drivers/intel/ssp/ssp.c: In function 'ssp_set_config_tplg':
sof/zephyr/include/sof/trace/trace.h:44:11: warning:
                   too many arguments for format [-Wformat-extra-args]
   44 |    printk("%llu: " format "\n", platform_timer_get(NULL), \
      |           ^~~~~~~~
  ...
sof/src/drivers/intel/ssp/ssp.c:763:4: note: in expansion of macro 'dai_info'
  763 |    dai_info(dai, "ssp_set_config(): hw_free stage:
                     ignore since there is still user", dai->index);
```

Using -Werror only in CI avoids slowing down developers with temporary
warnings they intend on fixing later (but before submission)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-09 15:48:18 +01:00
Marc Herbert a0ab594045 zephyr/docker-build.sh: pass arguments through to xtensa-build-zephyr.sh
Allows passing compilation flags and any other argument.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-09 15:48:18 +01:00
Marc Herbert 88327f618c xtensa-build-zephyr: support passing through CMake arguments
Like this:

  xtensa-build-zephyr.sh -a -- -DEXTRA_CFLAGS='-Werror -Wextra'

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-09 15:48:18 +01:00
Marc Herbert aec08eaf7e xtensa-build-zephyr: extract new parse_args() function from main()
main() was growing too big. Zero functional change.

Also rename the too generic "build()" to build_all()

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-09 15:48:18 +01:00
Keyon Jie 1e2d574356 zephyr: wrapper: hardcode SIZEs to unblock building
We have change the size of runtime_shared zone to be decided at link
stage, here hardcode HEAP_RUNTIME_SHARED_SIZE to unblock the Zephyr
building.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-09 09:36:31 +01:00
Keyon Jie 15e06515e2 rimage: update rimage for more cavs platforms
246ea6469a config: skl: change image_size to the real SRAM size
9c9e07c650 config: kbl: change image_size to the real SRAM size
44b37d19a2 config: sue: change image_size to the real SRAM size
580e4d674e config: tgl-cavs: change image_size to the real SRAM size

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-09 09:36:31 +01:00