Skip to content

Commit

Permalink
Merge branch 'thesofproject:main' into mtl-Es8326+HDMI-in
Browse files Browse the repository at this point in the history
  • Loading branch information
CBala21 authored Dec 4, 2023
2 parents d113ea7 + fb229b9 commit 60eb919
Show file tree
Hide file tree
Showing 143 changed files with 3,679 additions and 2,299 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,29 @@ jobs:
VERBOSE=1 NO_PROCESSORS=1 USE_XARGS=no
CMAKE_BUILD_TYPE=Release ./scripts/docker-run.sh
./scripts/build-tools.sh


SOF-alsa-plugin:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with: {filter: 'tree:0'}

- name: apt install
run: sudo apt-get update;
sudo apt-get -y install ninja-build libasound2-dev

# One space character is enough to detect most quoting issues
- name: configure
run: cmake -B 'build plugin' -S tools/plugin
-GNinja -Wdev -Werror=dev --warn-uninitialized

# Retry with -j1 in case of error because parallel builds drown error
# messages.
- name: build ExternalProjects first to avoid build race condition
run: cmake --build 'build plugin' -- sof_ep parser_ep ||
cmake --build 'build plugin' -- sof_ep parser_ep -j1

- name: Remaining build steps
run: cmake --build 'build plugin' ||
cmake --build 'build plugin' -j1
11 changes: 10 additions & 1 deletion lmdk/cmake/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ endif()

include(${CMAKE_CURRENT_LIST_DIR}/config.cmake)

# Build common module functions from sof to a static library
add_library(sof STATIC)
target_include_directories(sof PRIVATE "${SOF_BASE}/src/include")
add_subdirectory("${SOF_BASE}/src/module" module_api)

foreach(MODULE ${MODULES_LIST})
add_executable(${MODULE})
add_subdirectory(${LMDK_BASE}/modules/${MODULE} ${MODULE}_module)
Expand All @@ -19,6 +24,7 @@ foreach(MODULE ${MODULES_LIST})
target_include_directories(${MODULE} PRIVATE
"${LMDK_BASE}/include"
"${RIMAGE_INCLUDE_DIR}"
"${SOF_BASE}/src/include/module"
)

# generate linker script
Expand All @@ -35,6 +41,9 @@ foreach(MODULE ${MODULES_LIST})
-P ${CMAKE_CURRENT_LIST_DIR}/ldscripts.cmake
)

# Link module with sof common module functions
target_link_libraries(${MODULE} sof)

