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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
"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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>