Commit Graph

6780 Commits

Author SHA1 Message Date
Marc Herbert 02c21c25ba dma-trace.c: use new mtrace_printf() to demote FW ABI banner to INFO
... down from ERROR. It was never an error, this was a hack to be
duplicated to both trace and etrace. This will make it easier to search
for actual errors.

Also make the banners slightly different between etrace and trace thanks
to new SHM: and DMA: prefixes. This makes identification of log files
easier.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Marc Herbert 1a7c0056a2 dma-trace.c: use new mtrace_printf() to add some error handling
Replace some tr_err() too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Marc Herbert 50eb5c9ca2 trace.c: add mtrace_printf() low-level shortcut
Direct access to mbox shared memory logging when DMA tracing is
either not initialized yet or disabled or found broken for any
reason.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Marc Herbert 532642bb32 timer.h: add platform_safe_get_time(timer) and use it in trace.c
Returns a small constant instead of crashing platform_timer_get() when
timer is NULL.

This is required to restore early tracing before sof->timer is
initialized.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Marc Herbert 3674c0f113 trace.c: mtrace_event: fix memcpy_s( dest_size ) argument
Found by chance while looking for something else.

This makes no difference right now because we checked the "length" in
the line immediately before but let's do the right thing anyway, at the
very least it's more readable.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Marc Herbert a0743971c9 check patch: turn off printk warnings
Zephyr's printk does not work like Linuxs printk

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Li-Yu Yu 0c21218b37 comp: Free model_handler in error paths during create
Add matching comp_data_blob_handler_free calls for
comp_data_blob_handler_new in error paths, which are
missing in many components' "new" functions.

Signed-off-by: Li-Yu Yu <aaronyu@google.com>
2021-06-29 23:05:42 +01:00
Marc Herbert c194125b83 zephyr: add notifier_register(ipc_send_queued_msg) in task_main_start()
Fixes #4356

In XTOS SOF, ipc_send_queued_msg() is run by task_main_primary_core(),
the initialization of which has a hard and circular dependency with the
initialization of the EDF scheduler. This EDF scheduler is not part of
Zephyr. Because of the circular dependency it does not seem
possible (nor desirable?) to refactor this code and make it compatible
with Zephyr. So schedule ipc_send_queued_msg() differently in Zephyr:
using a notifier triggered by the periodic Low Latency scheduler.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:04:04 +01:00
Marc Herbert cf3a7d1604 notifier.h: document the API
... and rename some parameter names.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:04:04 +01:00
Zhang Keqiao 130bffa6a9 topology: add tgl-h nocodec topology build
add the TGL-H nocodec topology for zephyr test.

Signed-off-by: Zhang Keqiao <keqiao.zhang@intel.com>
2021-06-29 22:51:10 +01:00
Kai Vehmanen 8633d5fd6d cavs: pm: improve PM_RUNTIME_HOST_DMA_L1 documentation
Reword doxygen comments and change the private helper function
names to better reflect the actual implementation. No functional
change.

The PM_RUNTIME_HOST_DMA_L1 resource is used to coordinate host DMA
users, so that DMI link is kept in L1 until all users are ready to
activate the link. This is a bit unusual usage of runtime-pm interface
in that a 'put on a resource' triggers transition to higher power state,
so this deserves some more documentation.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-06-29 22:49:50 +01:00
Brent Lu 8c863f43af topology: sof-glk-cs42l42: using 24-bit sample depth on SSP2
Changing sample depth of SSP2 to 24 bits for better dynamic range.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2021-06-29 22:41:08 +01:00
Liam Girdwood eb7add5135 testbench: add a option for specifying the number of copy() iterations
All the user to specify the number of copies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:58 +01:00
Liam Girdwood b8d6760600 testbench: fix crash when file has no . extension
Testbench crashed when a in/out file has not . extension. Fix this.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:58 +01:00
Liam Girdwood 305223a1f6 testbench: free components and pipeline after test results.
Move the comp free to after the results and free the pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:58 +01:00
Liam Girdwood 777c0008c1 testbench: add more helpful output for options parsing.
Lets be more helpful to the user.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:58 +01:00
Liam Girdwood bc10ba8b76 testbench: squash some valgrind warnings.
Buffer and params not initialised to zero like the other IPC structures
used by testbench. Fix this.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:58 +01:00
Liam Girdwood 1ab68bfc00 mocks: enable allocator tests in host mocks with valgrind
This enables support for running the allocator mocks with valgrind by
building the allocator for the host library target using a similar
heap map to Intel CAVS targets (memory.c is almost identical copy of CAVS
version).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:02 +01:00
Liam Girdwood c1f0f7068e pipeline: add heap trace to pipeline_new()
Balance the heap status with the existing pipeline_free() heap debug.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:02 +01:00
Marc Herbert 24a6159cb2 apollolake/memory.h: sort regions table comment by address
This makes it possible to match the table with the definitions.

