Sound-open-firmware
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
- 1572 discussions

[Sound-open-firmware] [PATCH v2] dw-dma: add support for interrupt per channel
by Keyon Jie 06 Feb '18
by Keyon Jie 06 Feb '18
06 Feb '18
On Apollolake, the interrupt number for different channels of
the same controller are different, here add implementation of
it: register interrupt handler for each channel, and don't
need check channel in its specific handler anymore.
Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com>
---
Update in v2:
Fixed checkpatch.pl issues
Tested on GP-MRB,
SOF Master: f7beb51118e6e8463a864b9416c773a508930e06,
SOF Tool Master: 59d81995f682876bd34f939332e8838c76f714ec,
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
5a91e6776d41b0e97828882294cdc00b5c0bafd6
src/drivers/dw-dma.c | 247 +++++++++++++++++++++++++++++++++++++------------
src/include/reef/dma.h | 6 ++
2 files changed, 195 insertions(+), 58 deletions(-)
diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c
index 5501f8e..7a1805e 100644
--- a/src/drivers/dw-dma.c
+++ b/src/drivers/dw-dma.c
@@ -809,6 +809,194 @@ static inline void dw_dma_chan_reload_next(struct dma *dma, int channel,
dw_write(dma, DW_DMA_CHAN_EN, CHAN_ENABLE(channel));
}
+static void dw_dma_setup(struct dma *dma)
+{
+ struct dw_drv_plat_data *dp = dma->plat_data.drv_plat_data;
+ int i;
+
+ /* we cannot config DMAC if DMAC has been already enabled by host */
+ if (dw_read(dma, DW_DMA_CFG) != 0)
+ dw_write(dma, DW_DMA_CFG, 0x0);
+
+ /* now check that it's 0 */
+ for (i = DW_DMA_CFG_TRIES; i > 0; i--) {
+ if (dw_read(dma, DW_DMA_CFG) == 0)
+ goto found;
+ }
+ trace_dma_error("eDs");
+ return;
+
+found:
+ for (i = 0; i < DW_MAX_CHAN; i++)
+ dw_read(dma, DW_DMA_CHAN_EN);
+
+#ifdef HAVE_HDDA
+ /* enable HDDA before DMAC */
+ shim_write(SHIM_HMDC, SHIM_HMDC_HDDA_ALLCH);
+#endif
+
+ /* enable the DMA controller */
+ dw_write(dma, DW_DMA_CFG, 1);
+
+ /* mask all interrupts for all 8 channels */
+ dw_write(dma, DW_MASK_TFR, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_BLOCK, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_SRC_TRAN, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_DST_TRAN, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_ERR, INT_MASK_ALL);
+
+#ifdef DW_FIFO_PARTITION
+ /* TODO: we cannot config DMA FIFOs if DMAC has been already */
+ /* allocate FIFO partitions, 128 bytes for each ch */
+ dw_write(dma, DW_FIFO_PART1_LO, 0x100080);
+ dw_write(dma, DW_FIFO_PART1_HI, 0x100080);
+ dw_write(dma, DW_FIFO_PART0_HI, 0x100080);
+ dw_write(dma, DW_FIFO_PART0_LO, 0x100080 | (1 << 26));
+ dw_write(dma, DW_FIFO_PART0_LO, 0x100080);
+#endif
+
+ /* set channel priorities */
+ for (i = 0; i < DW_MAX_CHAN; i++) {
+#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL ||\
+ defined CONFIG_APOLLOLAKE || defined CONFIG_CANNONLAKE
+ dw_write(dma, DW_CTRL_HIGH(i),
+ DW_CTLH_CLASS(dp->chan[i].class));
+#elif defined CONFIG_BROADWELL || defined CONFIG_HASWELL
+ dw_write(dma, DW_CFG_LOW(i),
+ DW_CFG_CLASS(dp->chan[i].class));
+#endif
+ }
+}
+
+#ifdef CONFIG_APOLLOLAKE
+/* external layer 2 interrupt for dmac */
+static void dw_dma_irq_handler(void *data)
+{
+ struct dma_int *dma_int = (struct dma_int *)data;
+ struct dma *dma = dma_int->dma;
+ struct dma_pdata *p = dma_get_drvdata(dma);
+ struct dma_sg_elem next;
+ uint32_t status_tfr = 0, status_block = 0, status_err = 0, status_intr;
+ uint32_t mask;
+ int i = dma_int->channel;
+
+ status_intr = dw_read(dma, DW_INTR_STATUS);
+ if (!status_intr)
+ trace_dma_error("eDI");
+
+ trace_dma("irq");
+ trace_value(status_intr);
+
+ /* get the source of our IRQ. */
+ status_block = dw_read(dma, DW_STATUS_BLOCK);
+ status_tfr = dw_read(dma, DW_STATUS_TFR);
+
+ /* TODO: handle errors, just clear them atm */
+ status_err = dw_read(dma, DW_STATUS_ERR);
+ if (status_err) {
+ trace_dma_error("eDi");
+ dw_write(dma, DW_CLEAR_ERR, status_err & i);
+ }
+
+ /* clear interrupts for channel*/
+ dw_write(dma, DW_CLEAR_BLOCK, status_block);
+ dw_write(dma, DW_CLEAR_TFR, status_tfr);
+
+ /* skip if channel is not running */
+ if (p->chan[i].status != COMP_STATE_ACTIVE) {
+ trace_dma_error("eDs");
+ return;
+ }
+
+ mask = 0x1 << i;
+
+#if DW_USE_HW_LLI
+ /* end of a LLI block */
+ if (status_block & mask &&
+ p->chan[i].cb_type & DMA_IRQ_TYPE_BLOCK) {
+ next.src = DMA_RELOAD_LLI;
+ next.dest = DMA_RELOAD_LLI;
+ /* will reload lli by default */
+ next.size = DMA_RELOAD_LLI;
+ p->chan[i].cb(p->chan[i].cb_data,
+ DMA_IRQ_TYPE_BLOCK, &next);
+ }
+#endif
+ /* end of a transfer */
+ if ((status_tfr & mask) &&
+ (p->chan[i].cb_type & DMA_IRQ_TYPE_LLIST)) {
+ trace_value(status_tfr);
+
+ next.src = DMA_RELOAD_LLI;
+ next.dest = DMA_RELOAD_LLI;
+ next.size = DMA_RELOAD_LLI; /* will reload lli by default */
+ if (p->chan[i].cb)
+ p->chan[i].cb(p->chan[i].cb_data,
+ DMA_IRQ_TYPE_LLIST, &next);
+
+ /* check for reload channel:
+ * next.size is DMA_RELOAD_END, stop this dma copy;
+ * next.size > 0 but not DMA_RELOAD_LLI, use next
+ * element for next copy;
+ * if we are waiting for pause, pause it;
+ * otherwise, reload lli
+ */
+ switch (next.size) {
+ case DMA_RELOAD_END:
+ p->chan[i].status = COMP_STATE_PREPARE;
+ break;
+ case DMA_RELOAD_LLI:
+ /* reload lli, but let's check if it is paused */
+ if (p->chan[i].status != COMP_STATE_PAUSED)
+ dw_dma_chan_reload_lli(dma, i);
+ break;
+ default:
+ dw_dma_chan_reload_next(dma, i, &next);
+ break;
+ }
+ }
+}
+
+static int dw_dma_probe(struct dma *dma)
+{
+ struct dma_int *dma_int[DW_MAX_CHAN];
+ struct dma_pdata *dw_pdata;
+ int i;
+
+ /* allocate private data */
+ dw_pdata = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*dw_pdata));
+ dma_set_drvdata(dma, dw_pdata);
+
+ spinlock_init(&dma->lock);
+
+ dw_dma_setup(dma);
+
+ /* init work */
+ for (i = 0; i < dma->plat_data.channels; i++) {
+ dw_pdata->chan[i].dma = dma;
+ dw_pdata->chan[i].channel = i;
+ dw_pdata->chan[i].status = COMP_STATE_INIT;
+
+ dma_int[i] = rzalloc(RZONE_SYS, RFLAGS_NONE,
+ sizeof(struct dma_int));
+
+ dma_int[i]->dma = dma;
+ dma_int[i]->channel = i;
+ dma_int[i]->irq = dma->plat_data.irq +
+ (i << REEF_IRQ_BIT_SHIFT);
+
+ /* register our IRQ handler */
+ interrupt_register(dma_int[i]->irq,
+ dw_dma_irq_handler,
+ dma_int[i]);
+ interrupt_enable(dma_int[i]->irq);
+ }
+
+ return 0;
+}
+
+#else
+
/* this will probably be called at the end of every period copied */
static void dw_dma_irq_handler(void *data)
{
@@ -909,64 +1097,6 @@ static void dw_dma_irq_handler(void *data)
}
}
-static void dw_dma_setup(struct dma *dma)
-{
- struct dw_drv_plat_data *dp = dma->plat_data.drv_plat_data;
- int i;
-
- /* we cannot config DMAC if DMAC has been already enabled by host */
- if (dw_read(dma, DW_DMA_CFG) != 0)
- dw_write(dma, DW_DMA_CFG, 0x0);
-
- /* now check that it's 0 */
- for (i = DW_DMA_CFG_TRIES; i > 0; i--) {
- if (dw_read(dma, DW_DMA_CFG) == 0)
- goto found;
- }
- trace_dma_error("eDs");
- return;
-
-found:
- for (i = 0; i < DW_MAX_CHAN; i++)
- dw_read(dma, DW_DMA_CHAN_EN);
-
-#ifdef HAVE_HDDA
- /* enable HDDA before DMAC */
- shim_write(SHIM_HMDC, SHIM_HMDC_HDDA_ALLCH);
-#endif
-
- /* enable the DMA controller */
- dw_write(dma, DW_DMA_CFG, 1);
-
- /* mask all interrupts for all 8 channels */
- dw_write(dma, DW_MASK_TFR, INT_MASK_ALL);
- dw_write(dma, DW_MASK_BLOCK, INT_MASK_ALL);
- dw_write(dma, DW_MASK_SRC_TRAN, INT_MASK_ALL);
- dw_write(dma, DW_MASK_DST_TRAN, INT_MASK_ALL);
- dw_write(dma, DW_MASK_ERR, INT_MASK_ALL);
-
-#ifdef DW_FIFO_PARTITION
- /* TODO: we cannot config DMA FIFOs if DMAC has been already */
- /* allocate FIFO partitions, 128 bytes for each ch */
- dw_write(dma, DW_FIFO_PART1_LO, 0x100080);
- dw_write(dma, DW_FIFO_PART1_HI, 0x100080);
- dw_write(dma, DW_FIFO_PART0_HI, 0x100080);
- dw_write(dma, DW_FIFO_PART0_LO, 0x100080 | (1 << 26));
- dw_write(dma, DW_FIFO_PART0_LO, 0x100080);
-#endif
-
- /* set channel priorities */
- for (i = 0; i < DW_MAX_CHAN; i++) {
-#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL \
- || defined CONFIG_APOLLOLAKE || defined CONFIG_CANNONLAKE
- dw_write(dma, DW_CTRL_HIGH(i), DW_CTLH_CLASS(dp->chan[i].class));
-#else
- dw_write(dma, DW_CFG_LOW(i), DW_CFG_CLASS(dp->chan[i].class));
-#endif
- }
-
-}
-
static int dw_dma_probe(struct dma *dma)
{
struct dma_pdata *dw_pdata;
@@ -993,6 +1123,7 @@ static int dw_dma_probe(struct dma *dma)
return 0;
}
+#endif
const struct dma_ops dw_dma_ops = {
.channel_get = dw_dma_channel_get,
diff --git a/src/include/reef/dma.h b/src/include/reef/dma.h
index e33adaa..77f8f71 100644
--- a/src/include/reef/dma.h
+++ b/src/include/reef/dma.h
@@ -128,6 +128,12 @@ struct dma {
void *private;
};
+struct dma_int {
+ struct dma *dma;
+ uint32_t channel;
+ uint32_t irq;
+};
+
struct dma *dma_get(int dmac_id);
#define dma_set_drvdata(dma, data) \
--
2.11.0
2
2
From: Pan Xiuli <xiuli.pan(a)linux.intel.com>
memcpy argument need void * pointer.
Contributor: Luo Xionghu <xionghu.luo(a)intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com>
---
Test with:
Mininow max rt5651
SOF master: 0505823b9667036202758ea950c3ff3347359730
SOF-Tool master: 8c9ebfe9c4f8037b0d0816dedcb87dabef347c6b
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
5a91e6776d41b0e97828882294cdc00b5c0bafd6
---
src/audio/dai.c | 2 +-
src/audio/eq_fir.c | 2 +-
src/audio/eq_iir.c | 2 +-
src/audio/host.c | 2 +-
src/audio/mixer.c | 2 +-
src/audio/src.c | 2 +-
src/audio/tone.c | 2 +-
src/audio/volume.c | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/audio/dai.c b/src/audio/dai.c
index d19e18a..4015b84 100644
--- a/src/audio/dai.c
+++ b/src/audio/dai.c
@@ -190,7 +190,7 @@ static struct comp_dev *dai_new(struct sof_ipc_comp *comp)
return NULL;
dai = (struct sof_ipc_comp_dai *)&dev->comp;
- memcpy(dai, ipc_dai, sizeof(struct sof_ipc_comp_dai));
+ memcpy((void *)dai, ipc_dai, sizeof(struct sof_ipc_comp_dai));
dd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*dd));
if (dd == NULL) {
diff --git a/src/audio/eq_fir.c b/src/audio/eq_fir.c
index 2dfa11c..9628d13 100644
--- a/src/audio/eq_fir.c
+++ b/src/audio/eq_fir.c
@@ -260,7 +260,7 @@ static struct comp_dev *eq_fir_new(struct sof_ipc_comp *comp)
return NULL;
eq_fir = (struct sof_ipc_comp_eq_fir *) &dev->comp;
- memcpy(eq_fir, ipc_eq_fir, sizeof(struct sof_ipc_comp_eq_fir));
+ memcpy((void *)eq_fir, ipc_eq_fir, sizeof(struct sof_ipc_comp_eq_fir));
cd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd));
if (cd == NULL) {
diff --git a/src/audio/eq_iir.c b/src/audio/eq_iir.c
index eb464af..3742e7a 100644
--- a/src/audio/eq_iir.c
+++ b/src/audio/eq_iir.c
@@ -261,7 +261,7 @@ static struct comp_dev *eq_iir_new(struct sof_ipc_comp *comp)
if (dev == NULL)
return NULL;
- memcpy(&dev->comp, comp, sizeof(struct sof_ipc_comp_eq_iir));
+ memcpy((void *)&dev->comp, comp, sizeof(struct sof_ipc_comp_eq_iir));
cd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd));
if (cd == NULL) {
diff --git a/src/audio/host.c b/src/audio/host.c
index b3c3c83..30b2d8c 100644
--- a/src/audio/host.c
+++ b/src/audio/host.c
@@ -242,7 +242,7 @@ static struct comp_dev *host_new(struct sof_ipc_comp *comp)
return NULL;
host = (struct sof_ipc_comp_host *)&dev->comp;
- memcpy(host, ipc_host, sizeof(struct sof_ipc_comp_host));
+ memcpy((void *)host, ipc_host, sizeof(struct sof_ipc_comp_host));
hd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*hd));
if (hd == NULL) {
diff --git a/src/audio/mixer.c b/src/audio/mixer.c
index e3611d4..26e94d8 100644
--- a/src/audio/mixer.c
+++ b/src/audio/mixer.c
@@ -93,7 +93,7 @@ static struct comp_dev *mixer_new(struct sof_ipc_comp *comp)
return NULL;
mixer = (struct sof_ipc_comp_mixer *)&dev->comp;
- memcpy(mixer, ipc_mixer, sizeof(struct sof_ipc_comp_mixer));
+ memcpy((void *)mixer, ipc_mixer, sizeof(struct sof_ipc_comp_mixer));
md = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*md));
if (md == NULL) {
diff --git a/src/audio/src.c b/src/audio/src.c
index d494d96..55fa2f8 100644
--- a/src/audio/src.c
+++ b/src/audio/src.c
@@ -280,7 +280,7 @@ static struct comp_dev *src_new(struct sof_ipc_comp *comp)
return NULL;
src = (struct sof_ipc_comp_src *) &dev->comp;
- memcpy(src, ipc_src, sizeof(struct sof_ipc_comp_src));
+ memcpy((void *)src, ipc_src, sizeof(struct sof_ipc_comp_src));
cd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd));
if (cd == NULL) {
diff --git a/src/audio/tone.c b/src/audio/tone.c
index 581f87e..da8af5e 100644
--- a/src/audio/tone.c
+++ b/src/audio/tone.c
@@ -411,7 +411,7 @@ static struct comp_dev *tone_new(struct sof_ipc_comp *comp)
return NULL;
tone = (struct sof_ipc_comp_tone *) &dev->comp;
- memcpy(tone, ipc_tone, sizeof(struct sof_ipc_comp_tone));
+ memcpy((void *)tone, ipc_tone, sizeof(struct sof_ipc_comp_tone));
cd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd));
if (cd == NULL) {
diff --git a/src/audio/volume.c b/src/audio/volume.c
index 3b3e2aa..f289226 100644
--- a/src/audio/volume.c
+++ b/src/audio/volume.c
@@ -370,7 +370,7 @@ static struct comp_dev *volume_new(struct sof_ipc_comp *comp)
return NULL;
vol = (struct sof_ipc_comp_volume *)&dev->comp;
- memcpy(vol, ipc_vol, sizeof(struct sof_ipc_comp_volume));
+ memcpy((void *)vol, ipc_vol, sizeof(struct sof_ipc_comp_volume));
cd = rzalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd));
if (cd == NULL) {
--
2.7.4
1
0

[Sound-open-firmware] [PATCH] apollolake: probe all valid SSP ports at platform init
by Keyon Jie 29 Jan '18
by Keyon Jie 29 Jan '18
29 Jan '18
Add macro for apollolake valid SSP ports, and probe all of them
at platform init.
Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com>
---
Tested on GP-MRB,
SOF Master: f7beb51118e6e8463a864b9416c773a508930e06,
SOF Tool Master: 59d81995f682876bd34f939332e8838c76f714ec,
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
5a91e6776d41b0e97828882294cdc00b5c0bafd6
src/platform/apollolake/include/platform/platform.h | 2 ++
src/platform/apollolake/platform.c | 14 +++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/platform/apollolake/include/platform/platform.h b/src/platform/apollolake/include/platform/platform.h
index 4165b95..f7c83e8 100644
--- a/src/platform/apollolake/include/platform/platform.h
+++ b/src/platform/apollolake/include/platform/platform.h
@@ -38,6 +38,8 @@
struct reef;
+#define PLATFORM_SSP_COUNT 6
+
/* Host page size */
#define HOST_PAGE_SIZE 4096
#define PLATFORM_PAGE_TABLE_SIZE 256
diff --git a/src/platform/apollolake/platform.c b/src/platform/apollolake/platform.c
index bb44634..608695a 100644
--- a/src/platform/apollolake/platform.c
+++ b/src/platform/apollolake/platform.c
@@ -178,7 +178,8 @@ int platform_init(struct reef *reef)
{
struct dma *dmac0;
struct dma *dmac1;
- struct dai *ssp2;
+ struct dai *ssp;
+ int i;
platform_interrupt_init();
@@ -244,9 +245,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_SSP_COUNT; i++) {
+ ssp = dai_get(SOF_DAI_INTEL_SSP, i);
+ if (!ssp)
+ return -ENODEV;
+ dai_probe(ssp);
+ }
+
return 0;
}
--
2.11.0
1
0

