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 -----
  • July
  • June
  • 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

March 2018

  • 20 participants
  • 144 discussions
[Sound-open-firmware] [PATCH] hda-dma: fix configure direction wrong issue
by Keyon Jie 07 Mar '18

07 Mar '18
The directions configured in sg_elem are actually dma transfer type, not playback/capture direction, here correct them. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- src/drivers/hda-dma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/drivers/hda-dma.c b/src/drivers/hda-dma.c index 87221a8..57cb7fc 100644 --- a/src/drivers/hda-dma.c +++ b/src/drivers/hda-dma.c @@ -313,7 +313,7 @@ static int hda_dma_set_config(struct dma *dma, int channel, list_for_item(plist, &config->elem_list) { sg_elem = container_of(plist, struct dma_sg_elem, list); - if (config->direction == SOF_IPC_STREAM_PLAYBACK) + if (config->direction == DMA_DIR_HMEM_TO_LMEM) addr = sg_elem->dest; else addr = sg_elem->src; @@ -344,10 +344,10 @@ static int hda_dma_set_config(struct dma *dma, int channel, dgcs = DGCS_FWCB; /* set DGCS.SCS bit to 0 for 32 bit container */ - if ((config->direction == SOF_IPC_STREAM_PLAYBACK && - config->dest_width <= 16) || - (config->direction == SOF_IPC_STREAM_CAPTURE && - config->src_width <= 16)) + if ((config->direction == DMA_DIR_HMEM_TO_LMEM && + config->dest_width <= 16) || + (config->direction == DMA_DIR_LMEM_TO_HMEM && + config->src_width <= 16)) dgcs |= DGCS_SCS; /* init channel in HW */ -- 2.14.1
2 2
0 0
[Sound-open-firmware] [PATCH] topology: fix dai capture tokens and move buffer size macro definition
by Ranjani Sridharan 06 Mar '18

06 Mar '18
This patch fixes typo in dai capture tokens and moves te buffer size macro definition to buffer.m4 Signed-off-by: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com> --- topology/dsps/bdw.m4 | 2 +- topology/dsps/bxt.m4 | 2 +- topology/dsps/byt.m4 | 2 +- topology/dsps/cht.m4 | 2 +- topology/dsps/cnl.m4 | 2 +- topology/dsps/hsw.m4 | 2 +- topology/m4/buffer.m4 | 22 ++++++++++++++++++++++ topology/m4/pcm.m4 | 22 ---------------------- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4 index a6022b9..c2bf04e 100644 --- a/topology/dsps/bdw.m4 +++ b/topology/dsps/bdw.m4 @@ -31,7 +31,7 @@ W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC " W_DATA(dai0p_plat_conf, dai0p_plat_tokens) # DAI0 platform capture configuration -W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"')) +W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "1"')) W_DATA(dai0c_plat_conf, dai0c_plat_tokens) diff --git a/topology/dsps/bxt.m4 b/topology/dsps/bxt.m4 index 4d45386..df61d1a 100644 --- a/topology/dsps/bxt.m4 +++ b/topology/dsps/bxt.m4 @@ -34,7 +34,7 @@ W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC " W_DATA(dai0p_plat_conf, dai0p_plat_tokens) # DAI0 platform capture configuration -W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"')) +W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "1"')) W_DATA(dai0c_plat_conf, dai0c_plat_tokens) diff --git a/topology/dsps/byt.m4 b/topology/dsps/byt.m4 index ab707f8..d1d4886 100644 --- a/topology/dsps/byt.m4 +++ b/topology/dsps/byt.m4 @@ -31,7 +31,7 @@ W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC " W_DATA(dai0p_plat_conf, dai0p_plat_tokens) # DAI0 platform capture configuration -W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"')) +W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "1"')) W_DATA(dai0c_plat_conf, dai0c_plat_tokens) diff --git a/topology/dsps/cht.m4 b/topology/dsps/cht.m4 index 41529dc..4ed114f 100644 --- a/topology/dsps/cht.m4 +++ b/topology/dsps/cht.m4 @@ -31,7 +31,7 @@ W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC " W_DATA(dai0p_plat_conf, dai0p_plat_tokens) # DAI0 platform capture configuration -W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"')) +W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "1"')) W_DATA(dai0c_plat_conf, dai0c_plat_tokens) diff --git a/topology/dsps/cnl.m4 b/topology/dsps/cnl.m4 index 431db32..41ece94 100644 --- a/topology/dsps/cnl.m4 +++ b/topology/dsps/cnl.m4 @@ -35,7 +35,7 @@ W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC " W_DATA(dai0p_plat_conf, dai0p_plat_tokens) # DAI0 platform capture configuration -W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"')) +W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "1"')) W_DATA(dai0c_plat_conf, dai0c_plat_tokens) diff --git a/topology/dsps/hsw.m4 b/topology/dsps/hsw.m4 index 5db318f..754fc41 100644 --- a/topology/dsps/hsw.m4 +++ b/topology/dsps/hsw.m4 @@ -31,7 +31,7 @@ W_VENDORTUPLES(dai0p_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC " W_DATA(dai0p_plat_conf, dai0p_plat_tokens) # DAI0 platform capture configuration -W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC "1"')) +W_VENDORTUPLES(dai0c_plat_tokens, sof_dai_tokens, LIST(` ', `SOF_TKN_DAI_DMAC "1"', `SOF_TKN_DAI_DMAC_CHAN "1"')) W_DATA(dai0c_plat_conf, dai0c_plat_tokens) diff --git a/topology/m4/buffer.m4 b/topology/m4/buffer.m4 index fc06ba0..4bfd212 100644 --- a/topology/m4/buffer.m4 +++ b/topology/m4/buffer.m4 @@ -26,4 +26,26 @@ define(`W_BUFFER', ` ]' `}') +dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) +define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')') + +dnl PCM_PLAYBACK_ADD(name, pipeline, pcm_id, dai_id, playback) +define(`PCM_PLAYBACK_ADD', +`SectionPCM.STR($1) {' +`' +` index STR($2)' +`' +` # used for binding to the PCM' +` id STR($3)' +`' +` dai.STR($1 $3) {' +` id STR($4)' +` }' +`' +` pcm."playback" {' +`' +` capabilities STR($5)' +` }' +`}') + divert(0)dnl diff --git a/topology/m4/pcm.m4 b/topology/m4/pcm.m4 index d767350..596f2fe 100644 --- a/topology/m4/pcm.m4 +++ b/topology/m4/pcm.m4 @@ -93,28 +93,6 @@ define(`PCM_CAPABILITIES', ` buffer_size_max STR($12)' `}') -dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) -define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')') - -dnl PCM_PLAYBACK_ADD(name, pipeline, pcm_id, dai_id, playback) -define(`PCM_PLAYBACK_ADD', -`SectionPCM.STR($1) {' -`' -` index STR($2)' -`' -` # used for binding to the PCM' -` id STR($3)' -`' -` dai.STR($1 $3) {' -` id STR($4)' -` }' -`' -` pcm."playback" {' -`' -` capabilities STR($5)' -` }' -`}') - dnl PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture) define(`PCM_CAPTURE_ADD', `SectionPCM.STR($1) {' -- 2.14.1
2 1
0 0
[Sound-open-firmware] [PATCH] topology: byt-rt5651: Fix BE DAI link name.
by Liam Girdwood 06 Mar '18

06 Mar '18
Should be SSP2-Codec. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/reef-byt-rt5651.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index 96147d3..ec114d7 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -93,7 +93,7 @@ PCM_DUPLEX_ADD(Low Latency, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) # # BE configurations - overrides config in ACPI if present # -DAI_CONFIG(SSP, 2, Baytrail Audio, I2S, 24, +DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 24, DAI_CLOCK(mclk, 19200000, slave), DAI_CLOCK(bclk, 2400000, slave), DAI_CLOCK(fsync, 48000, slave), -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH V4 1/2] ASoc: SOF: Add memory window for all platform
by Xiuli Pan 06 Mar '18

06 Mar '18
From: Pan Xiuli <xiuli.pan(a)linux.intel.com> Add memory window handler for BYT, HSW and BDW. Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com> --- v1: rebase and some typo fix v2: rebase and fix window setting v3: rebase v4: rebase and add err handler for get_window function Test with: Mininow max rt5651 SOF master: e92ef97834489f52c0f20445d401a8c6e0aaed62 SOF-Tool master: 5b8dfd13019cfd29999503b56c902f56209000ed https://github.com/plbossart/sound/tree/topic/sof-v4.14: d919ea06b7f79c95ab4eb68baf05e9faf3a894c1 --- sound/soc/sof/hw-apl.c | 23 +++++++++--- sound/soc/sof/hw-bdw.c | 97 +++++++++++++++++++++++++++++++++++++++++++++---- sound/soc/sof/hw-byt.c | 98 +++++++++++++++++++++++++++++++++++++++++++++----- sound/soc/sof/hw-hsw.c | 97 +++++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 289 insertions(+), 26 deletions(-) diff --git a/sound/soc/sof/hw-apl.c b/sound/soc/sof/hw-apl.c index bfbdd915..1823153 100644 --- a/sound/soc/sof/hw-apl.c +++ b/sound/soc/sof/hw-apl.c @@ -1089,12 +1089,18 @@ static int apl_prepare(struct snd_sof_dev *sdev, unsigned int format, static void apl_get_windows(struct snd_sof_dev *sdev) { struct sof_ipc_window_elem *elem; + u32 outbox_offset = 0; + u32 stream_offset = 0; + u32 inbox_offset = 0; + u32 outbox_size = 0; + u32 stream_size = 0; + u32 inbox_size = 0; int i; - u32 inbox_offset = 0, outbox_offset = 0; - u32 inbox_size = 0, outbox_size = 0; - if (!sdev->info_window) + if (!sdev->info_window) { + dev_err(sdev->dev, "error: have no window info\n"); return; + } for (i = 0; i < sdev->info_window->num_windows; i++) { elem = &sdev->info_window->window[i]; @@ -1135,6 +1141,9 @@ static void apl_get_windows(struct snd_sof_dev *sdev) elem->size, "debug"); break; case SOF_IPC_REGION_STREAM: + stream_offset = + elem->offset + SRAM_WINDOW_OFFSET(elem->id); + stream_size = elem->size; snd_sof_debugfs_create_item(sdev, sdev->bar[APL_DSP_BAR] + elem->offset + @@ -1151,10 +1160,16 @@ static void apl_get_windows(struct snd_sof_dev *sdev) elem->size, "regs"); break; default: - break; + dev_err(sdev->dev, "error: get illegal window info\n"); + return; } } + if (outbox_size == 0 || inbox_size == 0) { + dev_err(sdev->dev, "error: get illegal mailbox window\n"); + return; + } + snd_sof_dsp_mailbox_init(sdev, inbox_offset, inbox_size, outbox_offset, outbox_size); diff --git a/sound/soc/sof/hw-bdw.c b/sound/soc/sof/hw-bdw.c index b1c9508..1fe2807 100644 --- a/sound/soc/sof/hw-bdw.c +++ b/sound/soc/sof/hw-bdw.c @@ -66,7 +66,6 @@ static const struct snd_sof_debugfs_map bdw_debugfs[] = { {"iram", BDW_DSP_BAR, IRAM_OFFSET, BDW_IRAM_SIZE}, {"dram", BDW_DSP_BAR, DRAM_OFFSET, BDW_DRAM_SIZE}, {"shim", BDW_DSP_BAR, SHIM_OFFSET, SHIM_SIZE}, - {"mbox", BDW_DSP_BAR, MBOX_OFFSET, MBOX_SIZE}, }; /* @@ -389,6 +388,88 @@ static irqreturn_t bdw_irq_thread(int irq, void *context) /* * IPC Firmware ready. */ +static void bdw_get_windows(struct snd_sof_dev *sdev) +{ + struct sof_ipc_window_elem *elem; + u32 outbox_offset = 0; + u32 stream_offset = 0; + u32 inbox_offset = 0; + u32 outbox_size = 0; + u32 stream_size = 0; + u32 inbox_size = 0; + int i; + + if (!sdev->info_window) { + dev_err(sdev->dev, "error: have no window info\n"); + return; + } + + for (i = 0; i < sdev->info_window->num_windows; i++) { + elem = &sdev->info_window->window[i]; + + switch (elem->type) { + case SOF_IPC_REGION_UPBOX: + inbox_offset = elem->offset + MBOX_OFFSET; + inbox_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[BDW_DSP_BAR] + + inbox_offset, + elem->size, "inbox"); + break; + case SOF_IPC_REGION_DOWNBOX: + outbox_offset = elem->offset + MBOX_OFFSET; + outbox_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[BDW_DSP_BAR] + + outbox_offset, + elem->size, "outbox"); + break; + case SOF_IPC_REGION_TRACE: + snd_sof_debugfs_create_item(sdev, + sdev->bar[BDW_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "etrace"); + break; + case SOF_IPC_REGION_DEBUG: + snd_sof_debugfs_create_item(sdev, + sdev->bar[BDW_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "debug"); + break; + case SOF_IPC_REGION_STREAM: + stream_offset = elem->offset + MBOX_OFFSET; + stream_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[BDW_DSP_BAR] + + stream_offset, + elem->size, "stream"); + break; + case SOF_IPC_REGION_REGS: + snd_sof_debugfs_create_item(sdev, + sdev->bar[BDW_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "regs"); + break; + default: + dev_err(sdev->dev, "error: get illegal window info\n"); + return; + } + } + + if (outbox_size == 0 || inbox_size == 0) { + dev_err(sdev->dev, "error: get illegal mailbox window\n"); + return; + } + + snd_sof_dsp_mailbox_init(sdev, inbox_offset, inbox_size, + outbox_offset, outbox_size); + + dev_dbg(sdev->dev, " mailbox upstream 0x%x - size 0x%x\n", + inbox_offset, inbox_size); + dev_dbg(sdev->dev, " mailbox downstream 0x%x - size 0x%x\n", + outbox_offset, outbox_size); +} + static int bdw_fw_ready(struct snd_sof_dev *sdev, u32 msg_id) { struct sof_ipc_fw_ready *fw_ready = &sdev->fw_ready; @@ -409,14 +490,16 @@ static int bdw_fw_ready(struct snd_sof_dev *sdev, u32 msg_id) fw_ready->hostbox_offset, fw_ready->hostbox_size); - dev_dbg(sdev->dev, " mailbox DSP initiated 0x%x - size 0x%x\n", - fw_ready->dspbox_offset, fw_ready->dspbox_size); - dev_dbg(sdev->dev, " mailbox Host initiated 0x%x - size 0x%x\n", - fw_ready->hostbox_offset, fw_ready->hostbox_size); - - dev_info(sdev->dev, " Firmware info: version %d:%d-%s build %d on %s:%s\n", + dev_info(sdev->dev, + " Firmware info: version %d:%d-%s build %d on %s:%s\n", v->major, v->minor, v->tag, v->build, v->date, v->time); + /* now check for extended data */ + snd_sof_fw_parse_ext_data(sdev, MBOX_OFFSET + + sizeof(struct sof_ipc_fw_ready)); + + bdw_get_windows(sdev); + return 0; } diff --git a/sound/soc/sof/hw-byt.c b/sound/soc/sof/hw-byt.c index 367fab9..8d27e18 100644 --- a/sound/soc/sof/hw-byt.c +++ b/sound/soc/sof/hw-byt.c @@ -76,7 +76,6 @@ static const struct snd_sof_debugfs_map byt_debugfs[] = { {"iram", BYT_DSP_BAR, IRAM_OFFSET, IRAM_SIZE}, {"dram", BYT_DSP_BAR, DRAM_OFFSET, DRAM_SIZE}, {"shim", BYT_DSP_BAR, SHIM_OFFSET, SHIM_SIZE}, - {"mbox", BYT_DSP_BAR, MBOX_OFFSET, MBOX_SIZE}, }; static const struct snd_sof_debugfs_map cht_debugfs[] = { @@ -92,7 +91,6 @@ static const struct snd_sof_debugfs_map cht_debugfs[] = { {"iram", BYT_DSP_BAR, IRAM_OFFSET, IRAM_SIZE}, {"dram", BYT_DSP_BAR, DRAM_OFFSET, DRAM_SIZE}, {"shim", BYT_DSP_BAR, SHIM_OFFSET, SHIM_SIZE}, - {"mbox", BYT_DSP_BAR, MBOX_OFFSET, MBOX_SIZE}, }; /* @@ -160,6 +158,88 @@ static void byt_block_read(struct snd_sof_dev *sdev, u32 offset, void *dest, /* * IPC Firmware ready. */ +static void byt_get_windows(struct snd_sof_dev *sdev) +{ + struct sof_ipc_window_elem *elem; + u32 outbox_offset = 0; + u32 stream_offset = 0; + u32 inbox_offset = 0; + u32 outbox_size = 0; + u32 stream_size = 0; + u32 inbox_size = 0; + int i; + + if (!sdev->info_window) { + dev_err(sdev->dev, "error: have no window info\n"); + return; + } + + for (i = 0; i < sdev->info_window->num_windows; i++) { + elem = &sdev->info_window->window[i]; + + switch (elem->type) { + case SOF_IPC_REGION_UPBOX: + inbox_offset = elem->offset + MBOX_OFFSET; + inbox_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[BYT_DSP_BAR] + + inbox_offset, + elem->size, "inbox"); + break; + case SOF_IPC_REGION_DOWNBOX: + outbox_offset = elem->offset + MBOX_OFFSET; + outbox_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[BYT_DSP_BAR] + + outbox_offset, + elem->size, "outbox"); + break; + case SOF_IPC_REGION_TRACE: + snd_sof_debugfs_create_item(sdev, + sdev->bar[BYT_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "etrace"); + break; + case SOF_IPC_REGION_DEBUG: + snd_sof_debugfs_create_item(sdev, + sdev->bar[BYT_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "debug"); + break; + case SOF_IPC_REGION_STREAM: + stream_offset = elem->offset + MBOX_OFFSET; + stream_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[BYT_DSP_BAR] + + stream_offset, + elem->size, "stream"); + break; + case SOF_IPC_REGION_REGS: + snd_sof_debugfs_create_item(sdev, + sdev->bar[BYT_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "regs"); + break; + default: + dev_err(sdev->dev, "error: get illegal window info\n"); + return; + } + } + + if (outbox_size == 0 || inbox_size == 0) { + dev_err(sdev->dev, "error: get illegal mailbox window\n"); + return; + } + + snd_sof_dsp_mailbox_init(sdev, inbox_offset, inbox_size, + outbox_offset, outbox_size); + + dev_dbg(sdev->dev, " mailbox upstream 0x%x - size 0x%x\n", + inbox_offset, inbox_size); + dev_dbg(sdev->dev, " mailbox downstream 0x%x - size 0x%x\n", + outbox_offset, outbox_size); +} + static int byt_fw_ready(struct snd_sof_dev *sdev, u32 msg_id) { struct sof_ipc_fw_ready *fw_ready = &sdev->fw_ready; @@ -180,14 +260,16 @@ static int byt_fw_ready(struct snd_sof_dev *sdev, u32 msg_id) fw_ready->hostbox_offset, fw_ready->hostbox_size); - dev_dbg(sdev->dev, " mailbox DSP initiated 0x%x - size 0x%x\n", - fw_ready->dspbox_offset, fw_ready->dspbox_size); - dev_dbg(sdev->dev, " mailbox Host initiated 0x%x - size 0x%x\n", - fw_ready->hostbox_offset, fw_ready->hostbox_size); - - dev_info(sdev->dev, " Firmware info: version %d:%d-%s build %d on %s:%s\n", + dev_info(sdev->dev, + " Firmware info: version %d:%d-%s build %d on %s:%s\n", v->major, v->minor, v->tag, v->build, v->date, v->time); + /* now check for extended data */ + snd_sof_fw_parse_ext_data(sdev, MBOX_OFFSET + + sizeof(struct sof_ipc_fw_ready)); + + byt_get_windows(sdev); + return 0; } diff --git a/sound/soc/sof/hw-hsw.c b/sound/soc/sof/hw-hsw.c index 495009a..f636ce4 100644 --- a/sound/soc/sof/hw-hsw.c +++ b/sound/soc/sof/hw-hsw.c @@ -66,7 +66,6 @@ static const struct snd_sof_debugfs_map hsw_debugfs[] = { {"iram", HSW_DSP_BAR, IRAM_OFFSET, HSW_IRAM_SIZE}, {"dram", HSW_DSP_BAR, DRAM_OFFSET, HSW_DRAM_SIZE}, {"shim", HSW_DSP_BAR, SHIM_OFFSET, SHIM_SIZE}, - {"mbox", HSW_DSP_BAR, MBOX_OFFSET, MBOX_SIZE}, }; /* @@ -389,6 +388,88 @@ static irqreturn_t hsw_irq_thread(int irq, void *context) /* * IPC Firmware ready. */ +static void hsw_get_windows(struct snd_sof_dev *sdev) +{ + struct sof_ipc_window_elem *elem; + u32 outbox_offset = 0; + u32 stream_offset = 0; + u32 inbox_offset = 0; + u32 outbox_size = 0; + u32 stream_size = 0; + u32 inbox_size = 0; + int i; + + if (!sdev->info_window) { + dev_err(sdev->dev, "error: have no window info\n"); + return; + } + + for (i = 0; i < sdev->info_window->num_windows; i++) { + elem = &sdev->info_window->window[i]; + + switch (elem->type) { + case SOF_IPC_REGION_UPBOX: + inbox_offset = elem->offset + MBOX_OFFSET; + inbox_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[HSW_DSP_BAR] + + inbox_offset, + elem->size, "inbox"); + break; + case SOF_IPC_REGION_DOWNBOX: + outbox_offset = elem->offset + MBOX_OFFSET; + outbox_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[HSW_DSP_BAR] + + outbox_offset, + elem->size, "outbox"); + break; + case SOF_IPC_REGION_TRACE: + snd_sof_debugfs_create_item(sdev, + sdev->bar[HSW_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "etrace"); + break; + case SOF_IPC_REGION_DEBUG: + snd_sof_debugfs_create_item(sdev, + sdev->bar[HSW_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "debug"); + break; + case SOF_IPC_REGION_STREAM: + stream_offset = elem->offset + MBOX_OFFSET; + stream_size = elem->size; + snd_sof_debugfs_create_item(sdev, + sdev->bar[HSW_DSP_BAR] + + stream_offset, + elem->size, "stream"); + break; + case SOF_IPC_REGION_REGS: + snd_sof_debugfs_create_item(sdev, + sdev->bar[HSW_DSP_BAR] + + elem->offset + MBOX_OFFSET, + elem->size, "regs"); + break; + default: + dev_err(sdev->dev, "error: get illegal window info\n"); + return; + } + } + + if (outbox_size == 0 || inbox_size == 0) { + dev_err(sdev->dev, "error: get illegal mailbox window\n"); + return; + } + + snd_sof_dsp_mailbox_init(sdev, inbox_offset, inbox_size, + outbox_offset, outbox_size); + + dev_dbg(sdev->dev, " mailbox upstream 0x%x - size 0x%x\n", + inbox_offset, inbox_size); + dev_dbg(sdev->dev, " mailbox downstream 0x%x - size 0x%x\n", + outbox_offset, outbox_size); +} + static int hsw_fw_ready(struct snd_sof_dev *sdev, u32 msg_id) { struct sof_ipc_fw_ready *fw_ready = &sdev->fw_ready; @@ -409,14 +490,16 @@ static int hsw_fw_ready(struct snd_sof_dev *sdev, u32 msg_id) fw_ready->hostbox_offset, fw_ready->hostbox_size); - dev_dbg(sdev->dev, " mailbox DSP initiated 0x%x - size 0x%x\n", - fw_ready->dspbox_offset, fw_ready->dspbox_size); - dev_dbg(sdev->dev, " mailbox Host initiated 0x%x - size 0x%x\n", - fw_ready->hostbox_offset, fw_ready->hostbox_size); - - dev_info(sdev->dev, " Firmware info: version %d:%d-%s build %d on %s:%s\n", + dev_info(sdev->dev, + " Firmware info: version %d:%d-%s build %d on %s:%s\n", v->major, v->minor, v->tag, v->build, v->date, v->time); + /* now check for extended data */ + snd_sof_fw_parse_ext_data(sdev, MBOX_OFFSET + + sizeof(struct sof_ipc_fw_ready)); + + hsw_get_windows(sdev); + return 0; } -- 2.7.4
2 2
0 0
[Sound-open-firmware] [PATCH] dma-trace: fix DMA trace buffer must be DMA-able memory
by Liam Girdwood 06 Mar '18

06 Mar '18
Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/lib/dma-trace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/dma-trace.c b/src/lib/dma-trace.c index 211f34f..b08e7fb 100644 --- a/src/lib/dma-trace.c +++ b/src/lib/dma-trace.c @@ -132,8 +132,9 @@ int dma_trace_init_early(struct reef *reef) buffer = &trace_data->dmatb; /* allocate new buffer */ - buffer->addr = rballoc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, - DMA_TRACE_LOCAL_SIZE); + buffer->addr = rballoc(RZONE_RUNTIME, + SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, + DMA_TRACE_LOCAL_SIZE); if (buffer->addr == NULL) { trace_buffer_error("ebm"); return -ENOMEM; -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH] apl: probe all SSP ports in platform init
by Liam Girdwood 06 Mar '18

