Skip to content

Commit

Permalink
Merge pull request #529 from thesofproject/topic/abi
Browse files Browse the repository at this point in the history
ABI updates with Semantic versioning
  • Loading branch information
plbossart authored Nov 11, 2018
2 parents 0762095 + 0f3e1ee commit 5838f71
Show file tree
Hide file tree
Showing 96 changed files with 2,020 additions and 1,297 deletions.
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,34 @@ jobs:
include:
- stage: compile
name: "BYT Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr byt
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l byt
- stage: compile
name: "CHT Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr cht
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l cht
- stage: compile
name: "BDW Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr bdw
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l bdw
- stage: compile
name: "HSW Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr hsw
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l hsw
- stage: compile
name: "APL Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr apl
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l apl
- stage: compile
name: "CNL Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr cnl
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l cnl
- stage: compile
name: "SUE Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr sue
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l sue
- stage: compile
name: "ICL Build"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr icl
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l icl
- stage: compile
name: "Host Build"
script: docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./scripts/host-build-all.sh -l
- stage: test
name: "BYT Boot Test"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr byt && ./scripts/docker-qemu.sh ../sof.git/scripts/qemu-check.sh byt
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l byt && ./scripts/docker-qemu.sh ../sof.git/scripts/qemu-check.sh byt
- stage: test
name: "CHT Boot Test"
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -lr cht && ./scripts/docker-qemu.sh ../sof.git/scripts/qemu-check.sh cht
script: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l cht && ./scripts/docker-qemu.sh ../sof.git/scripts/qemu-check.sh cht
16 changes: 15 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ m4_define(sof_minor, `cat .version | cut -d. -f2 | cut -d- -f1`)
m4_define(sof_micro, `cat .version | cut -d. -f3 | cut -d- -f1`)
AC_DEFINE_UNQUOTED([SOF_MAJOR], sof_major, [Sof major version])
AC_DEFINE_UNQUOTED([SOF_MINOR], sof_minor, [Sof minor version])
AC_DEFINE_UNQUOTED([SOF_MICRO], sof_micro, [Sof micro version])

# micr version can sometimes be NULL, so make it 0
if test sof_micro != ""; then
AC_DEFINE_UNQUOTED([SOF_MICRO], sof_micro, [Sof micro version])
else
AC_DEFINE_UNQUOTED([SOF_MICRO], 0, [Sof micro version])
fi

AC_CANONICAL_HOST

Expand Down Expand Up @@ -65,6 +71,12 @@ if test "x$with_meu" != "xno"; then
fi
fi

#check if we should enable debug build
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable debug, default: no])], enable_debug=$enableval, enable_debug=no)
if test "$enable_debug" = "yes"; then
AC_DEFINE([DEBUG_BUILD], [1], [Configure to build debug version])
fi

