Skip to content

Commit efa794d

Browse files
lrgirdwoMaureenHelm
authored andcommitted
samples/audio: Add Sound Open Firmware
Adds the Sound Open Firmware project, built as a Zephyr application, under samples/subsys/sudio/sof. Signed-off-by: Liam Girdwood <[email protected]>
1 parent afefcd1 commit efa794d

File tree

8 files changed

+98
-0
lines changed

8 files changed

+98
-0
lines changed

samples/audio/sof/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.13.1)
4+
5+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
6+
project(sample_sof)
7+
8+
target_sources(app PRIVATE
9+
src/main.c
10+
)
11+
12+
zephyr_interface_library_named(sof_lib)
13+
14+
zephyr_library_include_directories(app PUBLIC
15+
${sof_module}/src/arch/xtensa/include
16+
${sof_module}/src/include
17+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_APOLLOLAKE=y
2+
CONFIG_INTEL_DMIC=y
3+
CONFIG_INTEL_SSP=y
4+
CONFIG_CORE_COUNT=1
5+
CONFIG_LP_MEMORY_BANKS=2
6+
CONFIG_HP_MEMORY_BANKS=8
7+
CONFIG_PERFORMANCE_COUNTERS=y
8+
CONFIG_COMP_SRC_SMALL=y
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_CANNONLAKE=y
2+
CONFIG_INTEL_DMIC=y
3+
CONFIG_INTEL_SSP=y
4+
CONFIG_INTEL_ALH=y
5+
CONFIG_LP_MEMORY_BANKS=1
6+
CONFIG_HP_MEMORY_BANKS=47
7+
CONFIG_PERFORMANCE_COUNTERS=y
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CONFIG_ICELAKE=y
2+
CONFIG_INTEL_DMIC=y
3+
CONFIG_INTEL_SSP=y
4+
CONFIG_INTEL_ALH=y
5+
CONFIG_LP_MEMORY_BANKS=1
6+
CONFIG_HP_MEMORY_BANKS=47
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CONFIG_TIGERLAKE=y
2+
CONFIG_INTEL_DMIC=y
3+
CONFIG_INTEL_SSP=y
4+
CONFIG_INTEL_ALH=y
5+
CONFIG_LP_MEMORY_BANKS=1
6+
CONFIG_HP_MEMORY_BANKS=46

samples/audio/sof/prj.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_SOF=y
2+
CONFIG_SMP=n
3+
CONFIG_LOG=y
4+
CONFIG_MP_NUM_CPUS=1
5+
6+
# Requires heap_info() be implemented, but no Zephyr wrapper
7+
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n

samples/audio/sof/sample.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sample:
2+
description: Audio with SOF
3+
name: sof
4+
common:
5+
tags: audio
6+
tests:
7+
sample.audio.sof:
8+
tags: sof
9+
build_only: true
10+
integration_platforms:
11+
- intel_adsp_cavs15

samples/audio/sof/src/main.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2020 Intel Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr.h>
8+
9+
#include <logging/log.h>
10+
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);
11+
12+
/**
13+
* Should be included from sof/schedule/task.h
14+
* but triggers include chain issue
15+
* FIXME
16+
*/
17+
int sof_main(int argc, char *argv[]);
18+
19+
/**
20+
* TODO: Here comes SOF initialization
21+
*/
22+
23+
void main(void)
24+
{
25+
int ret;
26+
27+
LOG_INF("SOF on %s", CONFIG_BOARD);
28+
29+
/* sof_main is actually SOF initialization */
30+
ret = sof_main(0, NULL);
31+
if (ret) {
32+
LOG_ERR("SOF initialization failed");
33+
}
34+
35+
LOG_INF("SOF initialized");
36+
}

0 commit comments

Comments
 (0)