06 Mar '18
Fix. We must probe all our SSP ports in platform init. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/platform/apollolake/dai.c | 3 ++- src/platform/apollolake/include/platform/platform.h | 3 +++ src/platform/apollolake/platform.c | 14 +++++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/platform/apollolake/dai.c b/src/platform/apollolake/dai.c index 6149d26..7c2aaa9 100644 --- a/src/platform/apollolake/dai.c +++ b/src/platform/apollolake/dai.c @@ -34,6 +34,7 @@ #include <reef/ssp.h> #include <reef/stream.h> #include <reef/audio/component.h> +#include <platform/platform.h> #include <platform/memory.h> #include <platform/interrupt.h> #include <platform/dma.h> @@ -41,7 +42,7 @@ #include <string.h> #include <config.h> -static struct dai ssp[6] = { +static struct dai ssp[PLATFORM_NUM_SSP] = { { .type = SOF_DAI_INTEL_SSP, .index = 0, diff --git a/src/platform/apollolake/include/platform/platform.h b/src/platform/apollolake/include/platform/platform.h index 995efca..8a84308 100644 --- a/src/platform/apollolake/include/platform/platform.h +++ b/src/platform/apollolake/include/platform/platform.h @@ -109,6 +109,9 @@ struct reef; /* platform has low power memory type */ #define PLATFORM_MEM_HAS_LP_RAM +/* number of SSP ports in platform */ +#define PLATFORM_NUM_SSP 6 + /* Platform defined panic code */ #define platform_panic(__x) \ sw_reg_write(SRAM_REG_FW_STATUS, (0xdead000 | __x) & 0x3fffffff) diff --git a/src/platform/apollolake/platform.c b/src/platform/apollolake/platform.c index ae8a854..9574970 100644 --- a/src/platform/apollolake/platform.c +++ b/src/platform/apollolake/platform.c @@ -178,7 +178,8 @@ static void platform_memory_windows_init(void) int platform_init(struct reef *reef) { struct dma *dmac; - struct dai *ssp2; + struct dai *ssp; + int i; platform_interrupt_init(); @@ -254,9 +255,12 @@ int platform_init(struct reef *reef) /* init SSP ports */ trace_point(TRACE_BOOT_PLATFORM_SSP); - ssp2 = dai_get(SOF_DAI_INTEL_SSP, 4); - if (ssp2 == NULL) - return -ENODEV; - dai_probe(ssp2); + for (i = 0; i < PLATFORM_NUM_SSP; i++) { + ssp = dai_get(SOF_DAI_INTEL_SSP, i); + if (ssp == NULL) + return -ENODEV; + dai_probe(ssp); + } + return 0; } -- 2.14.1
2 1
0 0
[Sound-open-firmware] [PATCH] host: host-gw: only check first_copy for playback
by Keyon Jie 06 Mar '18

