mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Sound-open-firmware

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
sound-open-firmware@alsa-project.org

December 2017

  • 11 participants
  • 66 discussions
[Sound-open-firmware] [PATCH] topology: test: make mclk configurable
by Keyon Jie 10 Jan '18

10 Jan '18
The mclk may be different for different platforms, here make it configurable for test topology files. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- topology/test/test-capture-ssp.m4 | 3 ++- topology/test/test-playback-ssp.m4 | 3 ++- topology/test/test-ssp.m4 | 3 ++- topology/test/tplg-build.sh | 43 ++++++++++++++++++++++---------------- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4 index 613e666..2c808ba 100644 --- a/topology/test/test-capture-ssp.m4 +++ b/topology/test/test-capture-ssp.m4 @@ -23,6 +23,7 @@ include(`dsps/byt.m4') # TEST_SSP_PORT - SSP port number e.g. 2 # TEST_SSP_FORMAT - SSP data format e.g s16le # TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP MCLK in Hz # TEST_SSP_BCLK - SSP BCLK in Hz # TEST_SSP_PHY_BITS - SSP physical slot size # TEST_SSP_DATA_BITS - SSP data slot size @@ -66,7 +67,7 @@ PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2) # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(mclk, TEST_SSP_MCLK, slave), DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), DAI_CLOCK(fsync, 48000, slave), DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4 index 351b8af..093ad17 100644 --- a/topology/test/test-playback-ssp.m4 +++ b/topology/test/test-playback-ssp.m4 @@ -23,6 +23,7 @@ include(`dsps/byt.m4') # TEST_SSP_PORT - SSP port number e.g. 2 # TEST_SSP_FORMAT - SSP data format e.g s16le # TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP MCLK in Hz # TEST_SSP_BCLK - SSP BCLK in Hz # TEST_SSP_PHY_BITS - SSP physical slot size # TEST_SSP_DATA_BITS - SSP data slot size @@ -66,7 +67,7 @@ PCM_PLAYBACK_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1) # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(mclk, TEST_SSP_MCLK, slave), DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), DAI_CLOCK(fsync, 48000, slave), DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 index 92e91bf..304aab9 100644 --- a/topology/test/test-ssp.m4 +++ b/topology/test/test-ssp.m4 @@ -23,6 +23,7 @@ include(`dsps/byt.m4') # TEST_SSP_PORT - SSP port number e.g. 2 # TEST_SSP_FORMAT - SSP data format e.g s16le # TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_MCLK - SSP BCLK in Hz # TEST_SSP_BCLK - SSP BCLK in Hz # TEST_SSP_PHY_BITS - SSP physical slot size # TEST_SSP_DATA_BITS - SSP data slot size @@ -84,7 +85,7 @@ PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT # DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, - DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(mclk, TEST_SSP_MCLK, slave), DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), DAI_CLOCK(fsync, 48000, slave), DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index 5d7cd49..71bb120 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -25,6 +25,7 @@ SIMPLE_TESTS=(test-ssp test-capture-ssp test-playback-ssp) # 7) dai_phy_bits - SSP physical number of BLKCs per slot/channel # 8) dai_data_bits - SSP number of valid daat bits per slot/channel # 9) dai_bclk - SSP BCLK in HZ +# 10) dai_mclk - SSP MCLK in HZ # function simple_test { for i in ${SIMPLE_TESTS[@]} @@ -38,6 +39,7 @@ function simple_test { -DTEST_SSP_FORMAT=$6 \ -DTEST_PIPE_FORMAT=$4 \ -DTEST_SSP_BCLK=$9 \ + -DTEST_SSP_BCLK=$10 \ -DTEST_SSP_PHY_BITS=$7 \ -DTEST_SSP_DATA_BITS=$8 \ $i.m4 > ${TFILE}.conf @@ -47,23 +49,28 @@ function simple_test { } # Pre-process the simple tests -simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 -simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 -simple_test nocodec volume "NoCodec" s16le 2 s16le 20 16 1920000 -simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 -simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 -simple_test nocodec src "NoCodec" s24le 2 s24le 25 24 2400000 +simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 19200000 +simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 19200000 +simple_test nocodec volume "NoCodec" s16le 2 s16le 20 16 1920000 19200000 +simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 19200000 +simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 19200000 +simple_test nocodec src "NoCodec" s24le 2 s24le 25 24 2400000 19200000 + +simple_test codec passthrough "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000 +simple_test codec passthrough "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 +simple_test codec volume "SSP2-Codec" s16le 2 s16le 20 16 1920000 19200000 +simple_test codec volume "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 +simple_test codec volume "SSP2-Codec" s16le 2 s24le 25 24 2400000 19200000 +simple_test codec src "SSP2-Codec" s24le 2 s24le 25 24 2400000 19200000 + +simple_test baytrail passthrough "Baytrail Audio" s16le 2 s16le 20 16 1920000 19200000 +simple_test baytrail passthrough "Baytrail Audio" s24le 2 s24le 25 24 2400000 19200000 +simple_test baytrail volume "Baytrail Audio" s16le 2 s16le 20 16 1920000 19200000 +simple_test baytrail volume "Baytrail Audio" s24le 2 s24le 25 24 2400000 19200000 +simple_test baytrail volume "Baytrail Audio" s16le 2 s24le 25 24 2400000 19200000 +simple_test baytrail src "Baytrail Audio" s24le 2 s24le 25 24 2400000 19200000 + +simple_test nocodec passthrough "NoCodec" s16le 4 s16le 16 16 1536000 24576000 +simple_test apollolake passthrough "SSP4-Codec" s16le 4 s16le 16 16 1536000 24576000 -simple_test codec passthrough "SSP2-Codec" s16le 2 s16le 20 16 1920000 -simple_test codec passthrough "SSP2-Codec" s24le 2 s24le 25 24 2400000 -simple_test codec volume "SSP2-Codec" s16le 2 s16le 20 16 1920000 -simple_test codec volume "SSP2-Codec" s24le 2 s24le 25 24 2400000 -simple_test codec volume "SSP2-Codec" s16le 2 s24le 25 24 2400000 -simple_test codec src "SSP2-Codec" s24le 2 s24le 25 24 2400000 -simple_test baytrail passthrough "Baytrail Audio" s16le 2 s16le 20 16 1920000 -simple_test baytrail passthrough "Baytrail Audio" s24le 2 s24le 25 24 2400000 -simple_test baytrail volume "Baytrail Audio" s16le 2 s16le 20 16 1920000 -simple_test baytrail volume "Baytrail Audio" s24le 2 s24le 25 24 2400000 -simple_test baytrail volume "Baytrail Audio" s16le 2 s24le 25 24 2400000 -simple_test baytrail src "Baytrail Audio" s24le 2 s24le 25 24 2400000 -- 2.11.0
2 1
0 0
[Sound-open-firmware] [PATCH v2] dma-trace: add build condition for dma trace
by Keyon Jie 22 Dec '17