target_link_options(${MODULE} PRIVATE
"-nostartfiles"
"-Wl,--no-undefined" "-Wl,--unresolved-symbols=report-all" "-Wl,--error-unresolved-symbols"
Expand Down Expand Up @@ -76,6 +85,6 @@ find_program(RIMAGE_COMMAND NAMES rimage

add_custom_target(${PROJECT_NAME}_target ALL
DEPENDS ${RIMAGE_MODULES_LIST}
COMMAND ${RIMAGE_COMMAND} -k ${SIGNING_KEY} -f 2.0.0 -b 1 -o ${RIMAGE_OUTPUT_FILE} -c ${TOML} -e ${RIMAGE_MODULES_LIST}
COMMAND ${RIMAGE_COMMAND} -l -k ${SIGNING_KEY} -f 2.0.0 -b 1 -o ${RIMAGE_OUTPUT_FILE} -c ${TOML} -e ${RIMAGE_MODULES_LIST}
COMMAND ${CMAKE_COMMAND} -E cat ${RIMAGE_OUTPUT_FILE}.xman ${RIMAGE_OUTPUT_FILE} > ${OUTPUT_FILE}
)
24 changes: 24 additions & 0 deletions lmdk/cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,27 @@ cmake_path(ABSOLUTE_PATH SOF_BASE NORMALIZE)

set(RIMAGE_INCLUDE_DIR ${SOF_BASE}/tools/rimage/src/include)
cmake_path(ABSOLUTE_PATH RIMAGE_INCLUDE_DIR NORMALIZE)

# Adds sources to target like target_sources, but assumes that
# paths are relative to subdirectory.
# Works like:
# Cmake >= 3.13:
# target_sources(<target> PRIVATE <sources>)
# Cmake < 3.13:
# target_sources(<target> PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/<sources>)
function(add_local_sources target)
foreach(arg ${ARGN})
if(IS_ABSOLUTE ${arg})
set(path ${arg})
else()
set(path ${CMAKE_CURRENT_SOURCE_DIR}/${arg})
endif()

target_sources(${target} PRIVATE ${path})
endforeach()
endfunction()

# Currently loadable modules do not support the Zephyr build system
macro(is_zephyr ret)
set(${ret} FALSE)
endmacro()
1 change: 0 additions & 1 deletion lmdk/libraries/dummy/dummy_mtl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ length = "0x0" # calculated by rimage

[signed_pkg]
name = "ADSP"
partition_usage = "0x23"
[[signed_pkg.module]]
name = "ADSP.met"

Expand Down
39 changes: 6 additions & 33 deletions lmdk/modules/dummy/dummy.c
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2023 Intel Corporation. All rights reserved.
/*
* Copyright 2023 Intel Corporation. All rights reserved.
*/

#include <rimage/sof/user/manifest.h>
#include <module/api_ver.h>

/* rimage fails if no .bss section found */
int bss_workaround;
DECLARE_LOADABLE_MODULE_API_VERSION(dummy);

#define ADSP_BUILD_INFO_FORMAT 0

/* these supposed to be defined in some API header file which is not yet available */
union adsp_api_version {
uint32_t full;
struct {
uint32_t minor : 10;
uint32_t middle : 10;
uint32_t major : 10;
uint32_t reserved : 2;
} fields;
};

struct adsp_build_info {
uint32_t format;
union adsp_api_version api_version_number;
};

struct adsp_build_info dummy_build_info __attribute__((section(".buildinfo"))) = {
ADSP_BUILD_INFO_FORMAT,
{
((0x3FF & MAJOR_IADSP_API_VERSION) << 20) |
((0x3FF & MIDDLE_IADSP_API_VERSION) << 10) |
((0x3FF & MINOR_IADSP_API_VERSION) << 0)
}
};

__attribute__((section(".cmi.text")))
void *dummyPackageEntryPoint(int a, int b)
void *dummyPackageEntryPoint(void *mod_cfg, void *parent_ppl, void **mod_ptr)
{
/* supposed to return here a pointer to module interface implementation */
return (void *)0x12345678;
Expand Down
9 changes: 9 additions & 0 deletions scripts/cmake/misc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ macro(is_zephyr ret)
endif()
endmacro()

# This macro
# - saves a LOT of repetition, and
# - mimics Zephyr, which helps with compatibility.
macro(add_local_sources_ifdef condition target)
if(${condition})
add_local_sources(${target} ${ARGN})
endif()
endmacro()

# Adds sources to target like target_sources, but assumes that
# paths are relative to subdirectory.
# Works like:
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ add_subdirectory(ipc)
add_subdirectory(audio)
add_subdirectory(lib)
add_subdirectory(math)
add_subdirectory(module)

if(CONFIG_SAMPLES)
add_subdirectory(samples)
endif()
Expand Down
2 changes: 2 additions & 0 deletions src/arch/xtensa/configs/override/mt8188_chrome_waves.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_COMP_MODULE_ADAPTER=y
CONFIG_WAVES_CODEC=y
3 changes: 3 additions & 0 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
if(CONFIG_COMP_CHAIN_DMA)
add_local_sources(sof chain_dma.c)
endif()
if(CONFIG_DTS_CODEC)
add_subdirectory(codec)
endif()

return()
endif()
Expand Down
Loading

0 comments on commit 60eb919

Please sign in to comment.