[Sound-open-firmware] [PATCH v4] build: add library build support for host platform

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Wed Jan 24 19:38:24 CET 2018


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 at 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   |    8 +
 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, 2003 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..6dddb35
--- /dev/null
+++ b/src/arch/host/include/arch/Makefile.am
@@ -0,0 +1,8 @@
+includedir = $(prefix)/include/sof/arch
+
+include_HEADERS = \
+	cache.h \
+	interrupt.h \
+	reef.h \
+	spinlock.h \
+	timer.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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at linux.intel.com>
+ *         Keyon Jie <yang.jie at 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 at 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 at 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 at 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



More information about the Sound-open-firmware mailing list