Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ source "src/arch/Kconfig"
source "src/platform/Kconfig"

source "src/drivers/Kconfig"

source "src/audio/Kconfig"
2 changes: 2 additions & 0 deletions src/arch/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target_include_directories(sof_options INTERFACE ${GENERATED_DIRECTORY}/include)
# TODO: add Kconfig support also for testbench when it'll be decoupled from fw
set(CONFIG_HOST 1)
set(CONFIG_LIB 1)
set(CONFIG_COMP_VOLUME 1)
set(CONFIG_COMP_SRC 1)
Comment thread
abonislawski marked this conversation as resolved.
Resolved

configure_file (
"${PROJECT_SOURCE_DIR}/src/arch/host/config.h.in"
Expand Down
2 changes: 2 additions & 0 deletions src/arch/host/config.h.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#define CONFIG_HOST @CONFIG_HOST@
#define CONFIG_LIB @CONFIG_LIB@
#define CONFIG_COMP_VOLUME @CONFIG_COMP_VOLUME@
#define CONFIG_COMP_SRC @CONFIG_COMP_SRC@
22 changes: 15 additions & 7 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ if(NOT BUILD_HOST)
fir_hifi2ep.c
fir_hifi3.c
tone.c
src.c
src_generic.c
src_hifi2ep.c
src_hifi3.c
mixer.c
mux.c
volume.c
volume_generic.c
volume_hifi3.c
switch.c
dai.c
host.c
Expand All @@ -24,6 +17,21 @@ if(NOT BUILD_HOST)
component.c
buffer.c
)
if(CONFIG_COMP_VOLUME)
add_local_sources(sof
Comment thread
abonislawski marked this conversation as resolved.
Resolved
volume.c
volume_generic.c
volume_hifi3.c
)
endif()
if(CONFIG_COMP_SRC)
add_local_sources(sof
src.c
src_generic.c
src_hifi2ep.c
src_hifi3.c
)
endif()
return()
endif()

Expand Down
15 changes: 15 additions & 0 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
menu "Audio components"

config COMP_VOLUME
bool "Volume component"
default y
help
Select for Volume component

config COMP_SRC
bool "SRC component"
default y
help
Select for SRC component

endmenu
8 changes: 8 additions & 0 deletions src/include/sof/audio/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,16 @@ void sys_comp_host_init(void);
void sys_comp_mixer_init(void);
void sys_comp_mux_init(void);
void sys_comp_switch_init(void);
#ifdef CONFIG_COMP_VOLUME
Comment thread
abonislawski marked this conversation as resolved.
Resolved
void sys_comp_volume_init(void);
#else
static inline void sys_comp_volume_init(void) {}
#endif
#ifdef CONFIG_COMP_SRC
void sys_comp_src_init(void);
#else
static inline void sys_comp_src_init(void) {}
#endif
void sys_comp_tone_init(void);
void sys_comp_eq_iir_init(void);
void sys_comp_eq_fir_init(void);
Expand Down
26 changes: 24 additions & 2 deletions src/platform/apollolake/include/platform/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,24 @@
#define HP_SRAM_WIN3_BASE SRAM_TRACE_BASE
#define HP_SRAM_WIN3_SIZE SRAM_TRACE_SIZE

#if defined(CONFIG_DMIC)
#define SOF_TEXT_DMIC_SIZE 0x2000
Comment thread
abonislawski marked this conversation as resolved.
Resolved
#else
#define SOF_TEXT_DMIC_SIZE 0
#endif

#if defined(CONFIG_COMP_VOLUME)
#define SOF_TEXT_VOLUME_SIZE 0x1000
#else
#define SOF_TEXT_VOLUME_SIZE 0
#endif

#if defined(CONFIG_COMP_SRC)
#define SOF_TEXT_SRC_SIZE 0x1000
#else
#define SOF_TEXT_SRC_SIZE 0
#endif

/* Apollolake HP-SRAM config */
#if defined(CONFIG_APOLLOLAKE) \
&& !(defined(CONFIG_KABYLAKE) || defined(CONFIG_SKYLAKE))
Expand All @@ -285,7 +303,9 @@

#define SOF_TEXT_START (HP_SRAM_VECBASE_RESET + 0x400)
#define SOF_TEXT_BASE (SOF_TEXT_START)
#define SOF_TEXT_SIZE (0x1d000 - 0x400)
#define SOF_TEXT_MIN_SIZE (0x19000 - 0x400)
#define SOF_TEXT_SIZE (SOF_TEXT_MIN_SIZE + SOF_TEXT_DMIC_SIZE \
+ SOF_TEXT_VOLUME_SIZE + SOF_TEXT_SRC_SIZE)