29 Jan '18
For hardware link list mode, we also need to configure address
and config registers for the first link list, here fix it.
Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com>
---
Tested on minnow turbot rt5651,
SOF Master: f7beb51118e6e8463a864b9416c773a508930e06,
SOF Tool Master: 59d81995f682876bd34f939332e8838c76f714ec,
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
5a91e6776d41b0e97828882294cdc00b5c0bafd6
src/audio/dai.c | 3 ++-
src/drivers/dw-dma.c | 43 +++++++++++++++++--------------------------
2 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/src/audio/dai.c b/src/audio/dai.c
index d19e18a..3a6b9f7 100644
--- a/src/audio/dai.c
+++ b/src/audio/dai.c
@@ -226,7 +226,8 @@ static struct comp_dev *dai_new(struct sof_ipc_comp *comp)
}
/* set up callback */
- dma_set_cb(dd->dma, dd->chan, DMA_IRQ_TYPE_LLIST, dai_dma_cb, dev);
+ dma_set_cb(dd->dma, dd->chan, DMA_IRQ_TYPE_BLOCK |
+ DMA_IRQ_TYPE_LLIST, dai_dma_cb, dev);
dev->state = COMP_STATE_READY;
return dev;
diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c
index 8248461..09e441c 100644
--- a/src/drivers/dw-dma.c
+++ b/src/drivers/dw-dma.c
@@ -396,22 +396,11 @@ static int dw_dma_start(struct dma *dma, int channel)
#if DW_USE_HW_LLI
/* TODO: Revisit: are we using LLP mode or single transfer ? */
- if (p->chan[channel].lli->llp) {
- /* LLP mode - only write LLP pointer */
+ if (p->chan[channel].lli) {
+ /* LLP mode - write LLP pointer */
dw_write(dma, DW_LLP(channel), (uint32_t)p->chan[channel].lli);
- } else {
- /* single transfer */
- dw_write(dma, DW_LLP(channel), 0);
-
- /* channel needs started from scratch, so write SARn, DARn */
- dw_write(dma, DW_SAR(channel), p->chan[channel].lli->sar);
- dw_write(dma, DW_DAR(channel), p->chan[channel].lli->dar);
-
- /* program CTLn */
- dw_write(dma, DW_CTRL_LOW(channel), p->chan[channel].lli->ctrl_lo);
- dw_write(dma, DW_CTRL_HIGH(channel), p->chan[channel].lli->ctrl_hi);
}
-#else
+#endif
/* channel needs started from scratch, so write SARn, DARn */
dw_write(dma, DW_SAR(channel), p->chan[channel].lli->sar);
dw_write(dma, DW_DAR(channel), p->chan[channel].lli->dar);
@@ -419,7 +408,6 @@ static int dw_dma_start(struct dma *dma, int channel)
/* program CTLn */
dw_write(dma, DW_CTRL_LOW(channel), p->chan[channel].lli->ctrl_lo);
dw_write(dma, DW_CTRL_HIGH(channel), p->chan[channel].lli->ctrl_hi);
-#endif
/* write channel config */
dw_write(dma, DW_CFG_LOW(channel), p->chan[channel].cfg_lo);
@@ -829,6 +817,7 @@ static void dw_dma_irq_handler(void *data)
struct dma_sg_elem next;
uint32_t status_tfr = 0;
uint32_t status_block = 0;
+ uint32_t status_block_new = 0;
uint32_t status_err = 0;
uint32_t status_intr;
uint32_t mask;
@@ -861,10 +850,10 @@ static void dw_dma_irq_handler(void *data)
platform_interrupt_clear(dma_irq(dma), pmask);
/* confirm IRQ cleared */
- status_block = dw_read(dma, DW_STATUS_BLOCK);
- if (status_block) {
+ status_block_new = dw_read(dma, DW_STATUS_BLOCK);
+ if (status_block_new) {
trace_dma_error("eI2");
- trace_value(status_block);
+ trace_value(status_block_new);
}
for (i = 0; i < DW_MAX_CHAN; i++) {
@@ -875,6 +864,16 @@ static void dw_dma_irq_handler(void *data)
mask = 0x1 << i;
+#if DW_USE_HW_LLI
+ /* end of a LLI block */
+ if (status_block & mask &&
+ p->chan[i].cb_type & DMA_IRQ_TYPE_BLOCK) {
+ next.src = next.dest = DMA_RELOAD_LLI;
+ next.size = DMA_RELOAD_LLI;
+ p->chan[i].cb(p->chan[i].cb_data,
+ DMA_IRQ_TYPE_BLOCK, &next);
+ }
+#endif
/* end of a transfer */
if ((status_tfr & mask) &&
(p->chan[i].cb_type & DMA_IRQ_TYPE_LLIST)) {
@@ -904,14 +903,6 @@ static void dw_dma_irq_handler(void *data)
break;
}
}
-#if DW_USE_HW_LLI
- /* end of a LLI block */
- if (status_block & mask &&
- p->chan[i].cb_type & DMA_IRQ_TYPE_BLOCK) {
- p->chan[i].cb(p->chan[i].cb_data,
- DMA_IRQ_TYPE_BLOCK);
- }
-#endif
}
}
--
2.11.0
2
2