22 Dec '17
Only compile dma-trace.c when BUILD_DMA_TRACE is true. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> Acked-by: Yan Wang <yan.wang(a)linux.intel.com> --- configure.ac | 2 ++ src/lib/Makefile.am | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 86d19cb..44ede24 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,8 @@ AS_IF([test "x$enable_dma_trace" != "xno"], [ AC_DEFINE([CONFIG_DMA_TRACE], [1], [Configure DMA trace]) ]) +AM_CONDITIONAL(BUILD_DMA_TRACE, test "x$enable_dma_trace" != "xno") + # Test after CFLAGS set othewise test of cross compiler fails. AM_PROG_AS AM_PROG_AR diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 5a6dfbf..0a566d0 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -6,10 +6,14 @@ libcore_a_SOURCES = \ work.c \ notifier.c \ trace.c \ - dma-trace.c \ schedule.c \ agent.c +if BUILD_DMA_TRACE +libcore_a_SOURCES += \ + dma-trace.c +endif + libcore_a_CFLAGS = \ $(ARCH_CFLAGS) \ $(ARCH_INCDIR) \ -- 2.11.0
2 2
0 0
[Sound-open-firmware] [PATCH] dma-trace: add build condition for dma trace
by Keyon Jie 22 Dec '17

22 Dec '17
Only compile dma-trace.c when BUILD_DMA_TRACE is true. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- configure.ac | 2 ++ src/lib/Makefile.am | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 353987b..f41d9f4 100644 --- a/configure.ac +++ b/configure.ac @@ -226,6 +226,8 @@ AS_IF([test "x$enable_dma_trace" != "xno"], [ AC_DEFINE([CONFIG_DMA_TRACE], [1], [Configure DMA trace]) ]) +AM_CONDITIONAL(BUILD_DMA_TRACE, test "x$enable_dma_trace" != "xno") + PLATFORM_BOOT_LDR_LDSCRIPT="boot_ldr.x" AC_SUBST(PLATFORM_BOOT_LDR_LDSCRIPT) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 53b99a2..a168c2c 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -6,10 +6,14 @@ libcore_a_SOURCES = \ work.c \ notifier.c \ trace.c \ - dma-trace.c \ schedule.c \ interrupt.c +if BUILD_DMA_TRACE +libcore_a_SOURCES += \ + dma-trace.c +endif + libcore_a_CFLAGS = \ $(ARCH_CFLAGS) \ $(ARCH_INCDIR) \ -- 2.11.0
2 2
0 0
[Sound-open-firmware] [PATCH] trace: do dma trace when CONFIG_DMA_TRACE is selected
by Keyon Jie 22 Dec '17