06 Mar '18
For capture, we don't need produce empty bytes, here add check to fix capture can't start issue. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- src/audio/host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio/host.c b/src/audio/host.c index a76e340..7a7c153 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -851,7 +851,8 @@ static int host_copy(struct comp_dev *dev) return 0; #if defined CONFIG_DMA_GW - if (hd->first_copy) { + if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK && + hd->first_copy) { /* * host dma will not start copy at this point yet, just produce * empty period bytes for it. -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH] alloc: rmalloc must check other zones/pools for capabilities
by Liam Girdwood 06 Mar '18

06 Mar '18
rmalloc should also check the buffer heap if no capable memory can be found in the runtime heap. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/lib/alloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/alloc.c b/src/lib/alloc.c index 6221d26..27916e3 100644 --- a/src/lib/alloc.c +++ b/src/lib/alloc.c @@ -351,10 +351,17 @@ static void *rmalloc_runtime(uint32_t caps, size_t bytes) struct mm_heap *heap; int i; + /* check runtime heap for capabilities */ heap = get_runtime_heap_from_caps(caps); + if (heap) + goto find; + + /* next check buffer heap for capabilities */ + heap = get_buffer_heap_from_caps(caps); if (heap == NULL) goto error; +find: for (i = 0; i < heap->blocks; i++) { /* is block big enough */ -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH] rmbox: remove legacy code and use sof debugFS by default.
by Liam Girdwood 06 Mar '18