Pure comment change, no code change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 09:25:19 +01:00
Ranjani Sridharan 6bbf6b0d3c Revert "dai: only process DAI config for comps on cores that enabled"
If the core is not up, the comp exist in the comp_list.
So no need to check if the core is up.
This reverts commit bccecb1a8e.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-28 20:45:35 +01:00
Kai Vehmanen 985c5b5685 zephyr: split the heap into shared and non shared
To increase performance of audio application code, the SOF heap should
be mapped to cached address region on platforms with aliased
cached/uncached memory layout.

This splits the heap into two and maps the SOF_MEM_ZONE_BUFFER to
the cached heap and all rest to uncached heap.

The raw heap memory area is still mapped to uncached memory, even for
the cached heap. The allocated blocks are converted to cached addresses
and passed to SOF users of rmalloc() and rballoc_align(). To ensure
application buffers do not share cachelines with heap metadata chunks,
allocation sizes are rounded up to integer multiples of platform
cacheline size.

BugLink: https://github.com/thesofproject/sof/issues/4306
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-06-28 20:07:02 +01:00
Ranjani Sridharan b91818be32 drivers: intel: dmic: fix double free dmic_remove()
Disable dmic interrupts first followed freeing by the dmic task
and finally, free the dmic pdata.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-28 19:59:12 +01:00
Liam Girdwood 0cf1f88546 buffer: fix double list deletion detected by valgrind.
Buffer lists were being deleted twice, at first by the
pipeline_disconnect() (the correct place) and then by buffer_free().

Fix this so buffer_free() only frees the buffer.

==426365== Invalid write of size 8
==426365==    at 0x49CB47B: list_item_del (list.h:57)
==426365==    by 0x49CB47B: buffer_free (buffer.c:179)
==426365==    by 0x49C8C7B: ipc_buffer_free (helper.c:697)
==426365==    by 0x10C1E6: free_comps (testbench.c:165)
==426365==    by 0x10C1E6: main (testbench.c:415)
==426365==  Address 0x4bdce48 is 152 bytes inside a block of size 168 free'd
==426365==    at 0x484521F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==426365==    by 0x49C9163: comp_free (component_ext.h:55)
==426365==    by 0x49C9163: ipc_comp_free (helper.c:866)
==426365==    by 0x10C200: free_comps (testbench.c:162)
==426365==    by 0x10C200: main (testbench.c:415)
==426365==  Block was alloc'd at
==426365==    at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==426365==    by 0x10D4E8: comp_alloc (component.h:548)
==426365==    by 0x10D4E8: file_new (file.c:430)
==426365==    by 0x49C81E7: comp_new (helper.c:423)
==426365==    by 0x49C8F0F: ipc_comp_new (helper.c:823)
==426365==    by 0x10E642: load_fileread (topology.c:323)
==426365==    by 0x49E13A0: load_widget (tplg_parser.c:1281)
==426365==    by 0x10F796: parse_topology (topology.c:779)
==426365==    by 0x10BE76: main (testbench.c:310)

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-28 09:11:34 +01:00
Ranjani Sridharan bccecb1a8e dai: only process DAI config for comps on cores that enabled
DAI config IPC is propagated to all DAI comps scheduled on
all cores but it should only be done if the secondary core is
enabled.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-27 20:15:44 +01:00
Ranjani Sridharan 928dba0853 pipeline/buffer: alloc them in the runtime shared zone
Make them shared between cores as they can be shared with
other pipelines, trace and possibly even DMA.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-27 20:15:44 +01:00
Ranjani Sridharan 29f0aeb913 arch: extensa: cpu: reset stale trace point during power down
When a secondary core is disabled and re-enabled without a
D3 cycle, the POWER_UP IDC message end up reading the trace
point message from the first boot. Reset it during power down
to avoid this.

Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-27 20:15:44 +01:00
Ranjani Sridharan 7b06921b6b pipeline_graph: no need to free pipeline components during pipeline_free()
Pipeline components will be freed by the host before the
pipeline widget itself is freed. No need to walk the pipeline
and free anything during pipeline_free().
Fix the unit tests to remove the tests that are not relevant anymore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-27 20:15:44 +01:00
Ranjani Sridharan 299fe20d80 schedule: edf/ll: remove list del/init during schedule free
edf_sh->list is not an item. So calling list_itel_del()
on it is wrong in scheduler_free_edf().