22 Dec '17
CONFIG_DMA_TRACE is selected by default. But we should not do dma trace when CONFIG_DMA_TRACE is not selected (--disable-dma-trace is added to configure command line), here add this judgement to fix compiling issue for that dma trace is not selected. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- src/lib/trace.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/trace.c b/src/lib/trace.c index bb81d47..859bc0e 100644 --- a/src/lib/trace.c +++ b/src/lib/trace.c @@ -49,7 +49,9 @@ void _trace_error(uint32_t event) { unsigned long flags; volatile uint64_t *t; +#if defined(CONFIG_DMA_TRACE) uint64_t dt[2]; +#endif uint64_t time; if (!trace.enable) @@ -57,10 +59,12 @@ void _trace_error(uint32_t event) time = platform_timer_get(platform_timer); +#if defined(CONFIG_DMA_TRACE) /* save event to DMA tracing buffer */ dt[0] = time; dt[1] = event; dtrace_event((const char*)dt, sizeof(uint64_t) * 2); +#endif /* send event by mail box too. */ spin_lock_irq(&trace.lock, flags); @@ -84,7 +88,9 @@ void _trace_error(uint32_t event) void _trace_error_atomic(uint32_t event) { volatile uint64_t *t; +#if defined(CONFIG_DMA_TRACE) uint64_t dt[2]; +#endif uint64_t time; if (!trace.enable) @@ -92,10 +98,12 @@ void _trace_error_atomic(uint32_t event) time = platform_timer_get(platform_timer); +#if defined(CONFIG_DMA_TRACE) /* save event to DMA tracing buffer */ dt[0] = time; dt[1] = event; dtrace_event_atomic((const char*)dt, sizeof(uint64_t) * 2); +#endif /* write timestamp and event to trace buffer */ t = (volatile uint64_t*)(MAILBOX_TRACE_BASE + trace.pos); -- 2.11.0
2 2
0 0
[Sound-open-firmware] [PATCH] comp: pause: Make sure dai/host state are preserved during pause/resume
by Liam Girdwood 22 Dec '17

22 Dec '17
The DAI and host components states must be preserved during pause so that when normal pipeline positions are used on resume. i.e. pause just looks like a very long pipeline schedule. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/dai.c | 10 ++++------ src/audio/host.c | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index 9058f5c..b7ad1b4 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -95,7 +95,6 @@ static void dai_dma_cb(void *data, uint32_t type, struct dma_sg_elem *next) /* inform waiters */ wait_completed(&dd->complete); - return; } /* is our pipeline handling an XRUN ? */ @@ -172,9 +171,8 @@ static void dai_dma_cb(void *data, uint32_t type, struct dma_sg_elem *next) } /* notify pipeline that DAI needs its buffer processed */ - pipeline_schedule_copy(dev->pipeline, 0); - - return; + if (dev->state == COMP_STATE_ACTIVE) + pipeline_schedule_copy(dev->pipeline, 0); } static struct comp_dev *dai_new(struct sof_ipc_comp *comp) @@ -539,10 +537,10 @@ static int dai_cmd(struct comp_dev *dev, int cmd, void *data) return ret; switch (cmd) { - case COMP_CMD_RELEASE: case COMP_CMD_START: - dai_pointer_init(dev); + /* fall through */ + case COMP_CMD_RELEASE: /* only start the DAI if we are not XRUN handling */ if (dd->xrun == 0) { diff --git a/src/audio/host.c b/src/audio/host.c index 8f09952..7cb62ef 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -529,7 +529,6 @@ static int host_cmd(struct comp_dev *dev, int cmd, void *data) return ret; switch (cmd) { - case COMP_CMD_PAUSE: case COMP_CMD_STOP: ret = host_stop(dev); break; -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH] baytrail: panic: fix panic on baytrail.
by Liam Girdwood 21 Dec '17

21 Dec '17
Simplify and fix panic output on baytrail. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/platform/baytrail/include/platform/platform.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 72174f3..dca0c47 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -93,13 +93,11 @@ struct reef; /* Platform defined panic code */ #define platform_panic(__x) \ - shim_write(SHIM_IPCXL, ((shim_read(SHIM_IPCXL) & 0xc0000000) |\ - ((0xdead000 | __x) & 0x3fffffff))) + shim_write(SHIM_IPCDH, (0xdead000 | (__x & 0xfff))) /* Platform defined trace code */ #define platform_trace_point(__x) \ - shim_write(SHIM_IPCDH, ((shim_read(SHIM_IPCDH) & 0xc0000000) |\ - ((__x) & 0x3fffffff))) + shim_write(SHIM_IPCDH, (__x & 0x3fffffff)) /* * APIs declared here are defined for every platform and IPC mechanism. */ -- 2.14.1
1 3
0 0
[Sound-open-firmware] [PATCH 1/2] agent: Add initial system monitoring agent.
by Liam Girdwood 21 Dec '17

21 Dec '17
Add a simple system monitoring agent that can detect when FW does not execute correctly. The assumption is that FW will always idle from time to time and this idling can be monitored by the SA. The FW wont idle if it's thrashing, continually interrupted, continually running work or continually rescheduling a task. The SA will emit trace and panic if idle is not entered for a specific time period. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/include/reef/agent.h | 50 ++++++++++++ src/include/reef/debug.h | 1 + src/include/reef/reef.h | 4 + src/include/reef/trace.h | 1 + src/lib/Makefile.am | 3 +- src/lib/agent.c | 96 +++++++++++++++++++++++ src/platform/baytrail/include/platform/platform.h | 3 + 7 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 src/include/reef/agent.h create mode 100644 src/lib/agent.c diff --git a/src/include/reef/agent.h b/src/include/reef/agent.h new file mode 100644 index 0000000..53912b5 --- /dev/null +++ b/src/include/reef/agent.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017, Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Intel Corporation nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Author: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> + */ + +#ifndef __INCLUDE_REEF_AGENT__ +#define __INCLUDE_REEF_AGENT__ + +#include <stdint.h> +#include <stddef.h> +#include <reef/work.h> + +struct reef; + +/* simple agent */ +struct sa { + uint64_t last_idle; /* time of last idle */ + uint64_t ticks; + struct work work; +}; + +void sa_enter_idle(struct reef *reef); +void sa_init(struct reef *reef); + +#endif diff --git a/src/include/reef/debug.h b/src/include/reef/debug.h index 85f91d4..2c5c573 100644 --- a/src/include/reef/debug.h +++ b/src/include/reef/debug.h @@ -47,6 +47,7 @@ #define PANIC_EXCEPTION 6 #define PANIC_DEADLOCK 7 #define PANIC_STACK 8 +#define PANIC_IDLE 9 #define DEBUG diff --git a/src/include/reef/reef.h b/src/include/reef/reef.h index 842ad94..c872acc 100644 --- a/src/include/reef/reef.h +++ b/src/include/reef/reef.h @@ -36,6 +36,7 @@ #include <arch/reef.h> struct ipc; +struct sa; /* use same syntax as Linux for simplicity */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) @@ -64,6 +65,9 @@ struct reef { /* ipc */ struct ipc *ipc; + /* system agent */ + struct sa *sa; + /* private data */ void *arch_private; void *plat_private; diff --git a/src/include/reef/trace.h b/src/include/reef/trace.h index 9497f98..4656ef7 100644 --- a/src/include/reef/trace.h +++ b/src/include/reef/trace.h @@ -87,6 +87,7 @@ #define TRACE_CLASS_TONE (18 << 24) #define TRACE_CLASS_EQ_FIR (19 << 24) #define TRACE_CLASS_EQ_IIR (20 << 24) +#define TRACE_CLASS_SA (21 << 24) /* move to config.h */ #define TRACE 1 diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index b4521df..5a6dfbf 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -7,7 +7,8 @@ libcore_a_SOURCES = \ notifier.c \ trace.c \ dma-trace.c \ - schedule.c + schedule.c \ + agent.c libcore_a_CFLAGS = \ $(ARCH_CFLAGS) \ diff --git a/src/lib/agent.c b/src/lib/agent.c new file mode 100644 index 0000000..1ffee81 --- /dev/null +++ b/src/lib/agent.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2017, Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Intel Corporation nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Author: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> + * + * System Agent - Simple FW Monitor that can notify host drivers in the event + * of any FW errors. The SA assumes that each core will enter the idle state + * from time to time (within a period of PLATFORM_IDLE_TIME). If the core does + * not enter the idle loop through looping forever or scheduling some work + * continuously then the SA will emit trace and panic(). + */ + +#include <reef/reef.h> +#include <reef/agent.h> +#include <reef/debug.h> +#include <reef/alloc.h> +#include <reef/clock.h> +#include <reef/trace.h> +#include <platform/timer.h> +#include <platform/platform.h> +#include <platform/clk.h> + +#define trace_sa(__e) trace_event_atomic(TRACE_CLASS_SA, __e) +#define trace_sa_value(__e) trace_value_atomic(__e) + +/* + * Notify the SA that we are about to enter idle state (WFI). + */ +void sa_enter_idle(struct reef *reef) +{ + struct sa *sa = reef->sa; + + sa->last_idle = platform_timer_get(platform_timer); +} + +static uint64_t validate(void *data, uint64_t delay) +{ + struct sa *sa = data; + uint64_t current; + uint64_t delta; + + current = platform_timer_get(platform_timer); + delta = current - sa->last_idle; + + /* were we last idle longer than timeout */ + if (delta > sa->ticks) { + trace_sa("tim"); + trace_sa_value(delta); + panic_dump_stack(PANIC_IDLE); + } + + return PLATFORM_IDLE_TIME; +} + +void sa_init(struct reef *reef) +{ + struct sa *sa; + + trace_sa("ini"); + + sa = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*sa)); + reef->sa = sa; + + /* set default tick timout */ + sa->ticks = clock_us_to_ticks(PLATFORM_WORKQ_CLOCK, PLATFORM_IDLE_TIME); + trace_sa_value(sa->ticks); + + /* set lst idle time to now to give time for boot completion */ + sa->last_idle = platform_timer_get(platform_timer) + sa->ticks; + work_init(&sa->work, validate, sa, WORK_ASYNC); + work_schedule_default(&sa->work, PLATFORM_IDLE_TIME); +} diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index bc90564..8b713df 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -94,6 +94,9 @@ struct reef; /* DMAC used for trace DMA */ #define PLATFORM_TRACE_DMAC DMA_ID_DMAC0 +/* DSP should be idle in this time frame */ +#define PLATFORM_IDLE_TIME 750000 + /* Platform defined panic code */ #define platform_panic(__x) \ shim_write(SHIM_IPCDH, (0xdead000 | (__x & 0xfff))) -- 2.14.1
1 1
0 0
[Sound-open-firmware] [PATCH V3] rimage: Fix some memory leak error
by Xiuli Pan 20 Dec '17

20 Dec '17
From: Pan Xiuli <xiuli.pan(a)linux.intel.com> Handle pointers and memory when error happens. Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com> --- V2: rebase on the HEAD V3: add ret value to avoid uninitialized use of ret Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com> --- rimage/rimage.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/rimage/rimage.c b/rimage/rimage.c index af57f5a..af4a7d0 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -208,10 +208,11 @@ static int write_elf_data(struct image *image) goto out; } - free(image->prg); - free(image->section); - out: + if (image->prg) + free(image->prg); + if (image->section) + free(image->section); return ret; } @@ -283,6 +284,8 @@ found: if (image.in_fd == NULL) { fprintf(stderr, "error: unable to open %s for reading %d\n", image.in_file, errno); + ret = -EINVAL; + goto out; } /* open outfile for writing */ @@ -291,14 +294,19 @@ found: if (image.out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.out_file, errno); + ret = -EINVAL; + goto out; } /* write data */ ret = write_elf_data(&image); +out: /* close files */ - fclose(image.out_fd); - fclose(image.in_fd); + if (image.in_fd) + fclose(image.in_fd); + if (image.out_fd) + fclose(image.out_fd); return ret; } -- 2.7.4
2 1
0 0
[Sound-open-firmware] [PATCH V2] rimage: Fix some memory leak error
by Xiuli Pan 20 Dec '17