06 Mar '18
Dump error log by default with no args. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- rmbox/rmbox.c | 99 +++++++++++------------------------------------------------ 1 file changed, 18 insertions(+), 81 deletions(-) diff --git a/rmbox/rmbox.c b/rmbox/rmbox.c index 9403cc7..115be83 100644 --- a/rmbox/rmbox.c +++ b/rmbox/rmbox.c @@ -47,42 +47,6 @@ #define TRACE_CLASS_EQ_FIR (19 << 24) #define TRACE_CLASS_EQ_IIR (20 << 24) -#define MAILBOX_HOST_OFFSET 0x144000 - -#define MAILBOX_OUTBOX_OFFSET 0x0 -#define MAILBOX_OUTBOX_SIZE 0x400 -#define MAILBOX_OUTBOX_BASE \ - (MAILBOX_BASE + MAILBOX_OUTBOX_OFFSET) - -#define MAILBOX_INBOX_OFFSET MAILBOX_OUTBOX_SIZE -#define MAILBOX_INBOX_SIZE 0x400 -#define MAILBOX_INBOX_BASE \ - (MAILBOX_BASE + MAILBOX_INBOX_OFFSET) - -#define MAILBOX_EXCEPTION_OFFSET \ - (MAILBOX_INBOX_SIZE + MAILBOX_OUTBOX_SIZE) -#define MAILBOX_EXCEPTION_SIZE 0x100 -#define MAILBOX_EXCEPTION_BASE \ - (MAILBOX_BASE + MAILBOX_EXCEPTION_OFFSET) - -#define MAILBOX_DEBUG_OFFSET \ - (MAILBOX_EXCEPTION_SIZE + MAILBOX_EXCEPTION_OFFSET) -#define MAILBOX_DEBUG_SIZE 0x100 -#define MAILBOX_DEBUG_BASE \ - (MAILBOX_BASE + MAILBOX_DEBUG_OFFSET) - -#define MAILBOX_STREAM_OFFSET \ - (MAILBOX_DEBUG_SIZE + MAILBOX_DEBUG_OFFSET) -#define MAILBOX_STREAM_SIZE 0x200 -#define MAILBOX_STREAM_BASE \ - (MAILBOX_BASE + MAILBOX_STREAM_OFFSET) - -#define MAILBOX_TRACE_OFFSET \ - (MAILBOX_STREAM_SIZE + MAILBOX_STREAM_OFFSET) -#define MAILBOX_TRACE_SIZE 0x380 -#define MAILBOX_TRACE_BASE \ - (MAILBOX_BASE + MAILBOX_TRACE_OFFSET) - #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) @@ -218,8 +182,7 @@ static void show_trace(uint64_t val, uint64_t addr, uint64_t *timestamp, double } } -static int trace_read(const char *in_file, const char *out_file, double clk, - int offset) +static int trace_read(const char *in_file, const char *out_file, double clk) { int count, i; FILE *in_fd = NULL, *out_fd = NULL; @@ -250,11 +213,6 @@ trace: if (count != TRACE_BLOCK_SIZE) break; - if (addr < offset) { - addr += TRACE_BLOCK_SIZE; - continue; - } - val = *((uint64_t*)tmp); for (i = 0; i < TRACE_BLOCK_SIZE / 2; i++) { @@ -277,21 +235,10 @@ trace: return 0; } -static void show_debug(uint32_t val, uint32_t addr) +static void show_data(uint32_t val, uint32_t addr) { - printf("debug: 0x%x (%2.2d) = \t0x%8.8x \t(%8.8d) \t|%c%c%c%c|\n", - (unsigned int)addr - MAILBOX_DEBUG_OFFSET, - ((unsigned int)addr - MAILBOX_DEBUG_OFFSET) / 4, - val, val, - get_char(val, 3), get_char(val, 2), - get_char(val, 1), get_char(val, 0)); -} - -static void show_exception(uint32_t val, uint32_t addr) -{ - printf("exp: 0x%x (%2.2d) = \t0x%8.8x \t(%8.8d) \t|%c%c%c%c|\n", - (unsigned int)addr - MAILBOX_EXCEPTION_OFFSET, - ((unsigned int)addr - MAILBOX_EXCEPTION_OFFSET) / 4, + printf("data: 0x%x = \t0x%8.8x \t(%8.8d) \t|%c%c%c%c|\n", + (unsigned int)addr, val, val, get_char(val, 3), get_char(val, 2), get_char(val, 1), get_char(val, 0)); @@ -299,7 +246,9 @@ static void show_exception(uint32_t val, uint32_t addr) static const char *debugfs[] = { - "dmac0","dmac1", "ssp0", "ssp1", "ssp2", "iram", "dram", "shim", "mbox" + "dmac0", "dmac1", "ssp0", "ssp1", + "ssp2", "iram", "dram", "shim", + "mbox", "etrace", }; static int snapshot(const char *name) @@ -362,12 +311,11 @@ static int snapshot(const char *name) int main(int argc, char *argv[]) { int opt, count, trace = 0; - const char * out_file = NULL, *in_file = "/sys/kernel/debug/sof/mbox"; + const char * out_file = NULL, *in_file = NULL; FILE *in_fd = NULL, *out_fd = NULL; char c, tmp[8] = {0}; uint64_t addr = 0, val, timestamp = 0, align = 4, i; double clk = 19.2; - int title_dbg_done = 0, title_exp_done = 0; while ((opt = getopt(argc, argv, "ho:i:s:m:c:t")) != -1) { switch (opt) { @@ -393,7 +341,15 @@ int main(int argc, char *argv[]) /* trace requested ? */ if (trace) - return trace_read("/sys/kernel/debug/sof/trace", out_file, clk, 0); + return trace_read("/sys/kernel/debug/sof/trace", + out_file, clk); + + /* default option with no infile is to dump errors/debug data */ + if (in_file == NULL) { + fprintf(stdout, "\nError log:\n"); + return trace_read("/sys/kernel/debug/sof/etrace", + out_file, clk); + } /* open infile for reading */ in_fd = fopen(in_file, "r"); @@ -432,21 +388,7 @@ convert: tmp[align - i - 1] = c; } - if (addr >= MAILBOX_DEBUG_OFFSET && - addr < MAILBOX_DEBUG_OFFSET + MAILBOX_DEBUG_SIZE) { - - if (!title_dbg_done++) - fprintf(stdout, "\nDebug log:\n"); - - show_debug(val, addr); - } else if (addr >= MAILBOX_EXCEPTION_OFFSET && - addr < MAILBOX_EXCEPTION_OFFSET + MAILBOX_EXCEPTION_SIZE) { - - if (!title_exp_done++) - fprintf(stdout, "\nException log:\n"); - - show_exception(val, addr); - } + show_data(val, addr); if (out_fd) { count = fwrite(&tmp[0], 1, align, out_fd); @@ -457,11 +399,6 @@ convert: addr += align; } - /* read debug */ - fprintf(stdout, "\nError log:\n"); - trace_read("/sys/kernel/debug/sof/mbox", out_file, clk, - MAILBOX_TRACE_OFFSET); - /* close files */ fclose(in_fd); if (out_fd) -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH 1/2] cnl: dma: refine dma probe
by Rander Wang 06 Mar '18