remove list_init() from scheduler_free_edf() as the list
should already be free and initialized.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-27 20:15:44 +01:00
Ranjani Sridharan da79c5073b ipc: ipc3: handler: fix error handling for pm_core_enable
Check and return error if enabling a core fails instead
of overwriting the error with a subsequent successful
core power up.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-27 20:15:44 +01:00
Curtis Malainey c4666dc27d OWNERS: replace dgried with chiang831
Dylan is transitioning, replace his spot with Jimmy for FYI on PRs.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-06-26 13:13:11 +01:00
Pierre-Louis Bossart 2d70f100c7 topology: use cAVS nocodec support for APL/GLK
Move the existing sof-apl-nocodec to the development folder, in case
SOF CI still wants to use it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart b5b0b2c4f2 topology: use same file for all cavs 1.8+ nocodec topologies
The beginning of the end of insanity?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart fdd8ec03b5 topology: sof-cnl-nocodec: prepare for different multicore configurations
Not all devices have 4 cores, some only have 2 and even APL/GLK is
currently limited to a single core.

For now we still use a single core for all topologies, we will enable
multi-core in a follow-up patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart 4050ff6c31 topology: intel-generic-dmic: add macro for DMIC_CORE_ID
Add macros to quickly enable multi-core with DMICs

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart c952c048b2 topology: sof-cnl-nocodec: change SSP index for APL
Prepare for use on APL to use SSP0,1, 5, all other platforms use SSP0,1,2

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart ac8df75466 topology: sof-cnl-nocodec: make SSP clocks parameters
use platform name to infer root clocks

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart ab3663f468 topology: sof-cnl-nocodec: use s32le
No idea what we add artificial limitations on formats

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart 556c114f47 topology: sof-cnl-nocodec: add macros for SSP cores
Prepare for reuse across all platforms. For now this still uses
single-core.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart d1bce3d8fc topology: sof-cnl-nocodec: use DMIC macros
Remove all the hard-coding and use macros.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart a379cc3751 topology: CMakelist: disable DYNAMIC pipelines for nocodec topologies
We first want to enable the simplified topologies, then multi-core
then dynamic pipelines. The latter two cases will be handled in
follow-up patches.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Pierre-Louis Bossart f07cf8ea1f topology: CMakelists: group nocodec together
Prepare for use of common file

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-06-25 11:18:28 -05:00
Andy Ross d2a79d05e1 trace: Don't initialize trace buffer under Zephyr
This memory is already owned and initialized by the OS under Zephyr
(and in many cases already holds live output!), don't touch it.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-25 14:06:16 +01:00
Marc Herbert c0f5668a82 panic: add comments, especially link to dump corruption bug #1346
Zero functional change.

These comments would have saved me at least a day.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-25 12:44:41 +01:00
Zhang Keqiao d750055a69 zephyr: switch to use 3k private key for tgl-h
TGL-H should be used the 3k otc private key for build.

Signed-off-by: Zhang Keqiao <keqiao.zhang@intel.com>
2021-06-25 11:10:33 +01:00
Keyon Jie 981524d197 idc: print out the target_core when timed out
Print out the target_core value when timed out during
idc_wait_in_blocking_mode(), which is useful for debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-06-25 16:51:19 +08:00
Daniel Baluta 7cc9a80ab8 codec_adapter: cadence: Reset init_done at init time
After first compress play run init_done is initialized with 1 and it
keeps this value as no one resets it.

This causes subsequent compress play to miss codec process init phase
and this causes decoding to fail.

With this change multiple cplay runs work fine!

Notice that cadence_codec_reset calls cadence_codec_init and thus resets
init_done flag.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-06-23 20:35:49 +03:00
Gongjun Song bc1497a742 Topology: Add sof-tgl-rt711-4ch topology
There is no rt1308 on the TGL-H-RVP platform, need to add a topology
file with only rt711 to enable soundwire on the TGL-H-RVP platform.

The patch of enable soundwire on the TGL-H-RVP platform has been
merged into the thesofproject/linux.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2021-06-23 15:06:35 +01:00
Viorel Suman 414e727a84 drivers: imx: sai: specify watermark value in fifo descriptor
Specify watermark via fifo descriptor in the same way
as the fifo depth is.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2021-06-23 14:59:35 +03:00
Viorel Suman d89ce5190a drivers: imx: sai: extract common flag outside switch statement
Same flag is set in all switch cases, so extract the
setting outside the switch statement.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2021-06-23 14:59:35 +03:00