# 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
Expand Down Expand Up @@ -565,6 +577,8 @@ AC_CONFIG_FILES([
src/include/sof/drivers/Makefile
src/include/sof/math/Makefile
src/include/uapi/Makefile
src/include/uapi/ipc/Makefile
src/include/uapi/user/Makefile
src/ipc/Makefile
src/library/Makefile
src/library/include/Makefile
Expand Down
4 changes: 1 addition & 3 deletions rimage/file_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@
#ifndef __INCLUDE_UAPI_SOF_FW_H__
#define __INCLUDE_UAPI_SOF_FW_H__

/* Skip inclusion of <sof/io.h> which causes errors */
#define __INCLUDE_IO__
#include <uapi/ipc.h>
#include <uapi/ipc/info.h>

#define SND_SOF_FW_SIG_SIZE 4
#define SND_SOF_FW_ABI 1
Expand Down
3 changes: 2 additions & 1 deletion rimage/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include <time.h>
#include <sys/time.h>

#include "uapi/manifest.h"
#include <uapi/user/manifest.h>

#include "rimage.h"
#include "file_format.h"
#include "css.h"
Expand Down
2 changes: 1 addition & 1 deletion rimage/manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define __MANIFEST_H__

#include <stdint.h>
#include "uapi/manifest.h"
#include <uapi/user/manifest.h>
#include "css.h"
#include "cse.h"
#include "plat_auth.h"
Expand Down
17 changes: 17 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,7 @@ sub process {
my $commit_log_long_line = 0;
my $commit_log_has_diff = 0;
my $reported_maintainer_file = 0;
my $reported_abi_update = 0;
my $non_utf8_charset = 0;

my $last_blank_line = 0;
Expand Down Expand Up @@ -2454,6 +2455,14 @@ sub process {
$in_commit_log = 0;
}

# Check if ABI is being updated. If so, there's probably no need to
# emit the "does ABI need updating?" message on file add/move/delete
if ($line =~ /#define SOF_ABI_MAJOR*/ ||
$line =~ /#define SOF_ABI_MINOR*/ ||
$line =~ /#define SOF_ABI_PATCH*/) {
$reported_abi_update = 1;
}

# Check if MAINTAINERS is being updated. If so, there's probably no need to
# emit the "does MAINTAINERS need updating?" message on file add/move/delete
if ($line =~ /^\s*MAINTAINERS\s*\|/) {
Expand Down Expand Up @@ -3039,6 +3048,14 @@ sub process {
"networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
}

# UAPI ABI version
if ($realfile =~ m@^(src/include/uapi/|uapi/)@ &&
$rawline =~ /^\+/ &&
!$reported_abi_update) {
WARN("ABI update ??",
"Please update ABI in accordance with http://semver.org\n" . $hereprev);
}

# Block comments use * on subsequent lines
if ($prevline =~ /$;[ \t]*$/ && #ends in comment
$prevrawline =~ /^\+.*?\/\*/ && #starting /*
Expand Down
47 changes: 25 additions & 22 deletions scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
#!/bin/bash

SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl sue icl skl kbl)
BUILD_RIMAGE=1
BUILD_RIMAGE=0
BUILD_DEBUG=no

pwd=`pwd`

if [ "$#" -eq 0 ]
then
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
echo "usage: xtensa-build.sh [options] platform(s)"
echo " [-l] Build rimage locally"
echo " [-a] Build all platforms"
echo " [-d] Enable debug build"
echo " Supported platforms ${SUPPORTED_PLATFORMS[@]}"
else
# parse the args
for args in $@
do
if [[ "$args" == "-l" ]]
then
BUILD_LOCAL=1

# build all images for chosen targets
if [ "$#" -eq 1 ]
then
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
break
fi
elif [[ "$args" == "-lr" ]]
then
BUILD_LOCAL=1
BUILD_RIMAGE=0
BUILD_RIMAGE=1

PATH=$pwd/local/bin:$PATH

# build all images for chosen targets
if [ "$#" -eq 1 ]
elif [[ "$args" == "-d" ]]
then
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
break
fi
BUILD_DEBUG=yes

# Build all platforms
elif [[ "$args" == "-a" ]]
then
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
else
for i in ${SUPPORTED_PLATFORMS[@]}
do
Expand All @@ -47,8 +44,12 @@ else
done
fi


# now build the firmware (depends on rimage)
# check target platform(s) have been passed in
if [ ${#PLATFORMS[@]} -eq 0 ];
then
echo "Error: No platforms specified. Supported are: ${SUPPORTED_PLATFORMS[@]}"
exit 1
fi

# fail on any errors
set -e
Expand Down Expand Up @@ -213,8 +214,10 @@ do
# only delete binary related to this build
rm -fr src/arch/xtensa/sof-$j.*

./configure --with-arch=xtensa --with-platform=$PLATFORM --with-root-dir=$ROOT --host=$HOST \
CC=$XCC OBJCOPY=$XTOBJCOPY OBJDUMP=$XTOBJDUMP --with-dsp-core=$XTENSA_CORE
./configure --with-arch=xtensa --with-platform=$PLATFORM \
--with-root-dir=$ROOT --host=$HOST --enable-debug=$BUILD_DEBUG \
CC=$XCC OBJCOPY=$XTOBJCOPY OBJDUMP=$XTOBJDUMP \
--with-dsp-core=$XTENSA_CORE

make clean
make
Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/boot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <arch/wait.h>
#include <sof/trace.h>
#include <sof/io.h>
#include <uapi/manifest.h>
#include <uapi/user/manifest.h>
#include <platform/platform.h>
#include <platform/memory.h>

Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/include/arch/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <stdint.h>
#include <stddef.h>
#include <sof/mailbox.h>
#include <uapi/ipc.h>
#include <uapi/ipc/xtensa.h>

/* architecture specific stack frames to dump */
#define ARCH_STACK_DUMP_FRAMES 32
Expand Down
2 changes: 1 addition & 1 deletion src/audio/component.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <sof/alloc.h>
#include <sof/audio/component.h>
#include <sof/audio/pipeline.h>
#include <uapi/ipc.h>
#include <uapi/ipc/topology.h>

struct comp_data {
struct list_item list; /* list of components */
Expand Down
4 changes: 2 additions & 2 deletions src/audio/eq_fir.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <stdbool.h>
#include <sof/sof.h>
#include <sof/audio/component.h>
#include <uapi/eq.h>
#include <uapi/user/eq.h>
#include "fir_config.h"

#if FIR_GENERIC
Expand Down Expand Up @@ -513,7 +513,7 @@ static int fir_cmd_set_data(struct comp_dev *dev,
int ret = 0;

/* Check version from ABI header */
if (cdata->data->comp_abi != SOF_ABI_VERSION) {
if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, cdata->data->abi)) {
trace_eq_error("eab");
return -EINVAL;
}
Expand Down
6 changes: 3 additions & 3 deletions src/audio/eq_iir.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#include <sof/audio/component.h>
#include <sof/audio/pipeline.h>
#include <sof/audio/format.h>
#include <uapi/ipc.h>
#include <uapi/eq.h>
#include <uapi/ipc/control.h>
#include <uapi/user/eq.h>
#include "eq_iir.h"
#include "iir.h"

Expand Down Expand Up @@ -480,7 +480,7 @@ static int iir_cmd_set_data(struct comp_dev *dev,
int ret = 0;

/* Check version from ABI header */
if (cdata->data->comp_abi != SOF_ABI_VERSION) {
if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, cdata->data->abi)) {
trace_eq_error("eab");
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/audio/fir.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <errno.h>
#include <sof/audio/component.h>
#include <sof/audio/format.h>
#include <uapi/eq.h>
#include <uapi/user/eq.h>
#include "fir_config.h"

#if FIR_GENERIC
Expand Down
2 changes: 1 addition & 1 deletion src/audio/fir_hifi2ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <errno.h>
#include <sof/audio/component.h>
#include <sof/audio/format.h>
#include <uapi/eq.h>
#include <uapi/user/eq.h>
#include "fir_config.h"

#if FIR_HIFIEP
Expand Down
2 changes: 1 addition & 1 deletion src/audio/fir_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <errno.h>
#include <sof/audio/component.h>
#include <sof/audio/format.h>
#include <uapi/eq.h>
#include <uapi/user/eq.h>
#include "fir_config.h"

#if FIR_HIFI3
Expand Down
2 changes: 1 addition & 1 deletion src/audio/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <sof/audio/pipeline.h>
#include <platform/dma.h>
#include <arch/cache.h>
#include <uapi/ipc.h>
#include <uapi/ipc/dai.h>

#define trace_host(__e) trace_event(TRACE_CLASS_HOST, __e)
#define tracev_host(__e) tracev_event(TRACE_CLASS_HOST, __e)
Expand Down
2 changes: 1 addition & 1 deletion src/audio/iir.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#endif

#include <sof/audio/format.h>
#include <uapi/eq.h>
#include <uapi/user/eq.h>
#include "iir.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion src/audio/iir.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef IIR_H
#define IIR_H

#include <uapi/eq.h>
#include <uapi/user/eq.h>

struct iir_state_df2t {
unsigned int biquads; /* Number of IIR 2nd order sections total */
Expand Down
2 changes: 1 addition & 1 deletion src/audio/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <sof/audio/component.h>
#include <sof/audio/pipeline.h>
#include <sof/math/numbers.h>
#include <uapi/ipc.h>
#include <uapi/ipc/topology.h>

#include "src_config.h"
#include "src.h"
Expand Down
6 changes: 3 additions & 3 deletions src/audio/tone.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#include <sof/audio/format.h>
#include <sof/audio/pipeline.h>
#include <sof/math/trig.h>
#include <uapi/ipc.h>
#include <uapi/tone.h>
#include <uapi/ipc/topology.h>
#include <uapi/user/tone.h>

#ifdef MODULE_TEST
#include <stdio.h>
Expand Down Expand Up @@ -529,7 +529,7 @@ static int tone_cmd_set_data(struct comp_dev *dev,
trace_tone("tri");

/* Check version from ABI header */
if (cdata->data->comp_abi != SOF_TONE_ABI_VERSION) {
if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_VERSION, cdata->data->abi)) {
trace_tone_error("abi");
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/intel/cavs/hda-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <platform/dma.h>
#include <platform/platform.h>
#include <arch/cache.h>
#include <uapi/ipc.h>
#include <uapi/ipc/topology.h>

#define trace_host(__e, ...) \
trace_event(TRACE_CLASS_HOST, __e, ##__VA_ARGS__)
Expand Down
2 changes: 1 addition & 1 deletion src/host/common_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <sof/dma.h>
#include <sof/work.h>
#include <sof/wait.h>
#include <sof/intel-ipc.h>
#include <sof/ipc.h>
#include <sof/audio/pipeline.h>
#include "host/common_test.h"
#include "host/topology.h"
Expand Down
Loading

0 comments on commit 5838f71

Please sign in to comment.