29 Jan '18
On Apollolake, the interrupt number for different channels of
the same controller are different, here add implementation of
it: register interrupt handler for each channel, and don't
need check channel in its specific handler anymore.
Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com>
---
Tested on GP-MRB,
SOF Master: f7beb51118e6e8463a864b9416c773a508930e06,
SOF Tool Master: 59d81995f682876bd34f939332e8838c76f714ec,
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
5a91e6776d41b0e97828882294cdc00b5c0bafd6
src/drivers/dw-dma.c | 244 +++++++++++++++++++++++++++++++++++++------------
src/include/reef/dma.h | 6 ++
2 files changed, 192 insertions(+), 58 deletions(-)
diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c
index 09e441c..a0782cb 100644
--- a/src/drivers/dw-dma.c
+++ b/src/drivers/dw-dma.c
@@ -809,6 +809,191 @@ static inline void dw_dma_chan_reload_next(struct dma *dma, int channel,
dw_write(dma, DW_DMA_CHAN_EN, CHAN_ENABLE(channel));
}
+static void dw_dma_setup(struct dma *dma)
+{
+ struct dw_drv_plat_data *dp = dma->plat_data.drv_plat_data;
+ int i;
+
+ /* we cannot config DMAC if DMAC has been already enabled by host */
+ if (dw_read(dma, DW_DMA_CFG) != 0)
+ dw_write(dma, DW_DMA_CFG, 0x0);
+
+ /* now check that it's 0 */
+ for (i = DW_DMA_CFG_TRIES; i > 0; i--) {
+ if (dw_read(dma, DW_DMA_CFG) == 0)
+ goto found;
+ }
+ trace_dma_error("eDs");
+ return;
+
+found:
+ for (i = 0; i < DW_MAX_CHAN; i++)
+ dw_read(dma, DW_DMA_CHAN_EN);
+
+#ifdef HAVE_HDDA
+ /* enable HDDA before DMAC */
+ shim_write(SHIM_HMDC, SHIM_HMDC_HDDA_ALLCH);
+#endif
+
+ /* enable the DMA controller */
+ dw_write(dma, DW_DMA_CFG, 1);
+
+ /* mask all interrupts for all 8 channels */
+ dw_write(dma, DW_MASK_TFR, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_BLOCK, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_SRC_TRAN, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_DST_TRAN, INT_MASK_ALL);
+ dw_write(dma, DW_MASK_ERR, INT_MASK_ALL);
+
+#ifdef DW_FIFO_PARTITION
+ /* TODO: we cannot config DMA FIFOs if DMAC has been already */
+ /* allocate FIFO partitions, 128 bytes for each ch */
+ dw_write(dma, DW_FIFO_PART1_LO, 0x100080);
+ dw_write(dma, DW_FIFO_PART1_HI, 0x100080);
+ dw_write(dma, DW_FIFO_PART0_HI, 0x100080);
+ dw_write(dma, DW_FIFO_PART0_LO, 0x100080 | (1 << 26));
+ dw_write(dma, DW_FIFO_PART0_LO, 0x100080);
+#endif
+
+ /* set channel priorities */
+ for (i = 0; i < DW_MAX_CHAN; i++) {
+#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL ||\
+ defined CONFIG_APOLLOLAKE || defined CONFIG_CANNONLAKE
+ dw_write(dma, DW_CTRL_HIGH(i),
+ DW_CTLH_CLASS(dp->chan[i].class));
+#elif defined CONFIG_BROADWELL || defined CONFIG_HASWELL
+ dw_write(dma, DW_CFG_LOW(i),
+ DW_CFG_CLASS(dp->chan[i].class));
+#endif
+ }
+}
+
+#ifdef CONFIG_APOLLOLAKE
+/* external layer 2 interrupt for dmac */
+static void dw_dma_irq_handler(void *data)
+{
+ struct dma_int *dma_int = (struct dma_int *)data;
+ struct dma *dma = dma_int->dma;
+ struct dma_pdata *p = dma_get_drvdata(dma);
+ struct dma_sg_elem next;
+ uint32_t status_tfr = 0, status_block = 0, status_err = 0, status_intr;
+ uint32_t mask;
+ int i = dma_int->channel;
+
+ status_intr = dw_read(dma, DW_INTR_STATUS);
+ if (!status_intr)
+ trace_dma_error("eDI");
+
+ trace_dma("irq");
+ trace_value(status_intr);
+
+ /* get the source of our IRQ. */
+ status_block = dw_read(dma, DW_STATUS_BLOCK);
+ status_tfr = dw_read(dma, DW_STATUS_TFR);
+
+ /* TODO: handle errors, just clear them atm */
+ status_err = dw_read(dma, DW_STATUS_ERR);
+ if (status_err) {
+ trace_dma_error("eDi");
+ dw_write(dma, DW_CLEAR_ERR, status_err & i);
+ }
+
+ /* clear interrupts for channel*/
+ dw_write(dma, DW_CLEAR_BLOCK, status_block);
+ dw_write(dma, DW_CLEAR_TFR, status_tfr);
+
+ /* skip if channel is not running */
+ if (p->chan[i].status != COMP_STATE_ACTIVE) {
+ trace_dma_error("eDs");
+ return;
+ }
+
+ mask = 0x1 << i;
+
+#if DW_USE_HW_LLI
+ /* end of a LLI block */
+ if (status_block & mask &&
+ p->chan[i].cb_type & DMA_IRQ_TYPE_BLOCK) {
+ next.src = next.dest = DMA_RELOAD_LLI;
+ /* will reload lli by default */
+ next.size = DMA_RELOAD_LLI;
+ p->chan[i].cb(p->chan[i].cb_data,
+ DMA_IRQ_TYPE_BLOCK, &next);
+ }
+#endif
+ /* end of a transfer */
+ if ((status_tfr & mask) &&
+ (p->chan[i].cb_type & DMA_IRQ_TYPE_LLIST)) {
+ trace_value(status_tfr);
+
+ next.src = next.dest = DMA_RELOAD_LLI;
+ next.size = DMA_RELOAD_LLI; /* will reload lli by default */
+ if (p->chan[i].cb)
+ p->chan[i].cb(p->chan[i].cb_data,
+ DMA_IRQ_TYPE_LLIST, &next);
+
+ /* check for reload channel:
+ * next.size is DMA_RELOAD_END, stop this dma copy;
+ * next.size > 0 but not DMA_RELOAD_LLI, use next
+ * element for next copy;
+ * if we are waiting for pause, pause it;
+ * otherwise, reload lli
+ */
+ switch (next.size) {
+ case DMA_RELOAD_END:
+ p->chan[i].status = COMP_STATE_PREPARE;
+ break;
+ case DMA_RELOAD_LLI:
+ /* reload lli, but let's check if it is paused */
+ if (p->chan[i].status != COMP_STATE_PAUSED)
+ dw_dma_chan_reload_lli(dma, i);
+ break;
+ default:
+ dw_dma_chan_reload_next(dma, i, &next);
+ break;
+ }
+ }
+}
+
+static int dw_dma_probe(struct dma *dma)
+{
+ struct dma_int *dma_int[DW_MAX_CHAN];
+ struct dma_pdata *dw_pdata;
+ int i;
+
+ /* allocate private data */
+ dw_pdata = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*dw_pdata));
+ dma_set_drvdata(dma, dw_pdata);
+
+ spinlock_init(&dma->lock);
+
+ dw_dma_setup(dma);
+
+ /* init work */
+ for (i = 0; i < dma->plat_data.channels; i++) {
+ dw_pdata->chan[i].dma = dma;
+ dw_pdata->chan[i].channel = i;
+ dw_pdata->chan[i].status = COMP_STATE_INIT;
+
+ dma_int[i] = rzalloc(RZONE_SYS, RFLAGS_NONE,
+ sizeof(struct dma_int));
+
+ dma_int[i]->dma = dma;
+ dma_int[i]->channel = i;
+ dma_int[i]->irq = dma->plat_data.irq +
+ (i << REEF_IRQ_BIT_SHIFT);
+
+ /* register our IRQ handler */
+ interrupt_register(dma_int[i]->irq,
+ dw_dma_irq_handler, dma_int[i]);
+ interrupt_enable(dma_int[i]->irq);
+ }
+
+ return 0;
+}
+
+#else
+
/* this will probably be called at the end of every period copied */
static void dw_dma_irq_handler(void *data)
{
@@ -906,64 +1091,6 @@ static void dw_dma_irq_handler(void *data)
}
}
-static void dw_dma_setup(struct dma *dma)
-{
- struct dw_drv_plat_data *dp = dma->plat_data.drv_plat_data;
- int i;
-
- /* we cannot config DMAC if DMAC has been already enabled by host */
- if (dw_read(dma, DW_DMA_CFG) != 0)
- dw_write(dma, DW_DMA_CFG, 0x0);
-
- /* now check that it's 0 */
- for (i = DW_DMA_CFG_TRIES; i > 0; i--) {
- if (dw_read(dma, DW_DMA_CFG) == 0)
- goto found;
- }
- trace_dma_error("eDs");
- return;
-
-found:
- for (i = 0; i < DW_MAX_CHAN; i++)
- dw_read(dma, DW_DMA_CHAN_EN);
-
-#ifdef HAVE_HDDA
- /* enable HDDA before DMAC */
- shim_write(SHIM_HMDC, SHIM_HMDC_HDDA_ALLCH);
-#endif
-
- /* enable the DMA controller */
- dw_write(dma, DW_DMA_CFG, 1);
-
- /* mask all interrupts for all 8 channels */
- dw_write(dma, DW_MASK_TFR, INT_MASK_ALL);
- dw_write(dma, DW_MASK_BLOCK, INT_MASK_ALL);
- dw_write(dma, DW_MASK_SRC_TRAN, INT_MASK_ALL);
- dw_write(dma, DW_MASK_DST_TRAN, INT_MASK_ALL);
- dw_write(dma, DW_MASK_ERR, INT_MASK_ALL);
-
-#ifdef DW_FIFO_PARTITION
- /* TODO: we cannot config DMA FIFOs if DMAC has been already */
- /* allocate FIFO partitions, 128 bytes for each ch */
- dw_write(dma, DW_FIFO_PART1_LO, 0x100080);
- dw_write(dma, DW_FIFO_PART1_HI, 0x100080);
- dw_write(dma, DW_FIFO_PART0_HI, 0x100080);
- dw_write(dma, DW_FIFO_PART0_LO, 0x100080 | (1 << 26));
- dw_write(dma, DW_FIFO_PART0_LO, 0x100080);
-#endif
-
- /* set channel priorities */
- for (i = 0; i < DW_MAX_CHAN; i++) {
-#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL \
- || defined CONFIG_APOLLOLAKE || defined CONFIG_CANNONLAKE
- dw_write(dma, DW_CTRL_HIGH(i), DW_CTLH_CLASS(dp->chan[i].class));
-#else
- dw_write(dma, DW_CFG_LOW(i), DW_CFG_CLASS(dp->chan[i].class));
-#endif
- }
-
-}
-
static int dw_dma_probe(struct dma *dma)
{
struct dma_pdata *dw_pdata;
@@ -990,6 +1117,7 @@ static int dw_dma_probe(struct dma *dma)
return 0;
}
+#endif
const struct dma_ops dw_dma_ops = {
.channel_get = dw_dma_channel_get,
diff --git a/src/include/reef/dma.h b/src/include/reef/dma.h
index e33adaa..77f8f71 100644
--- a/src/include/reef/dma.h
+++ b/src/include/reef/dma.h
@@ -128,6 +128,12 @@ struct dma {
void *private;
};
+struct dma_int {
+ struct dma *dma;
+ uint32_t channel;
+ uint32_t irq;
+};
+
struct dma *dma_get(int dmac_id);
#define dma_set_drvdata(dma, data) \
--
2.11.0
2
2

28 Jan '18
From: Luo Xionghu <xionghu.luo(a)intel.com>
this patchset fixes the missing logic checks in rimage.
TODO: is tested on hardware needed?
Luo Xionghu (3):
rimage: don't add date to css if date is NULL.
rimage: add return for non-void function.
rimge: initial the char array.
rimage/css.c | 3 +++
rimage/pkcs1_5.c | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
--
2.11.0
4
7

[Sound-open-firmware] [PATCH v5] build: add library build support for host platform
by Ranjani Sridharan 27 Jan '18
by Ranjani Sridharan 27 Jan '18
27 Jan '18
This patch provides library build support for host platform architecture.
It enables creating separate libraries for each SOF audio component.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com>
---
Makefile.am | 15 +-
README | 7 +
build-all.sh | 4 +
configure.ac | 107 +++-
src/Makefile.am | 11 +
src/arch/Makefile.am | 4 +
src/arch/host/Makefile.am | 1 +
src/arch/host/include/Makefile.am | 1 +
src/arch/host/include/arch/Makefile.am | 9 +
src/arch/host/include/arch/cache.h | 43 ++
src/arch/host/include/arch/interrupt.h | 56 ++
src/arch/host/include/arch/reef.h | 41 ++
src/arch/host/include/arch/spinlock.h | 46 ++
src/arch/host/include/arch/timer.h | 52 ++
src/arch/host/include/arch/wait.h | 34 +
src/arch/xtensa/Makefile.am | 4 +-
src/audio/Makefile.am | 1011 +++++++++++++++++++++++++++++-
src/include/reef/Makefile.am | 6 +-
src/include/reef/audio/Makefile.am | 8 +-
src/include/uapi/Makefile.am | 2 +-
src/ipc/Makefile.am | 37 +-
src/library/Makefile.am | 1 +
src/library/include/Makefile.am | 1 +
src/library/include/platform/Makefile.am | 12 +
src/library/include/platform/clk.h | 42 ++
src/library/include/platform/dma.h | 42 ++
src/library/include/platform/interrupt.h | 78 +++
src/library/include/platform/mailbox.h | 72 +++
src/library/include/platform/memory.h | 87 +++
src/library/include/platform/platform.h | 54 ++
src/library/include/platform/pmc.h | 41 ++
src/library/include/platform/shim.h | 40 ++
src/library/include/platform/timer.h | 54 ++
src/math/Makefile.am | 22 +-
34 files changed, 2004 insertions(+), 41 deletions(-)
create mode 100644 src/arch/host/Makefile.am
create mode 100644 src/arch/host/include/Makefile.am
create mode 100644 src/arch/host/include/arch/Makefile.am
create mode 100644 src/arch/host/include/arch/cache.h
create mode 100644 src/arch/host/include/arch/interrupt.h
create mode 100644 src/arch/host/include/arch/reef.h
create mode 100644 src/arch/host/include/arch/spinlock.h
create mode 100644 src/arch/host/include/arch/timer.h
create mode 100644 src/arch/host/include/arch/wait.h
create mode 100644 src/library/Makefile.am
create mode 100644 src/library/include/Makefile.am
create mode 100644 src/library/include/platform/Makefile.am
create mode 100644 src/library/include/platform/clk.h
create mode 100644 src/library/include/platform/dma.h
create mode 100644 src/library/include/platform/interrupt.h
create mode 100644 src/library/include/platform/mailbox.h
create mode 100644 src/library/include/platform/memory.h
create mode 100644 src/library/include/platform/platform.h
create mode 100644 src/library/include/platform/pmc.h
create mode 100644 src/library/include/platform/shim.h
create mode 100644 src/library/include/platform/timer.h
diff --git a/Makefile.am b/Makefile.am
index c05f042..82ad39e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,19 @@ EXTRA_DIST = version.sh
SRC_DIR = $(abs_top_builddir)/src
+if BUILD_HOST
+export ARCH_INCDIR = \
+ -I $(SRC_DIR)/arch/$(ARCH)/include
+
+export REEF_INCDIR = \
+ -I $(SRC_DIR)/include
+
+if BUILD_LIB
+export PLATFORM_INCDIR = \
+ -I $(SRC_DIR)/library/include
+endif
+
+else
export REEF_INCDIR = \
-I $(SRC_DIR)/include \
-I $(ROOT_DIR)/include
@@ -13,9 +26,9 @@ export REEF_INCDIR = \
export ARCH_INCDIR = \
-I $(SRC_DIR)/arch/$(ARCH)/include \
-I $(SRC_DIR)/arch/$(ARCH)/xtos
-
export PLATFORM_INCDIR = \
-I $(SRC_DIR)/platform/$(PLATFORM)/include
+endif
dist-hook:
./version.sh $(top_srcdir)
diff --git a/README b/README
index 9ca5b12..463fc42 100644
--- a/README
+++ b/README
@@ -13,6 +13,13 @@ Cherrytrail :-
./configure --with-arch=xtensa --with-platform=cherrytrail --with-root-dir=$PWD/../xtensa-root/xtensa-byt-elf --host=xtensa-byt-elf
+Library for Host Platform :-
+If building library for host platform, run the following configure. Please modify
+the --prefix option to choose the directory for installing the library files and
+headers
+
+./configure --with-arch=host --enable-library=yes --host=x86_64-unknown-linux-gnu --prefix=$pwd/../host-root/
+
3) make
4) make bin
diff --git a/build-all.sh b/build-all.sh
index 6035c66..ce719e9 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -33,6 +33,10 @@ make clean
make
make bin
+# Build library for host platform architecture
+./configure --with-arch=host --enable-library=yes --host=x86_64-unknown-linux-gnu --prefix=$pwd/../host-root/
+make
+make install
# list all the images
ls -l src/arch/xtensa/*.ri
diff --git a/configure.ac b/configure.ac
index d37fc67..05a3bee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,10 +29,13 @@ AC_SUBST(ASFLAGS)
AC_ARG_WITH([root-dir],
AS_HELP_STRING([--with-root-dir], [Specify location of cross gcc libraries and headers]),
[], [with_root_dir=no])
-AS_IF([test "x$with_root_dir" = xno],
- AC_MSG_ERROR([Please specify cross compiler root header directory]),
- [ROOT_DIR=$with_root_dir])
-AC_SUBST(ROOT_DIR)
+
+# check if we are building FW image or library
+AC_ARG_ENABLE(library, [AS_HELP_STRING([--enable-library],[build library])], have_library=$enableval, have_library=no)
+if test "$have_library" = "yes"; then
+ AC_DEFINE([CONFIG_LIB], [1], [Configure for Shared Library])
+fi
+AM_CONDITIONAL(BUILD_LIB, test "$have_library" = "yes")
# Architecture support
AC_ARG_WITH([arch],
@@ -57,6 +60,23 @@ case "$with_arch" in
ARCH="xtensa"
AC_SUBST(ARCH)
+
+ AS_IF([test "x$with_root_dir" = xno],
+ AC_MSG_ERROR([Please specify cross compiler root header directory]),
+ [ROOT_DIR=$with_root_dir])
+ AC_SUBST(ROOT_DIR)
+ ;;
+ host*)
+
+ ARCH_CFLAGS="-g"
+ AC_SUBST(ARCH_CFLAGS)
+
+ # extra CFLAGS defined here otherwise configure working gcc tests fails.
+ CFLAGS="${CFLAGS:+$CFLAGS } -O3"
+ LDFLAGS="${LDFLAGS:+$LDFLAGS }-lpthread"
+
+ ARCH="host"
+ AC_SUBST(ARCH)
;;
*)
AC_MSG_ERROR([DSP architecture not specified])
@@ -64,7 +84,7 @@ case "$with_arch" in
esac
AM_CONDITIONAL(BUILD_XTENSA, test "$ARCH" = "xtensa")
-
+AM_CONDITIONAL(BUILD_HOST, test "$ARCH" = "host")
# Platform support
AC_ARG_WITH([platform],
@@ -175,7 +195,12 @@ case "$with_platform" in
AC_DEFINE([CONFIG_IRQ_MAP], [1], [Configure IRQ maps])
;;
*)
- AC_MSG_ERROR([Host platform not specified])
+ if test "$ARCH" = "host"; then
+ PLATFORM="host"
+ AC_SUBST(PLATFORM)
+ else
+ AC_MSG_ERROR([Host platform not specified])
+ fi
;;
esac
@@ -215,6 +240,70 @@ AM_CONDITIONAL(BUILD_DMA_TRACE, test "x$enable_dma_trace" != "xno")
PLATFORM_BOOT_LDR_LDSCRIPT="boot_ldr.x"
AC_SUBST(PLATFORM_BOOT_LDR_LDSCRIPT)
+# Optimisation settings and checks
+
+# SSE4_2 support
+AC_ARG_ENABLE(sse42, [AS_HELP_STRING([--enable-sse42],[enable SSE42 optimizations])], have_sse42=$enableval, have_sse42=yes)
+AX_CHECK_COMPILE_FLAG(-msse4.2, [SSE42_CFLAGS="-DOPS_SSE42 -msse4.2 -ffast-math -ftree-vectorizer-verbose=0"],
+ [have_sse42=no])
+if test "$have_sse42" = "yes"; then
+ AC_DEFINE(HAVE_SSE42,1,[Define to enable SSE42 optimizations.])
+fi
+AM_CONDITIONAL(HAVE_SSE42, test "$have_sse42" = "yes")
+AC_SUBST(SSE42_CFLAGS)
+
+# AVX support
+AC_ARG_ENABLE(avx, [AS_HELP_STRING([--enable-avx],[enable AVX optimizations])], have_avx=$enableval, have_avx=yes)
+AX_CHECK_COMPILE_FLAG(-mavx, [AVX_CFLAGS="-DOPS_AVX -mavx -ffast-math -ftree-vectorizer-verbose=0"],
+ [have_avx=no])
+if test "$have_avx" = "yes"; then
+ AC_DEFINE(HAVE_AVX,1,[Define to enable AVX optimizations.])
+fi
+AM_CONDITIONAL(HAVE_AVX, test "$have_avx" = "yes")
+AC_SUBST(AVX_CFLAGS)
+
+
+# AVX2 support
+AC_ARG_ENABLE(avx2, [AS_HELP_STRING([--enable-avx2],[enable AVX2 optimizations])], have_avx2=$enableval, have_avx2=yes)
+AX_CHECK_COMPILE_FLAG(-mavx2, [AVX2_CFLAGS="-DOPS_AVX2 -mavx2 -ffast-math -ftree-vectorizer-verbose=0"],
+ [have_avx2=no])
+if test "$have_avx2" = "yes"; then
+ AC_DEFINE(HAVE_AVX2,1,[Define to enable AVX2 optimizations.])
+fi
+AM_CONDITIONAL(HAVE_AVX2, test "$have_avx2" = "yes")
+AC_SUBST(AVX2_CFLAGS)
+
+
+# FMA support
+AC_ARG_ENABLE(fma, [AS_HELP_STRING([--enable-fma],[enable FMA optimizations])], have_fma=$enableval, have_fma=yes)
+AX_CHECK_COMPILE_FLAG(-mfma, [FMA_CFLAGS="-DOPS_FMA -mfma -ffast-math -ftree-vectorizer-verbose=0"],
+ [have_fma=no])
+if test "$have_fma" = "yes"; then
+ AC_DEFINE(HAVE_FMA,1,[Define to enable FMA optimizations.])
+fi
+AM_CONDITIONAL(HAVE_FMA, test "$have_fma" = "yes")
+AC_SUBST(FMA_CFLAGS)
+
+# Hifi2EP
+AC_ARG_ENABLE(hifi2ep, [AS_HELP_STRING([--enable-hifi2ep],[enable HiFi2EP optimizations])], have_hifi2ep=$enableval, have_hifi2ep=yes)
+AX_CHECK_COMPILE_FLAG(-mhifi2ep, [FMA_CFLAGS="-DOPS_HIFI2EP -mhifi2ep -ffast-math -ftree-vectorizer-verbose=0"],
+ [have_hifi2ep=no])
+if test "$have_hifi2ep" = "yes"; then
+ AC_DEFINE(HAVE_HIFI2EP,1,[Define to enable Hifi2 EP optimizations.])
+fi
+AM_CONDITIONAL(HAVE_HIFI2EP, test "$have_hifi2ep" = "yes")
+AC_SUBST(HIFI2EP_CFLAGS)
+
+# Hifi3
+AC_ARG_ENABLE(hifi3, [AS_HELP_STRING([--enable-hifi3],[enable HiFi3 optimizations])], have_hifi3=$enableval, have_hifi3=yes)
+AX_CHECK_COMPILE_FLAG(-mhihi3, [FMA_CFLAGS="-DOPS_HIFI3 -mhifi3 -ffast-math -ftree-vectorizer-verbose=0"],
+ [have_hifi3=no])
+if test "$have_hifi3" = "yes"; then
+ AC_DEFINE(HAVE_HIFI3,1,[Define to enable Hifi3 optimizations.])
+fi
+AM_CONDITIONAL(HAVE_HIFI3, test "$have_hifi3" = "yes")
+AC_SUBST(HIFI3_CFLAGS)
+
# Test after CFLAGS set othewise test of cross compiler fails.
AM_PROG_AS
AM_PROG_AR
@@ -240,6 +329,9 @@ AC_CONFIG_FILES([
src/arch/xtensa/include/xtensa/config/Makefile
src/arch/xtensa/hal/Makefile
src/arch/xtensa/xtos/Makefile
+ src/arch/host/Makefile
+ src/arch/host/include/Makefile
+ src/arch/host/include/arch/Makefile
src/audio/Makefile
src/math/Makefile
src/drivers/Makefile
@@ -251,6 +343,9 @@ AC_CONFIG_FILES([
src/include/reef/math/Makefile
src/include/uapi/Makefile
src/ipc/Makefile
+ src/library/Makefile
+ src/library/include/Makefile
+ src/library/include/platform/Makefile
src/lib/Makefile
src/platform/Makefile
src/platform/baytrail/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index fb82330..291d45e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1 +1,12 @@
+export COMMON_INCDIR = \
+ $(REEF_INCDIR) \
+ $(ARCH_INCDIR) \
+ $(PLATFORM_INCDIR)
+
+if BUILD_LIB
+SUBDIRS = ipc math audio arch include library
+endif
+
+if BUILD_XTENSA
SUBDIRS = include init math audio platform tasks drivers ipc lib arch
+endif
diff --git a/src/arch/Makefile.am b/src/arch/Makefile.am
index d0d1b15..e924254 100644
--- a/src/arch/Makefile.am
+++ b/src/arch/Makefile.am
@@ -1,3 +1,7 @@
if BUILD_XTENSA
SUBDIRS = xtensa
endif
+
+if BUILD_HOST
+SUBDIRS = host
+endif
diff --git a/src/arch/host/Makefile.am b/src/arch/host/Makefile.am
new file mode 100644
index 0000000..7b92e00
--- /dev/null
+++ b/src/arch/host/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = include
diff --git a/src/arch/host/include/Makefile.am b/src/arch/host/include/Makefile.am
new file mode 100644
index 0000000..f0ac9b7
--- /dev/null
+++ b/src/arch/host/include/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = arch
diff --git a/src/arch/host/include/arch/Makefile.am b/src/arch/host/include/arch/Makefile.am
new file mode 100644
index 0000000..bedfa1e
--- /dev/null
+++ b/src/arch/host/include/arch/Makefile.am
@@ -0,0 +1,9 @@
+includedir = $(prefix)/include/sof/arch
+
+include_HEADERS = \
+ cache.h \
+ interrupt.h \
+ reef.h \
+ spinlock.h \
+ timer.h \
+ wait.h
diff --git a/src/arch/host/include/arch/cache.h b/src/arch/host/include/arch/cache.h
new file mode 100644
index 0000000..e64a6c5
--- /dev/null
+++ b/src/arch/host/include/arch/cache.h
@@ -0,0 +1,43 @@
+/*
+ * 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_ARCH_CACHE__
+#define __INCLUDE_ARCH_CACHE__
+
+#include <stdint.h>
+#include <stddef.h>
+
+static inline void dcache_writeback_region(void *addr, size_t size) {}
+static inline void dcache_invalidate_region(void *addr, size_t size) {}
+static inline void icache_invalidate_region(void *addr, size_t size) {}
+static inline void dcache_writeback_invalidate_region(void *addr,
+ size_t size) {}
+
+#endif
diff --git a/src/arch/host/include/arch/interrupt.h b/src/arch/host/include/arch/interrupt.h
new file mode 100644
index 0000000..b2bb686
--- /dev/null
+++ b/src/arch/host/include/arch/interrupt.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016, 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 __ARCH_INTERRUPT_H
+#define __ARCH_INTERRUPT_H
+
+#include <reef/interrupt-map.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#define PLATFORM_IRQ_CHILDREN 0
+
+static inline int arch_interrupt_register(int irq,
+ void (*handler)(void *arg), void *arg) {return 0; }
+static inline void arch_interrupt_unregister(int irq) {}
+static inline uint32_t arch_interrupt_enable_mask(uint32_t mask) {return 0; }
+static inline uint32_t arch_interrupt_disable_mask(uint32_t mask) {return 0; }
+static inline void arch_interrupt_set(int irq) {}
+static inline void arch_interrupt_clear(int irq) {}
+static inline uint32_t arch_interrupt_get_enabled(void) {return 0; }
+static inline uint32_t arch_interrupt_get_status(void) {return 0; }
+static inline uint32_t arch_interrupt_global_disable(void) {return 0; }
+static inline void arch_interrupt_global_enable(uint32_t flags) {}
+static inline int arch_interrupt_init(void) {return 0; }
+
+#endif
diff --git a/src/arch/host/include/arch/reef.h b/src/arch/host/include/arch/reef.h
new file mode 100644
index 0000000..29090a2
--- /dev/null
+++ b/src/arch/host/include/arch/reef.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016, 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_ARCH_REEF__
+#define __INCLUDE_ARCH_REEF__
+
+#include <stdint.h>
+#include <stddef.h>
+
+#define arch_memcpy(dest, src, size) \
+ memcpy(dest, src, size)
+
+#endif
diff --git a/src/arch/host/include/arch/spinlock.h b/src/arch/host/include/arch/spinlock.h
new file mode 100644
index 0000000..ea59769
--- /dev/null
+++ b/src/arch/host/include/arch/spinlock.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2016, 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 __ARCH_SPINLOCK_H_
+#define __ARCH_SPINLOCK_H_
+
+#include <stdint.h>
+#include <errno.h>
+#include <pthread.h>
+
+typedef struct {
+} spinlock_t;
+
+static inline void arch_spinlock_init(spinlock_t *lock) {}
+static inline void arch_spin_lock(spinlock_t *lock) {}
+static inline void arch_spin_unlock(spinlock_t *lock) {}
+
+#endif
diff --git a/src/arch/host/include/arch/timer.h b/src/arch/host/include/arch/timer.h
new file mode 100644
index 0000000..c650da3
--- /dev/null
+++ b/src/arch/host/include/arch/timer.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2016, 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 __ARCH_TIMER_H_
+#define __ARCH_TIMER_H_
+
+#include <arch/interrupt.h>
+#include <stdint.h>
+#include <errno.h>
+
+struct timer {
+};
+
+static inline int arch_timer_register(struct timer *timer,
+ void (*handler)(void *arg), void *arg) {return 0; }
+static inline void arch_timer_unregister(struct timer *timer) {}
+static inline void arch_timer_enable(struct timer *timer) {}
+static inline void arch_timer_disable(struct timer *timer) {}
+static inline uint32_t arch_timer_get_system(struct timer *timer) {return 0; }
+static inline int arch_timer_set(struct timer *timer,
+ uint64_t ticks) {return 0; }
+static inline void arch_timer_clear(struct timer *timer) {}
+
+#endif
diff --git a/src/arch/host/include/arch/wait.h b/src/arch/host/include/arch/wait.h
new file mode 100644
index 0000000..e1e23a1
--- /dev/null
+++ b/src/arch/host/include/arch/wait.h
@@ -0,0 +1,34 @@
+/*
+ * 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>
+ */
+
+static inline void arch_wait_for_interrupt(int level) {}
+
+static inline void idelay(int n) {}
+
diff --git a/src/arch/xtensa/Makefile.am b/src/arch/xtensa/Makefile.am
index b055a82..b94d14e 100644
--- a/src/arch/xtensa/Makefile.am
+++ b/src/arch/xtensa/Makefile.am
@@ -57,9 +57,9 @@ reef_LDADD = \
../../tasks/libtasks.a \
../../lib/libcore.a \
../../platform/$(PLATFORM)/libplatform.a \
- ../../ipc/libipc.a \
+ ../../ipc/libsof_ipc.a \
../../audio/libaudio.a \
- ../../math/libmath.a \
+ ../../math/libsof_math.a \
../../drivers/libdrivers.a \
libreset.a \
xtos/libxtos.a \
diff --git a/src/audio/Makefile.am b/src/audio/Makefile.am
index d19dff7..bccedbf 100644
--- a/src/audio/Makefile.am
+++ b/src/audio/Makefile.am
@@ -1,12 +1,1003 @@
-noinst_LIBRARIES = libaudio.a
+includedir = $(prefix)/include/sof/audio
-noinst_HEADERS = \
- eq_fir.h \
+include_HEADERS = \
eq_iir.h \
- fir.h \
- iir.h \
- src_config.h \
- src_core.h
+ eq_fir.h
+
+COMP_SRC = \
+ eq_iir.c \
+ iir.c \
+ eq_fir.c \
+ fir.c \
+ tone.c \
+ src.c \
+ src_core.c \
+ mixer.c \
+ mux.c \
+ volume.c \
+ switch.c \
+ dai.c \
+ host.c \
+ pipeline.c \
+ component.c \
+ buffer.c
+
+SOF_SRC = \
+ dai.c \
+ host.c \
+ pipeline.c \
+ component.c \
+ buffer.c
+
+SRC_SRC = \
+ src.c \
+ src_core.c
+
+EQ_FIR_SRC = \
+ eq_fir.c \
+ fir.c
+
+EQ_IIR_SRC = \
+ eq_iir.c \
+ iir.c
+
+if BUILD_LIB
+
+# only host builds shared libraries, the rest are static
+if BUILD_HOST
+
+# libsof
+lib_LTLIBRARIES = libsof.la
+
+libsof_la_SOURCES = $(SOF_SRC)
+
+libsof_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES += libsof_src.la
+
+libsof_src_la_SOURCES = $(SRC_SRC)
+
+libsof_src_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_src_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES += libsof_eq_fir.la
+
+libsof_eq_fir_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_fir_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES += libsof_eq_iir.la
+
+libsof_eq_iir_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_iir_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES += libsof_volume.la
+
+libsof_volume_la_SOURCES = volume.c
+
+libsof_volume_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_volume_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES += libsof_mux.la
+
+libsof_mux_la_SOURCES = mux.c
+
+libsof_mux_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mux_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES += libsof_switch.la
+
+libsof_switch_la_SOURCES = switch.c
+
+libsof_switch_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_switch_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES += libsof_mixer.la
+
+libsof_mixer_la_SOURCES = mixer.c
+
+libsof_mixer_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mixer_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES += libsof_tone.la
+
+libsof_tone_la_SOURCES = tone.c
+
+libsof_tone_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_tone_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+if HAVE_SSE42
+# libsof
+lib_LTLIBRARIES += libsof_sse42.la
+
+libsof_sse42_la_SOURCES = $(SOF_SRC)
+
+libsof_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES += libsof_src_sse42.la
+
+libsof_src_sse42_la_SOURCES = $(SRC_SRC)
+
+libsof_src_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_src_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES += libsof_eq_fir_sse42.la
+
+libsof_eq_fir_sse42_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_fir_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES += libsof_eq_iir_sse42.la
+
+libsof_eq_iir_sse42_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_iir_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES += libsof_volume_sse42.la
+
+libsof_volume_sse42_la_SOURCES = volume.c
+
+libsof_volume_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_volume_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES += libsof_mux_sse42.la
+
+libsof_mux_sse42_la_SOURCES = mux.c
+
+libsof_mux_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mux_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES += libsof_switch_sse42.la
+
+libsof_switch_sse42_la_SOURCES = switch.c
+
+libsof_switch_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_switch_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES += libsof_mixer_sse42.la
+
+libsof_mixer_sse42_la_SOURCES = mixer.c
+
+libsof_mixer_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mixer_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES += libsof_tone_sse42.la
+
+libsof_tone_sse42_la_SOURCES = tone.c
+
+libsof_tone_sse42_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_tone_sse42_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+endif
+
+if HAVE_AVX
+# libsof
+lib_LTLIBRARIES += libsof_avx.la
+
+libsof_avx_la_SOURCES = $(SOF_SRC)
+
+libsof_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES += libsof_src_avx.la
+
+libsof_src_avx_la_SOURCES = $(SRC_SRC)
+
+libsof_src_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_src_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES += libsof_eq_fir_avx.la
+
+libsof_eq_fir_avx_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_fir_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES += libsof_eq_iir_avx.la
+
+libsof_eq_iir_avx_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_iir_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES += libsof_volume_avx.la
+
+libsof_volume_avx_la_SOURCES = volume.c
+
+libsof_volume_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_volume_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES += libsof_mux_avx.la
+
+libsof_mux_avx_la_SOURCES = mux.c
+
+libsof_mux_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mux_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES += libsof_switch_avx.la
+
+libsof_switch_avx_la_SOURCES = switch.c
+
+libsof_switch_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_switch_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES += libsof_mixer_avx.la
+
+libsof_mixer_avx_la_SOURCES = mixer.c
+
+libsof_mixer_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mixer_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES += libsof_tone_avx.la
+
+libsof_tone_avx_la_SOURCES = tone.c
+
+libsof_tone_avx_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_tone_avx_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+endif
+
+if HAVE_AVX2
+# libsof
+lib_LTLIBRARIES += libsof_avx2.la
+
+libsof_avx2_la_SOURCES = $(SOF_SRC)
+
+libsof_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES += libsof_src_avx2.la
+
+libsof_src_avx2_la_SOURCES = $(SRC_SRC)
+
+libsof_src_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_src_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES += libsof_eq_fir_avx2.la
+
+libsof_eq_fir_avx2_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_fir_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES += libsof_eq_iir_avx2.la
+
+libsof_eq_iir_avx2_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_iir_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES += libsof_volume_avx2.la
+
+libsof_volume_avx2_la_SOURCES = volume.c
+
+libsof_volume_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_volume_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES += libsof_mux_avx2.la
+
+libsof_mux_avx2_la_SOURCES = mux.c
+
+libsof_mux_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mux_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES += libsof_switch_avx2.la
+
+libsof_switch_avx2_la_SOURCES = switch.c
+
+libsof_switch_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_switch_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES += libsof_mixer_avx2.la
+
+libsof_mixer_avx2_la_SOURCES = mixer.c
+
+libsof_mixer_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mixer_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES += libsof_tone_avx2.la
+
+libsof_tone_avx2_la_SOURCES = tone.c
+
+libsof_tone_avx2_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(AVX2_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_tone_avx2_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+endif
+
+if HAVE_FMA
+# libsof
+lib_LTLIBRARIES += libsof_fma.la
+
+libsof_fma_la_SOURCES = $(SOF_SRC)
+
+libsof_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_src
+lib_LTLIBRARIES += libsof_src_fma.la
+
+libsof_src_fma_la_SOURCES = $(SRC_SRC)
+
+libsof_src_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_src_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_fir
+lib_LTLIBRARIES += libsof_eq_fir_fma.la
+
+libsof_eq_fir_fma_la_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_fir_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_eq_iir
+lib_LTLIBRARIES += libsof_eq_iir_fma.la
+
+libsof_eq_iir_fma_la_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_eq_iir_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_volume
+lib_LTLIBRARIES += libsof_volume_fma.la
+
+libsof_volume_fma_la_SOURCES = volume.c
+
+libsof_volume_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_volume_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mux
+lib_LTLIBRARIES += libsof_mux_fma.la
+
+libsof_mux_fma_la_SOURCES = mux.c
+
+libsof_mux_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mux_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_switch
+lib_LTLIBRARIES += libsof_switch_fma.la
+
+libsof_switch_fma_la_SOURCES = switch.c
+
+libsof_switch_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_switch_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_mixer
+lib_LTLIBRARIES += libsof_mixer_fma.la
+
+libsof_mixer_fma_la_SOURCES = mixer.c
+
+libsof_mixer_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_mixer_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+# libsof_tone
+lib_LTLIBRARIES += libsof_tone_fma.la
+
+libsof_tone_fma_la_SOURCES = tone.c
+
+libsof_tone_fma_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(FMA_CFLAGS) \
+ $(COMMON_INCDIR)
+
+libsof_tone_fma_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+endif
+
+else
+
+# Build for non host targets
+
+# libsof
+lib_LIBRARIES = libsof.a
+
+libsof_a_SOURCES = $(SOF_SRC)
+
+libsof_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_src
+lib_LIBRARIES += libsof_src.a
+
+libsof_src_a_SOURCES = $(SRC_SRC)
+
+libsof_src_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_eq_fir
+lib_LIBRARIES += libsof_eq_fir.a
+
+libsof_eq_fir_a_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_eq_iir
+lib_LIBRARIES += libsof_eq_iir.a
+
+libsof_eq_iir_a_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_volume
+lib_LIBRARIES += libsof_volume.a
+
+libsof_volume_a_SOURCES = volume.c
+
+libsof_volume_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_mux
+lib_LIBRARIES += libsof_mux.a
+
+libsof_mux_a_SOURCES = mux.c
+
+libsof_mux_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_switch
+lib_LIBRARIES += libsof_switch.a
+
+libsof_switch_a_SOURCES = switch.c
+
+libsof_switch_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_mixer
+lib_LIBRARIES += libsof_mixer.a
+
+libsof_mixer_a_SOURCES = mixer.c
+
+libsof_mixer_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_tone
+lib_LIBRARIES += libsof_tone.a
+
+libsof_tone_a_SOURCES = tone.c
+
+libsof_tone_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+
+
+if HAVE_HIFI2EP
+# libsof
+lib_LIBRARIES += libsof_hifi2ep.a
+
+libsof_hifi2ep_a_SOURCES = $(SOF_SRC)
+
+libsof_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_src
+lib_LIBRARIES += libsof_src_hifi2ep.a
+
+libsof_src_hifi2ep_a_SOURCES = $(SRC_SRC)
+
+libsof_src_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_eq_fir
+lib_LIBRARIES += libsof_eq_fir_hifi2ep.a
+
+libsof_eq_fir_hifi2ep_a_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_eq_iir
+lib_LIBRARIES += libsof_eq_iir_hifi2ep.a
+
+libsof_eq_iir_hifi2ep_a_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_volume
+lib_LIBRARIES += libsof_volume_hifi2ep.a
+
+libsof_volume_hifi2ep_a_SOURCES = volume.c
+
+libsof_volume_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_mux
+lib_LIBRARIES += libsof_mux_hifi2ep.a
+
+libsof_mux_hifi2ep_a_SOURCES = mux.c
+
+libsof_mux_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_switch
+lib_LIBRARIES += libsof_switch_hifi2ep.a
+
+libsof_switch_hifi2ep_a_SOURCES = switch.c
+
+libsof_switch_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_mixer
+lib_LIBRARIES += libsof_mixer_hifi2ep.a
+
+libsof_mixer_hifi2ep_a_SOURCES = mixer.c
+
+libsof_mixer_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_tone
+lib_LIBRARIES += libsof_tone_hifi2ep.a
+
+libsof_tone_hifi2ep_a_SOURCES = tone.c
+
+libsof_tone_hifi2ep_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+endif
+
+if HAVE_HIFI3
+# libsof
+lib_LIBRARIES += libsof_hifi3.a
+
+libsof_hifi3_a_SOURCES = $(COMP_SRC)
+
+libsof_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_src
+lib_LIBRARIES += libsof_src_hifi3.a
+
+libsof_src_hifi3_a_SOURCES = $(SRC_SRC)
+
+libsof_src_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_eq_fir
+lib_LIBRARIES += libsof_eq_fir_hifi3.a
+
+libsof_eq_fir_hifi3_a_SOURCES = $(EQ_FIR_SRC)
+
+libsof_eq_fir_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_eq_iir
+lib_LIBRARIES += libsof_eq_iir_hifi3.a
+
+libsof_eq_iir_hifi3_a_SOURCES = $(EQ_IIR_SRC)
+
+libsof_eq_iir_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_volume
+lib_LIBRARIES += libsof_volume_hifi3.a
+
+libsof_volume_hifi3_a_SOURCES = volume.c
+
+libsof_volume_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_mux
+lib_LIBRARIES += libsof_mux_hifi3.a
+
+libsof_mux_hifi3_a_SOURCES = mux.c
+
+libsof_mux_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_switch
+lib_LIBRARIES += libsof_switch_hifi3.a
+
+libsof_switch_hifi3_a_SOURCES = switch.c
+
+libsof_switch_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_mixer
+lib_LIBRARIES += libsof_mixer_hifi3.a
+
+libsof_mixer_hifi3_a_SOURCES = mixer.c
+
+libsof_mixer_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+
+# libsof_tone
+lib_LIBRARIES += libsof_tone_hifi3.a
+
+libsof_tone_hifi3_a_SOURCES = tone.c
+
+libsof_tone_hifi3_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(SSE42_CFLAGS) \
+ $(COMMON_INCDIR)
+endif
+
+endif
+
+else
+
+# build for firmware image
+
+noinst_LIBRARIES = libaudio.a
libaudio_a_SOURCES = \
eq_iir.c \
@@ -29,6 +1020,6 @@ libaudio_a_SOURCES = \
libaudio_a_CFLAGS = \
$(ARCH_CFLAGS) \
- $(REEF_INCDIR) \
- $(ARCH_INCDIR) \
- $(PLATFORM_INCDIR)
+ $(COMMON_INCDIR)
+
+endif
diff --git a/src/include/reef/Makefile.am b/src/include/reef/Makefile.am
index 50ffada..f4d46f2 100644
--- a/src/include/reef/Makefile.am
+++ b/src/include/reef/Makefile.am
@@ -1,7 +1,11 @@
SUBDIRS = audio math
noinst_HEADERS = \
- agent.h \
+ agent.h
+
+includedir = $(prefix)/include/sof/reef
+
+include_HEADERS = \
alloc.h \
clock.h \
dai.h \
diff --git a/src/include/reef/audio/Makefile.am b/src/include/reef/audio/Makefile.am
index 60b7145..1d2b9cb 100644
--- a/src/include/reef/audio/Makefile.am
+++ b/src/include/reef/audio/Makefile.am
@@ -1,7 +1,9 @@
SUBDIRS = coefficients
-noinst_HEADERS = \
+includedir = $(prefix)/include/sof/reef/audio
+
+include_HEADERS = \
component.h \
pipeline.h \
- buffer.h \
- format.h
+ format.h \
+ buffer.h
diff --git a/src/include/uapi/Makefile.am b/src/include/uapi/Makefile.am
index 257fff0..327f97d 100644
--- a/src/include/uapi/Makefile.am
+++ b/src/include/uapi/Makefile.am
@@ -1,4 +1,4 @@
-includedir = $(prefix)/include/sof
+includedir = $(prefix)/include/sof/uapi
include_HEADERS = \
ipc.h \
diff --git a/src/ipc/Makefile.am b/src/ipc/Makefile.am
index bd83f60..1d84dd0 100644
--- a/src/ipc/Makefile.am
+++ b/src/ipc/Makefile.am
@@ -1,7 +1,22 @@
-noinst_LIBRARIES = libipc.a
+if BUILD_LIB
+lib_LTLIBRARIES = libsof_ipc.la
+
+libsof_ipc_la_SOURCES = \
+ ipc.c
+
+libsof_ipc_la_LDFLAGS = \
+ -version-info `echo $(VERSION) | cut -d '.' -f 1` \
+ -no-undefined \
+ -export-dynamic
+
+libsof_ipc_la_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+else
+noinst_LIBRARIES = libsof_ipc.a
if BUILD_BAYTRAIL
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
ipc.c \
intel-ipc.c \
byt-ipc.c \
@@ -10,7 +25,7 @@ libipc_a_SOURCES = \
endif
if BUILD_CHERRYTRAIL
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
ipc.c \
intel-ipc.c \
byt-ipc.c \
@@ -19,7 +34,7 @@ libipc_a_SOURCES = \
endif
if BUILD_BROADWELL
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
ipc.c \
intel-ipc.c \
hsw-ipc.c \
@@ -27,15 +42,16 @@ libipc_a_SOURCES = \
endif
if BUILD_HASWELL
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
ipc.c \
intel-ipc.c \
hsw-ipc.c \
dma-copy.c
endif
+
if BUILD_APOLLOLAKE
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
ipc.c \
intel-ipc.c \
apl-ipc.c \
@@ -43,16 +59,15 @@ libipc_a_SOURCES = \
endif
if BUILD_CANNONLAKE
-libipc_a_SOURCES = \
+libsof_ipc_a_SOURCES = \
ipc.c \
intel-ipc.c \
cnl-ipc.c \
dma-copy.c
endif
-libipc_a_CFLAGS = \
+libsof_ipc_a_CFLAGS = \
$(ARCH_CFLAGS) \
- $(ARCH_INCDIR) \
- $(REEF_INCDIR) \
- $(PLATFORM_INCDIR)
+ $(COMMON_INCDIR)
+endif
diff --git a/src/library/Makefile.am b/src/library/Makefile.am
new file mode 100644
index 0000000..7b92e00
--- /dev/null
+++ b/src/library/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = include
diff --git a/src/library/include/Makefile.am b/src/library/include/Makefile.am
new file mode 100644
index 0000000..912728c
--- /dev/null
+++ b/src/library/include/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = platform
diff --git a/src/library/include/platform/Makefile.am b/src/library/include/platform/Makefile.am
new file mode 100644
index 0000000..5a735ae
--- /dev/null
+++ b/src/library/include/platform/Makefile.am
@@ -0,0 +1,12 @@
+includedir = $(prefix)/include/sof/platform
+
+include_HEADERS = \
+ clk.h \
+ dma.h \
+ interrupt.h \
+ mailbox.h \
+ memory.h \
+ platform.h \
+ pmc.h \
+ shim.h \
+ timer.h
diff --git a/src/library/include/platform/clk.h b/src/library/include/platform/clk.h
new file mode 100644
index 0000000..0dd11e6
--- /dev/null
+++ b/src/library/include/platform/clk.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016, 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 __PLATFORM_HOST_CLOCK__
+#define __PLATFORM_HOST_CLOCK__
+
+#define CLK_CPU 0
+#define CLK_SSP 1
+
+#define CLK_DEFAULT_CPU_HZ 50000000
+#define CLK_MAX_CPU_HZ 343000000
+
+void init_platform_clocks(void);
+
+#endif
diff --git a/src/library/include/platform/dma.h b/src/library/include/platform/dma.h
new file mode 100644
index 0000000..457da8a
--- /dev/null
+++ b/src/library/include/platform/dma.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2016, 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 __PLATFORM_HOST_DMA_H__
+#define __PLATFORM_HOST_DMA_H__
+
+#include <stdint.h>
+
+#define DMA_ID_DMAC0 0
+#define DMA_ID_DMAC1 1
+
+#define DMA_DEV_PCM 0
+#define DMA_DEV_WAV 1
+
+#endif
diff --git a/src/library/include/platform/interrupt.h b/src/library/include/platform/interrupt.h
new file mode 100644
index 0000000..eb0fbfd
--- /dev/null
+++ b/src/library/include/platform/interrupt.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2016, 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_PLATFORM_HOST_INTERRUPT__
+#define __INCLUDE_PLATFORM_HOST_INTERRUPT__
+
+#include <stdint.h>
+#include <reef/interrupt-map.h>
+
+/* IRQ numbers */
+#define IRQ_NUM_SOFTWARE0 0 /* Level 1 */
+#define IRQ_NUM_TIMER1 1 /* Level 1 */
+#define IRQ_NUM_SOFTWARE1 2 /* Level 1 */
+#define IRQ_NUM_SOFTWARE2 3 /* Level 1 */
+#define IRQ_NUM_TIMER2 5 /* Level 2 */
+#define IRQ_NUM_SOFTWARE3 6 /* Level 2 */
+#define IRQ_NUM_TIMER3 7 /* Level 3 */
+#define IRQ_NUM_SOFTWARE4 8 /* Level 3 */
+#define IRQ_NUM_SOFTWARE5 9 /* Level 3 */
+#define IRQ_NUM_EXT_IA 10 /* Level 4 */
+#define IRQ_NUM_EXT_PMC 11 /* Level 4 */
+#define IRQ_NUM_SOFTWARE6 12 /* Level 5 */
+#define IRQ_NUM_EXT_DMAC0 13 /* Level 5 */
+#define IRQ_NUM_EXT_DMAC1 14 /* Level 5 */
+#define IRQ_NUM_EXT_TIMER 15 /* Level 5 */
+#define IRQ_NUM_EXT_SSP0 16 /* Level 5 */
+#define IRQ_NUM_EXT_SSP1 17 /* Level 5 */
+#define IRQ_NUM_EXT_SSP2 18 /* Level 5 */
+#define IRQ_NUM_NMI 20 /* Level 7 */
+
+/* IRQ Masks */
+#define IRQ_MASK_SOFTWARE0 (1 << IRQ_NUM_SOFTWARE0)
+#define IRQ_MASK_TIMER1 (1 << IRQ_NUM_TIMER1)
+#define IRQ_MASK_SOFTWARE1 (1 << IRQ_NUM_SOFTWARE1)
+#define IRQ_MASK_SOFTWARE2 (1 << IRQ_NUM_SOFTWARE2)
+#define IRQ_MASK_TIMER2 (1 << IRQ_NUM_TIMER2)
+#define IRQ_MASK_SOFTWARE3 (1 << IRQ_NUM_SOFTWARE3)
+#define IRQ_MASK_TIMER3 (1 << IRQ_NUM_TIMER3)
+#define IRQ_MASK_SOFTWARE4 (1 << IRQ_NUM_SOFTWARE4)
+#define IRQ_MASK_SOFTWARE5 (1 << IRQ_NUM_SOFTWARE5)
+#define IRQ_MASK_EXT_IA (1 << IRQ_NUM_EXT_IA)
+#define IRQ_MASK_EXT_PMC (1 << IRQ_NUM_EXT_PMC)
+#define IRQ_MASK_SOFTWARE6 (1 << IRQ_NUM_SOFTWARE6)
+#define IRQ_MASK_EXT_DMAC0 (1 << IRQ_NUM_EXT_DMAC0)
+#define IRQ_MASK_EXT_DMAC1 (1 << IRQ_NUM_EXT_DMAC1)
+#define IRQ_MASK_EXT_TIMER (1 << IRQ_NUM_EXT_TIMER)
+#define IRQ_MASK_EXT_SSP0 (1 << IRQ_NUM_EXT_SSP0)
+#define IRQ_MASK_EXT_SSP1 (1 << IRQ_NUM_EXT_SSP1)
+#define IRQ_MASK_EXT_SSP2 (1 << IRQ_NUM_EXT_SSP2)
+
+#endif
diff --git a/src/library/include/platform/mailbox.h b/src/library/include/platform/mailbox.h
new file mode 100644
index 0000000..650ab47
--- /dev/null
+++ b/src/library/include/platform/mailbox.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2016, 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_PLATFORM_HOST_MAILBOX__
+#define __INCLUDE_PLATFORM_HOST_MAILBOX__
+
+#include <platform/memory.h>
+
+#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)
+
+#endif
diff --git a/src/library/include/platform/memory.h b/src/library/include/platform/memory.h
new file mode 100644
index 0000000..78541e7
--- /dev/null
+++ b/src/library/include/platform/memory.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2016, 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 __PLATFORM_HOST_MEMORY_H__
+#define __PLATFORM_HOST_MEMORY_H__
+
+#include <config.h>
+
+#if CONFIG_HT_BAYTRAIL
+#include <baytrail/include/platform/memory.h>
+#endif
+
+#define HEAP_BUFFER_SIZE (1024 * 128)
+
+#if 0
+/* physical DSP addresses */
+
+#define IRAM_BASE 0xFF2C0000
+#define IRAM_SIZE 0x00014000
+
+#define DRAM0_BASE 0xFF300000
+#define DRAM0_SIZE 0x00028000
+#define DRAM0_VBASE 0xC0000000
+
+#define MAILBOX_BASE (DRAM0_BASE + DRAM0_SIZE - 0x2000)
+
+
+/* HEAP Constants - WARNING this MUST be aligned with the linker script */
+/* TODO:preproces linker script with this header to align automatically. */
+
+/* Heap section sizes for module pool */
+#define HEAP_MOD_COUNT8 0
+#define HEAP_MOD_COUNT16 256
+#define HEAP_MOD_COUNT32 128
+#define HEAP_MOD_COUNT64 64
+#define HEAP_MOD_COUNT128 32
+#define HEAP_MOD_COUNT256 16
+#define HEAP_MOD_COUNT512 8
+#define HEAP_MOD_COUNT1024 4
+
+/* total Heap for modules - must be aligned with linker script !!! */
+#define HEAP_MOD_SIZE \
+ (HEAP_MOD_COUNT8 * 8 + HEAP_MOD_COUNT16 * 16 + \
+ HEAP_MOD_COUNT32 * 32 + HEAP_MOD_COUNT64 * 64 + \
+ HEAP_MOD_COUNT128 * 128 + HEAP_MOD_COUNT256 * 256 + \
+ HEAP_MOD_COUNT512 * 512 + HEAP_MOD_COUNT1024 * 1024)
+
+/* Heap for buffers */
+#define HEAP_BUF_BLOCK_SIZE 1024
+#define HEAP_BUF_COUNT 111
+#define HEAP_BUF_SIZE (HEAP_BUF_BLOCK_SIZE * HEAP_BUF_COUNT)
+
+/* Remaining DRAM for Stack, data and BSS.
+ * TODO: verify no overflow during build
+ */
+#define SYSTEM_MEM \
+ (DRAM0_SIZE - HEAP_MOD_SIZE - HEAP_BUF_SIZE)
+
+#endif
+#endif
diff --git a/src/library/include/platform/platform.h b/src/library/include/platform/platform.h
new file mode 100644
index 0000000..a429e84
--- /dev/null
+++ b/src/library/include/platform/platform.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016, 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>
+ * Keyon Jie <yang.jie(a)linux.intel.com>
+ */
+
+#ifndef __PLATFORM_HOST_PLATFORM_H__
+#define __PLATFORM_HOST_PLATFORM_H__
+
+#include <platform/shim.h>
+#include <platform/interrupt.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Host page size */
+#define HOST_PAGE_SIZE 4096
+
+/* Platform stream capabilities */
+#define PLATFORM_MAX_CHANNELS 4
+#define PLATFORM_MAX_STREAMS 5
+
+/* DMA channel drain timeout in microseconds */
+#define PLATFORM_DMA_TIMEOUT 1333
+
+/* IPC page data copy timeout */
+#define PLATFORM_IPC_DMA_TIMEOUT 2000
+
+
+#endif
diff --git a/src/library/include/platform/pmc.h b/src/library/include/platform/pmc.h
new file mode 100644
index 0000000..d54fc1c
--- /dev/null
+++ b/src/library/include/platform/pmc.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016, 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 __PLATFORM_HOST_PMC_H__
+#define __PLATFORM_HOST_PMC_H__
+
+#include <stdint.h>
+
+
+int platform_ipc_pmc_init(void);
+int ipc_pmc_send_msg(uint32_t message);
+int pmc_process_msg_queue(void);
+
+#endif
diff --git a/src/library/include/platform/shim.h b/src/library/include/platform/shim.h
new file mode 100644
index 0000000..d6d94d4
--- /dev/null
+++ b/src/library/include/platform/shim.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016, 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 __PLATFORM_HOST_SHIM_H__
+#define __PLATFORM_HOST_SHIM_H__
+
+#include <platform/memory.h>
+#include <stdint.h>
+
+static inline uint32_t shim_read(uint32_t reg) {return 0; }
+static inline void shim_write(uint32_t reg, uint32_t val) {}
+
+#endif
diff --git a/src/library/include/platform/timer.h b/src/library/include/platform/timer.h
new file mode 100644
index 0000000..3521e4c
--- /dev/null
+++ b/src/library/include/platform/timer.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016, 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 __PLATFORM_HOST_TIMER_H__
+#define __PLATFORM_HOST_TIMER_H__
+
+#include <stdint.h>
+#include <reef/timer.h>
+#include <platform/interrupt.h>
+
+struct comp_dev;
+struct sof_ipc_stream_posn;
+
+/* get timestamp for host stream DMA position */
+static inline void platform_host_timestamp(struct comp_dev *host,
+ struct sof_ipc_stream_posn *posn) {}
+
+/* get timestamp for DAI stream DMA position */
+static inline void platform_dai_timestamp(struct comp_dev *dai,
+ struct sof_ipc_stream_posn *posn) {}
+
+/* get current wallclock for componnent */
+static inline void platform_dai_wallclock(struct comp_dev *dai,
+ uint64_t *wallclock) {}
+
+#endif
diff --git a/src/math/Makefile.am b/src/math/Makefile.am
index b795afa..6a48e29 100644
--- a/src/math/Makefile.am
+++ b/src/math/Makefile.am
@@ -1,11 +1,21 @@
-noinst_LIBRARIES = libmath.a
+if BUILD_LIB
+lib_LTLIBRARIES = libsof_math.la
-libmath_a_SOURCES = \
+libsof_math_la_SOURCES = \
trig.c \
numbers.c
-libmath_a_CFLAGS = \
+libsof_math_la_CFLAGS = \
$(ARCH_CFLAGS) \
- $(REEF_INCDIR) \
- $(ARCH_INCDIR) \
- $(PLATFORM_INCDIR)
+ $(COMMON_INCDIR)
+else
+noinst_LIBRARIES = libsof_math.a
+
+libsof_math_a_SOURCES = \
+ trig.c \
+ numbers.c
+
+libsof_math_a_CFLAGS = \
+ $(ARCH_CFLAGS) \
+ $(COMMON_INCDIR)
+endif
--
2.11.0
2
1

27 Jan '18
From: Pan Xiuli <xiuli.pan(a)linux.intel.com>
We may have different buffer size around volume.
Change the size due to the endpoint setting.
Signed-off-by: Pan Xiuli <xiuli.pan(a)linux.intel.com>
---
topology/sof/pipe-volume-capture.m4 | 2 +-
topology/sof/pipe-volume-playback.m4 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4
index 258f8fa..8532aa3 100644
--- a/topology/sof/pipe-volume-capture.m4
+++ b/topology/sof/pipe-volume-capture.m4
@@ -53,7 +53,7 @@ W_PGA(0, Master Capture Volume, PIPELINE_FORMAT, 2, 2, 2)
W_BUFFER(0, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
W_BUFFER(1, COMP_BUFFER_SIZE(2,
- COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
+ COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
# DAI definitions
diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4
index b532161..54bc13d 100644
--- a/topology/sof/pipe-volume-playback.m4
+++ b/topology/sof/pipe-volume-playback.m4
@@ -53,7 +53,7 @@ W_PGA(0, Master Playback Volume, PIPELINE_FORMAT, 2, 2, 2)
W_BUFFER(0, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
W_BUFFER(1, COMP_BUFFER_SIZE(2,
- COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
+ COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
# DAI definitions
--
2.7.4
3
2

27 Jan '18
From: Yan Wang <yan.wang(a)linux.intel.com>
Fix coding style, typo and dos file format based
on checkpatch warning.
The checked commits are from f198ad907c5ad14cf7a99129ea8c17f40a632c29
to f7beb51118e6e8463a864b9416c773a508930e06.
Signed-off-by: Yan Wang <yan.wang(a)linux.intel.com>
---
Tested on minnow max rt5651,
SOF Master: f7beb51118e6e8463a864b9416c773a508930e06,
SOF Tool Master: 59d81995f682876bd34f939332e8838c76f714ec,
https://github.com/plbossart/sound/tree/topic/sof-v4.14: 5a91e6776d41b0e97828882294cdc00b5c0bafd6
---
src/arch/xtensa/boot_entry.S | 2 +-
src/arch/xtensa/boot_loader.c | 8 +-
src/arch/xtensa/crt1-boards.S | 606 ++++++++++-----------
src/arch/xtensa/include/arch/wait.h | 3 +-
src/ipc/apl-ipc.c | 4 +-
src/ipc/byt-ipc.c | 8 +-
src/ipc/cnl-ipc.c | 10 +-
src/ipc/hsw-ipc.c | 8 +-
src/lib/interrupt.c | 4 +-
src/platform/apollolake/include/platform/memory.h | 4 +-
.../apollolake/include/platform/platform.h | 2 +-
src/platform/apollolake/interrupt.c | 11 +-
src/platform/baytrail/include/platform/platform.h | 2 +-
.../cannonlake/include/platform/platform.h | 2 +-
src/platform/cannonlake/interrupt.c | 11 +-
src/platform/cannonlake/platform.c | 4 +-
src/platform/haswell/include/platform/platform.h | 2 +-
17 files changed, 343 insertions(+), 348 deletions(-)
diff --git a/src/arch/xtensa/boot_entry.S b/src/arch/xtensa/boot_entry.S
index cf793f5..5ad94bf 100644
--- a/src/arch/xtensa/boot_entry.S
+++ b/src/arch/xtensa/boot_entry.S
@@ -31,7 +31,7 @@
/*
* Entry point from ROM - assumes :-
*
- * 1) C runtime environment is initalised by ROM.
+ * 1) C runtime environment is initialized by ROM.
* 2) Stack is in first HPSRAM bank.
*/
diff --git a/src/arch/xtensa/boot_loader.c b/src/arch/xtensa/boot_loader.c
index 5c5939c..dfaa1a7 100644
--- a/src/arch/xtensa/boot_loader.c
+++ b/src/arch/xtensa/boot_loader.c
@@ -90,7 +90,7 @@ static void parse_module(struct sof_man_fw_header *hdr,
break;
case SOF_MAN_SEGMENT_BSS:
/* copy from IMR to SRAM */
- bbzero((void*)mod->segment[i].v_base_addr,
+ bbzero((void *)mod->segment[i].v_base_addr,
mod->segment[i].flags.r.length * HOST_PAGE_SIZE);
break;
default:
@@ -143,9 +143,8 @@ static int32_t hp_sram_init(void)
idelay(delay_count);
status = io_reg_read(HSPGISTS0);
- if (timeout-- < 0) {
+ if (timeout-- < 0)
return -EIO;
- }
}
/* query the power status of second part of HP memory */
@@ -156,9 +155,8 @@ static int32_t hp_sram_init(void)
idelay(delay_count);
status = io_reg_read(HSPGISTS1);
- if (timeout-- < 0) {
+ if (timeout-- < 0)
return -EIO;
- }
}
/* add some delay before touch power register */
diff --git a/src/arch/xtensa/crt1-boards.S b/src/arch/xtensa/crt1-boards.S
index ff24bfd..7239f4f 100644
--- a/src/arch/xtensa/crt1-boards.S
+++ b/src/arch/xtensa/crt1-boards.S
@@ -1,303 +1,303 @@
-// crt1-boards.S
-//
-// For most hardware / boards, this code sets up the C calling context
-// (setting up stack, PS, and clearing BSS) and jumps to __clibrary_start
-// which sets up the C library, calls constructors and registers destructors,
-// and calls main().
-//
-// Control arrives here at _start from the reset vector or from crt0-app.S.
-
-// Copyright (c) 1998-2010 Tensilica Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#include <xtensa/coreasm.h>
-// DF #include "xtos-internal.h"
-//#include <xtensa/../../src/xtos/xtos-internal.h>
-
-//.global _ResetVector
-#if 0
-/*
- * Reset vector.
- * Only a trampoline to jump to _start
- * (Note that we have to mark the section writable as the section contains
- * a relocatable literal)
- */
-
- .section .ResetVector.text, "awx"
- .global _ResetVector
-_ResetVector:
-
- j 1f
- .align 4
-2: .long _start
-1: l32r a2, 2b
- jx a2
-#endif
-
-// Exports
-.global _start
-
-// Imports
-// __clibrary_init from C library (eg. newlib or uclibc)
-// exit from C library
-// main from user application
-// board_init board-specific (uart/mingloss/tinygloss.c)
-// xthal_dcache_all_writeback from HAL library
-// __stack from linker script (see LSP Ref Manual)
-// _bss_table_start from linker script (see LSP Ref Manual)
-// _bss_table_end from linker script (see LSP Ref Manual)
-
-.type main, @function
-
-// Macros to abstract away ABI differences
-
-#if __XTENSA_CALL0_ABI__
-# define CALL call0
-# define ARG1 a2 /* 1st outgoing call argument */
-# define ARG2 a3 /* 2nd outgoing call argument */
-# define ARG3 a4 /* 3rd outgoing call argument */
-# define ARG4 a5 /* 4th outgoing call argument */
-# define ARG5 a6 /* 5th outgoing call argument */
-#else
-# define CALL call4
-# define CALLX callx4
-# define ARG1 a6 /* 1st outgoing call argument */
-# define ARG2 a7 /* 2nd outgoing call argument */
-# define ARG3 a8 /* 3rd outgoing call argument */
-# define ARG4 a9 /* 4th outgoing call argument */
-# define ARG5 a10 /* 5th outgoing call argument */
-#endif
-
-
-/**************************************************************************/
-
- .text
- .align 4
- .literal_position
-_start:
- // _start is typically NOT at the beginning of the text segment --
- // it is always called from either the reset vector or other code
- // that does equivalent initialization (such as crt0-app.S).
- //
- // Assumptions on entry to _start:
- // - low (level-one) and medium priority interrupts are disabled
- // via PS.INTLEVEL and/or INTENABLE (PS.INTLEVEL is expected to
- // be zeroed, to potentially enable them, before calling main)
- // - C calling context not initialized:
- // - PS not initialized
- // - SP not initialized
- // - the following are initialized:
- // - LITBASE, cache attributes, WindowBase, WindowStart,
- // CPENABLE, FP's FCR and FSR, EXCSAVE[n]
-
- // Keep a0 zero. It is used to initialize a few things.
- // It is also the return address, where zero indicates
- // that the frame used by _start is the bottommost frame.
- //
-#if !XCHAL_HAVE_HALT || !XCHAL_HAVE_BOOTLOADER // not needed for Xtensa TX
- movi a0, 0 // keep this register zero.
-#endif
-
-#if XTOS_RESET_UNNEEDED && !XCHAL_HAVE_HALT
-#include "reset-unneeded.S"
-#endif
-
-#if XCHAL_HAVE_BOOTLOADER
- .weak _Level2FromVector
- .weak _Level3FromVector
- .weak _Level4FromVector
- .weak _Level5FromVector
-
- movi a4, _Level2FromVector
- wsr a4, EXCSAVE+2
- movi a4, _Level3FromVector
- wsr a4, EXCSAVE+3
- movi a4, _Level4FromVector
- wsr a4, EXCSAVE+4
- movi a4, _Level5FromVector
- wsr a4, EXCSAVE+5
-#endif
-
- // Initialize the stack pointer.
- // See the "ABI and Software Conventions" chapter in the
- // Xtensa ISA Reference manual for details.
-
- // NOTE: Because the _start routine does not use any memory in its
- // stack frame, and because all of its CALL instructions use a
- // window size of 4 (or zero), the stack frame for _start can be empty.
-
- movi sp, __stack
-
- /*
- * Now that sp (a1) is set, we can set PS as per the application
- * (user vector mode, enable interrupts, enable window exceptions if applicable).
- */
-#if XCHAL_HAVE_EXCEPTIONS
-# ifdef __XTENSA_CALL0_ABI__
- movi a3, PS_UM // PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
-# else
- movi a3, PS_UM|PS_WOE // PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
-# endif
- wsr a3, PS
- rsync
-#endif
-
-/*
- * Do any initialization that affects the memory map, such as
- * setting up TLB entries, that needs to be done before we can
- * successfully clear BSS (e.g. if some BSS segments are in
- * remapped areas).
- *
- * NOTE: This hook works where the reset vector does not unpack
- * segments (see "ROM packing" in the LSP manual), or where
- * unpacking of segments is not affected by memory remapping.
- * If ROM unpacking is affected, TLB setup must be done in
- * assembler from the reset vector.
- *
- * The __memmap_init() routine can be a C function, however it
- * does not have BSS initialized! In particular, __memmap_init()
- * cannot set BSS variables, i.e. uninitialized global variables
- * (they'll be wiped out by the following BSS clear), nor can it
- * assume they are yet initialized to zero.
- *
- * The __memmap_init() function is optional. It is marked as a
- * weak symbol, so that it gets valued zero if not defined.
- */
-
- .weak __memmap_init
- movi a4, __memmap_init
- beqz a4, 1f
- CALLX a4
-1:
-
-#if !XCHAL_HAVE_BOOTLOADER /* boot loader takes care of zeroing BSS */
- /*
- * Clear the BSS (uninitialized data) segments.
- * This code supports multiple zeroed sections (*.bss).
- *
- * Register allocation:
- * a0 = 0
- * a6 = pointer to start of table, and through table
- * a7 = pointer to end of table
- * a8 = start address of bytes to be zeroed
- * a9 = end address of bytes to be zeroed
- * a10 = length of bytes to be zeroed
- */
- movi a0, 0
- movi a6, _bss_table_start
- movi a7, _bss_table_end
- bgeu a6, a7, .L3zte
-
-.L0zte: l32i a8, a6, 0 // get start address, assumed multiple of 4
- l32i a9, a6, 4 // get end address, assumed multiple of 4
- addi a6, a6, 8 // next entry
- sub a10, a9, a8 // a10 = length, assumed a multiple of 4
- bbci.l a10, 2, .L1zte
- s32i a0, a8, 0 // clear 4 bytes to make length multiple of 8
- addi a8, a8, 4
-.L1zte: bbci.l a10, 3, .L2zte
- s32i a0, a8, 0 // clear 8 bytes to make length multiple of 16
- s32i a0, a8, 4
- addi a8, a8, 8
-.L2zte: srli a10, a10, 4 // length is now multiple of 16, divide by 16
- floopnez a10, clearzte
- s32i a0, a8, 0 // clear 16 bytes at a time...
- s32i a0, a8, 4
- s32i a0, a8, 8
- s32i a0, a8, 12
- addi a8, a8, 16
- floopend a10, clearzte
-
- bltu a6, a7, .L0zte // loop until end of table of *.bss sections
-.L3zte:
-#endif
-
-
- // We can now call C code, the C calling environment has been initialized.
- //
- // From this point on, we use ABI-specific macros to refer to registers a0 .. a15
- // (ARG#).
-
-
-#if XCHAL_HAVE_HALT
- // Assume minimalist environment for memory-constrained TX cores.
- // No C library or board initialization, no parameters passed to main
- // (assume declared as "void main(void)") and no call to exit().
-
- CALL main
- halt
-
-#else /* !HALT */
-
- .type board_init, @function
- .type __clibrary_init, @function
- .type exit, @function
-
-
- // Initialize the board (eg. the UART on the XT2000).
- //CALL board_init
-
- /*
- * Call __clibrary_init to initialize the C library:
- *
- * void __clibrary_init(int argc, char ** argv, char ** environ,
- * void(*init_func)(void), void(*fini_func)(void));
- */
-
- // Pass an empty argv array, with an empty string as the program name.
-#if 0
- movi ARG1, _start_argc // argc address
- movi ARG2, _start_argv // argv = ["", 0]
- movi ARG3, _start_envp // envp = [0]
-// movi ARG4, _init // function that calls constructors
-// movi ARG5, _fini // function that calls destructors
- l32i ARG1, ARG1, 0 // argc = 1
- CALL __clibrary_init
-#endif
- // Call: int main(int argc, char ** argv, char ** environ);
- movi ARG1, _start_argc // argc address
- movi ARG2, _start_argv // argv = ["", 0]
- movi ARG3, _start_envp // envp = [0]
- l32i ARG1, ARG1, 0 // argc = 1
- CALL main
- // The return value is the same register as the first outgoing argument.
-// CALL exit // exit with main's return value
- // Does not return here.
-
- .data
- // Mark argc/argv/envp parameters as weak so that an external
- // object file can override them.
- .weak _start_argc, _start_argv, _start_envp
- .align 4
-_start_argv:
- .word _start_null // empty program name
-_start_null:
-_start_envp:
- .word 0 // end of argv array, empty string, empty environ
-_start_argc:
- .word 1 // one argument (program name)
- .text
-
-#endif /* !HALT */
-
- .size _start, . - _start
-
-//#endif
+// crt1-boards.S
+//
+// For most hardware / boards, this code sets up the C calling context
+// (setting up stack, PS, and clearing BSS) and jumps to __clibrary_start
+// which sets up the C library, calls constructors and registers destructors,
+// and calls main().
+//
+// Control arrives here at _start from the reset vector or from crt0-app.S.
+
+// Copyright (c) 1998-2010 Tensilica Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#include <xtensa/coreasm.h>
+// DF #include "xtos-internal.h"
+//#include <xtensa/../../src/xtos/xtos-internal.h>
+
+//.global _ResetVector
+#if 0
+/*
+ * Reset vector.
+ * Only a trampoline to jump to _start
+ * (Note that we have to mark the section writable as the section contains
+ * a relocatable literal)
+ */
+
+ .section .ResetVector.text, "awx"
+ .global _ResetVector
+_ResetVector:
+
+ j 1f
+ .align 4
+2: .long _start
+1: l32r a2, 2b
+ jx a2
+#endif
+
+// Exports
+.global _start
+
+// Imports
+// __clibrary_init from C library (eg. newlib or uclibc)
+// exit from C library
+// main from user application
+// board_init board-specific (uart/mingloss/tinygloss.c)
+// xthal_dcache_all_writeback from HAL library
+// __stack from linker script (see LSP Ref Manual)
+// _bss_table_start from linker script (see LSP Ref Manual)
+// _bss_table_end from linker script (see LSP Ref Manual)
+
+.type main, @function
+
+// Macros to abstract away ABI differences
+
+#if __XTENSA_CALL0_ABI__
+# define CALL call0
+# define ARG1 a2 /* 1st outgoing call argument */
+# define ARG2 a3 /* 2nd outgoing call argument */
+# define ARG3 a4 /* 3rd outgoing call argument */
+# define ARG4 a5 /* 4th outgoing call argument */
+# define ARG5 a6 /* 5th outgoing call argument */
+#else
+# define CALL call4
+# define CALLX callx4
+# define ARG1 a6 /* 1st outgoing call argument */
+# define ARG2 a7 /* 2nd outgoing call argument */
+# define ARG3 a8 /* 3rd outgoing call argument */
+# define ARG4 a9 /* 4th outgoing call argument */
+# define ARG5 a10 /* 5th outgoing call argument */
+#endif
+
+
+/**************************************************************************/
+
+ .text
+ .align 4
+ .literal_position
+_start:
+ // _start is typically NOT at the beginning of the text segment --
+ // it is always called from either the reset vector or other code
+ // that does equivalent initialization (such as crt0-app.S).
+ //
+ // Assumptions on entry to _start:
+ // - low (level-one) and medium priority interrupts are disabled
+ // via PS.INTLEVEL and/or INTENABLE (PS.INTLEVEL is expected to
+ // be zeroed, to potentially enable them, before calling main)
+ // - C calling context not initialized:
+ // - PS not initialized
+ // - SP not initialized
+ // - the following are initialized:
+ // - LITBASE, cache attributes, WindowBase, WindowStart,
+ // CPENABLE, FP's FCR and FSR, EXCSAVE[n]
+
+ // Keep a0 zero. It is used to initialize a few things.
+ // It is also the return address, where zero indicates
+ // that the frame used by _start is the bottommost frame.
+ //
+#if !XCHAL_HAVE_HALT || !XCHAL_HAVE_BOOTLOADER // not needed for Xtensa TX
+ movi a0, 0 // keep this register zero.
+#endif
+
+#if XTOS_RESET_UNNEEDED && !XCHAL_HAVE_HALT
+#include "reset-unneeded.S"
+#endif
+
+#if XCHAL_HAVE_BOOTLOADER
+ .weak _Level2FromVector
+ .weak _Level3FromVector
+ .weak _Level4FromVector
+ .weak _Level5FromVector
+
+ movi a4, _Level2FromVector
+ wsr a4, EXCSAVE+2
+ movi a4, _Level3FromVector
+ wsr a4, EXCSAVE+3
+ movi a4, _Level4FromVector
+ wsr a4, EXCSAVE+4
+ movi a4, _Level5FromVector
+ wsr a4, EXCSAVE+5
+#endif
+
+ // Initialize the stack pointer.
+ // See the "ABI and Software Conventions" chapter in the
+ // Xtensa ISA Reference manual for details.
+
+ // NOTE: Because the _start routine does not use any memory in its
+ // stack frame, and because all of its CALL instructions use a
+ // window size of 4 (or zero), the stack frame for _start can be empty.
+
+ movi sp, __stack
+
+ /*
+ * Now that sp (a1) is set, we can set PS as per the application
+ * (user vector mode, enable interrupts, enable window exceptions if applicable).
+ */
+#if XCHAL_HAVE_EXCEPTIONS
+# ifdef __XTENSA_CALL0_ABI__
+ movi a3, PS_UM // PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
+# else
+ movi a3, PS_UM|PS_WOE // PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0
+# endif
+ wsr a3, PS
+ rsync
+#endif
+
+/*
+ * Do any initialization that affects the memory map, such as
+ * setting up TLB entries, that needs to be done before we can
+ * successfully clear BSS (e.g. if some BSS segments are in
+ * remapped areas).
+ *
+ * NOTE: This hook works where the reset vector does not unpack
+ * segments (see "ROM packing" in the LSP manual), or where
+ * unpacking of segments is not affected by memory remapping.
+ * If ROM unpacking is affected, TLB setup must be done in
+ * assembler from the reset vector.
+ *
+ * The __memmap_init() routine can be a C function, however it
+ * does not have BSS initialized! In particular, __memmap_init()
+ * cannot set BSS variables, i.e. uninitialized global variables
+ * (they'll be wiped out by the following BSS clear), nor can it
+ * assume they are yet initialized to zero.
+ *
+ * The __memmap_init() function is optional. It is marked as a
+ * weak symbol, so that it gets valued zero if not defined.
+ */
+
+ .weak __memmap_init
+ movi a4, __memmap_init
+ beqz a4, 1f
+ CALLX a4
+1:
+
+#if !XCHAL_HAVE_BOOTLOADER /* boot loader takes care of zeroing BSS */
+ /*
+ * Clear the BSS (uninitialized data) segments.
+ * This code supports multiple zeroed sections (*.bss).
+ *
+ * Register allocation:
+ * a0 = 0
+ * a6 = pointer to start of table, and through table
+ * a7 = pointer to end of table
+ * a8 = start address of bytes to be zeroed
+ * a9 = end address of bytes to be zeroed
+ * a10 = length of bytes to be zeroed
+ */
+ movi a0, 0
+ movi a6, _bss_table_start
+ movi a7, _bss_table_end
+ bgeu a6, a7, .L3zte
+
+.L0zte: l32i a8, a6, 0 // get start address, assumed multiple of 4
+ l32i a9, a6, 4 // get end address, assumed multiple of 4
+ addi a6, a6, 8 // next entry
+ sub a10, a9, a8 // a10 = length, assumed a multiple of 4
+ bbci.l a10, 2, .L1zte
+ s32i a0, a8, 0 // clear 4 bytes to make length multiple of 8
+ addi a8, a8, 4
+.L1zte: bbci.l a10, 3, .L2zte
+ s32i a0, a8, 0 // clear 8 bytes to make length multiple of 16
+ s32i a0, a8, 4
+ addi a8, a8, 8
+.L2zte: srli a10, a10, 4 // length is now multiple of 16, divide by 16
+ floopnez a10, clearzte
+ s32i a0, a8, 0 // clear 16 bytes at a time...
+ s32i a0, a8, 4
+ s32i a0, a8, 8
+ s32i a0, a8, 12
+ addi a8, a8, 16
+ floopend a10, clearzte
+
+ bltu a6, a7, .L0zte // loop until end of table of *.bss sections
+.L3zte:
+#endif
+
+
+ // We can now call C code, the C calling environment has been initialized.
+ //
+ // From this point on, we use ABI-specific macros to refer to registers a0 .. a15
+ // (ARG#).
+
+
+#if XCHAL_HAVE_HALT
+ // Assume minimalist environment for memory-constrained TX cores.
+ // No C library or board initialization, no parameters passed to main
+ // (assume declared as "void main(void)") and no call to exit().
+
+ CALL main
+ halt
+
+#else /* !HALT */
+
+ .type board_init, @function
+ .type __clibrary_init, @function
+ .type exit, @function
+
+
+ // Initialize the board (eg. the UART on the XT2000).
+ //CALL board_init
+
+ /*
+ * Call __clibrary_init to initialize the C library:
+ *
+ * void __clibrary_init(int argc, char ** argv, char ** environ,
+ * void(*init_func)(void), void(*fini_func)(void));
+ */
+
+ // Pass an empty argv array, with an empty string as the program name.
+#if 0
+ movi ARG1, _start_argc // argc address
+ movi ARG2, _start_argv // argv = ["", 0]
+ movi ARG3, _start_envp // envp = [0]
+// movi ARG4, _init // function that calls constructors
+// movi ARG5, _fini // function that calls destructors
+ l32i ARG1, ARG1, 0 // argc = 1
+ CALL __clibrary_init
+#endif
+ // Call: int main(int argc, char ** argv, char ** environ);
+ movi ARG1, _start_argc // argc address
+ movi ARG2, _start_argv // argv = ["", 0]
+ movi ARG3, _start_envp // envp = [0]
+ l32i ARG1, ARG1, 0 // argc = 1
+ CALL main
+ // The return value is the same register as the first outgoing argument.
+// CALL exit // exit with main's return value
+ // Does not return here.
+
+ .data
+ // Mark argc/argv/envp parameters as weak so that an external
+ // object file can override them.
+ .weak _start_argc, _start_argv, _start_envp
+ .align 4
+_start_argv:
+ .word _start_null // empty program name
+_start_null:
+_start_envp:
+ .word 0 // end of argv array, empty string, empty environ
+_start_argc:
+ .word 1 // one argument (program name)
+ .text
+
+#endif /* !HALT */
+
+ .size _start, . - _start
+
+//#endif
diff --git a/src/arch/xtensa/include/arch/wait.h b/src/arch/xtensa/include/arch/wait.h
index 2f6e4f5..2527324 100644
--- a/src/arch/xtensa/include/arch/wait.h
+++ b/src/arch/xtensa/include/arch/wait.h
@@ -62,8 +62,7 @@ static inline void arch_wait_for_interrupt(int level)
static inline void idelay(int n)
{
- while (n--) {
+ while (n--)
asm volatile("nop");
- }
}
diff --git a/src/ipc/apl-ipc.c b/src/ipc/apl-ipc.c
index c779062..8597c27 100644
--- a/src/ipc/apl-ipc.c
+++ b/src/ipc/apl-ipc.c
@@ -204,8 +204,8 @@ int platform_ipc_init(struct ipc *ipc)
iipc->pm_prepare_D3 = 0;
/* configure interrupt */
- interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
- interrupt_enable(PLATFORM_IPC_INTERUPT);
+ interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+ interrupt_enable(PLATFORM_IPC_INTERRUPT);
/* enable IPC interrupts from host */
ipc_write(IPC_DIPCCTL, IPC_DIPCCTL_IPCIDIE | IPC_DIPCCTL_IPCTBIE);
diff --git a/src/ipc/byt-ipc.c b/src/ipc/byt-ipc.c
index 8897bb9..8760121 100644
--- a/src/ipc/byt-ipc.c
+++ b/src/ipc/byt-ipc.c
@@ -100,7 +100,7 @@ static void irq_handler(void *arg)
/* Mask Done interrupt before return */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_DONE);
- interrupt_clear(PLATFORM_IPC_INTERUPT);
+ interrupt_clear(PLATFORM_IPC_INTERRUPT);
do_notify();
}
@@ -108,7 +108,7 @@ static void irq_handler(void *arg)
/* Mask Busy interrupt before return */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_BUSY);
- interrupt_clear(PLATFORM_IPC_INTERUPT);
+ interrupt_clear(PLATFORM_IPC_INTERRUPT);
/* TODO: place message in Q and process later */
/* It's not Q ATM, may overwrite */
@@ -230,8 +230,8 @@ int platform_ipc_init(struct ipc *ipc)
iipc->pm_prepare_D3 = 0;
/* configure interrupt */
- interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
- interrupt_enable(PLATFORM_IPC_INTERUPT);
+ interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+ interrupt_enable(PLATFORM_IPC_INTERRUPT);
/* Unmask Busy and Done interrupts */
imrd = shim_read(SHIM_IMRD);
diff --git a/src/ipc/cnl-ipc.c b/src/ipc/cnl-ipc.c
index cd5e825..3522d67 100644
--- a/src/ipc/cnl-ipc.c
+++ b/src/ipc/cnl-ipc.c
@@ -91,7 +91,7 @@ static void irq_handler(void *arg)
ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) & ~IPC_DIPCCTL_IPCIDIE);
/* clear DONE bit - tell host we have completed the operation */
- ipc_write(IPC_DIPCIDA, ipc_read(IPC_DIPCIDA) |IPC_DIPCIDA_DONE);
+ ipc_write(IPC_DIPCIDA, ipc_read(IPC_DIPCIDA) | IPC_DIPCIDA_DONE);
/* unmask Done interrupt */
ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) | IPC_DIPCCTL_IPCIDIE);
@@ -128,8 +128,8 @@ done:
ipc->host_pending = 0;
/* write 1 to clear busy, and trigger interrupt to host*/
- ipc_write(IPC_DIPCTDR, ipc_read(IPC_DIPCTDR) |IPC_DIPCTDR_BUSY);
- ipc_write(IPC_DIPCTDA, ipc_read(IPC_DIPCTDA) |IPC_DIPCTDA_BUSY );
+ ipc_write(IPC_DIPCTDR, ipc_read(IPC_DIPCTDR) | IPC_DIPCTDR_BUSY);
+ ipc_write(IPC_DIPCTDA, ipc_read(IPC_DIPCTDA) | IPC_DIPCTDA_BUSY);
/* unmask Busy interrupt */
ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) | IPC_DIPCCTL_IPCTBIE);
@@ -202,8 +202,8 @@ int platform_ipc_init(struct ipc *ipc)
iipc->pm_prepare_D3 = 0;
/* configure interrupt */
- interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
- interrupt_enable(PLATFORM_IPC_INTERUPT);
+ interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+ interrupt_enable(PLATFORM_IPC_INTERRUPT);
/* enable IPC interrupts from host */
ipc_write(IPC_DIPCCTL, IPC_DIPCCTL_IPCIDIE | IPC_DIPCCTL_IPCTBIE);
diff --git a/src/ipc/hsw-ipc.c b/src/ipc/hsw-ipc.c
index 4a16f41..653c215 100644
--- a/src/ipc/hsw-ipc.c
+++ b/src/ipc/hsw-ipc.c
@@ -99,7 +99,7 @@ static void irq_handler(void *arg)
/* Mask Done interrupt before return */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_DONE);
- interrupt_clear(PLATFORM_IPC_INTERUPT);
+ interrupt_clear(PLATFORM_IPC_INTERRUPT);
do_notify();
}
@@ -107,7 +107,7 @@ static void irq_handler(void *arg)
/* Mask Busy interrupt before return */
shim_write(SHIM_IMRD, shim_read(SHIM_IMRD) | SHIM_IMRD_BUSY);
- interrupt_clear(PLATFORM_IPC_INTERUPT);
+ interrupt_clear(PLATFORM_IPC_INTERRUPT);
/* place message in Q and process later */
_ipc->host_msg = shim_read(SHIM_IPCX);
@@ -219,8 +219,8 @@ int platform_ipc_init(struct ipc *ipc)
iipc->pm_prepare_D3 = 0;
/* configure interrupt */
- interrupt_register(PLATFORM_IPC_INTERUPT, irq_handler, NULL);
- interrupt_enable(PLATFORM_IPC_INTERUPT);
+ interrupt_register(PLATFORM_IPC_INTERRUPT, irq_handler, NULL);
+ interrupt_enable(PLATFORM_IPC_INTERRUPT);
/* Unmask Busy and Done interrupts */
imrd = shim_read(SHIM_IMRD);
diff --git a/src/lib/interrupt.c b/src/lib/interrupt.c
index 4516cf3..60c0a31 100644
--- a/src/lib/interrupt.c
+++ b/src/lib/interrupt.c
@@ -106,7 +106,7 @@ uint32_t irq_enable_child(struct irq_parent *parent, int irq)
spin_lock(&parent->lock);
- child =parent->child[REEF_IRQ_BIT(irq)];
+ child = parent->child[REEF_IRQ_BIT(irq)];
/* already enabled ? */
if (child->enabled)
@@ -133,7 +133,7 @@ uint32_t irq_disable_child(struct irq_parent *parent, int irq)
spin_lock(&parent->lock);
- child =parent->child[REEF_IRQ_BIT(irq)];
+ child = parent->child[REEF_IRQ_BIT(irq)];
/* already disabled ? */
if (!child->enabled)
diff --git a/src/platform/apollolake/include/platform/memory.h b/src/platform/apollolake/include/platform/memory.h
index eca9a53..d84ec40 100644
--- a/src/platform/apollolake/include/platform/memory.h
+++ b/src/platform/apollolake/include/platform/memory.h
@@ -191,8 +191,8 @@
#define HEAP_BUFFER_BASE (HEAP_RUNTIME_BASE + HEAP_RUNTIME_SIZE)
#define HEAP_BUFFER_SIZE \
- (L2_SRAM_SIZE - L2_VECTOR_SIZE - REEF_TEXT_SIZE - REEF_DATA_SIZE - \
- REEF_BSS_DATA_SIZE - HEAP_RUNTIME_SIZE - REEF_STACK_SIZE - HEAP_SYSTEM_SIZE)
+ (L2_SRAM_SIZE - L2_VECTOR_SIZE - REEF_TEXT_SIZE - REEF_DATA_SIZE - \
+ REEF_BSS_DATA_SIZE - HEAP_RUNTIME_SIZE - REEF_STACK_SIZE - HEAP_SYSTEM_SIZE)
#define HEAP_BUFFER_BLOCK_SIZE 0x180
#define HEAP_BUFFER_COUNT (HEAP_BUFFER_SIZE / HEAP_BUFFER_BLOCK_SIZE)
diff --git a/src/platform/apollolake/include/platform/platform.h b/src/platform/apollolake/include/platform/platform.h
index 4165b95..6609f33 100644
--- a/src/platform/apollolake/include/platform/platform.h
+++ b/src/platform/apollolake/include/platform/platform.h
@@ -43,7 +43,7 @@ struct reef;
#define PLATFORM_PAGE_TABLE_SIZE 256
/* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT IRQ_EXT_IPC_LVL2(0)
+#define PLATFORM_IPC_INTERRUPT IRQ_EXT_IPC_LVL2(0)
/* pipeline IRQ */
#define PLATFORM_SCHEDULE_IRQ IRQ_NUM_SOFTWARE5
diff --git a/src/platform/apollolake/interrupt.c b/src/platform/apollolake/interrupt.c
index 3f799b7..86f8d84 100644
--- a/src/platform/apollolake/interrupt.c
+++ b/src/platform/apollolake/interrupt.c
@@ -42,7 +42,7 @@
static void parent_level2_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -85,7 +85,7 @@ next:
static void parent_level3_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -128,7 +128,7 @@ next:
static void parent_level4_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -171,7 +171,7 @@ next:
static void parent_level5_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -298,7 +298,6 @@ void platform_interrupt_init(void)
irq_write(REG_IRQ_IL4MSD(0), REG_IRQ_IL4MD_ALL);
irq_write(REG_IRQ_IL5MSD(0), REG_IRQ_IL5MD_ALL);
- for (i = 0; i < ARRAY_SIZE(dsp_irq); i++) {
+ for (i = 0; i < ARRAY_SIZE(dsp_irq); i++)
spinlock_init(&dsp_irq[i].lock);
- }
}
diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h
index 8b713df..59b940b 100644
--- a/src/platform/baytrail/include/platform/platform.h
+++ b/src/platform/baytrail/include/platform/platform.h
@@ -39,7 +39,7 @@
struct reef;
/* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT IRQ_NUM_EXT_IA
+#define PLATFORM_IPC_INTERRUPT IRQ_NUM_EXT_IA
/* Host page size */
#define HOST_PAGE_SIZE 4096
diff --git a/src/platform/cannonlake/include/platform/platform.h b/src/platform/cannonlake/include/platform/platform.h
index 00e0069..60b0518 100644
--- a/src/platform/cannonlake/include/platform/platform.h
+++ b/src/platform/cannonlake/include/platform/platform.h
@@ -46,7 +46,7 @@ struct reef;
#define PLATFORM_PAGE_TABLE_SIZE 256
/* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT IRQ_EXT_IPC_LVL2(0)
+#define PLATFORM_IPC_INTERRUPT IRQ_EXT_IPC_LVL2(0)
/* pipeline IRQ */
#define PLATFORM_SCHEDULE_IRQ IRQ_NUM_SOFTWARE5
diff --git a/src/platform/cannonlake/interrupt.c b/src/platform/cannonlake/interrupt.c
index 3268362..381030a 100644
--- a/src/platform/cannonlake/interrupt.c
+++ b/src/platform/cannonlake/interrupt.c
@@ -42,7 +42,7 @@
static void parent_level2_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -85,7 +85,7 @@ next:
static void parent_level3_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -128,7 +128,7 @@ next:
static void parent_level4_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -171,7 +171,7 @@ next:
static void parent_level5_handler(void *data)
{
struct irq_parent *parent = (struct irq_parent *)data;
- struct irq_child * child = NULL;
+ struct irq_child *child = NULL;
uint32_t status;
uint32_t i = 0;
@@ -298,7 +298,6 @@ void platform_interrupt_init(void)
irq_write(REG_IRQ_IL4MSD(0), REG_IRQ_IL4MD_ALL);
irq_write(REG_IRQ_IL5MSD(0), REG_IRQ_IL5MD_ALL);
- for (i = 0; i < ARRAY_SIZE(dsp_irq); i++) {
+ for (i = 0; i < ARRAY_SIZE(dsp_irq); i++)
spinlock_init(&dsp_irq[i].lock);
- }
}
diff --git a/src/platform/cannonlake/platform.c b/src/platform/cannonlake/platform.c
index 729364f..89aa2c3 100644
--- a/src/platform/cannonlake/platform.c
+++ b/src/platform/cannonlake/platform.c
@@ -178,7 +178,7 @@ static void platform_init_hw(void)
GENO_MDIVOSEL | GENO_DIOPTOSEL);
io_reg_write(DSP_INIT_IOPO,
- IOPO_DMIC_FLAG |IOPO_I2S_FLAG);
+ IOPO_DMIC_FLAG | IOPO_I2S_FLAG);
io_reg_write(DSP_INIT_ALHO,
ALHO_ASO_FLAG | ALHO_CSO_FLAG | ALHO_CFO_FLAG);
@@ -261,7 +261,7 @@ int platform_init(struct reef *reef)
/* init SSP ports */
trace_point(TRACE_BOOT_PLATFORM_SSP);
- for(i = 0; i < PLATFORM_SSP_COUNT; i++) {
+ for (i = 0; i < PLATFORM_SSP_COUNT; i++) {
ssp = dai_get(SOF_DAI_INTEL_SSP, i);
if (ssp == NULL)
return -ENODEV;
diff --git a/src/platform/haswell/include/platform/platform.h b/src/platform/haswell/include/platform/platform.h
index 8475e31..01a3646 100644
--- a/src/platform/haswell/include/platform/platform.h
+++ b/src/platform/haswell/include/platform/platform.h
@@ -38,7 +38,7 @@
struct reef;
/* IPC Interrupt */
-#define PLATFORM_IPC_INTERUPT IRQ_NUM_EXT_IA
+#define PLATFORM_IPC_INTERRUPT IRQ_NUM_EXT_IA
/* Host page size */
#define HOST_PAGE_SIZE 4096
--
2.14.3
2
2

[Sound-open-firmware] [PATCH v2 3/3] rimge: initial the char array.
by xionghu.luo@linux.intel.com 26 Jan '18
by xionghu.luo@linux.intel.com 26 Jan '18
26 Jan '18
From: Luo Xionghu <xionghu.luo(a)intel.com>
the variable maybe used uninitalied, initialize it to empty.
If the image->key_name is NULL, restore it to NULL before return.
---
v2: if path is modified in the function, strcmp returns not 0.
Signed-off-by: Luo Xionghu <xionghu.luo(a)intel.com>
---
rimage/pkcs1_5.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c
index 0c5806b..feffb7b 100644
--- a/rimage/pkcs1_5.c
+++ b/rimage/pkcs1_5.c
@@ -56,7 +56,9 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man,
RSA *priv_rsa = NULL;
EVP_PKEY *privkey;
FILE *fp;
- unsigned char digest[SHA256_DIGEST_LENGTH], path[256], mod[MAN_RSA_KEY_MODULUS_LEN];
+ unsigned char path[256] = "";
+ unsigned char digest[SHA256_DIGEST_LENGTH];
+ unsigned char mod[MAN_RSA_KEY_MODULUS_LEN];
unsigned int siglen = MAN_RSA_SIGNATURE_LEN;
int ret = -EINVAL, i;
@@ -80,6 +82,8 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man,
fp = fopen(image->key_name, "r");
if (fp == NULL) {
fprintf(stderr, "error: can't open file %s %d\n", path, -errno);
+ if (strcmp(path, ""))
+ image->key_name = NULL;
return -errno;
}
PEM_read_PrivateKey(fp, &privkey, NULL, NULL);
--
2.11.0
2
1