/* Skylake or kabylake HP-SRAM config */
#elif defined(CONFIG_KABYLAKE) || defined(CONFIG_SKYLAKE)
Expand All @@ -303,7 +323,9 @@

#define SOF_TEXT_START HP_SRAM_VECBASE_RESET
#define SOF_TEXT_BASE (SOF_TEXT_START + 0x1000)
#define SOF_TEXT_SIZE 0x1c000
#define SOF_TEXT_MIN_SIZE 0x18000
#define SOF_TEXT_SIZE (SOF_TEXT_MIN_SIZE + SOF_TEXT_DMIC_SIZE \
+ SOF_TEXT_VOLUME_SIZE + SOF_TEXT_SRC_SIZE)

#else
#error Platform not specified
Expand Down
22 changes: 21 additions & 1 deletion src/platform/cannonlake/include/platform/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,30 @@
#define HEAP_HP_BUFFER_COUNT \
(HEAP_HP_BUFFER_SIZE / HEAP_HP_BUFFER_BLOCK_SIZE)

#if defined(CONFIG_DMIC)
#define SOF_TEXT_DMIC_SIZE 0x2000
Comment thread
abonislawski marked this conversation as resolved.
Resolved
#else
#define SOF_TEXT_DMIC_SIZE 0
#endif

#if defined(CONFIG_COMP_VOLUME)
#define SOF_TEXT_VOLUME_SIZE 0x1000
#else
#define SOF_TEXT_VOLUME_SIZE 0
#endif

#if defined(CONFIG_COMP_SRC)
#define SOF_TEXT_SRC_SIZE 0x1000
#else
#define SOF_TEXT_SRC_SIZE 0
#endif

/* text and data share the same HP L2 SRAM on Cannonlake */
#define SOF_TEXT_START 0xBE040400
#define SOF_TEXT_BASE (SOF_TEXT_START)
#define SOF_TEXT_SIZE (0x1b000 - 0x400 + 0x2000)
#define SOF_TEXT_MIN_SIZE (0x17000 - 0x400 + 0x2000)
#define SOF_TEXT_SIZE (SOF_TEXT_MIN_SIZE + SOF_TEXT_DMIC_SIZE \
+ SOF_TEXT_VOLUME_SIZE + SOF_TEXT_SRC_SIZE)

/* initialized data */
#define SOF_DATA_START (SOF_TEXT_BASE + SOF_TEXT_SIZE)
Expand Down
22 changes: 21 additions & 1 deletion src/platform/icelake/include/platform/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,30 @@
#define HEAP_HP_BUFFER_COUNT \
(HEAP_HP_BUFFER_SIZE / HEAP_HP_BUFFER_BLOCK_SIZE)

#if defined(CONFIG_DMIC)
#define SOF_TEXT_DMIC_SIZE 0x2000
#else
#define SOF_TEXT_DMIC_SIZE 0
#endif

#if defined(CONFIG_COMP_VOLUME)
#define SOF_TEXT_VOLUME_SIZE 0x1000
#else
#define SOF_TEXT_VOLUME_SIZE 0
#endif

#if defined(CONFIG_COMP_SRC)
#define SOF_TEXT_SRC_SIZE 0x1000
#else
#define SOF_TEXT_SRC_SIZE 0
#endif

/* text and data share the same HP L2 SRAM on Icelake */
#define SOF_TEXT_START 0xBE040400
#define SOF_TEXT_BASE (SOF_TEXT_START)
#define SOF_TEXT_SIZE (0x1F000 - 0x400)
#define SOF_TEXT_MIN_SIZE (0x1B000 - 0x400)
#define SOF_TEXT_SIZE (SOF_TEXT_MIN_SIZE + SOF_TEXT_DMIC_SIZE \
+ SOF_TEXT_VOLUME_SIZE + SOF_TEXT_SRC_SIZE)

/* initialized data */
#define SOF_DATA_START (SOF_TEXT_BASE + SOF_TEXT_SIZE)
Expand Down
4 changes: 3 additions & 1 deletion test/cmocka/src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ add_subdirectory(buffer)
add_subdirectory(component)
add_subdirectory(mixer)
add_subdirectory(pipeline)
add_subdirectory(volume)
if(CONFIG_COMP_VOLUME)
add_subdirectory(volume)
endif()