06 Mar '18
Probe each dma individually Signed-off-by: Rander Wang <rander.wang(a)linux.intel.com> --- src/drivers/dw-dma.c | 37 ++++++++++--------------------------- src/platform/cannonlake/platform.c | 5 +++++ 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c index 15d608c..f736679 100644 --- a/src/drivers/dw-dma.c +++ b/src/drivers/dw-dma.c @@ -1029,7 +1029,6 @@ static int dw_dma_probe(struct dma *dma) } #else - /* this will probably be called at the end of every period copied */ static void dw_dma_irq_handler(void *data) { @@ -1047,14 +1046,7 @@ static void dw_dma_irq_handler(void *data) status_intr = dw_read(dma, DW_INTR_STATUS); if (!status_intr) { -#ifdef CONFIG_CANNONLAKE - dma++; - status_intr = dw_read(dma, DW_INTR_STATUS); - if (!status_intr) - trace_dma_error("eI0"); -#else trace_dma_error("eI0"); -#endif } tracev_dma("DIr"); @@ -1147,30 +1139,21 @@ static void dw_dma_irq_handler(void *data) static int dw_dma_probe(struct dma *dma) { struct dma_pdata *dw_pdata; - struct dma *dmac = dma; int i; -#ifdef CONFIG_CANNONLAKE - int j; - - for (j = 0; j < MAX_GPDMA_COUNT; j++) -#endif - { - /* allocate private data */ - dw_pdata = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*dw_pdata)); - dma_set_drvdata(dmac, dw_pdata); - spinlock_init(&dmac->lock); + /* allocate private data */ + dw_pdata = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*dw_pdata)); + dma_set_drvdata(dma, dw_pdata); - dw_dma_setup(dmac); + spinlock_init(&dma->lock); - /* init work */ - for (i = 0; i < DW_MAX_CHAN; i++) { - dw_pdata->chan[i].dma = dmac; - dw_pdata->chan[i].channel = i; - dw_pdata->chan[i].status = COMP_STATE_INIT; - } + dw_dma_setup(dma); - dmac++; + /* init work */ + for (i = 0; i < DW_MAX_CHAN; i++) { + dw_pdata->chan[i].dma = dma; + dw_pdata->chan[i].channel = i; + dw_pdata->chan[i].status = COMP_STATE_INIT; } /* register our IRQ handler */ diff --git a/src/platform/cannonlake/platform.c b/src/platform/cannonlake/platform.c index beb6582..1a9b88a 100644 --- a/src/platform/cannonlake/platform.c +++ b/src/platform/cannonlake/platform.c @@ -253,6 +253,11 @@ int platform_init(struct reef *reef) return -ENODEV; dma_probe(dmac); + dmac = dma_get(DMA_GP_LP_DMAC1); + if (!dmac) + return -ENODEV; + dma_probe(dmac); + dmac = dma_get(DMA_HOST_OUT_DMAC); if (!dmac) return -ENODEV; -- 2.14.1
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.