20 Dec '17
From: Pan Xiuli <xiuli.pan(a)linux.intel.com> Handle pointers and memory when error happens. Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com> --- V2: rebase on the HEAD Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com> --- rimage/rimage.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/rimage/rimage.c b/rimage/rimage.c index af57f5a..f5b5404 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -208,10 +208,11 @@ static int write_elf_data(struct image *image) goto out; } - free(image->prg); - free(image->section); - out: + if (image->prg) + free(image->prg); + if (image->section) + free(image->section); return ret; } @@ -283,6 +284,7 @@ found: if (image.in_fd == NULL) { fprintf(stderr, "error: unable to open %s for reading %d\n", image.in_file, errno); + goto out; } /* open outfile for writing */ @@ -291,14 +293,18 @@ found: if (image.out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.out_file, errno); + goto out; } /* write data */ ret = write_elf_data(&image); +out: /* close files */ - fclose(image.out_fd); - fclose(image.in_fd); + if (image.in_fd) + fclose(image.in_fd); + if (image.out_fd) + fclose(image.out_fd); return ret; } -- 2.7.4
1 0
0 0
[Sound-open-firmware] [PATCH 1/2] topology: sof: Fix a typo for pipe src capture
by Xiuli Pan 20 Dec '17

20 Dec '17
From: Pan Xiuli <xiuli.pan(a)linux.intel.com> Should be src capture here in capture pipe. Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com> --- topology/sof/pipe-src-capture.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4 index 9484ca8..c843a6c 100644 --- a/topology/sof/pipe-src-capture.m4 +++ b/topology/sof/pipe-src-capture.m4 @@ -14,7 +14,7 @@ include(`local.m4') # Host "Passthrough Playback" PCM uses pipeline DMAC and channel # with 4 sink and 0 source periods -W_PCM_PLAYBACK(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2) +W_PCM_CAPTURE(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2) # # SRC Configuration -- 2.7.4
2 2
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.