[Sound-open-firmware] [PATCH] platform: hsw: Add build support for haswell and broadwell

Liam Girdwood liam.r.girdwood at linux.intel.com
Mon Jan 22 12:33:27 CET 2018


Add build support Makefiles

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 build-all.sh                    | 13 +++++++++++++
 configure.ac                    | 40 ++++++++++++++++++++++++++++++++++++++++
 src/arch/xtensa/hal/Makefile.am | 18 ++++++++++++++++++
 src/audio/src_config.h          |  2 +-
 src/platform/Makefile.am        |  7 +++++++
 5 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/build-all.sh b/build-all.sh
index 2e015f6..6035c66 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -21,5 +21,18 @@ make clean
 make
 make bin
 
+# Build for Broadwell
+make clean
+./configure --with-arch=xtensa --with-platform=broadwell --with-root-dir=$pwd/../xtensa-root/xtensa-hsw-elf --host=xtensa-hsw-elf
+make
+make bin
+
+# Build for Haswell
+make clean
+./configure --with-arch=xtensa --with-platform=haswell --with-root-dir=$pwd/../xtensa-root/xtensa-hsw-elf --host=xtensa-hsw-elf
+make
+make bin
+
+
 # list all the images
 ls -l src/arch/xtensa/*.ri
diff --git a/configure.ac b/configure.ac
index 00c377f..40e8b9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,40 @@ case "$with_platform" in
 	AC_DEFINE([CONFIG_CHERRYTRAIL], [1], [Configure for Cherrytrail])
 	AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table])
     ;;
+    haswell*)
+
+	PLATFORM_LDSCRIPT="haswell.x"
+	AC_SUBST(PLATFORM_LDSCRIPT)
+
+	PLATFORM="haswell"
+	AC_SUBST(PLATFORM)
+
+	FW_NAME="hsw"
+	AC_SUBST(FW_NAME)
+
+	XTENSA_CORE="hifiep_bd5"
+	AC_SUBST(XTENSA_CORE)
+
+	AC_DEFINE([CONFIG_HASWELL], [1], [Configure for Haswell])
+	AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table])
+    ;;
+    broadwell*)
+
+	PLATFORM_LDSCRIPT="broadwell.x"
+	AC_SUBST(PLATFORM_LDSCRIPT)
+
+	PLATFORM="haswell"
+	AC_SUBST(PLATFORM)
+
+	FW_NAME="bdw"
+	AC_SUBST(FW_NAME)
+
+	XTENSA_CORE="hifiep_bd5"
+	AC_SUBST(XTENSA_CORE)
+
+	AC_DEFINE([CONFIG_BROADWELL], [1], [Configure for Broadwell])
+	AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table])
+    ;;
     *)
         AC_MSG_ERROR([Host platform not specified])
     ;;
@@ -112,6 +146,7 @@ AM_CONDITIONAL(BUILD_CHERRYTRAIL,  test "$FW_NAME" = "cht")
 AM_CONDITIONAL(BUILD_HASWELL,  test "$FW_NAME" = "hsw")
 AM_CONDITIONAL(BUILD_BROADWELL,  test "$FW_NAME" = "bdw")
 AM_CONDITIONAL(BUILD_APOLLOLAKE,  test "$FW_NAME" = "apl")
+
 # DSP core support (Optional)
 AC_ARG_WITH([dsp-core],
         AS_HELP_STRING([--with-dsp-core], [Specify DSP Core]),
@@ -179,6 +214,11 @@ AC_CONFIG_FILES([
 	src/platform/baytrail/include/platform/Makefile
 	src/platform/baytrail/include/xtensa/Makefile
 	src/platform/baytrail/include/xtensa/config/Makefile
+	src/platform/haswell/Makefile
+	src/platform/haswell/include/Makefile
+	src/platform/haswell/include/platform/Makefile
+	src/platform/haswell/include/xtensa/Makefile
+	src/platform/haswell/include/xtensa/config/Makefile
 ])
 AC_OUTPUT
 
diff --git a/src/arch/xtensa/hal/Makefile.am b/src/arch/xtensa/hal/Makefile.am
index e1e7a80..23c1b79 100644
--- a/src/arch/xtensa/hal/Makefile.am
+++ b/src/arch/xtensa/hal/Makefile.am
@@ -134,6 +134,24 @@ PLATFORM_DEFS = \
 	$(CACHE_DEFS)
 endif
 
+if BUILD_BROADWELL
+PLATFORM_DEFS = \
+	$(STATE_DEFS) \
+	$(DISASS_DEFS) \
+	$(MISC_DEFS) \
+	$(INTERRUPTS_DEFS) \
+	$(CACHE_DEFS)
+endif
+
+if BUILD_HASWELL
+PLATFORM_DEFS = \
+	$(STATE_DEFS) \
+	$(DISASS_DEFS) \
+	$(MISC_DEFS) \
+	$(INTERRUPTS_DEFS) \
+	$(CACHE_DEFS)
+endif
+
 noinst_LIBRARIES = libhal.a
 
 libhal_a_SOURCES = \
diff --git a/src/audio/src_config.h b/src/audio/src_config.h
index 66f23da..3ad4c78 100644
--- a/src/audio/src_config.h
+++ b/src/audio/src_config.h
@@ -34,7 +34,7 @@
 
 #include <config.h>
 
-#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL
+#if defined CONFIG_BAYTRAIL || defined CONFIG_CHERRYTRAIL || defined CONFIG_BROADWELL || defined CONFIG_HASWELL
 #define SRC_SHORT 1
 #include <reef/audio/coefficients/src/src_tiny_int16_define.h>
 #include <reef/audio/coefficients/src/src_tiny_int16_table.h>
diff --git a/src/platform/Makefile.am b/src/platform/Makefile.am
index c11996a..9d360c3 100644
--- a/src/platform/Makefile.am
+++ b/src/platform/Makefile.am
@@ -6,3 +6,10 @@ if BUILD_CHERRYTRAIL
 SUBDIRS = baytrail 
 endif
 
+if BUILD_HASWELL
+SUBDIRS = haswell
+endif
+
+if BUILD_BROADWELL
+SUBDIRS = haswell
+endif
-- 
2.14.1



More information about the Sound-open-firmware mailing list