diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 6c0577a093ce..3cb568999b39 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -27,7 +27,7 @@ jobs: # depth 2 so: # ^1. we can show the Subject of the current target branch tip # ^2. we reconnect/graft to the later fetch pull/1234/head, - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 2} - name: install codespell @@ -50,7 +50,12 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: run yamllint - run: yamllint --strict .github/workflows/*.yml + # Quoting to please all parsers is hard. This indirection helps. + env: + yamllint_config: '{extends: default, rules: {line-length: {max: 100}}}' + run: yamllint -f parsable + -d "$yamllint_config" + --strict .github/workflows/*.yml diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 178c090f89d9..2b0601d9ef37 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -28,7 +28,7 @@ jobs: ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # From time to time this will catch a git tag and change SOF_VERSION with: {fetch-depth: 50, submodules: recursive} diff --git a/.github/workflows/ipc_fuzzer.yml b/.github/workflows/ipc_fuzzer.yml deleted file mode 100644 index 036cbc82f37e..000000000000 --- a/.github/workflows/ipc_fuzzer.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- - -# For the actual fuzzer see tools/oss-fuzz/README. -# also see -# https://google.github.io/oss-fuzz/getting-started/continuous-integration/ -# -# Build and run fuzzer for 5s just to check that it runs properly. If it -# consistently fails in under 5s you probably did something wrong - -# If you came here to quickly copy/paste the invocation of some build -# script in order to reproduce a failure reported by github then you -# will be disappointed by the Github Action below: it's magical. For a -# thorough reproduction you must follow the links above. For a quick, -# dirty and incomplete reproduction hack you can try the following two -# lines. Don't do this at home. -# -# OUT=unused_dir cmake -B oss-fuzz-build/ -S tools/oss-fuzz/ -# make -j -C oss-fuzz-build sof_ep fuzz_ipc.o - -name: IPC fuzzer compile test - -# 'workflow_dispatch' allows running this workflow manually from the -# 'Actions' tab - -# yamllint disable-line rule:truthy -on: [pull_request, workflow_dispatch] - -jobs: - ipc-fuzzer-build: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'sound-open-firmware' - - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'sound-open-firmware' - language: c - fuzz-seconds: 5 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 32c0d36630e0..3a06f122765a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: apt get doxygen graphviz run: sudo apt-get -y install ninja-build doxygen graphviz @@ -58,7 +58,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 5} - name: apt get valgrind @@ -83,6 +83,26 @@ jobs: run: ./scripts/host-testbench.sh + # This is a bit redundant with the other jobs below and with the (much + # faster!) installer[.yml] but it may differ in which platforms are + # built. This makes sure platforms without any open-source toolchain + # are added in the right place and do not accidentally break the -a + # option, Docker testing etc. + gcc-build-default-platforms: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + with: {fetch-depth: 5, submodules: recursive} + + - name: docker + run: docker pull thesofproject/sof && docker tag thesofproject/sof sof + + - name: xtensa-build-all.sh -a + run: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -a || + ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -a -j 1 + + gcc-build-only: runs-on: ubuntu-20.04 @@ -95,17 +115,19 @@ jobs: platform: [imx8ulp, sue jsl tgl, rn, + # TODO: enable mt81xx after docker image udpated + # mt8186, mt8195, ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 0, submodules: recursive} - name: docker run: docker pull thesofproject/sof && docker tag thesofproject/sof sof - - name: xtensa-build-all + - name: xtensa-build-all.sh platforms env: PLATFORM: ${{ matrix.platform }} run: ./scripts/docker-run.sh @@ -134,7 +156,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 0, submodules: recursive} - name: turn off HAVE_AGENT @@ -144,7 +166,7 @@ jobs: - name: docker SOF run: docker pull thesofproject/sof && docker tag thesofproject/sof sof - - name: xtensa-build-all -o no-agent + - name: xtensa-build-all.sh -o no-agent platforms env: PLATFORM: ${{ matrix.platform }} run: ./scripts/docker-run.sh diff --git a/.github/workflows/repro-build.yml b/.github/workflows/repro-build.yml index c3090154b608..4325467123ce 100644 --- a/.github/workflows/repro-build.yml +++ b/.github/workflows/repro-build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 5, submodules: recursive} - name: docker pull diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 5be87125a8ba..670d67ad9627 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -12,7 +12,7 @@ jobs: top-level_default_CMake_target_ALL: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # The ALSA version in Ubuntu 20.04 is buggy # (https://github.com/thesofproject/sof/issues/2543) and likely diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 9bbe004092ea..bc1619fda3b5 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -14,7 +14,7 @@ jobs: cmocka_utests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 2} - name: build and run all defconfigs diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 79be79fb4a9b..737313368204 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -11,15 +11,23 @@ jobs: zephyr-build: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # From time to time this will catch a git tag and change SOF_VERSION with: {fetch-depth: 10, submodules: recursive} + # v0.23.4 is the last image with Zephyr SDK 0.14. + # SDK 0.15 fails with the following Werror: + # /workdir/zephyrproject/zephyr/include/zephyr/kernel/thread_stack.h:190:16: + # error: ignoring attribute 'section (".cached.\"WEST_TOPDIR/zephyr/kernel/init.c\".3")' + # because it conflicts with previous 'section + # (".cached.\"WEST_TOPDIR/zephyr/arch/xtensa/include/kernel_arch_func.h\"' + # [-Werror=attributes] + # https://github.com/zephyrproject-rtos/docker-image # Note: env variables can be passed to the container with # -e https_proxy=... - name: build run: docker run -v "$(pwd)":/workdir - ghcr.io/zephyrproject-rtos/zephyr-build:latest + ghcr.io/zephyrproject-rtos/zephyr-build:v0.23.4 ./zephyr/docker-build.sh --cmake-args=-DEXTRA_CFLAGS=-Werror --cmake-args=--warn-uninitialized -a diff --git a/CODEOWNERS b/CODEOWNERS index 3a5a8b899053..365405b49e7a 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,45 +2,55 @@ # Each line is a file pattern followed by one or more owners. # These owners will be the default owners for everything in the repo. -* @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta +* @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta @kv2019i # Order is important. The last matching pattern has the most precedence. -# So if a pull request only touches javascript files, only these owners -# will be requested to review. +# File patterns work mostly like .gitignore. Try to keep this file +# simple because it's literally impossible to test. +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners # include files src/include/sof/drivers/dmic.h @singalsu src/include/ipc/** @thesofproject/steering-committee -src/include/ipc/** @randerwang @marcinszkudlinski +src/include/ipc/** @randerwang @marcinszkudlinski @pblaszko +src/include/ipc4/** @randerwang @marcinszkudlinski @pblaszko src/include/kernel/** @thesofproject/steering-committee src/include/user/** @thesofproject/steering-committee -src/include/sof/debug/gdb/* @mrajwa -src/include/sof/audio/kpb.h @mrajwa -src/include/sof/audio/mux.h @akloniex -src/include/sof/audio/codec_adapter/* @cujomalainey @mrajwa @dbaluta +src/include/sof/debug/gdb/* @abonislawski +src/include/sof/audio/aria/* @abonislawski +src/include/sof/audio/kpb.h @fkwasowi @iganakov +src/include/sof/audio/mux.h @fkwasowi +src/include/sof/audio/up_down_mixer/* @abonislawski +src/include/sof/audio/codec_adapter/* @cujomalainey @abonislawski @dbaluta +src/include/sof/audio/module_adapter/* @ranj063 @jxstelter src/include/sof/drivers/acp_dai_dma.h @bhiregoudar @sunilkumardommati src/include/sof/drivers/afe* @yaochunhung # audio component -src/audio/src* @singalsu +src/audio/src* @singalsu @abonislawski +# src/audio/chain_dma* TODO +src/audio/copier/* @randerwang @abonislawski @pblaszko src/audio/eq* @singalsu src/audio/eq_fir* @singalsu src/audio/eq_iir* @singalsu src/audio/tone.c @singalsu -src/audio/kpb.c @mrajwa -src/audio/mux/* @akloniex -src/audio/dcblock* @cujomalainey @chiang831 @johnylin76 -src/audio/crossover* @cujomalainey @chiang831 @johnylin76 +src/audio/kpb.c @fkwasowi @iganakov +src/audio/mux/* @fkwasowi +src/audio/dcblock* @thesofproject/google +src/audio/crossover* @thesofproject/google src/audio/tdfb* @singalsu -src/audio/drc/* @johnylin76 @cujomalainey @chiang831 -src/audio/multiband_drc/* @johnylin76 @cujomalainey @chiang831 -src/audio/codec_adapter/* @cujomalainey @mrajwa @dbaluta -src/audio/google_hotword_detect.c @bzhg @cujomalainey @chiang831 @johnylin76 +src/audio/drc/* @thesofproject/google +src/audio/selector/* @tlissows +src/audio/up_down_mixer/* @abonislawski +src/audio/multiband_drc/* @thesofproject/google +src/audio/codec_adapter/* @cujomalainey @abonislawski @dbaluta +src/audio/module_adapter/* @ranj063 @jxstelter +src/audio/google/* @thesofproject/google # platforms src/platform/haswell/* @randerwang src/platform/suecreek/* @lyakh -src/arch/xtensa/debug/gdb/* @mrajwa +src/arch/xtensa/debug/gdb/* @abonislawski src/platform/imx8/** @dbaluta src/platform/amd/** @bhiregoudar @sunilkumardommati src/platform/mt8195/** @yaochunhung @kuanhsuncheng @@ -56,39 +66,59 @@ src/drivers/mediatek/mt8195/* @yaochunhung @kuanhsuncheng # other libs src/math/* @singalsu -src/ipc/* @bardliao @marcinszkudlinski +src/ipc/* @bardliao @marcinszkudlinski @pblaszko src/drivers/intel/cavs/sue-ipc.c @lyakh -src/lib/* @libinyang -src/debug/gdb/* @mrajwa -src/schedule @mrajwa +# src/lib/* TODO +src/debug/gdb/* @abonislawski +src/schedule @pblaszko @marcinszkudlinski @dbaluta @LaurentiuM1234 + +# samples +samples/audio/detect_test.c @iganakov # other helpers -# Mostly overridden by *.(ba)sh below -scripts/* @marc-hb @aborisovich +# Many files overridden by *.(ba)sh pattern below +# scripts/* TODO # tools(old 'soft' repo) tools/logger/* @bkokoszx @akloniex -tools/topology/* @ranj063 +tools/topology/** @ranj063 +tools/topology/topology2/** @ranj063 @jsarha tools/testbench/* @ranj063 tools/test/audio/* @singalsu tools/ctl/* @singalsu tools/tune/* @singalsu -tools/tune/crossover/* @cujomalainey @johnylin76 @chiang831 -tools/tune/dcblock/* @cujomalainey @johnylin76 @chiang831 -tools/tune/drc/* @cujomalainey @johnylin76 @chiang831 -tools/oss-fuzz/* @cujomalainey - -# build system -**/CMakeLists.txt @marc-hb @aborisovich -# **/Kconfig -# scripts/cmake/** -# scripts/kconfig/** - -*.sh @marc-hb -*.bash @marc-hb +tools/tune/crossover/* @thesofproject/google +tools/tune/dcblock/* @thesofproject/google +tools/tune/drc/* @thesofproject/google +tools/oss-fuzz/* @thesofproject/google + +zephyr/** @kv2019i @lyakh @iuliana-prodan @dbaluta @abonislawski +zephyr/lib/cpu.c @tmleman +zephyr/lib/alloc.c @dabekjakub +zephyr/lib/regions_mm.c @dabekjakub + +# installer +# installer/** TODO + +# CMake + +# Include only "top-level" CMakeLists.txt files; the other ones are just +# dumb list of source files and generate too much noise. +# /CMakeLists.txt TODO +#/*/CMakeLists.txt TODO +# /test/cmocka/CMakeLists.txt TODO + +# There's a small enough number of files in tools/ and little +# churn: keep it simple and take them all. +# FIXME: some topology CMakeLists.txt files are configuration files +# in disguise. Move them to actual configuration files. +# /tools/**/CMakeLists.txt TODO + +# *.sh TODO +# *.bash TODO *trace.* @akloniex -/.github/ @dbaluta @cujomalainey @lgirdwood @marc-hb @aborisovich +/.github/ @dbaluta @cujomalainey @lgirdwood # You can also use email addresses if you prefer. #docs/* docs@example.com diff --git a/rimage b/rimage index 9d453321f892..02abc5d342a3 160000 --- a/rimage +++ b/rimage @@ -1 +1 @@ -Subproject commit 9d453321f892b7ec3f0c74d3382eaa4e674a6e6a +Subproject commit 02abc5d342a3ee6965bdc933ea1439d85d0256da diff --git a/scripts/build-alsa-tools.sh b/scripts/build-alsa-tools.sh new file mode 100755 index 000000000000..5e1e7f75d39d --- /dev/null +++ b/scripts/build-alsa-tools.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2025 Intel Corporation. All rights reserved. + +# fail immediately on any errors +set -e + +# Array of ALSA Git repository URLs. Add or remove repositories as needed. +declare -a REPOS=( + "https://github.com/thesofproject/alsa-lib.git" + "https://github.com/thesofproject/alsa-utils.git" + # Add more repositories here... +) + +# Commit ID to check for (optional). If specified, the script will update +# the repository if this commit ID is not found. Leave empty to skip. +# This array order must align with REPO array above. +declare -a COMMIT_ID=( + "df8f1cc1ec9d9ee15be5e2c23ad25b9389fd8766" + "09550cd393b1a7d307ee6f26637b1ed7bd275e38" + # Add more IDs here... +) + +# Directory where repositories will be cloned/updated. +if [[ -z "$SOF_WORKSPACE" ]]; then + # Environment variable is empty or unset so use default + BASE_DIR="$HOME/work/sof" +else + # Environment variable exists and has a value + BASE_DIR="$SOF_WORKSPACE" +fi + +# Arguments to pass to ./configure for each repository. Add or remove +declare -a CONFIGURE_ARGS=( + "--prefix=${BASE_DIR}/tools" + "--prefix=${BASE_DIR}/tools \ + --with-alsa-prefix=${BASE_DIR}/tools \ + --with-alsa-inc-prefix=${BASE_DIR}/tools/include \ + --with-sysroot=${BASE_DIR}/tools \ + --with-udev-rules-dir=${BASE_DIR}/tools \ + PKG_CONFIG_PATH=${BASE_DIR}/tools \ + LDFLAGS=-L${BASE_DIR}/tools/lib \ + --with-asound-state-dir=${BASE_DIR}/tools/var/lib/alsa \ + --with-systemdsystemunitdir=${BASE_DIR}/tools/lib/systemd/system" +) + +# Arguments to pass to make for each repository. Add or remove arguments as needed. +declare -a TARGET_ARGS=( + "--disable-old-symbols" + "--enable-alsatopology" +) + +# Function to check if a commit ID exists in a repository +check_commit() { + local repo_dir="$1" + local commit_id="$2" + + if [ -z "$commit_id" ]; then + return 0 # Skip check if no commit ID is provided + fi + + if ! git -C "$repo_dir" rev-parse --quiet --verify "$commit_id" >/dev/null 2>&1; then + return 1 # Commit ID not found + else + return 0 # Commit ID found + fi +} + + +# Function to update the repository +update_repo() { + local repo_dir="$1" + echo "Updating repository: $repo_dir" + git -C "$repo_dir" fetch --all + git -C "$repo_dir" pull +} + +# Function to build and install the repository +build_and_install() { + local repo_dir="$1" + local configure_args="$2" + local target_args="$3" + + echo "Building and installing: $repo_dir $configure_args $target_args" + + if [ ! -f "$repo_dir/gitcompile" ]; then + echo "Error: gitcompile not found in $repo_dir" >&2 + exit 1 + fi + + # if Makefile exists then we can just run make + if [ ! -f "$repo_dir/Makefile" ]; then + (cd "$repo_dir" && ./gitcompile $configure_args $target_args) || \ + { echo "configure failed in $repo_dir"; exit 1; } + else + (cd "$repo_dir" && make -j) || { echo "make failed in $repo_dir"; exit 1; } + fi + + (cd "$repo_dir" && make install) || { echo "make install failed in $repo_dir"; exit 1; } + + echo "Build and installation complete for $repo_dir" +} + +# Main script logic +mkdir -p "$BASE_DIR" + +for ((i = 0; i < ${#REPOS[@]}; i++)); do + echo "Counter: $i, Value: ${REPOS[i]}" + repo_url=${REPOS[i]} + + repo_name=$(basename "$repo_url" .git) # Extract repo name + repo_dir="$BASE_DIR/$repo_name" + + if [ ! -d "$repo_dir" ]; then + echo "Cloning repository: $repo_url" + git clone "$repo_url" "$repo_dir" || { echo "git clone failed for $repo_url"; exit 1; } + elif ! check_commit "$repo_dir" "${COMMIT_ID[i]}"; then + update_repo "$repo_dir" + else + echo "Repository $repo_name is up to date." + fi + + build_and_install "$repo_dir" "${CONFIGURE_ARGS[i]}" + +done + +echo "All repositories processed." diff --git a/scripts/build-tools.sh b/scripts/build-tools.sh index 496ca4c2d7cc..658c8279045a 100755 --- a/scripts/build-tools.sh +++ b/scripts/build-tools.sh @@ -16,7 +16,7 @@ Attention: the list below is _not_ exhaustive. To re-build _everything_ from scratch don't select any particular target; this will build the CMake's default target "ALL". -usage: $0 [-c|-f|-h|-l|-p|-t|-T] +usage: $0 [-c|-f|-h|-l|-p|-t|-T|-A] -h Display help -c Rebuild ctl/ @@ -25,6 +25,7 @@ usage: $0 [-c|-f|-h|-l|-p|-t|-T] -p Rebuild probes/ -T Rebuild topology/ (not topology/development/! Use ALL) -t Rebuild test/topology/ (or tools/test/topology/tplg-build.sh directly) + -A Clone and rebuild local ALSA lib and utils. -C No build, only CMake re-configuration. Shows CMake targets. EOFUSAGE @@ -101,6 +102,7 @@ main() DO_BUILD_ctl=false DO_BUILD_fuzzer=false + DO_BUILD_alsa=false DO_BUILD_logger=false DO_BUILD_probes=false DO_BUILD_tests=false @@ -109,7 +111,7 @@ main() # eval is a sometimes necessary evil # shellcheck disable=SC2034 - while getopts "cfhlptTC" OPTION; do + while getopts "cfhlptTCA" OPTION; do case "$OPTION" in c) DO_BUILD_ctl=true ;; f) DO_BUILD_fuzzer=true ;; @@ -118,6 +120,7 @@ main() t) DO_BUILD_tests=true ;; T) DO_BUILD_topologies=true ;; C) CMAKE_ONLY=true ;; + A) DO_BUILD_alsa=true ;; h) print_usage; exit 1;; *) print_usage; exit 1;; esac @@ -125,6 +128,10 @@ main() shift "$((OPTIND - 1))" reconfigure_build + if "$DO_BUILD_alsa"; then + $SOF_TOP/scripts/build-alsa-tools.sh + fi + if "$CMAKE_ONLY"; then print_build_info exit diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index 96034cf27359..a34f10fb1d57 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -25,10 +25,12 @@ if tty --quiet; then SOF_DOCKER_RUN="$SOF_DOCKER_RUN --tty" fi -# Not fatal, just a warning to allow other "creative" solutions. -# TODO: fix this with 'adduser' like in zephyr/docker-build.sh -test "$(id -n)" = 1001 || - >&2 printf "Warning: this script should be run as user ID 1001 to match the container\n" +# The --user option below can cause the command to run as a user who +# does not exist in the container. So far so good but in case something +# ever goes wrong try replacing --user with the newer +# scripts/sudo-cwd.sh script. +test "$(id -u)" = 1000 || + >&2 printf "Warning: this script should be run as user ID 1000 to match the container's account\n" set -x docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ @@ -40,6 +42,5 @@ docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ --env VERBOSE \ --env http_proxy="$http_proxy" \ --env https_proxy="$https_proxy" \ - --user "$(id -u)" \ $SOF_DOCKER_RUN \ - thesofproject/sof "$@" + thesofproject/sof:latest ./scripts/sudo-cwd.sh "$@" diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index c181d919feee..abdaaafc0337 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -89,7 +89,7 @@ RUN cd /home/sof && \ mkdir -p /home/sof/work/ && \ cd crosstool-ng && \ ./bootstrap && ./configure --prefix=`pwd` && make && make install && \ - for arch in byt hsw apl cnl imx imx8m imx8ulp rn; do \ + for arch in byt hsw apl cnl imx imx8m imx8ulp rn mt8186 mt8195; do \ cp config-${arch}-gcc10.2-gdb9 .config && \ # replace the build dist to save space sed -i 's#${CT_TOP_DIR}\/builds#\/home\/sof\/work#g' .config && \ @@ -107,12 +107,14 @@ ENV PATH="/home/sof/work/xtensa-rn-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-imx-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-imx8m-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-imx8ulp-elf/bin:${PATH}" +ENV PATH="/home/sof/work/xtensa-mt8186-elf/bin:${PATH}" +ENV PATH="/home/sof/work/xtensa-mt8195-elf/bin:${PATH}" ARG NEWLIB_REPO=https://github.com/jcmvbkbc/newlib-xtensa.git RUN cd /home/sof && \ git clone $CLONE_DEFAULTS --branch xtensa $NEWLIB_REPO && \ cd newlib-xtensa && \ - for arch in byt hsw apl cnl imx imx8m imx8ulp rn; do \ + for arch in byt hsw apl cnl imx imx8m imx8ulp rn mt8186 mt8195; do \ ./configure --target=xtensa-${arch}-elf \ --prefix=/home/sof/work/xtensa-root && \ make && \ diff --git a/scripts/sudo-cwd.sh b/scripts/sudo-cwd.sh new file mode 100755 index 000000000000..2823cf2f6c73 --- /dev/null +++ b/scripts/sudo-cwd.sh @@ -0,0 +1,77 @@ +#!/bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 Intel Corporation. All rights reserved. + +# This is a "brute force" solution to filesystem permission issues: +# +# If the current user does not own the current directory then this +# wrapper script switches to the user who does own the current directory +# before running the given command. + +# If no user owns the current directory, a user who does gets created +# first! + +# The main use case is to run this first thing inside a container to +# solve file ownership mismatches. + +# `docker run --user=$(id -un) ...` achieves something very similar +# without any code except the resulting user many not exist inside the +# container. Some commands may not like that. +# +# To understand more about the Docker problem solved here take a look at +# https://stackoverflow.com/questions/35291520/docker-and-userns-remap-how-to-manage-volume-permissions-to-share-data-betwee +# and many other similar questions. + +# TODO: replace sudo with gosu? + +set -e +set -x + +main() +{ + cwd_uid="$(stat --printf='%u' .)" + local current_uid; current_uid="$(id -u)" + if test "$current_uid" = "$cwd_uid"; then + exec "$@" + else + exec_as_cwd_uid "$@" + fi +} + +exec_as_cwd_uid() +{ + # If missing, add new user owning the current directory + local cwd_user; cwd_user="$(id "$cwd_uid")" || { + cwd_user='cwd_user' + + local cwd_guid; cwd_guid="$(stat --printf='%g' .)" + + getent group "$cwd_guid" || + sudo groupadd -g "$cwd_guid" 'cwd_group' + + sudo useradd -m -u "$cwd_uid" -g "$cwd_guid" "$cwd_user" + + local current_user; current_user="$(id -un)" + + # Copy sudo permissions just in case the build needs it + if test -e /etc/sudoers.d/"$current_user"; then + sudo sed -e "s/$current_user/$cwd_user/" /etc/sudoers.d/"$current_user" | + sudo tee -a /etc/sudoers.d/"$cwd_user" + sudo chmod --reference=/etc/sudoers.d/"$current_user" \ + /etc/sudoers.d/"$cwd_user" + fi + } + + # Double sudo to work around some funny restriction in + # zephyr-build:/etc/sudoers: 'user' can do anything but... only as + # root. + # Passing empty http[s]_proxy is OK + # shellcheck disable=SC2154 + sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" \ + http_proxy="$http_proxy" https_proxy="$https_proxy" \ + "$@" + + exit "$?" +} + +main "$@" diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index af268cc76889..4e99fcbb3442 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -23,6 +23,8 @@ west_top = pathlib.Path(SOF_TOP, "zephyrproject") default_rimage_key = pathlib.Path("modules", "audio", "sof", "keys", "otc_private_key.pem") +sof_version = None + if platform.system() == "Windows": xtensa_tools_version_postfix = "-win32" elif platform.system() == "Linux": @@ -144,7 +146,7 @@ def parse_args(): help="Initial Zephyr git ref for the -c option." " Can be a branch, tag, full SHA1 in a fork") parser.add_argument("-u", "--url", required=False, - default="https://github.com/zephyrproject-rtos/zephyr/", + default="https://github.com/thesofproject/zephyr/", help="URL to clone Zephyr from") mode_group = parser.add_mutually_exclusive_group() mode_group.add_argument("-p", "--west_path", required=False, type=pathlib.Path, @@ -197,7 +199,7 @@ def parse_args(): if args.zephyr_ref and not args.clone_mode: raise RuntimeError(f"Argument -z without -c makes no sense") if args.clone_mode and not args.zephyr_ref: - args.zephyr_ref = "main" # set default name for -z if -c specified + args.zephyr_ref = "sof/stable-v2.2" # set default name for -z if -c specified if args.west_path: # let the user provide an already existing zephyrproject/ anywhere west_top = pathlib.Path(args.west_path) @@ -323,6 +325,28 @@ def west_init_update(): # Do NOT "west update sof"!! execute_command(["west", "update", "zephyr", "hal_xtensa"], timeout=300, cwd=west_top) +def get_sof_version(abs_build_dir): + """[summary] Get version string major.minor.micro of SOF firmware + file. When building multiple platforms from the same SOF commit, + all platforms share the same version. So for the 1st platform, + generate the version string from sof_version.h and later platforms + will reuse it. + """ + global sof_version + if sof_version: + return sof_version + + versions = {} + with open(pathlib.Path(abs_build_dir, + "zephyr/include/generated/sof_versions.h"), encoding="utf8") as hfile: + for hline in hfile: + words = hline.split() + if words[0] == '#define': + versions[words[1]] = words[2] + sof_version = versions['SOF_MAJOR'] + '.' + versions['SOF_MINOR'] + '.' + \ + versions['SOF_MICRO'] + return sof_version + def build_platforms(): global west_top, SOF_TOP print(f"SOF_TOP={SOF_TOP}") @@ -447,6 +471,8 @@ def build_platforms(): signing_key = default_rimage_key sign_cmd += ["--tool-data", str(rimage_config), "--", "-k", str(signing_key)] + sign_cmd += ["-f", get_sof_version(abs_build_dir)] + if args.ipc == "IPC4": rimage_desc = pathlib.Path(SOF_TOP, "rimage", "config", platform_dict["IPC4_RIMAGE_DESC"]) sign_cmd += ["-c", str(rimage_desc)] diff --git a/smex/elf.c b/smex/elf.c index bd088716691d..0d0e976dcb8a 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -17,7 +17,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section = module->section; + Elf32_Shdr *section; size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -27,7 +27,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: can't seek to %s section header %d\n", module->elf_file, ret); - return ret; + return -errno; } /* allocate space for each section header */ @@ -41,7 +41,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (count != hdr->shnum) { fprintf(stderr, "error: failed to read %s section header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } /* read in strings */ @@ -56,7 +56,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: can't seek to %s stringss %d\n", module->elf_file, ret); - return ret; + return -errno; } count = fread(module->strings, 1, section[hdr->shstrndx].size, @@ -64,7 +64,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (count != section[hdr->shstrndx].size) { fprintf(stderr, "error: failed to read %s strings %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } module->bss_index = elf_find_section(module, ".bss"); @@ -128,7 +128,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) static int elf_read_programs(struct elf_module *module, bool verbose) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Phdr *prg = module->prg; + Elf32_Phdr *prg; size_t count; int i, ret; @@ -137,7 +137,7 @@ static int elf_read_programs(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: cant seek to %s program header %d\n", module->elf_file, ret); - return ret; + return -errno; } /* allocate space for programs */ @@ -151,7 +151,7 @@ static int elf_read_programs(struct elf_module *module, bool verbose) if (count != hdr->phnum) { fprintf(stderr, "error: failed to read %s program header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } /* check each program */ @@ -191,7 +191,7 @@ static int elf_read_hdr(struct elf_module *module, bool verbose) if (count != 1) { fprintf(stderr, "error: failed to read %s elf header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } if (!verbose) @@ -398,6 +398,7 @@ int elf_find_section(const struct elf_module *module, const char *name) ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to string section %d\n", ret); + ret = -errno; goto out; } @@ -405,13 +406,20 @@ int elf_find_section(const struct elf_module *module, const char *name) if (count != section->size) { fprintf(stderr, "error: can't read string section %d\n", -errno); - ret = -errno; + ret = count < 0 ? -errno : -ENODATA; goto out; } + buffer[section->size - 1] = '\0'; /* find section with name */ for (i = 0; i < hdr->shnum; i++) { s = &module->section[i]; + if (s->name >= section->size) { + fprintf(stderr, "error: invalid section name string index %d\n", s->name); + ret = -EINVAL; + goto out; + } + if (!strcmp(name, buffer + s->name)) { ret = i; goto out; @@ -431,8 +439,8 @@ int elf_read_section(const struct elf_module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { const Elf32_Shdr *section; - int section_index = -1; - int read; + int section_index; + int ret; section_index = elf_find_section(module, section_name); if (section_index < 0) { @@ -451,17 +459,25 @@ int elf_read_section(const struct elf_module *module, const char *section_name, return -ENOMEM; /* fill buffer with section content */ - fseek(module->fd, section->off, SEEK_SET); - read = fread(*dst_buff, 1, section->size, module->fd); - if (read != section->size) { - fprintf(stderr, - "error: can't read %s section %d\n", section_name, - -errno); - free(*dst_buff); - return -errno; + ret = fseek(module->fd, section->off, SEEK_SET); + if (ret) { + fprintf(stderr, "error: can't seek to %s section %d\n", section_name, -errno); + ret = -errno; + goto error; + } + + ret = fread(*dst_buff, 1, section->size, module->fd); + if (ret != section->size) { + fprintf(stderr, "error: can't read %s section %d\n", section_name, -errno); + ret = ret < 0 ? -errno : -ENODATA; + goto error; } return section->size; + +error: + free(*dst_buff); + return ret; } int elf_read_module(struct elf_module *module, const char *name, bool verbose) @@ -479,12 +495,16 @@ int elf_read_module(struct elf_module *module, const char *name, bool verbose) /* get file size */ ret = fseek(module->fd, 0, SEEK_END); - if (ret < 0) + if (ret < 0) { + ret = -errno; goto hdr_err; + } module->file_size = ftell(module->fd); ret = fseek(module->fd, 0, SEEK_SET); - if (ret < 0) + if (ret < 0) { + ret = -errno; goto hdr_err; + } /* read in elf header */ ret = elf_read_hdr(module, verbose); diff --git a/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config b/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config index 2ab50bab406c..86876f830f54 100644 --- a/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config +++ b/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config @@ -2,3 +2,5 @@ CONFIG_CAVS_LPS=y CONFIG_COMP_IIR=y CONFIG_COMP_CODEC_ADAPTER=y CONFIG_DTS_CODEC=y +CONFIG_SAMPLE_KEYPHRASE=n +CONFIG_MAXIM_DSM=y diff --git a/src/audio/copier.c b/src/audio/copier.c index 4e639bcc0d01..e23deb85247e 100644 --- a/src/audio/copier.c +++ b/src/audio/copier.c @@ -525,7 +525,7 @@ static void copier_free(struct comp_dev *dev) for (i = 0; i < cd->endpoint_num; i++) { cd->endpoint[i]->drv->ops.free(cd->endpoint[i]); - buffer_release(cd->endpoint_buffer[i]); + buffer_free(cd->endpoint_buffer[i]); } rfree(cd); @@ -1167,6 +1167,25 @@ static int copier_get_large_config(struct comp_dev *dev, uint32_t param_id, return -EINVAL; } +static int copier_get_attribute(struct comp_dev *dev, uint32_t type, void *value) +{ + struct copier_data *cd = comp_get_drvdata(dev); + + switch (type) { + case COMP_ATTR_COPY_DIR: + /* direction is set based on gateway type */ + if (!cd->endpoint_num) + return -EINVAL; + + *(uint32_t *)value = dev->direction; + break; + default: + return -EINVAL; + } + + return 0; +} + static const struct comp_driver comp_copier = { .uid = SOF_RT_UUID(copier_comp_uuid), .tctx = &copier_comp_tr, @@ -1180,6 +1199,7 @@ static const struct comp_driver comp_copier = { .params = copier_params, .prepare = copier_prepare, .reset = copier_reset, + .get_attribute = copier_get_attribute, }, }; diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index a9238d0cb9fa..bcb33908c61a 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -135,6 +135,16 @@ static int multiband_drc_init_coef(struct multiband_drc_comp_data *cd, int16_t n "multiband_drc_init_coef(), initializing %i-way crossover", config->num_bands); + /* Crossover: determine the split function */ + cd->crossover_split = crossover_find_split_func(config->num_bands); + if (!cd->crossover_split) { + comp_cl_err(&comp_multiband_drc, + "multiband_drc_init_coef(), No crossover_split for band num %i", + config->num_bands); + ret = -EINVAL; + goto err; + } + /* Crossover: collect the coef array and assign it to every channel */ crossover = config->crossover_coef; for (ch = 0; ch < nch; ch++) { @@ -456,7 +466,10 @@ static void multiband_drc_process(struct comp_dev *dev, struct comp_buffer *sour buffer_stream_invalidate(source, source_bytes); - cd->multiband_drc_func(dev, &source->stream, &sink->stream, frames); + if (cd->process_enabled) + cd->multiband_drc_func(dev, &source->stream, &sink->stream, frames); + else + multiband_drc_default_pass(dev, &source->stream, &sink->stream, frames); buffer_stream_writeback(sink, sink_bytes); @@ -530,35 +543,19 @@ static int multiband_drc_prepare(struct comp_dev *dev) comp_dbg(dev, "multiband_drc_prepare(), source_format=%d, sink_format=%d", cd->source_format, cd->source_format); cd->config = comp_get_data_blob(cd->model_handler, NULL, NULL); - if (cd->config && cd->process_enabled) { + if (cd->config) { ret = multiband_drc_setup(cd, sourceb->stream.channels, sourceb->stream.rate); if (ret < 0) { comp_err(dev, "multiband_drc_prepare() error: multiband_drc_setup failed."); goto err; } + } - cd->multiband_drc_func = multiband_drc_find_proc_func(cd->source_format); - if (!cd->multiband_drc_func) { - comp_err(dev, "multiband_drc_prepare(), No proc func"); - ret = -EINVAL; - goto err; - } - - cd->crossover_split = crossover_find_split_func(cd->config->num_bands); - if (!cd->crossover_split) { - comp_err(dev, "multiband_drc_prepare(), No crossover_split for band num %i", - cd->config->num_bands); - ret = -EINVAL; - goto err; - } - } else { - comp_info(dev, "multiband_drc_prepare(), DRC is in passthrough mode"); - cd->multiband_drc_func = multiband_drc_find_proc_func_pass(cd->source_format); - if (!cd->multiband_drc_func) { - comp_err(dev, "multiband_drc_prepare(), No proc func passthrough"); - ret = -EINVAL; - goto err; - } + cd->multiband_drc_func = multiband_drc_find_proc_func(cd->source_format); + if (!cd->multiband_drc_func) { + comp_err(dev, "multiband_drc_prepare(), No proc func"); + ret = -EINVAL; + goto err; } /* validate sink data format and period bytes */ diff --git a/src/audio/multiband_drc/multiband_drc_generic.c b/src/audio/multiband_drc/multiband_drc_generic.c index 57689a09d633..2aef2e2b2771 100644 --- a/src/audio/multiband_drc/multiband_drc_generic.c +++ b/src/audio/multiband_drc/multiband_drc_generic.c @@ -10,10 +10,10 @@ #include #include -static void multiband_drc_default_pass(const struct comp_dev *dev, - const struct audio_stream *source, - struct audio_stream *sink, - uint32_t frames) +void multiband_drc_default_pass(const struct comp_dev *dev, + const struct audio_stream *source, + struct audio_stream *sink, + uint32_t frames) { audio_stream_copy(source, 0, sink, 0, source->channels * frames); } diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 68c07b462445..c0dbe6ea0785 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -325,6 +325,17 @@ static int pipeline_comp_reset(struct comp_dev *current, } } + /* two cases for a component still being active here: + * 1. trigger function failed to handle stop event + * 2. trigger functon skipped due to error of other component's trigger function + */ + if (current->state == COMP_STATE_ACTIVE) { + pipe_warn(current->pipeline, "pipeline_comp_reset(): component is in active state, try to stop it"); + err = comp_trigger(current, COMP_TRIGGER_STOP); + if (err) + pipe_err(current->pipeline, "pipeline_comp_reset(): failed to recover"); + } + err = comp_reset(current); if (err < 0 || err == PPL_STATUS_PATH_STOP) return err; diff --git a/src/drivers/intel/dmic/dmic_nhlt.c b/src/drivers/intel/dmic/dmic_nhlt.c index a4d2319bd46a..7b533696a301 100644 --- a/src/drivers/intel/dmic/dmic_nhlt.c +++ b/src/drivers/intel/dmic/dmic_nhlt.c @@ -318,7 +318,7 @@ int dmic_set_config_nhlt(struct dai *dai, void *spec_config) * configuration */ bfth = OUTCONTROL0_BFTH_GET(val); - dai->plat_data.fifo->depth = 1 << bfth; + dai->plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth = 1 << bfth; /* Get PDMx registers */ pdm_ctrl_mask = ((struct nhlt_pdm_ctrl_mask *)p)->pdm_ctrl_mask; diff --git a/src/drivers/intel/hda/hda-dma.c b/src/drivers/intel/hda/hda-dma.c index 01f82055ac18..76be5c8050cc 100644 --- a/src/drivers/intel/hda/hda-dma.c +++ b/src/drivers/intel/hda/hda-dma.c @@ -945,7 +945,7 @@ static int hda_dma_link_check_xrun(struct dma_chan_data *chan) uint32_t dgcs = dma_chan_reg_read(chan, DGCS); if (chan->direction == DMA_DIR_MEM_TO_DEV && dgcs & DGCS_BUR) { - tr_err(&hdma_tr, "hda_dma_link_check_xrun(): underrun detected"); + tr_warn(&hdma_tr, "hda_dma_link_check_xrun(): underrun detected"); dma_chan_reg_update_bits(chan, DGCS, DGCS_BUR, DGCS_BUR); } else if (chan->direction == DMA_DIR_DEV_TO_MEM && dgcs & DGCS_BOR) { tr_err(&hdma_tr, "hda_dma_link_check_xrun(): overrun detected"); diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index cc30cfba7908..e2fac23c3ad6 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -41,63 +41,107 @@ DECLARE_SOF_UUID("ssp-dai", ssp_uuid, 0x31458125, 0x95c4, 0x4085, DECLARE_TR_CTX(ssp_tr, SOF_UUID(ssp_uuid), LOG_LEVEL_INFO); -/* empty SSP transmit FIFO */ -static void ssp_empty_tx_fifo(struct dai *dai) +static void ssp_wait_tx_dma_idle(struct dai *dai) { - int ret; - uint32_t sssr; + struct ssp_pdata *ssp = dai_get_drvdata(dai); + uint64_t sample_ticks = clock_ticks_per_sample(PLATFORM_DEFAULT_CLOCK, + ssp->params.fsync_rate); + uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; + uint32_t entries[2]; - /* - * SSSR_TNF is cleared when TX FIFO is empty or full, - * so wait for set TNF then for TFL zero - order matter. - */ - ret = poll_for_register_delay(dai_base(dai) + SSSR, SSSR_TNF, SSSR_TNF, - SSP_MAX_SEND_TIME_PER_SAMPLE); - ret |= poll_for_register_delay(dai_base(dai) + SSCR3, SSCR3_TFL_MASK, 0, - SSP_MAX_SEND_TIME_PER_SAMPLE * - (SSP_FIFO_DEPTH - 1) / 2); + entries[0] = SSCR3_TFL_VAL(ssp_read(dai, SSCR3)); + + /* Unlikely: the TX FIFO is empty */ + if (!entries[0] && (ssp_read(dai, SSSR) & SSSR_TNF)) + return; + + while (retry--) { + /* Wait one sample time */ + wait_delay(sample_ticks); - if (ret) - dai_warn(dai, "ssp_empty_tx_fifo() warning: timeout"); + entries[1] = SSCR3_TFL_VAL(ssp_read(dai, SSCR3)); + + /* + * If the TX FIFO has less entries or equal entries after one + * sample time then DMA is not running to fill the FIFO and we + * can break out from the loop + */ + if (entries[0] >= entries[1]) + break; + } + + /* Just in case clear the underflow status */ + ssp_update_bits(dai, SSSR, SSSR_TUR, SSSR_TUR); +} + +static void ssp_empty_rx_fifo_on_start(struct dai *dai) +{ + uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; + uint32_t i, sssr; sssr = ssp_read(dai, SSSR); - /* clear interrupt */ - if (sssr & SSSR_TUR) - ssp_write(dai, SSSR, sssr); + if (sssr & SSSR_ROR) { + /* The RX FIFO is in overflow condition, empty it */ + for (i = 0; i < SSP_FIFO_DEPTH; i++) + ssp_read(dai, SSDR); + + /* Clear the overflow status */ + ssp_update_bits(dai, SSSR, SSSR_ROR, SSSR_ROR); + /* Re-read the SSSR register */ + sssr = ssp_read(dai, SSSR); + } + + while ((sssr & SSSR_RNE) && retry--) { + uint32_t entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); + + /* Empty the RX FIFO (the DMA is not running at this point) */ + for (i = 0; i < entries + 1; i++) + ssp_read(dai, SSDR); + + sssr = ssp_read(dai, SSSR); + } } -/* empty SSP receive FIFO */ -static void ssp_empty_rx_fifo(struct dai *dai) +static void ssp_empty_rx_fifo_on_stop(struct dai *dai) { struct ssp_pdata *ssp = dai_get_drvdata(dai); uint64_t sample_ticks = clock_ticks_per_sample(PLATFORM_DEFAULT_CLOCK, ssp->params.fsync_rate); uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; - uint32_t entries; - uint32_t i; + uint32_t entries[2]; + uint32_t i, sssr; - /* - * To make sure all the RX FIFO entries are read out for the flushing, - * we need to wait a minimal SSP port delay after entries are all read, - * and then re-check to see if there is any subsequent entries written - * to the FIFO. This will help to make sure there is no sample mismatched - * issue for the next run with the SSP RX. - */ - while ((ssp_read(dai, SSSR) & SSSR_RNE) && retry--) { - entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); - dai_dbg(dai, "ssp_empty_rx_fifo(), before flushing, entries %d", entries); - for (i = 0; i < entries + 1; i++) - /* read to try empty fifo */ - ssp_read(dai, SSDR); + sssr = ssp_read(dai, SSSR); + entries[0] = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); - /* wait to get valid fifo status and re-check */ + while ((sssr & SSSR_RNE) && retry--) { + /* Wait one sample time */ wait_delay(sample_ticks); - entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); - dai_dbg(dai, "ssp_empty_rx_fifo(), after flushing, entries %d", entries); + + entries[1] = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); + sssr = ssp_read(dai, SSSR); + + if (entries[0] > entries[1]) { + /* + * The DMA is reading the FIFO, check the status in the + * next loop + */ + entries[0] = entries[1]; + } else if (!(sssr & SSSR_RFS)) { + /* + * The DMA request is not asserted, read the FIFO + * directly, otherwise let the next loop iteration to + * check the status + */ + for (i = 0; i < entries[1] + 1; i++) + ssp_read(dai, SSDR); + } + + sssr = ssp_read(dai, SSSR); } - /* clear interrupt */ + /* Just in case clear the overflow status */ ssp_update_bits(dai, SSSR, SSSR_ROR, SSSR_ROR); } @@ -105,13 +149,15 @@ static int ssp_mclk_prepare_enable(struct dai *dai) { struct ssp_pdata *ssp = dai_get_drvdata(dai); struct sof_ipc_dai_config *config = &ssp->config; - int ret; + int ret = 0; if (ssp->clk_active & SSP_CLK_MCLK_ACTIVE) return 0; /* MCLK config */ - ret = mn_set_mclk(config->ssp.mclk_id, config->ssp.mclk_rate); + if (ssp->clk_active & SSP_CLK_MCLK_IS_NEEDED) + ret = mn_set_mclk(config->ssp.mclk_id, config->ssp.mclk_rate); + if (ret < 0) dai_err(dai, "ssp_mclk_prepare_enable(): invalid mclk_rate = %d for mclk_id = %d", config->ssp.mclk_rate, config->ssp.mclk_id); @@ -128,7 +174,8 @@ static void ssp_mclk_disable_unprepare(struct dai *dai) if (!(ssp->clk_active & SSP_CLK_MCLK_ACTIVE)) return; - mn_release_mclk(ssp->config.ssp.mclk_id); + if (ssp->clk_active & SSP_CLK_MCLK_IS_NEEDED) + mn_release_mclk(ssp->config.ssp.mclk_id); ssp->clk_active &= ~SSP_CLK_MCLK_ACTIVE; } @@ -142,6 +189,9 @@ static int ssp_bclk_prepare_enable(struct dai *dai) bool need_ecs = false; int ret = 0; + if (!(ssp->clk_active & SSP_CLK_BCLK_IS_NEEDED)) + goto out; + if (ssp->clk_active & SSP_CLK_BCLK_ACTIVE) return 0; @@ -202,7 +252,8 @@ static void ssp_bclk_disable_unprepare(struct dai *dai) if (!(ssp->clk_active & SSP_CLK_BCLK_ACTIVE)) return; #if CONFIG_INTEL_MN - mn_release_bclk(dai->index); + if (ssp->clk_active & SSP_CLK_BCLK_IS_NEEDED) + mn_release_bclk(dai->index); #endif ssp->clk_active &= ~SSP_CLK_BCLK_ACTIVE; } @@ -307,16 +358,19 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co sscr1 |= SSCR1_SCLKDIR | SSCR1_SFRMDIR; break; case SOF_DAI_FMT_CBC_CFC: + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED | SSP_CLK_BCLK_IS_NEEDED; sscr1 |= SSCR1_SCFR; cfs = true; break; case SOF_DAI_FMT_CBP_CFC: + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED; sscr1 |= SSCR1_SCLKDIR; /* FIXME: this mode has not been tested */ cfs = true; break; case SOF_DAI_FMT_CBC_CFP: + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED | SSP_CLK_BCLK_IS_NEEDED; sscr1 |= SSCR1_SCFR | SSCR1_SFRMDIR; /* FIXME: this mode has not been tested */ break; @@ -699,6 +753,17 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE; clk: + /* MCLK always-on: turn on mclk and never turn it off */ + if (ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON) { + ret = ssp_mclk_prepare_enable(dai); + if (ret < 0) + goto out; + + ssp->clk_active |= SSP_CLK_MCLK_AON_REQ; + + dai_info(dai, "ssp_set_config(): enable MCLK for SSP%d", dai->index); + } + switch (config->flags & SOF_DAI_CONFIG_FLAGS_CMD_MASK) { case SOF_DAI_CONFIG_FLAGS_HW_PARAMS: if (ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES) { @@ -725,12 +790,6 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co ssp->clk_active |= SSP_CLK_BCLK_ES_REQ; if (enable_sse) { - - /* enable TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - SSCR1_TSRE | SSCR1_RSRE); - /* enable port */ ssp_update_bits(dai, SSCR0, SSCR0_SSE, SSCR0_SSE); @@ -754,11 +813,6 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co dai_info(dai, "ssp_set_config(): hw_free stage: releasing BCLK clocks for SSP%d...", dai->index); if (ssp->clk_active & SSP_CLK_BCLK_ACTIVE) { - /* clear TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - 0); - ssp_update_bits(dai, SSCR0, SSCR0_SSE, 0); dai_info(dai, "ssp_set_config(): SSE clear for SSP%d", dai->index); } @@ -787,18 +841,19 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co { struct ipc4_ssp_configuration_blob *blob = spec_config; struct ssp_pdata *ssp = dai_get_drvdata(dai); - uint32_t ssc0, sstsa, ssrsa; + uint32_t ssc0, sstsa, ssrsa, sscr1; /* set config only once for playback or capture */ if (dai->sref > 1) return 0; ssc0 = blob->i2s_driver_config.i2s_config.ssc0; - sstsa = blob->i2s_driver_config.i2s_config.sstsa; - ssrsa = blob->i2s_driver_config.i2s_config.ssrsa; + sstsa = SSTSA_GET(blob->i2s_driver_config.i2s_config.sstsa); + ssrsa = SSRSA_GET(blob->i2s_driver_config.i2s_config.ssrsa); + sscr1 = blob->i2s_driver_config.i2s_config.ssc1 & ~(SSCR1_RSRE | SSCR1_TSRE); ssp_write(dai, SSCR0, ssc0); - ssp_write(dai, SSCR1, blob->i2s_driver_config.i2s_config.ssc1); + ssp_write(dai, SSCR1, sscr1); ssp_write(dai, SSCR2, blob->i2s_driver_config.i2s_config.ssc2); ssp_write(dai, SSCR3, blob->i2s_driver_config.i2s_config.ssc3); ssp_write(dai, SSPSP, blob->i2s_driver_config.i2s_config.sspsp); @@ -809,8 +864,7 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co ssp_write(dai, SSRSA, ssrsa); dai_info(dai, "ssp_set_config(), sscr0 = 0x%08x, sscr1 = 0x%08x, ssto = 0x%08x, sspsp = 0x%0x", - ssc0, blob->i2s_driver_config.i2s_config.ssc1, - blob->i2s_driver_config.i2s_config.sscto, + ssc0, sscr1, blob->i2s_driver_config.i2s_config.sscto, blob->i2s_driver_config.i2s_config.sspsp); dai_info(dai, "ssp_set_config(), sscr2 = 0x%08x, sspsp2 = 0x%08x, sscr3 = 0x%08x", blob->i2s_driver_config.i2s_config.ssc2, blob->i2s_driver_config.i2s_config.sspsp2, @@ -831,15 +885,19 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_PREPARE; ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE; - /* ssp blob is set by pcm_hw_params for ipc4 stream, so enable - * mclk and bclk at this time. + /* ssp blob is set by pcm_hw_params for ipc4 stream. + * Configure MCLK/BCLK only if SSP is the clock provider */ - mn_set_mclk_blob(blob->i2s_driver_config.mclk_config.mdivc, - blob->i2s_driver_config.mclk_config.mdivr); - ssp->clk_active |= SSP_CLK_MCLK_ES_REQ; + if (!(blob->i2s_driver_config.i2s_config.ssc1 & (SSCR1_SCLKDIR | SSCR1_SFRMDIR))) { + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED; + if (!(blob->i2s_driver_config.i2s_config.ssc1 & SSCR1_SCLKDIR)) + ssp->clk_active |= SSP_CLK_BCLK_IS_NEEDED; - /* enable TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, SSCR1_TSRE | SSCR1_RSRE, SSCR1_TSRE | SSCR1_RSRE); + mn_set_mclk_blob(blob->i2s_driver_config.mclk_config.mdivc, + blob->i2s_driver_config.mclk_config.mdivr); + } + + ssp->clk_active |= SSP_CLK_MCLK_ES_REQ; /* enable port */ ssp_update_bits(dai, SSCR0, SSCR0_SSE, SSCR0_SSE); @@ -873,7 +931,8 @@ static int ssp_pre_start(struct dai *dai) * We will test if mclk/bclk is configured in * ssp_mclk/bclk_prepare_enable/disable functions */ - if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ)) { + if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ) && + !(ssp->clk_active & SSP_CLK_MCLK_AON_REQ)) { /* MCLK config */ ret = ssp_mclk_prepare_enable(dai); if (ret < 0) @@ -903,7 +962,8 @@ static void ssp_post_stop(struct dai *dai) dai->index); ssp_bclk_disable_unprepare(dai); } - if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ)) { + if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ) && + !(ssp->clk_active & SSP_CLK_MCLK_AON_REQ)) { dai_info(dai, "ssp_post_stop releasing MCLK clocks for SSP%d...", dai->index); ssp_mclk_disable_unprepare(dai); @@ -950,15 +1010,14 @@ static void ssp_early_start(struct dai *dai, int direction) key = k_spin_lock(&dai->lock); + /* RX fifo must be cleared before start */ + if (direction == DAI_DIR_CAPTURE) + ssp_empty_rx_fifo_on_start(dai); + /* request mclk/bclk */ ssp_pre_start(dai); if (!(ssp->clk_active & SSP_CLK_BCLK_ES_REQ)) { - /* enable TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - SSCR1_TSRE | SSCR1_RSRE); - /* enable port */ ssp_update_bits(dai, SSCR0, SSCR0_SSE, SSCR0_SSE); dai_info(dai, "ssp_early_start(): SSE set for SSP%d", dai->index); @@ -979,10 +1038,14 @@ static void ssp_start(struct dai *dai, int direction) dai_info(dai, "ssp_start()"); /* enable DMA */ - if (direction == DAI_DIR_PLAYBACK) + if (direction == DAI_DIR_PLAYBACK) { + ssp_update_bits(dai, SSSR, SSSR_TUR, SSSR_TUR); + ssp_update_bits(dai, SSCR1, SSCR1_TSRE, SSCR1_TSRE); ssp_update_bits(dai, SSTSA, SSTSA_TXEN, SSTSA_TXEN); - else + } else { + ssp_update_bits(dai, SSCR1, SSCR1_RSRE, SSCR1_RSRE); ssp_update_bits(dai, SSRSA, SSRSA_RXEN, SSRSA_RXEN); + } ssp->state[direction] = COMP_STATE_ACTIVE; @@ -1029,7 +1092,8 @@ static void ssp_stop(struct dai *dai, int direction) if (direction == DAI_DIR_CAPTURE && ssp->state[SOF_IPC_STREAM_CAPTURE] != COMP_STATE_PREPARE) { ssp_update_bits(dai, SSRSA, SSRSA_RXEN, 0); - ssp_empty_rx_fifo(dai); + ssp_update_bits(dai, SSCR1, SSCR1_RSRE, 0); + ssp_empty_rx_fifo_on_stop(dai); ssp->state[SOF_IPC_STREAM_CAPTURE] = COMP_STATE_PREPARE; dai_info(dai, "ssp_stop(), RX stop"); } @@ -1037,7 +1101,8 @@ static void ssp_stop(struct dai *dai, int direction) /* stop Tx if needed */ if (direction == DAI_DIR_PLAYBACK && ssp->state[SOF_IPC_STREAM_PLAYBACK] != COMP_STATE_PREPARE) { - ssp_empty_tx_fifo(dai); + ssp_update_bits(dai, SSCR1, SSCR1_TSRE, 0); + ssp_wait_tx_dma_idle(dai); ssp_update_bits(dai, SSTSA, SSTSA_TXEN, 0); ssp->state[SOF_IPC_STREAM_PLAYBACK] = COMP_STATE_PREPARE; dai_info(dai, "ssp_stop(), TX stop"); @@ -1045,16 +1110,10 @@ static void ssp_stop(struct dai *dai, int direction) /* disable SSP port if no users */ if (ssp->state[SOF_IPC_STREAM_CAPTURE] == COMP_STATE_PREPARE && - ssp->state[SOF_IPC_STREAM_PLAYBACK] == COMP_STATE_PREPARE) { - if (!(ssp->clk_active & SSP_CLK_BCLK_ES_REQ)) { - /* clear TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - 0); - - ssp_update_bits(dai, SSCR0, SSCR0_SSE, 0); - dai_info(dai, "ssp_stop(): SSE clear SSP%d", dai->index); - } + ssp->state[SOF_IPC_STREAM_PLAYBACK] == COMP_STATE_PREPARE && + !(ssp->clk_active & SSP_CLK_BCLK_ES_REQ)) { + ssp_update_bits(dai, SSCR0, SSCR0_SSE, 0); + dai_info(dai, "ssp_stop(): SSE clear for SSP%d", dai->index); } ssp_post_stop(dai); @@ -1131,16 +1190,23 @@ static int ssp_probe(struct dai *dai) /* Disable dynamic clock gating before touching any register */ pm_runtime_get_sync(SSP_CLK, dai->index); - ssp_empty_rx_fifo(dai); - return 0; } static int ssp_remove(struct dai *dai) { + struct ssp_pdata *ssp = dai_get_drvdata(dai); + pm_runtime_put_sync(SSP_CLK, dai->index); - ssp_mclk_disable_unprepare(dai); + /* + * dai comp will be freed during HW_FREE stage if dynamic pipeline is + * enabled; need to check the MCLK_AON quirk to see if we need to keep + * MCLK on even when dai comp is going to be freed + */ + if (!(ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON)) + ssp_mclk_disable_unprepare(dai); + ssp_bclk_disable_unprepare(dai); /* Disable SSP power */ diff --git a/src/include/ipc/dai-intel.h b/src/include/ipc/dai-intel.h index 41e39a47db1f..4545a2b40282 100644 --- a/src/include/ipc/dai-intel.h +++ b/src/include/ipc/dai-intel.h @@ -60,6 +60,8 @@ #define SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES BIT(6) /* bclk early start */ #define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES BIT(7) +/* mclk always on */ +#define SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON BIT(8) /* DMIC max. four controllers for eight microphone channels */ #define SOF_DAI_INTEL_DMIC_NUM_CTRL 4 diff --git a/src/include/kernel/abi.h b/src/include/kernel/abi.h index f59fa1f2bc0a..b14618749a5e 100644 --- a/src/include/kernel/abi.h +++ b/src/include/kernel/abi.h @@ -29,8 +29,8 @@ /** \brief SOF ABI version major, minor and patch numbers */ #define SOF_ABI_MAJOR 3 -#define SOF_ABI_MINOR 22 -#define SOF_ABI_PATCH 1 +#define SOF_ABI_MINOR 23 +#define SOF_ABI_PATCH 0 /** \brief SOF ABI version number. Format within 32bit word is MMmmmppp */ #define SOF_ABI_MAJOR_SHIFT 24 diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 24a8cb826fc6..a8b922be0a67 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -844,8 +844,8 @@ void comp_get_copy_limits_with_lock(struct comp_buffer *source, comp_get_copy_limits(source_c, sink_c, cl); - buffer_release(source_c); buffer_release(sink_c); + buffer_release(source_c); } /** @@ -862,13 +862,15 @@ void comp_get_copy_limits_with_lock_frame_aligned(struct comp_buffer *source, struct comp_buffer *sink, struct comp_copy_limits *cl) { - source = buffer_acquire(source); - sink = buffer_acquire(sink); + struct comp_buffer __sparse_cache *source_c, *sink_c; + + source_c = buffer_acquire(source); + sink_c = buffer_acquire(sink); - comp_get_copy_limits_frame_aligned(source, sink, cl); + comp_get_copy_limits_frame_aligned(source_c, sink_c, cl); - buffer_release(source); - buffer_release(sink); + buffer_release(sink_c); + buffer_release(source_c); } /** diff --git a/src/include/sof/audio/multiband_drc/multiband_drc.h b/src/include/sof/audio/multiband_drc/multiband_drc.h index ae98aa785b14..b08a18b54f26 100644 --- a/src/include/sof/audio/multiband_drc/multiband_drc.h +++ b/src/include/sof/audio/multiband_drc/multiband_drc.h @@ -52,6 +52,11 @@ extern const struct multiband_drc_proc_fnmap multiband_drc_proc_fnmap[]; extern const struct multiband_drc_proc_fnmap multiband_drc_proc_fnmap_pass[]; extern const size_t multiband_drc_proc_fncount; +void multiband_drc_default_pass(const struct comp_dev *dev, + const struct audio_stream *source, + struct audio_stream *sink, + uint32_t frames); + /** * \brief Returns Multiband DRC processing function. */ diff --git a/src/include/sof/drivers/ssp.h b/src/include/sof/drivers/ssp.h index 5d6e8988808a..0ab1e9523c51 100644 --- a/src/include/sof/drivers/ssp.h +++ b/src/include/sof/drivers/ssp.h @@ -228,10 +228,13 @@ extern const struct dai_driver ssp_driver; #define ssp_irq(ssp) \ ssp->plat_data.irq -#define SSP_CLK_MCLK_ES_REQ BIT(0) -#define SSP_CLK_MCLK_ACTIVE BIT(1) -#define SSP_CLK_BCLK_ES_REQ BIT(2) -#define SSP_CLK_BCLK_ACTIVE BIT(3) +#define SSP_CLK_MCLK_IS_NEEDED BIT(1) +#define SSP_CLK_MCLK_ES_REQ BIT(2) +#define SSP_CLK_MCLK_ACTIVE BIT(3) +#define SSP_CLK_MCLK_AON_REQ BIT(4) +#define SSP_CLK_BCLK_IS_NEEDED BIT(5) +#define SSP_CLK_BCLK_ES_REQ BIT(6) +#define SSP_CLK_BCLK_ACTIVE BIT(7) /* SSP private data */ struct ssp_pdata { diff --git a/src/include/sof/ipc/topology.h b/src/include/sof/ipc/topology.h index c78b92302eff..3ac58c8ac11a 100644 --- a/src/include/sof/ipc/topology.h +++ b/src/include/sof/ipc/topology.h @@ -52,7 +52,7 @@ int ipc4_add_comp_dev(struct comp_dev *dev); const struct comp_driver *ipc4_get_drv(uint8_t *uuid); int ipc4_create_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma); int ipc4_trigger_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma); -bool ipc4_comp_is_gateway(struct comp_dev *dev); +bool ipc4_comp_has_dir(struct comp_dev *dev); #else #error "No or invalid IPC MAJOR version selected." #endif diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index d66544c8b888..cf3a13f0c217 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -422,7 +422,7 @@ static int update_dir_to_pipeline_component(uint32_t *ppl_id, uint32_t count) * since one of them is for playback and the other one * is for capture */ - if (ipc4_comp_is_gateway(icd->cd)) + if (ipc4_comp_has_dir(icd->cd)) break; icd->cd->direction = dai->direction; @@ -999,11 +999,19 @@ void ipc_cmd(struct ipc_cmd_hdr *_hdr) if (err) tr_err(&ipc_tr, "ipc4: %d failed err %d", target, err); - /* FW sends a ipc message to host if request bit is set*/ + /* FW sends an ipc message to host if request bit is clear */ if (in->primary.r.rsp == SOF_IPC4_MESSAGE_DIR_MSG_REQUEST) { char *data = ipc_get()->comp_data; struct ipc4_message_reply reply; + /* Do not send reply for SET_DX if we are going to enter D3 + * The reply is going to be sent as part of the power down + * sequence + */ + if (in->primary.r.type == SOF_IPC4_MOD_SET_DX && + ipc_get()->pm_prepare_D3) + return; + if (ipc_wait_for_compound_msg() != 0) { tr_err(&ipc_tr, "ipc4: failed to send delayed reply"); err = IPC4_FAILURE; diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 542ff69c92d9..cbc36523d760 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -780,17 +780,13 @@ const struct comp_driver *ipc4_get_drv(uint8_t *uuid) return drv; } -bool ipc4_comp_is_gateway(struct comp_dev *dev) +bool ipc4_comp_has_dir(struct comp_dev *dev) { - const struct sof_uuid copier = {0x9ba00c83, 0xca12, 0x4a83, {0x94, 0x3c, - 0x1f, 0xa2, 0xe8, 0x2f, 0x9d, 0xda}}; - - /* check whether it is a copier module with copier uuid */ - if (!memcmp(dev->drv->uid, &copier, UUID_SIZE)) { - /* dai or host, not a module for copy */ - if (list_is_empty(&dev->bsink_list) || list_is_empty(&dev->bsource_list)) - return true; - } + int dir = -EINVAL; + + comp_get_attribute(dev, COMP_ATTR_COPY_DIR, &dir); + if (dir == SOF_IPC_STREAM_PLAYBACK || dir == SOF_IPC_STREAM_CAPTURE) + return true; return false; } diff --git a/src/platform/intel/cavs/lib/dai.c b/src/platform/intel/cavs/lib/dai.c index 9791e48b060a..0cf77c323f5b 100644 --- a/src/platform/intel/cavs/lib/dai.c +++ b/src/platform/intel/cavs/lib/dai.c @@ -161,68 +161,74 @@ int dai_init(struct sof *sof) } #if CONFIG_INTEL_SSP - dai = ssp->dai_array; - - /* init ssp */ - for (i = 0; i < ssp->num_dais; i++) { - dai[i].index = i; - dai[i].drv = &ssp_driver; - dai[i].plat_data.base = SSP_BASE(i); - dai[i].plat_data.irq = IRQ_EXT_SSPx_LVL5(i); - dai[i].plat_data.irq_name = irq_name_level5; - dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].offset = - SSP_BASE(i) + SSDR; - dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].handshake = - DMA_HANDSHAKE_SSP0_TX + 2 * i; - dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].offset = - SSP_BASE(i) + SSDR; - dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].handshake = - DMA_HANDSHAKE_SSP0_RX + 2 * i; - /* initialize spin locks early to enable ref counting */ - k_spinlock_init(&dai[i].lock); + if (ssp) { + dai = ssp->dai_array; + + /* init ssp */ + for (i = 0; i < ssp->num_dais; i++) { + dai[i].index = i; + dai[i].drv = &ssp_driver; + dai[i].plat_data.base = SSP_BASE(i); + dai[i].plat_data.irq = IRQ_EXT_SSPx_LVL5(i); + dai[i].plat_data.irq_name = irq_name_level5; + dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].offset = + SSP_BASE(i) + SSDR; + dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].handshake = + DMA_HANDSHAKE_SSP0_TX + 2 * i; + dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].offset = + SSP_BASE(i) + SSDR; + dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].handshake = + DMA_HANDSHAKE_SSP0_RX + 2 * i; + /* initialize spin locks early to enable ref counting */ + k_spinlock_init(&dai[i].lock); + } } - #endif #if CONFIG_INTEL_MCLK mn_init(sof); #endif - dai = hda->dai_array; + if (hda) { + dai = hda->dai_array; - /* init hd/a, note that size depends on the platform caps */ - for (i = 0; i < hda->num_dais; i++) { - dai[i].index = i; - dai[i].drv = &hda_driver; - k_spinlock_init(&dai[i].lock); + /* init hd/a, note that size depends on the platform caps */ + for (i = 0; i < hda->num_dais; i++) { + dai[i].index = i; + dai[i].drv = &hda_driver; + k_spinlock_init(&dai[i].lock); + } } #if (CONFIG_INTEL_DMIC) - dai = dmic->dai_array; + if (dmic) { + dai = dmic->dai_array; - /* init dmic */ - for (i = 0; i < dmic->num_dais; i++) - k_spinlock_init(&dai[i].lock); + /* init dmic */ + for (i = 0; i < dmic->num_dais; i++) + k_spinlock_init(&dai[i].lock); + } #endif #if CONFIG_INTEL_ALH - dai = alh->dai_array; - - for (i = 0; i < alh->num_dais; i++) { - dai[i].index = (i / DAI_NUM_ALH_BI_DIR_LINKS_GROUP) << 8 | - (i % DAI_NUM_ALH_BI_DIR_LINKS_GROUP); - dai[i].drv = &alh_driver; - - /* set burst length to align with DMAT value in the - * Audio Link Hub. - */ - dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].depth = - ALH_GPDMA_BURST_LENGTH; - dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth = - ALH_GPDMA_BURST_LENGTH; - k_spinlock_init(&dai[i].lock); + if (alh) { + dai = alh->dai_array; + + for (i = 0; i < alh->num_dais; i++) { + dai[i].index = (i / DAI_NUM_ALH_BI_DIR_LINKS_GROUP) << 8 | + (i % DAI_NUM_ALH_BI_DIR_LINKS_GROUP); + dai[i].drv = &alh_driver; + + /* set burst length to align with DMAT value in the + * Audio Link Hub. + */ + dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].depth = + ALH_GPDMA_BURST_LENGTH; + dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth = + ALH_GPDMA_BURST_LENGTH; + k_spinlock_init(&dai[i].lock); + } } - #endif return 0; diff --git a/src/platform/intel/cavs/lib/power_down.S b/src/platform/intel/cavs/lib/power_down.S index 9422e8770de0..8bdd01e842fc 100644 --- a/src/platform/intel/cavs/lib/power_down.S +++ b/src/platform/intel/cavs/lib/power_down.S @@ -26,8 +26,15 @@ .align 64 power_down_literals: .literal_position +#if CONFIG_IPC_MAJOR_3 ipc_flag: .word IPC_DIPCTDR_BUSY +#elif CONFIG_IPC_MAJOR_4 +set_dx_reply: + /* BUSY (bit31), MODULE_MSG (bit30), reply (bit29), SET_DX (bit 24-28: 7) */ + .word 0xE7000000 + +#endif sram_dis_loop_cnt: .word 4096 @@ -137,6 +144,7 @@ _PD_DISABLE_HPSRAM: m_cavs_set_hpldo_state temp_reg0, temp_reg1, temp_reg2 _PD_SEND_IPC: +#if CONFIG_IPC_MAJOR_3 /* Send IPC to host informing of PD completion - Clear BUSY * bit by writing IPC_DIPCTDR_BUSY to IPC_DIPCTDR * and writing IPC_DIPCTDA_DONE to IPC_DIPCTDA @@ -150,6 +158,17 @@ _PD_SEND_IPC: l32i temp_reg1, host_base, IPC_DIPCTDA or temp_reg1, temp_reg1, temp_reg2 s32i temp_reg1, host_base, IPC_DIPCTDA +#elif CONFIG_IPC_MAJOR_4 +/* Send IPC reply for SET_DX message */ + movi temp_reg1, 0 + s32i temp_reg1, host_base, IPC_DIPCIDD + + movi temp_reg1, set_dx_reply + l32i temp_reg1, temp_reg1, 0 + s32i temp_reg1, host_base, IPC_DIPCIDR +#else +#error "Support for this IPC version is not implemented" +#endif _PD_SLEEP: /* effecfively executes: diff --git a/src/platform/tigerlake/include/platform/platform.h b/src/platform/tigerlake/include/platform/platform.h index 75848cf282f6..169f69833237 100644 --- a/src/platform/tigerlake/include/platform/platform.h +++ b/src/platform/tigerlake/include/platform/platform.h @@ -81,7 +81,7 @@ struct timer; #define PLATFORM_FORCE_L1_EXIT_TIME 985 /* the SSP port fifo depth */ -#define SSP_FIFO_DEPTH 16 +#define SSP_FIFO_DEPTH 32 /* the watermark for the SSP fifo depth setting */ #define SSP_FIFO_WATERMARK 8 diff --git a/src/trace/dma-trace.c b/src/trace/dma-trace.c index 730d823c837b..1ae9f7add659 100644 --- a/src/trace/dma-trace.c +++ b/src/trace/dma-trace.c @@ -645,15 +645,9 @@ static void dtrace_add_event(const char *e, uint32_t length) uint32_t tmp_dropped_entries = trace_data->dropped_entries; trace_data->dropped_entries = 0; - /* - * this trace_error invocation causes recursion, - * so after it we have to recalculate margin and - * overflow - */ - tr_err(&dt_tr, "dtrace_add_event(): number of dropped logs = %u", - tmp_dropped_entries); - margin = dtrace_calc_buf_margin(buffer); - overflow = dtrace_calc_buf_overflow(buffer, length); + mtrace_printf(LOG_LEVEL_WARNING, + "dtrace_add_event(): number of dropped logs = %u", + tmp_dropped_entries); } } diff --git a/tools/ctl/CMakeLists.txt b/tools/ctl/CMakeLists.txt index 70735f88da65..5c4c2dd315b5 100644 --- a/tools/ctl/CMakeLists.txt +++ b/tools/ctl/CMakeLists.txt @@ -4,6 +4,9 @@ add_executable(sof-ctl ctl.c ) +target_link_directories(sof-ctl BEFORE + PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/../tools/lib") + target_link_libraries(sof-ctl PRIVATE "-lasound" ) @@ -13,6 +16,7 @@ target_compile_options(sof-ctl PRIVATE ) target_include_directories(sof-ctl PRIVATE + "${SOF_ROOT_SOURCE_DIRECTORY}/../tools/include" "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" "${SOF_ROOT_SOURCE_DIRECTORY}" ) diff --git a/tools/logger/CMakeLists.txt b/tools/logger/CMakeLists.txt index d84c92ce0cc5..57637706c5d6 100644 --- a/tools/logger/CMakeLists.txt +++ b/tools/logger/CMakeLists.txt @@ -1,5 +1,13 @@ # SPDX-License-Identifier: BSD-3-Clause +# https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-To-Write-Platform-Checks +INCLUDE (CheckIncludeFiles) +CHECK_INCLUDE_FILES(sys/inotify.h HAS_INOTIFY) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/config.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + add_executable(sof-logger logger.c convert.c diff --git a/tools/logger/config.h.in b/tools/logger/config.h.in new file mode 100644 index 000000000000..fecbafbd274c --- /dev/null +++ b/tools/logger/config.h.in @@ -0,0 +1 @@ +#cmakedefine01 HAS_INOTIFY diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 569f81579f52..7de47f97075b 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -60,13 +60,11 @@ struct proc_ldc_entry { uintptr_t params[TRACE_MAX_PARAMS_COUNT]; }; -static const char *BAD_PTR_STR = ""; - +#define BAD_PTR_STR "" #define UUID_LOWER "%s%s%s<%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x>%s%s%s" #define UUID_UPPER "%s%s%s<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>%s%s%s" -/* pointer to config for global context */ -struct convert_config *global_config; +static const char *missing = ""; static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_address); @@ -131,6 +129,10 @@ static const char *format_uid(uint32_t uid_ptr, int use_colors, bool be, bool up if (uid_ptr < uids_dict->base_address || uid_ptr >= uids_dict->base_address + uids_dict->data_length) { str = calloc(1, strlen(BAD_PTR_STR) + 1 + 6); + if (!str) { + log_err("can't allocate memory\n"); + exit(EXIT_FAILURE); + } sprintf(str, BAD_PTR_STR, uid_ptr); } else { uid_entry = get_uuid_entry(uid_ptr); @@ -248,6 +250,8 @@ static void process_params(struct proc_ldc_entry *pe, /* check for string printing, because it leads to logger crash */ log_err("String printing is not supported\n"); pe->params[i] = (uintptr_t)log_asprintf("", raw_param); + if (!pe->params[i]) + abort(); pe->subst_mask |= 1 << i; ++i; p += 2; @@ -256,6 +260,8 @@ static void process_params(struct proc_ldc_entry *pe, /* substitute UUID entry address with formatted string pointer from heap */ pe->params[i] = (uintptr_t)asprintf_uuid(p, raw_param, use_colors, &uuid_fmt_len); + if (!pe->params[i]) + abort(); pe->subst_mask |= 1 << i; ++i; /* replace uuid formatter with %s */ @@ -267,7 +273,12 @@ static void process_params(struct proc_ldc_entry *pe, /* %pQ format specifier */ /* substitute log entry address with formatted entry text */ pe->params[i] = (uintptr_t)asprintf_entry_text(raw_param); - pe->subst_mask |= 1 << i; + + if (pe->params[i]) + pe->subst_mask |= 1 << i; + else + pe->params[i] = (uintptr_t)missing; + ++i; /* replace entry formatter with %s */ @@ -307,13 +318,13 @@ static double to_usecs(uint64_t time) } /** Justified timestamp width for printf format string */ -static unsigned int timestamp_width(unsigned int precision) +static uint8_t timestamp_width(uint8_t precision) { /* 64bits yields less than 20 digits precision. As reported by * gcc 9.3, this avoids a very long precision causing snprintf() * to truncate time_fmt */ - assert(precision >= 0 && precision < 20); + assert(precision < 20); /* * 12 digits for units is enough for 1M seconds = 11 days which * should be enough for most test runs. @@ -327,7 +338,6 @@ static inline void print_table_header(void) { FILE *out_fd = global_config->out_fd; int hide_location = global_config->hide_location; - char time_fmt[32]; char date_string[64]; const time_t epoc_secs = time(NULL); @@ -337,16 +347,14 @@ static inline void print_table_header(void) if (gettime_ret) { log_err("clock_gettime() failed: %s\n", - strerror(gettime_ret)); + strerror(errno)); exit(1); } if (global_config->time_precision >= 0) { - const unsigned int ts_width = - timestamp_width(global_config->time_precision); - snprintf(time_fmt, sizeof(time_fmt), "%%-%ds(us)%%%ds ", - ts_width, ts_width); - fprintf(out_fd, time_fmt, " TIMESTAMP", "DELTA"); + const uint8_t ts_width = timestamp_width(global_config->time_precision); + + fprintf(out_fd, "%*s(us)%*s ", -ts_width, " TIMESTAMP", ts_width, "DELTA"); } fprintf(out_fd, "%2s %-18s ", "C#", "COMPONENT"); @@ -355,11 +363,14 @@ static inline void print_table_header(void) fprintf(out_fd, "%s", "CONTENT"); if (global_config->time_precision >= 0) { + struct tm *ltime = localtime(&epoc_secs); + /* e.g.: ktime=4263.487s @ 2021-04-27 14:21:13 -0700 PDT */ fprintf(out_fd, "\tktime=%lu.%03lus", ktime.tv_sec, ktime.tv_nsec / 1000000); - if (strftime(date_string, sizeof(date_string), - "%F %X %z %Z", localtime(&epoc_secs))) + + if (ltime && strftime(date_string, sizeof(date_string), + "%F %X %z %Z", ltime)) fprintf(out_fd, " @ %s", date_string); } @@ -461,7 +472,6 @@ static void print_entry_params(const struct log_entry_header *dma_log, char ids[TRACE_MAX_IDS_STR]; float dt = to_usecs(dma_log->timestamp - last_timestamp); struct proc_ldc_entry proc_entry; - static char time_fmt[64]; int ret; if (raw_output) @@ -502,13 +512,7 @@ static void print_entry_params(const struct log_entry_header *dma_log, ids[0] = '\0'; if (raw_output) { /* "raw" means script-friendly (not all hex) */ - const char *entry_fmt = "%s%u %u %s%s%s "; - - if (time_precision >= 0) - snprintf(time_fmt, sizeof(time_fmt), "%%.%df %%.%df ", - time_precision, time_precision); - - fprintf(out_fd, entry_fmt, + fprintf(out_fd, "%s%u %u %s%s%s ", entry->header.level == use_colors ? (LOG_LEVEL_CRITICAL ? KRED : KNRM) : "", dma_log->core_id, @@ -516,9 +520,12 @@ static void print_entry_params(const struct log_entry_header *dma_log, get_component_name(entry->header.component_class, dma_log->uid), raw_output && strlen(ids) ? "-" : "", ids); + if (time_precision >= 0) - fprintf(out_fd, time_fmt, - to_usecs(dma_log->timestamp - timestamp_origin), dt); + fprintf(out_fd, "%.*f %.*f ", + time_precision, to_usecs(dma_log->timestamp - timestamp_origin), + time_precision, dt); + if (!hide_location) fprintf(out_fd, "(%s:%u) ", format_file_name(entry->file_name, raw_output), @@ -527,13 +534,11 @@ static void print_entry_params(const struct log_entry_header *dma_log, if (time_precision >= 0) { const unsigned int ts_width = timestamp_width(time_precision); - snprintf(time_fmt, sizeof(time_fmt), - "%%s[%%%d.%df] (%%%d.%df)%%s ", - ts_width, time_precision, ts_width, time_precision); - - fprintf(out_fd, time_fmt, + fprintf(out_fd, "%s[%*.*f] (%*.*f)%s ", use_colors ? KGRN : "", - to_usecs(dma_log->timestamp - timestamp_origin), dt, + ts_width, time_precision, + to_usecs(dma_log->timestamp - timestamp_origin), + ts_width, time_precision, dt, use_colors ? KNRM : ""); } @@ -609,7 +614,13 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ entry->params = NULL; /* set file position to beginning of processed entry */ - fseek(global_config->ldc_fd, entry_offset, SEEK_SET); + ret = fseek(global_config->ldc_fd, entry_offset, SEEK_SET); + if (ret) { + log_err("Failed to seek to entry header for offset 0x%x in dictionary.\n", + entry_offset); + ret = -errno; + goto out; + } /* fetching elf header params */ ret = fread(&entry->header, sizeof(entry->header), 1, global_config->ldc_fd); @@ -625,7 +636,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -EINVAL; goto out; } - entry->file_name = (char *)malloc(entry->header.file_name_len); + entry->file_name = (char *)malloc(entry->header.file_name_len + 1); if (!entry->file_name) { log_err("can't allocate %d byte for entry.file_name\n", @@ -636,6 +647,8 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = fread(entry->file_name, sizeof(char), entry->header.file_name_len, global_config->ldc_fd); + entry->file_name[entry->header.file_name_len] = '\0'; + if (ret != entry->header.file_name_len) { log_err("Failed to read source filename for offset 0x%x in dictionary.\n", entry_offset); @@ -649,7 +662,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -EINVAL; goto out; } - entry->text = (char *)malloc(entry->header.text_len); + entry->text = (char *)malloc(entry->header.text_len + 1); if (!entry->text) { log_err("can't allocate %d byte for entry.text\n", entry->header.text_len); ret = -ENOMEM; @@ -662,6 +675,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -1; goto out; } + entry->text[entry->header.text_len] = '\0'; return 0; @@ -900,8 +914,13 @@ static int logger_read(void) /* When the address is not correct, move forward by one DWORD (not * entire struct dma_log) */ - fseek(global_config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), - SEEK_CUR); + ret = fseek(global_config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), + SEEK_CUR); + if (ret) { + log_err("fetch_entry() failed on seek, aborting\n"); + ret = -errno; + break; + } skipped_dwords++; continue; @@ -998,7 +1017,7 @@ static int dump_ldc_info(void) if (global_config->version_fd) { struct sof_ipc_fw_version ver; - if (fread(&ver, sizeof(ver), 1, global_config->version_fd)) + if (fread(&ver, sizeof(ver), 1, global_config->version_fd) == 1) fprintf(out_fd, "Loaded FW expects checksum\t0x%08x\n", ver.src_hash); } @@ -1017,7 +1036,7 @@ static int dump_ldc_info(void) while (remaining > 0) { name = format_uid_raw(&uid_ptr[cnt], 0, 0, false, false); uid_addr = get_uuid_key(&uid_ptr[cnt]); - fprintf(out_fd, "\t%p %s\n", (void *)uid_addr, name); + fprintf(out_fd, "\t%p %s\n", (void *)uid_addr, name ? name : missing); if (name) { free(name); @@ -1033,36 +1052,45 @@ static int dump_ldc_info(void) return 0; } -int convert(struct convert_config *config) +int convert(void) { - struct snd_sof_logs_header snd; + struct snd_sof_logs_header * const logs_hdr = malloc(sizeof(*logs_hdr)); struct snd_sof_uids_header uids_hdr; int count, ret = 0; - config->logs_header = &snd; - global_config = config; + /* const pointer initialized at build time */ + if (!global_config) + abort(); + + if (!logs_hdr) + abort(); + + /* just a shorter alias */ + struct convert_config * const config = global_config; - count = fread(&snd, sizeof(snd), 1, config->ldc_fd); + config->logs_header = logs_hdr; + + count = fread(logs_hdr, sizeof(*logs_hdr), 1, config->ldc_fd); if (!count) { log_err("Error while reading %s.\n", config->ldc_file); return -ferror(config->ldc_fd); } - if (strncmp((char *) snd.sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE)) { + if (strncmp((char *)logs_hdr->sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE)) { log_err("Invalid ldc file signature.\n"); return -EINVAL; } if (global_config->version_fw && /* -n option */ !global_config->dump_ldc) { - ret = verify_ldc_checksum(global_config->logs_header->version.src_hash); + ret = verify_ldc_checksum(logs_hdr->version.src_hash); if (ret) return ret; } /* default logger and ldc_file abi verification */ if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_DBG_VERSION, - snd.version.abi_version)) { + logs_hdr->version.abi_version)) { log_err("abi version in %s file does not coincide with abi version used by logger.\n", config->ldc_file); log_err("logger ABI Version is %d:%d:%d\n", @@ -1070,14 +1098,19 @@ int convert(struct convert_config *config) SOF_ABI_VERSION_MINOR(SOF_ABI_DBG_VERSION), SOF_ABI_VERSION_PATCH(SOF_ABI_DBG_VERSION)); log_err("ldc_file ABI Version is %d:%d:%d\n", - SOF_ABI_VERSION_MAJOR(snd.version.abi_version), - SOF_ABI_VERSION_MINOR(snd.version.abi_version), - SOF_ABI_VERSION_PATCH(snd.version.abi_version)); + SOF_ABI_VERSION_MAJOR(logs_hdr->version.abi_version), + SOF_ABI_VERSION_MINOR(logs_hdr->version.abi_version), + SOF_ABI_VERSION_PATCH(logs_hdr->version.abi_version)); return -EINVAL; } /* read uuid section header */ - fseek(config->ldc_fd, snd.data_offset + snd.data_length, SEEK_SET); + ret = fseek(config->ldc_fd, logs_hdr->data_offset + logs_hdr->data_length, SEEK_SET); + if (ret) { + log_err("Error while seeking to uuids header from %s.\n", config->ldc_file); + return -errno; + } + count = fread(&uids_hdr, sizeof(uids_hdr), 1, config->ldc_fd); if (!count) { log_err("Error while reading uuids header from %s.\n", config->ldc_file); diff --git a/tools/logger/convert.h b/tools/logger/convert.h index 607e5e59e049..8117e023b2f9 100644 --- a/tools/logger/convert.h +++ b/tools/logger/convert.h @@ -41,10 +41,14 @@ struct convert_config { int dump_ldc; int hide_location; int relative_timestamps; - int time_precision; + uint8_t time_precision; struct snd_sof_uids_header *uids_dict; struct snd_sof_logs_header *logs_header; }; uint32_t get_uuid_key(const struct sof_uuid_entry *entry); -int convert(struct convert_config *config); + +/* pointer to config for global context */ +extern struct convert_config * const global_config; + +int convert(void); diff --git a/tools/logger/filter.c b/tools/logger/filter.c index b70af55f156b..80b5f72345fd 100644 --- a/tools/logger/filter.c +++ b/tools/logger/filter.c @@ -22,8 +22,6 @@ #define COMPONENTS_SEPARATOR ',' #define COMPONENT_NAME_SCAN_STRING_LENGTH 32 -extern struct convert_config *global_config; - /** map between log level given by user and enum value */ static const struct { const char name[16]; diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 543e8e85a0c8..b6c2b26bd629 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -5,6 +5,7 @@ // Author: Bartosz Kokoszko // Artur Kloniecki +#include #include #include #include @@ -15,6 +16,18 @@ #include #include #include + +#include +#include + +#include "config.h" + +#if HAS_INOTIFY +#include +#include +#include +#endif + #include "convert.h" #include "misc.h" @@ -91,8 +104,8 @@ static int snapshot(const char *name) for (i = 0; i < ARRAY_SIZE(debugfs); i++) { - sprintf(pinname, "%s/%s", path, debugfs[i]); - sprintf(poutname, "%s.%s.txt", name, debugfs[i]); + snprintf(pinname, sizeof(pinname), "%s/%s", path, debugfs[i]); + snprintf(poutname, sizeof(poutname), "%s.%s.txt", name, debugfs[i]); /* open debugfs for reading */ in_fd = fopen(pinname, "rb"); @@ -119,9 +132,14 @@ static int snapshot(const char *name) if (count != 4) break; - sprintf(buffer, "0x%6.6x: 0x%8.8x\n", addr, val); + snprintf(buffer, sizeof(buffer), "0x%6.6x: 0x%8.8x\n", addr, val); - count = fwrite(buffer, 1, strlen(buffer), out_fd); + i = strlen(buffer); + count = fwrite(buffer, 1, i, out_fd); + if (count != i) { + fprintf(stderr, "error: an error occurred during write to %s: %s\n", + poutname, strerror(errno)); + } addr += 4; } @@ -151,7 +169,12 @@ static int configure_uart(const char *file, unsigned int baud) tio.c_cc[VMIN] = 1; ret = tcsetattr(fd, TCSANOW, &tio); - return ret < 0 ? -errno : fd; + if (ret < 0) { + close(fd); + return -errno; + } + + return fd; } /* Concantenate `config->filter_config` with `input` + `\n` */ @@ -170,6 +193,108 @@ static int append_filter_config(struct convert_config *config, const char *input return 0; } +#if !HAS_INOTIFY +static void *wait_open(const char *watched_dir, const char *expected_file) +{ + assert(HAS_INOTIFY); /* Should never be called */ +} +#else +/* + * This 5 minutes timeout is for "backward compatible safety" in case + * any user/script of an earlier, pre-inotify version of sof-logger + * (accidentally?) _expected_ the tool to quit when the driver was not + * loaded. This expectation was always wrong but an infinite wait is too + * severe of a punishment. This timeout cannot be too small otherwise it + * would defeat the new feature. + */ +#ifndef SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS +#define SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS (5 * 60) +#endif + +/* + * Using inotify, wait up to 5 minutes for 'expected_name' to appear in + * 'watched_dir'. Then return opendir/fopen(expected_name). fopen() and + * opendir() failures are NOT handled; e.g. NULL from fopen() is just + * passed through. + * + * Returns a FILE * or DIR * + */ +static void *wait_open(const char *watched_dir, const char *expected_file) +{ + if (access(watched_dir, R_OK)) { + fprintf(stderr, "error: %s() cannot read %s\n", __func__, watched_dir); + return NULL; + } + + const int iqueue = inotify_init(); + const int dwatch = inotify_add_watch(iqueue, watched_dir, IN_CREATE); + struct stat expected_stat; + void *ret_stream = NULL; + const int fpath_len = strlen(watched_dir) + 1 + strlen(expected_file) + 1; + char * const fpath = malloc(fpath_len); + + if (!fpath) { + fprintf(stderr, "error: can't allocate memory\n"); + exit(EXIT_FAILURE); + } + + snprintf(fpath, fpath_len, "%s/%s", watched_dir, expected_file); + + /* Not racy because the inotify watch was set first. */ + if (!access(fpath, F_OK)) + goto fopenit; + + fprintf(stdout, "%s: waiting in %s/ for %s\n", APP_NAME, watched_dir, expected_file); + fflush(stdout); + + while (1) { + char evlist[1 * sizeof(struct inotify_event)]; + struct pollfd pfd[1] = {{ .fd = iqueue, .events = POLLIN, .revents = 0 }}; + int pret = poll(pfd, sizeof(pfd) / sizeof(struct pollfd), + SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS * 1000); + + if (pret == 0) { + fprintf(stderr, "error: no %s after waiting %d seconds\n", + expected_file, SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS); + goto cleanup; + } + + if (pret < 0 || pfd[0].revents != POLLIN) { + fprintf(stderr, "error: in %s, poll(%s) returned %d, %d\n", + __func__, watched_dir, pret, pfd[0].revents); + goto cleanup; + } + + /* Silence __attribute__((warn_unused_result)) which is + * enabled by some Linux distros even when broken in gcc: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 + */ + (void)!read(iqueue, evlist, sizeof(evlist)); + + if (!access(fpath, F_OK)) + goto fopenit; + } + +fopenit: + if (stat(fpath, &expected_stat)) + goto cleanup; + + if ((expected_stat.st_mode & S_IFMT) == S_IFDIR) + ret_stream = opendir(fpath); + else + ret_stream = fopen(fpath, "rb"); + +cleanup: + free(fpath); + inotify_rm_watch(iqueue, dwatch); + + return ret_stream; +} +#endif // HAS_INOTIFY + +static struct convert_config _global_config; +struct convert_config * const global_config = &_global_config; + int main(int argc, char *argv[]) { static const char optstring[] = "ho:i:l:ps:c:u:tv:rd:Le:f:gF:n"; @@ -249,7 +374,8 @@ int main(int argc, char *argv[]) if (i < 0 || 1 < i) { fprintf(stderr, "%s: invalid option: -e %s\n", APP_NAME, optarg); - return -EINVAL; + ret = -EINVAL; + goto out; } config.relative_timestamps = i; break; @@ -258,7 +384,8 @@ int main(int argc, char *argv[]) config.time_precision = atoi(optarg); if (config.time_precision < 0) { usage(); - return -EINVAL; + ret = -EINVAL; + goto out; } break; case 'g': @@ -288,8 +415,10 @@ int main(int argc, char *argv[]) usage(); } - if (snapshot_file) - return baud ? EINVAL : -snapshot(snapshot_file); + if (snapshot_file) { + ret = baud ? EINVAL : -snapshot(snapshot_file); + goto out; + } if (!config.ldc_file) { fprintf(stderr, "error: Missing ldc file\n"); @@ -304,17 +433,6 @@ int main(int argc, char *argv[]) goto out; } - if (config.version_fw) { - config.version_fd = fopen(config.version_file, "rb"); - if (!config.version_fd && !config.dump_ldc) { - ret = errno; - fprintf(stderr, - "error: Unable to open version file %s: %s\n", - config.version_file, strerror(ret)); - goto out; - } - } - if (config.out_file) { config.out_fd = fopen(config.out_file, "w"); if (!config.out_fd) { @@ -339,6 +457,11 @@ int main(int argc, char *argv[]) if (!config.in_file && !config.dump_ldc) config.in_file = "/sys/kernel/debug/sof/etrace"; + if (!config.in_file && baud) { + fprintf(stderr, "error: No UART device specified\n"); + usage(); + } + if (config.input_std) { config.in_fd = stdin; } else if (baud) { @@ -348,7 +471,27 @@ int main(int argc, char *argv[]) goto out; } } else if (config.in_file) { - config.in_fd = fopen(config.in_file, "rb"); + static const char sys_debug[] = "/sys/kernel/debug"; + static const char sys_debug_sof[] = "/sys/kernel/debug/sof"; + /* In the future we could add an option to force waiting + * for _any_ input file, not just for /sys/kernel/debug/sof/[e]trace + */ + config.in_fd = NULL; + if (!HAS_INOTIFY || + strncmp(config.in_file, sys_debug, strlen(sys_debug))) { + config.in_fd = fopen(config.in_file, "rb"); + } else { // both inotify and /sys/kernel/debug/ + DIR *dbg_sof = (DIR *)wait_open(sys_debug, "sof"); + + if (dbg_sof) { + closedir(dbg_sof); + config.in_fd = + (FILE *)wait_open(sys_debug_sof, + config.in_file + + strlen(sys_debug_sof) + 1); + } + } + if (!config.in_fd) { ret = errno; fprintf(stderr, @@ -360,7 +503,19 @@ int main(int argc, char *argv[]) if (isatty(fileno(config.out_fd)) != 1) config.use_colors = 0; - ret = -convert(&config); + if (config.version_fw) { + config.version_fd = fopen(config.version_file, "rb"); + if (!config.version_fd && !config.dump_ldc) { + ret = errno; + fprintf(stderr, + "error: Unable to open version file %s: %s\n", + config.version_file, strerror(ret)); + goto out; + } + } + + _global_config = config; + ret = -convert(); out: /* free memory */ diff --git a/tools/logger/misc.c b/tools/logger/misc.c index 37ca30adb9c1..20e5db9f95b8 100644 --- a/tools/logger/misc.c +++ b/tools/logger/misc.c @@ -41,8 +41,6 @@ char *log_asprintf(const char *format, ...) return result; } -extern struct convert_config *global_config; - /** Prints 1. once to stderr. 2. a second time to the global out_fd if * out_fd is neither stderr nor stdout (because the -o option was used). */ diff --git a/tools/sof_ri_info/sof_ri_info.py b/tools/sof_ri_info/sof_ri_info.py index 8bd2f4c4502c..079bf22366e8 100755 --- a/tools/sof_ri_info/sof_ri_info.py +++ b/tools/sof_ri_info/sof_ri_info.py @@ -1461,7 +1461,7 @@ def dump_info(self): CNL_MEMORY_SPACE = DspMemory('Intel Cannonlake', [ - DspMemorySegment('imr', 0xb0000000, 8*0x1024*0x1024), + DspMemorySegment('imr', 0xb0000000, 8*1024*1024), DspMemorySegment('l2 hpsram', 0xbe000000, 48*64*1024), DspMemorySegment('l2 lpsram', 0xbe800000, 1*64*1024) ]) diff --git a/tools/topology/CMakeLists.txt b/tools/topology/CMakeLists.txt index 4b7b36d1a2a1..be032f730dde 100644 --- a/tools/topology/CMakeLists.txt +++ b/tools/topology/CMakeLists.txt @@ -1,4 +1,48 @@ set(SOF_TOPOLOGY_BINARY_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") +set(SOF_ALSA_TOOLS_DIR "${SOF_ROOT_SOURCE_DIRECTORY}/../tools/bin") +set(ALSATPLG_CMD "${SOF_ALSA_TOOLS_DIR}/alsatplg") + +function(alsatplg_version OUT_STATUS OUT_VERSION) + execute_process(COMMAND ${ALSATPLG_CMD} --version + RESULT_VARIABLE status + OUTPUT_VARIABLE stdout + OUTPUT_STRIP_TRAILING_WHITESPACE) + message(DEBUG "${ALSATPLG_CMD} --version: status=${status}, output=${stdout}") + + set(${OUT_STATUS} "${status}" PARENT_SCOPE) + + # Some error messages have already been printed on stderr + if(NOT status EQUAL 0) + message(WARNING "${ALSATPLG_CMD} --version returned status: ${status}, +${stdout}") + return() + endif() + + string(REPLACE "\n" ";" ALSA_VERSION_LIST ${stdout}) + list(GET ALSA_VERSION_LIST 0 ALSATPLG_VERSION) + string(REGEX MATCH "[0-9]\.[0-9]\.*[0-9]*" ALSATPLG_VERSION_NUMBER ${ALSATPLG_VERSION}) + + set(${OUT_VERSION} "${ALSATPLG_VERSION_NUMBER}" PARENT_SCOPE) +endfunction() + + +# Being written in C, `alsatplg` silently ignores some invalid inputs +# and produces an corrupt .tplg file instead of returning an error code +# that fails the build. For instance, alsatplg versions < 1.2.5 silently +# corrupt `codec_consumer` and turn it into `codec_master` instead. +# Longer story in #5192. +alsatplg_version(STATUS ALSATPLG_VERSION_NUMBER) +if(NOT STATUS EQUAL 0) + message(WARNING "${ALSATPLG_CMD} failed: ${STATUS}; all topologies skipped") + return() +else() + if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.5") + message(WARNING "All topologies skipped: minimum alsatplg version 1.2.5,\ + found ${ALSATPLG_VERSION_NUMBER}.") + return() + endif() + # success +endif() # This use of VERBOSE relies on original CMake behavior. # From the add_custom_command() manual: @@ -23,7 +67,7 @@ macro(add_alsatplg_command) # permissions are hardcoded and only the user can read # the -o(utput) file. # See bug https://github.com/alsa-project/alsa-utils/issues/126 - COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${ARGV0} -o ${ARGV1} + COMMAND ${ALSATPLG_CMD} \$\${VERBOSE:+-v 1} -c ${ARGV0} -o ${ARGV1} USES_TERMINAL ) endmacro() @@ -41,7 +85,7 @@ macro(add_alsatplg2_command input_file output_file include_path) MAIN_DEPENDENCY ${input_file} OUTPUT ${output_file} # -p to pre-process Topology2.0 conf file - COMMAND ALSA_CONFIG_DIR=${CMAKE_SOURCE_DIR}/topology/topology2 alsatplg \$\${VERBOSE:+-v 1} + COMMAND ALSA_CONFIG_DIR=${CMAKE_SOURCE_DIR}/topology/topology2 ${ALSATPLG_CMD} \$\${VERBOSE:+-v 1} -I ${include_path} -D "'${defines}'" -p -c ${input_file} -o ${output_file} USES_TERMINAL ) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 01616ac90d18..2f5f0eeaa4e4 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -9,8 +9,12 @@ file(GLOB TPLG_DEPS ) add_custom_target(abi_v1 + DEPENDS abi.h +) +add_custom_command(OUTPUT abi.h COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/get_abi.sh ${SOF_ROOT_SOURCE_DIRECTORY} - DEPENDS ${TPLG_DEPS} + DEPENDS ${TPLG_DEPS} ${SOF_ROOT_SOURCE_DIRECTORY}/src/include/kernel/abi.h + # get_abi.h generates (a smaller) abi.h in the current directory WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM USES_TERMINAL @@ -24,9 +28,12 @@ set(TPLGS ## HDaudio codec topologies "sof-hda-generic\;sof-hda-generic\;-DCHANNELS=0\;-DHSPROC=volume\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-1ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-1ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-2ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-3ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-4ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-4ch-bt\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1\;-DBT_OFFLOAD" ## end HDaudio codec topologies "sof-hda-generic-idisp\;sof-hda-generic-idisp\;-DCHANNELS=0\;-DDYNAMIC=1" @@ -89,6 +96,7 @@ set(TPLGS "sof-cavs-nocodec\;sof-tgl-h-nocodec\;-DPLATFORM=tgl\;-DNCORES=2\;-DDYNAMIC=1" "sof-cavs-nocodec\;sof-ehl-nocodec\;-DPLATFORM=ehl\;-DDYNAMIC=1" "sof-cavs-nocodec\;sof-adl-nocodec\;-DPLATFORM=adl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" + "sof-cavs-nocodec\;sof-rpl-nocodec\;-DPLATFORM=rpl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" "sof-icl-dmic-4ch\;sof-icl-dmic-4ch" "sof-cml-rt5682\;sof-cml-rt5682\;-DPLATFORM=cml\;-DDMICPROC=eq-iir-volume\;-DDMIC16KPROC=eq-iir-volume" "sof-cml-rt5682\;sof-whl-rt5682\;-DPLATFORM=whl\;-DDMICPROC=eq-iir-volume\;-DDMIC16KPROC=eq-iir-volume" @@ -124,91 +132,205 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DNOAMP\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DNOAMP\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-cs42l43-l0\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DMIC_LINK=0\;-DAMP_1_LINK=0\;-DMONO\;-DMFC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl\;-DDYNAMIC=1" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DPLATFORM=rpl\;-DDYNAMIC=1" ## end SoundWire topologies ## SoundWire NOJACK topologies + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l1-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l02-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DNOJACK\;-DNOHDMI4\;-DNO_LOCAL_MIC\;-DAMP_1_LINK=0\;-DAMP_2_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire NOJACK topologies "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" "sof-ehl-rt5660\;sof-ehl-rt5660-nohdmi" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" + "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves-spk-only\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DWAVES_SPK_ONLY" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DGOOGLE_RTC_AUDIO_PROCESSING" + "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" + "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682-waves\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DGOOGLE_RTC_AUDIO_PROCESSING" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" - "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-igonr\;-DAMP_SSP=1\;-DIGO" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2\;-DAMP_SSP=2" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2-xperi\;-DAMP_SSP=2\;-DINCLUDE_IIR_EQ=1" - "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DDTS=`DTS'" - "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DAMP_SSP=2" + "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDTS=`DTS'" + "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-nau8318-nau8825\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" - "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl" + "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl\;-DDYNAMIC=1" + "sof-adl-sdw-cs42l42\;sof-adl-sdw-cs42l42-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" "sof-jsl-da7219\;sof-jsl-da7219-mx98360a\;-DPLATFORM=jsl-dedede" "sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec" - "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DPLATFORM=jsl-rt1015" - "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1" - "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DPLATFORM=jsl-dedede" - "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DPLATFORM=jsl-dedede" + "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-rt1015" + "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1" + "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-dedede" + "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DHEADPHONE=cs42l42\;-DPLATFORM=jsl-dedede" + "sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP" + "sof-jsl-rt5682\;sof-jsl-rt5650\;-DHEADPHONE=rt5650\;-DPLATFORM=jsl-rt1015" + + ## DRC/EQ topologies + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-drceq\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-drceq\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0-drceq\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-drceq\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-drceq\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219-drceq\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5650-drceq\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDRC_EQ" + + "sof-adl-nau8825\;sof-adl-max98360a-nau8825-drceq\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825-drceq\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825-drceq\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-adl-nau8825\;sof-adl-nau8318-nau8825-drceq\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + ## end DRC/EQ topologies "sof-glk-es8336\;sof-apl-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" - "sof-glk-es8336\;sof-apl-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" - "sof-glk-es8336\;sof-glk-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-glk-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-jsl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=4" + "sof-glk-es8336\;sof-jsl-es8336-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-jsl-es8336-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-jsl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=4" - "sof-glk-es8336\;sof-cml-es8336-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + + "sof-glk-es8336\;sof-icl-es8336-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=0" + "sof-glk-es8336\;sof-icl-es8336-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-icl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-icl-es8336-dmic2ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-icl-es8336-dmic2ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-icl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-icl-es8336-dmic4ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-icl-es8336-dmic4ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-icl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-cml-es8336-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-cml-es8336-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=2" "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-tgl-es8336-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-tgl-es8336-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-tgl-es8336-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=2" "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" + + "sof-glk-es8336\;sof-adl-es8336\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=0" + "sof-glk-es8336\;sof-adl-es8336-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-adl-es8336-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=4" + + #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. + "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" + "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02-4ch\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=4\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" + + #To support HDMI-in capture with RT1308 ssp-amplifier products. + "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" + #Topologies for No SSP-amp or codec+HDMI-IN capture support. + "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-nocodec-hdmi-ssp15\;-DNO_AMP\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" + "sof-tgl-rt1308-hdmi-ssp\;sof-adl-nocodec-hdmi-ssp02\;-DNO_AMP\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2\;-DPLATFORM=adl" + ## i.MX8 (i.MX8QM and i.MX8QXP) topologies "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-cs42888\;sof-imx8-cs42888" "sof-imx8-nocodec-sai\;sof-imx8-nocodec-sai" @@ -269,6 +391,8 @@ foreach(tplg ${TPLGS}) endforeach() endif() + # m4 + # TODO: reduce duplication with subdirectories add_custom_command( OUTPUT production/${output}.conf COMMAND m4 --fatal-warnings @@ -282,11 +406,16 @@ foreach(tplg ${TPLGS}) ${CMAKE_CURRENT_SOURCE_DIR}/${input}.m4 > production/${output}.conf MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${input}.m4 - DEPENDS abi_v1 + # The 'abi.h' file is the real dependency that triggers + # a rebuild. 'abi_v1' is the target that avoids a race + # to rebuild abi.h. See the CMake FAQ or (better) Sam + # Thursfield's blog about custom targets. + DEPENDS abi_v1 ${CMAKE_CURRENT_BINARY_DIR}/abi.h VERBATIM USES_TERMINAL ) + # alsatplg add_alsatplg_command(production/${output}.conf production/${output}.tplg) add_custom_target(topology1_${output} DEPENDS production/${output}.tplg) diff --git a/tools/topology/topology1/development/CMakeLists.txt b/tools/topology/topology1/development/CMakeLists.txt index 20c622f83f83..55086abee9dd 100644 --- a/tools/topology/topology1/development/CMakeLists.txt +++ b/tools/topology/topology1/development/CMakeLists.txt @@ -85,15 +85,15 @@ foreach(tplg ${TPLGS}) ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) add_alsatplg_command(${output}.conf ${output}.tplg) - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(dev_topologies1 topology_${output}) + add_custom_target(dev_topology_${output} DEPENDS ${output}.tplg) + add_dependencies(dev_topologies1 dev_topology_${output}) endforeach() # Duplicate of above to handle topologies in parent directory @@ -121,7 +121,7 @@ foreach(tplg ${TPLGS_UP}) ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) diff --git a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt index 9399b48e5c21..bdb655dd7800 100644 --- a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt +++ b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt @@ -34,13 +34,13 @@ foreach(tplg ${TPLGS_UP}) ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) add_alsatplg_command(${output}.conf ${output}.tplg) - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(dsp_topologies1 topology_${output}) + add_custom_target(dsp_topology_${output} DEPENDS ${output}.tplg) + add_dependencies(dsp_topologies1 dsp_topology_${output}) endforeach() diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index bd9134b2a3d2..a772aa1a9ff7 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -5,7 +5,9 @@ set(TPLGS_UP ## HDaudio codec topologies "sof-hda-generic\;sof-hda-generic\;-DDEEP_BUFFER\;-DCHANNELS=0\;-DHSPROC=volume\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-1ch\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-1ch-pdm1\;-DPDM1\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-2ch\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-3ch\;-DDEEP_BUFFER\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-4ch\;-DDEEP_BUFFER\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" ## end HDaudio codec topologies @@ -32,12 +34,32 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" ## end SoundWire topologies + + ## SoundWire NOJACK topologies + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l1-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=0" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" + ## end SoundWire NOJACK topologies ) add_custom_target(kernel_dependent_v5_19_topologies1) @@ -68,12 +90,12 @@ foreach(tplg ${TPLGS_UP}) ${CMAKE_CURRENT_SOURCE_DIR}/../../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/../../${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) add_alsatplg_command(${output}.conf ${output}.tplg) - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(kernel_dependent_v5_19_topologies1 topology_${output}) + add_custom_target(k519_topology_${output} DEPENDS ${output}.tplg) + add_dependencies(kernel_dependent_v5_19_topologies1 k519_topology_${output}) endforeach() diff --git a/tools/topology/topology1/m4/buffer.m4 b/tools/topology/topology1/m4/buffer.m4 index 9a8f5b73f8f4..376e206c6c09 100644 --- a/tools/topology/topology1/m4/buffer.m4 +++ b/tools/topology/topology1/m4/buffer.m4 @@ -44,6 +44,8 @@ dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')') dnl COMP_PERIOD_FRAMES( sample_rate, period_us) -define(`COMP_PERIOD_FRAMES', `eval(`($1 * $2) / 1000000')') +dnl note: m4 eval arithmetic is 32bit signed, so split the 10^6 +dnl division to avoid overflow. +define(`COMP_PERIOD_FRAMES', `eval(`$1 / 100 * $2 / 10000')') divert(0)dnl diff --git a/tools/topology/topology1/platform/common/ssp.m4 b/tools/topology/topology1/platform/common/ssp.m4 index 39a5ba185b0f..9dbedcf643f6 100644 --- a/tools/topology/topology1/platform/common/ssp.m4 +++ b/tools/topology/topology1/platform/common/ssp.m4 @@ -34,6 +34,8 @@ dnl SSP_CC_MCLK_ES 64 = (1 << 6) define(`SSP_CC_MCLK_ES', 64) dnl SSP_CC_BCLK_ES 128 = (1 << 7) define(`SSP_CC_BCLK_ES', 128) +dnl SSP_CC_BCLK_ES 256 = (1 << 8) +define(`SSP_CC_MCLK_AON', 256) dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id, quirks, bclk_delay, dnl clks_control, pulse_width, padding) diff --git a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 index c9808c3d96f0..de24ffe1a6b7 100644 --- a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 +++ b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 @@ -11,6 +11,8 @@ ifdef(`DMIC_16k_PCM_NAME',`', `define(DMIC_16k_PCM_NAME, `DMIC16kHz')') # variable that need to be defined in upper m4 +ifdef(`DMICPROC',`',`fatal_error(note: Need to define dmic processing for intel-generic-dmic +)') ifdef(`CHANNELS',`',`fatal_error(note: Need to define channel number for intel-generic-dmic )') ifdef(`DMIC_PCM_48k_ID',`',`fatal_error(note: Need to define dmic48k pcm id for intel-generic-dmic @@ -144,6 +146,8 @@ PCM_CAPTURE_ADD(DMIC_48k_PCM_NAME, DMIC_PCM_48k_ID, concat(`PIPELINE_PCM_', DMIC ifdef(NO16KDMIC, `', `PCM_CAPTURE_ADD(DMIC_16k_PCM_NAME, DMIC_PCM_16k_ID, concat(`PIPELINE_PCM_', DMIC_PIPELINE_16k_ID))') +ifdef(`PDM1',`define(DEF_STEREO_PDM, `STEREO_PDM1')',`define(DEF_STEREO_PDM, `STEREO_PDM0')') + # # BE configurations - overrides config in ACPI if present # @@ -157,7 +161,7 @@ ifelse(DMIC_DAI_CHANNELS, 4, `DAI_CONFIG(DMIC, 0, DMIC_DAI_LINK_48k_ID, DMIC_DAI_LINK_48k_NAME, DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, DMIC_WORD_LENGTH(s32le), 200, DMIC, 0, - PDM_CONFIG(DMIC, 0, STEREO_PDM0)))') + PDM_CONFIG(DMIC, 0, DEF_STEREO_PDM)))') ifdef(NO16KDMIC, `', `ifelse(DMIC16K_DAI_CHANNELS, 4, @@ -168,4 +172,6 @@ ifdef(NO16KDMIC, `', `DAI_CONFIG(DMIC, 1, DMIC_DAI_LINK_16k_ID, DMIC_DAI_LINK_16k_NAME, DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, STEREO_PDM0)))')') + PDM_CONFIG(DMIC, 1, DEF_STEREO_PDM)))')') + +undefine(DEF_STEREO_PDM) diff --git a/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 b/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 new file mode 100644 index 000000000000..afe48b4adad3 --- /dev/null +++ b/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 @@ -0,0 +1,53 @@ +# +# HDMI-SSP Audio Offload support +# + +include(`ssp.m4') + +define(`HDMI_SSP_NAME', concat(concat(`SSP', HDMI_SSP_NUM),`-HDMI')) +define(`HDMI_SSP_PCM_NAME', concat(concat(`HDMI-', HDMI_SSP_NUM),`-In')) + +# variable that need to be defined in upper m4 +ifdef(`HDMI_SSP_PIPELINE_CP_ID',`',`fatal_error(note: Need to define capture pcm id for ssp intel-hdmi-in +)') +ifdef(`HDMI_SSP_DAI_LINK_ID',`',`fatal_error(note: Need to define DAI link id for ssp intel-hdmi-in +)') +ifdef(`HDMI_SSP_PCM_ID',`',`fatal_error(note: Need to define pipeline PCM dev id for ssp intel-hdmi-in +)') + + +# Low Latency capture pipeline 4 on PCM HDMI_SSP_PCM_ID using max 2 channels of s32le. +# 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, + HDMI_SSP_PIPELINE_CP_ID, HDMI_SSP_PCM_ID, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + + +# capture DAI is SSP using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-capture.m4, + HDMI_SSP_PIPELINE_CP_ID, SSP, HDMI_SSP_NUM, HDMI_SSP_NAME, + concat(`PIPELINE_SINK_', HDMI_SSP_PIPELINE_CP_ID), 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + + +PCM_CAPTURE_ADD(HDMI_SSP_PCM_NAME, HDMI_SSP_PCM_ID, concat(`PIPELINE_PCM_', HDMI_SSP_PIPELINE_CP_ID)) + + +#BE configuration in slave mode +DAI_CONFIG(SSP, HDMI_SSP_NUM, HDMI_SSP_DAI_LINK_ID, HDMI_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_provider), + SSP_CLOCK(fsync, 48000, codec_provider), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, HDMI_SSP_NUM, 32, 0))) + + +undefine(`HDMI_SSP_PIPELINE_CP_ID') +undefine(`HDMI_SSP_DAI_LINK_ID') +undefine(`HDMI_SSP_PCM_ID') dnl use fixed PCM_ID +undefine(`HDMI_SSP_NUM') +undefine(`HDMI_SSP_NAME') +undefine(`HDMI_SSP_PCM_NAME') + diff --git a/tools/topology/topology1/platform/intel/jsl-rt1015.m4 b/tools/topology/topology1/platform/intel/jsl-rt1015.m4 index 981045d93f6b..d1b8a003b294 100644 --- a/tools/topology/topology1/platform/intel/jsl-rt1015.m4 +++ b/tools/topology/topology1/platform/intel/jsl-rt1015.m4 @@ -10,9 +10,18 @@ define(`SPK_NAME', `SSP1-Codec') undefine(`SPK_DATA_FORMAT') define(`SPK_DATA_FORMAT', `s24le') +ifelse(HEADPHONE, `rt5650', ` +define(`SET_SSP_CONFIG', + `SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 1, 24, 0, 0, 0, SSP_CC_MCLK_AON))') +', ` define(`SET_SSP_CONFIG', `SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, 1, 24))') +') \ No newline at end of file diff --git a/tools/topology/topology1/platform/intel/rpl.m4 b/tools/topology/topology1/platform/intel/rpl.m4 new file mode 100644 index 000000000000..a36e847e9bad --- /dev/null +++ b/tools/topology/topology1/platform/intel/rpl.m4 @@ -0,0 +1,6 @@ +# +# Raptor Lake differentiation for pipelines and components +# + +# no difference yet, use Alder Lake definitions +include(`platform/intel/adl.m4') diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 index 8187597bc7eb..860065c7a6dd 100644 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ b/tools/topology/topology1/sof-adl-nau8825.m4 @@ -93,6 +93,8 @@ ifdef(`BT_OFFLOAD', ` # PCM99 <---- volume <---- DMIC01 (dmic 48k capture) # PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) +ifdef(`SPK_MIC_PERIOD_US',`', `define(`SPK_MIC_PERIOD_US', 1000)') + ifdef(`NO_AMP',,` ifdef(`SMART_AMP',` # Smart amplifier related @@ -142,7 +144,13 @@ ifdef(`IGO', `define(`DMIC_PIPELINE_48k_CORE_ID', 1)') # define pcm, pipeline and dai id define(KWD_PIPE_SCH_DEADLINE_US, 20000) # include the generic dmic with kwd -include(`platform/intel/intel-generic-dmic-kwd.m4') +ifdef(`NOHOTWORD', +` +define(NO16KDMIC) +define(DMIC_48k_CORE_ID, 1) +define(DMICPROC, passthrough) +include(`platform/intel/intel-generic-dmic.m4')', +`include(`platform/intel/intel-generic-dmic-kwd.m4')') # define(`SSP_MCLK', ) ifdef(`SSP_MCLK',`',`define(`SSP_MCLK', 19200000)') @@ -168,9 +176,11 @@ ifdef(`NO_AMP',,` ifdef(`SMART_AMP',,` # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, +PIPELINE_PCM_ADD( + ifdef(`DRC_EQ', sof/pipe-drc-eq-volume-demux-playback.m4, + sof/pipe-volume-demux-playback.m4), 1, 0, 2, s32le, - 1000, 0, 0, + SPK_MIC_PERIOD_US, 0, 0, 48000, 48000, 48000)')') # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. @@ -273,14 +283,14 @@ ifdef(`SMART_AMP',,` # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SOURCE_1, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + PIPELINE_SOURCE_1, 2, FMT, + SPK_MIC_PERIOD_US, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # The echo refenrence pipeline has no connections in it, # it is used for the capture DAI widget to dock. DAI_ADD(sof/pipe-echo-ref-dai-capture.m4, 29, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SINK_29, 3, s16le, + PIPELINE_SINK_29, 3, FMT, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # Capture pipeline 9 from demux on PCM 6 using max 2 channels of s32le. @@ -357,10 +367,31 @@ ifdef(`NO_AMP',,` ifdef(`SMART_AMP',,` `# SSP' SPK_SSP_INDEX `(ID: 7)' DAI_CONFIG(SSP, SPK_SSP_INDEX, SPK_BE_ID, SPK_SSP_NAME, +ifelse( + CODEC, `MAX98360A', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), + SSP_CLOCK(bclk, 1536000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 16, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', + CODEC, `RT1019P', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), + SSP_CLOCK(bclk, 1536000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 16, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', + CODEC, `RT1015P', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', + CODEC, `NAU8318', ` SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), SSP_CLOCK(bclk, 1536000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 16, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))')') + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', +)')') DEBUG_END diff --git a/tools/topology/topology1/sof-adl-sdw-cs42l42.m4 b/tools/topology/topology1/sof-adl-sdw-cs42l42.m4 new file mode 100755 index 000000000000..9d627be852fc --- /dev/null +++ b/tools/topology/topology1/sof-adl-sdw-cs42l42.m4 @@ -0,0 +1,286 @@ +# +# Topology for Tigerlake with rt711 + rt1308 (x2). +# + +# if XPROC is not defined, define with default pipe +ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') +ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`alh.m4') +include(`hda.m4') +include(`platform/intel/dmic.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +include(`platform/intel/'PLATFORM`.m4') + +ifdef(`NO_JACK', +` +define(JACK_OFFSET, `0') +', +` +define(JACK_OFFSET, `2') +') + +ifdef(`AMP_1_LINK',`', +`define(AMP_1_LINK, `1')') + +# if there is an external RT1308 amplifier connected over SoundWire, +# enable "EXT_AMP" option in the CMakefile. +ifdef(`EXT_AMP', +` +define(AMP_OFFSET, `1') +', +` +define(AMP_OFFSET, `0') +' +) + +ifdef(`EXT_AMP_REF', +` +define(AMP_REF_OFFSET, `1') +', +` +define(AMP_REF_OFFSET, `0') +' +) + +# Define pipeline id for intel-generic-dmic.m4 +# to generate dmic setting +ifelse(CHANNELS, `0', +` +define(DMIC_OFFSET, `0') +' +, +` +define(DMIC_PCM_48k_ID, `10') +define(DMIC_PCM_16k_ID, `11') +define(DMIC_PIPELINE_48k_ID, `4') +define(DMIC_PIPELINE_16k_ID, `5') + +define(DMIC_DAI_LINK_48k_ID, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET)) +define(DMIC_DAI_LINK_16k_ID, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+1)) +include(`platform/intel/intel-generic-dmic.m4') + +define(DMIC_OFFSET, `2') +' +) + +define(HDMI_BE_ID_BASE, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+DMIC_OFFSET)) + +# Add Bluetooth Audio Offload pass-through + +ifdef(`BT_OFFLOAD', +` define(`BT_PIPELINE_PB_ID', `13') + define(`BT_PIPELINE_CP_ID', `14') + define(`BT_DAI_LINK_ID', eval(HDMI_BE_ID_BASE + 4)) + define(`BT_PCM_ID', `14') dnl use fixed PCM_ID + define(HW_CONFIG_ID, eval(6 + DMIC_OFFSET)) + include(`platform/intel/intel-generic-bt.m4') +' +) + +DEBUG_START + +# +# Define the pipelines +# +# PCM0 ---> volume ----> mixer --->ALH 2 BE dailink 0 +# PCM31 ---> volume ------^ +# PCM1 <--- volume <---- ALH 3 BE dailink 1 +ifdef(`EXT_AMP', ` +# PCM2 ---> volume ----> ALH 2 BE dailink AMP_1_LINK +') +# PCM5 ---> volume <---- iDisp1 +# PCM6 ---> volume <---- iDisp2 +# PCM7 ---> volume <---- iDisp3 +# PCM8 ---> volume <---- iDisp4 +# PCM10 <----volume <---- DMIC01 +# PCM11 <----volume <---- DMIC16k +ifdef(`BT_OFFLOAD', +` +# PCM14 <---> passthrough <---> SSP2 BT playback/capture +') + +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, + 2, 1, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +ifdef(`EXT_AMP', +` +# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 3, 2, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) +') +# Low Latency playback pipeline 6 on PCM 5 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 6, 5, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 7 on PCM 6 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 7, 6, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 8 on PCM 7 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 8, 7, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl deadline, priority, core, time_domain) + +# playback DAI is ALH(SDW1 PIN258) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, + 1, ALH, 258, SDW1-Playback, + NOT_USED_IGNORED, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + +# capture DAI is ALH(SDW1 PIN259) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, ALH, 259, SDW1-Capture, + PIPELINE_SINK_2, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# Low Latency playback pipeline 30 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, + 30, 0, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000, + SCHEDULE_TIME_DOMAIN_TIMER, + PIPELINE_PLAYBACK_SCHED_COMP_1) + +# Deep buffer playback pipeline 31 on PCM 31 using max 2 channels of s32le +# Set 1000us deadline on core 0 with priority 0. +# TODO: Modify pipeline deadline to account for deep buffering +ifdef(`HEADSET_DEEP_BUFFER', +` +PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, + 31, 31, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000, + SCHEDULE_TIME_DOMAIN_TIMER, + PIPELINE_PLAYBACK_SCHED_COMP_1) +' +) + +SectionGraph."mixer-host" { + index "0" + + lines [ + # connect mixer dai pipelines to PCM pipelines + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_30) +ifdef(`HEADSET_DEEP_BUFFER', +` + + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_31) +' +) + ] +} + +ifdef(`EXT_AMP', +` +# playback DAI is ALH(AMP_1_LINK PIN2) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', + PIPELINE_SOURCE_3, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) +') + +# playback DAI is iDisp1 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 6, HDA, 0, iDisp1, + PIPELINE_SOURCE_6, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp2 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 7, HDA, 1, iDisp2, + PIPELINE_SOURCE_7, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp3 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 8, HDA, 2, iDisp3, + PIPELINE_SOURCE_8, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# PCM Low Latency, id 0 +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +PCM_PLAYBACK_ADD(Jack Out, 0, PIPELINE_PCM_30) +ifdef(`HEADSET_DEEP_BUFFER', +` +PCM_PLAYBACK_ADD(Jack Out DeepBuffer, 31, PIPELINE_PCM_31) +' +) +PCM_CAPTURE_ADD(Jack In, 1, PIPELINE_PCM_2) +ifdef(`EXT_AMP', +` +PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3) +') +PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_6) +PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_7) +PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_8) +# +# BE configurations - overrides config in ACPI if present +# + +#ALH dai index = ((link_id << 8) | PDI id) +#ALH SDW1 Pin258 (ID: 0) +DAI_CONFIG(ALH, 258, 0, SDW1-Playback, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, 258, 48000, 2))) + +#ALH SDW1 Pin259 (ID: 1) +DAI_CONFIG(ALH, 259, 1, SDW1-Capture, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, 259, 48000, 2))) + +ifdef(`EXT_AMP', +` +#ALH SDW AMP_1_LINK Pin2 (ID: 2) +DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) +') + +# 3 HDMI/DP outputs +DAI_CONFIG(HDA, 0, HDMI_BE_ID_BASE, iDisp1, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) +DAI_CONFIG(HDA, 1, eval(HDMI_BE_ID_BASE + 1), iDisp2, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) +DAI_CONFIG(HDA, 2, eval(HDMI_BE_ID_BASE + 2), iDisp3, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) + +DEBUG_END diff --git a/tools/topology/topology1/sof-cavs-nocodec.m4 b/tools/topology/topology1/sof-cavs-nocodec.m4 index 1efa0dddf109..40e563eba400 100644 --- a/tools/topology/topology1/sof-cavs-nocodec.m4 +++ b/tools/topology/topology1/sof-cavs-nocodec.m4 @@ -115,17 +115,19 @@ dnl time_domain, sched_comp) # Volume switch capture pipeline 2 on PCM 0 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, +ifdef(`DISABLE_SSP0',, + `PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 2, 0, 2, PIPE_BITS, 1000, 0, SSP0_CORE_ID, - 48000, 48000, 48000) + 48000, 48000, 48000)') # Volume switch capture pipeline 4 on PCM 1 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP1_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, +ifdef(`DISABLE_SSP1',, + `PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 4, 1, 2, PIPE_BITS, 1000, 0, SSP1_CORE_ID, - 48000, 48000, 48000) + 48000, 48000, 48000)') # Volume switch capture pipeline 6 on PCM 2 using max 2 channels of PIPE_BITS. # Set 1000us deadline with priority 0 on core SSP2_CORE_ID @@ -146,19 +148,21 @@ dnl deadline, priority, core, time_domain) # playback DAI is SSP0 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP0_CORE_ID # The 'NOT_USED_IGNORED' is due to dependencies and is adjusted later with an explicit dapm line. -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, +ifdef(`DISABLE_SSP0',, + `DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, 1, SSP, SSP0_IDX, NoCodec-0, NOT_USED_IGNORED, 2, DAI_BITS, - 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)') # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, +ifdef(`DISABLE_SSP0',, + `PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, 7, 0, 2, PIPE_BITS, 1000, 0, SSP0_CORE_ID, 48000, 48000, 48000, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) + PIPELINE_PLAYBACK_SCHED_COMP_1)') # Deep buffer playback pipeline 11 on PCM 3 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0. @@ -173,33 +177,37 @@ ifelse(PLATFORM, `bxt', `', # capture DAI is SSP0 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP0_IDX -DAI_ADD(sof/pipe-dai-capture.m4, +ifdef(`DISABLE_SSP0',, + `DAI_ADD(sof/pipe-dai-capture.m4, 2, SSP, SSP0_IDX, NoCodec-0, PIPELINE_SINK_2, 2, DAI_BITS, - 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP1 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP1_CORE_ID -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, +ifdef(`DISABLE_SSP1',, + `DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, 3, SSP, SSP1_IDX, NoCodec-1, NOT_USED_IGNORED, 2, DAI_BITS, - 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)') # Low Latency playback pipeline 8 on PCM 1 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP1_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, +ifdef(`DISABLE_SSP1',, + `PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, 8, 1, 2, PIPE_BITS, 1000, 0, SSP1_CORE_ID, 48000, 48000, 48000, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_3) + PIPELINE_PLAYBACK_SCHED_COMP_3)') # capture DAI is SSP1 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP1_CORE_ID -DAI_ADD(sof/pipe-dai-capture.m4, +ifdef(`DISABLE_SSP1',, + `DAI_ADD(sof/pipe-dai-capture.m4, 4, SSP, SSP1_IDX, NoCodec-1, PIPELINE_SINK_4, 2, DAI_BITS, - 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP2 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP2_CORE_ID @@ -240,8 +248,8 @@ SectionGraph."mixer-host" { lines [ # connect mixer dai pipelines to PCM pipelines - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_7) - dapm(PIPELINE_MIXER_3, PIPELINE_SOURCE_8) + ifdef(`DISABLE_SSP0',,`dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_7)') + ifdef(`DISABLE_SSP1',, `dapm(PIPELINE_MIXER_3, PIPELINE_SOURCE_8)') dapm(PIPELINE_MIXER_5, PIPELINE_SOURCE_9) ifelse(PLATFORM, `bxt', `dapm(PIPELINE_MIXER_5, PIPELINE_SOURCE_11)', diff --git a/tools/topology/topology1/sof-glk-es8336.m4 b/tools/topology/topology1/sof-glk-es8336.m4 index 08fc45124ca5..181b150ef523 100644 --- a/tools/topology/topology1/sof-glk-es8336.m4 +++ b/tools/topology/topology1/sof-glk-es8336.m4 @@ -53,6 +53,24 @@ include(`platform/intel/intel-generic-dmic.m4') ' ) +# Add HDMI-SSP Audio Offload pass-through +ifdef(`HDMI_1_SSP_NUM', +` define(`HDMI_SSP_NUM', HDMI_1_SSP_NUM) + define(`HDMI_SSP_PIPELINE_CP_ID', `8') + define(`HDMI_SSP_DAI_LINK_ID', 6) + define(`HDMI_SSP_PCM_ID', `3') dnl use fixed PCM_ID + include(`platform/intel/intel-hdmi-ssp.m4') +' +) + +ifdef(`HDMI_2_SSP_NUM', +` define(`HDMI_SSP_NUM', HDMI_2_SSP_NUM) + define(`HDMI_SSP_PIPELINE_CP_ID', `9') + define(`HDMI_SSP_DAI_LINK_ID', 7) + define(`HDMI_SSP_PCM_ID', `4') dnl use fixed PCM_ID + include(`platform/intel/intel-hdmi-ssp.m4') +' +) DEBUG_START # @@ -68,6 +86,16 @@ ifelse(CHANNELS, `0', # PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5) # PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6) # PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7) +ifdef(`HDMI_1_SSP_NUM', +` +# PCM3 <---- volume <----- HDMI_1_SSP_NUM (lt6911) +' +) +ifdef(`HDMI_2_SSP_NUM', +` +# PCM4 <---- volume <----- HDMI_2_SSP_NUM (lt6911) +' +) # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # 1000us deadline with priority 0 on core 0 diff --git a/tools/topology/topology1/sof-hda-generic.m4 b/tools/topology/topology1/sof-hda-generic.m4 index 485ef520c496..d7fd82662e8e 100644 --- a/tools/topology/topology1/sof-hda-generic.m4 +++ b/tools/topology/topology1/sof-hda-generic.m4 @@ -37,6 +37,15 @@ include(`platform/intel/intel-generic-dmic.m4') ' ) +ifdef(`BT_OFFLOAD', ` +# BT offload support +define(`BT_PIPELINE_PB_ID', `12') +define(`BT_PIPELINE_CP_ID', `13') +define(`BT_DAI_LINK_ID', 8) +define(`BT_PCM_ID', `8') +define(`HW_CONFIG_ID', 8) +include(`platform/intel/intel-generic-bt.m4')') + # The pipeline naming notation is pipe-mixer-PROCESSING-dai-DIRECTION.m4 # HSPROC is set by makefile, if not the default above is applied define(PIPE_HEADSET_PLAYBACK, `sof/pipe-mixer-`HSPROC'-dai-playback.m4') diff --git a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 index 74f96d7b4d3d..26430f3d45fe 100644 --- a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 +++ b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 @@ -2,6 +2,10 @@ # Topology for Icelake with rt711 + rt1308 (x2) + rt715. # +# if XPROC is not defined, define with default pipe +ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') +ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') + # Include topology builder include(`utils.m4') include(`dai.m4') @@ -9,6 +13,7 @@ include(`pipeline.m4') include(`alh.m4') include(`muxdemux.m4') include(`hda.m4') +include(`platform/intel/dmic.m4') # Include TLV library include(`common/tlv.m4') @@ -19,6 +24,9 @@ include(`sof/tokens.m4') # Include Platform specific DSP configuration include(`platform/intel/'PLATFORM`.m4') +ifdef(`CHANNELS',`', +`define(CHANNELS, `0')') + ifdef(`UAJ_LINK',`', `define(UAJ_LINK, `0')') @@ -40,6 +48,36 @@ ifdef(`MIC_LINK',`', # HDMI ID calculated based on the configuraiton define(HDMI_BE_ID_BASE, `0') +# SDW Pin as DAIs index starts from 2 on each SDW link +define(`ALH_JACK_OUT_PIN', `2') +define(`ALH_JACK_IN_PIN', `3') +define(`ALH_AMP_OUT_PIN', `2') +define(`ALH_DMIC_IN_PIN', `2') + +define(`ALH_JACK_OUT_NAME', `SDW'eval(UAJ_LINK)`-Playback') +define(`ALH_JACK_IN_NAME', `SDW'eval(UAJ_LINK)`-Capture') +define(`ALH_AMP_OUT_NAME', `SDW'eval(AMP_1_LINK)`-Playback') +define(`ALH_DMIC_IN_NAME', `SDW'eval(MIC_LINK)`-Capture') + +ifdef(`MFC', ` +undefine(`ALH_JACK_IN_PIN') +undefine(`ALH_AMP_OUT_PIN') +undefine(`ALH_DMIC_IN_PIN') +define(`ALH_JACK_IN_PIN', `4') +define(`ALH_AMP_OUT_PIN', `5') +define(`ALH_DMIC_IN_PIN', `3') + +# align the partial string match of full dai link name +undefine(`ALH_JACK_OUT_NAME') +undefine(`ALH_JACK_IN_NAME') +undefine(`ALH_AMP_OUT_NAME') +undefine(`ALH_DMIC_IN_NAME') +define(`ALH_JACK_OUT_NAME', `Playback-SimpleJack') +define(`ALH_JACK_IN_NAME', `Capture-SimpleJack') +define(`ALH_AMP_OUT_NAME', `Playback-SmartAmp') +define(`ALH_DMIC_IN_NAME', `Capture-SmartMic')' +) + ifdef(`NO_JACK', `', `undefine(`HDMI_BE_ID_BASE') define(HDMI_BE_ID_BASE, `2')' @@ -61,6 +99,27 @@ ifdef(`NO_LOCAL_MIC', `', define(HDMI_BE_ID_BASE, `5')' ) +# Define pipeline id for intel-generic-dmic.m4 +# to generate dmic setting +ifelse(CHANNELS, `0', +` +' +, +` +define(DMIC_PCM_48k_ID, `10') +define(DMIC_PCM_16k_ID, `11') +define(DMIC_PIPELINE_48k_ID, `10') +define(DMIC_PIPELINE_16k_ID, `11') + +define(DMIC_DAI_LINK_48k_ID, `4') +define(DMIC_DAI_LINK_16k_ID, eval(DMIC_DAI_LINK_48k_ID+1)) +include(`platform/intel/intel-generic-dmic.m4') +undefine(`HDMI_BE_ID_BASE') +define(HDMI_BE_ID_BASE, eval(DMIC_DAI_LINK_16k_ID+1)) +' +) + + DEBUG_START dnl Configure demux @@ -106,16 +165,16 @@ ifdef(`NOJACK', `', ` # PCM0 ---> volume ----> mixer --->ALH 2 BE UAJ_LINK # PCM31 ---> volume ------^ -# PCM1 <--- volume <---- ALH 3 BE UAJ_LINK +# PCM1 <--- volume <---- ALH 3/4 BE UAJ_LINK ') ifdef(`NOAMP', `', ` -# PCM2 ---> volume ----> ALH 2 BE AMP_1_LINK +# PCM2 ---> volume ----> ALH 2/5 BE AMP_1_LINK ifdef(`MONO', `', -`# PCM40 ---> volume ----> ALH 2 BE AMP_2_LINK') +`# PCM40 ---> volume ----> ALH 2/5 BE AMP_2_LINK') ') ifdef(`NO_LOCAL_MIC', `', -`# PCM4 <--- volume <---- ALH 2 BE MIC_LINK') +`# PCM4 <--- volume <---- ALH 2/3 BE MIC_LINK') ifdef(`NOHDMI', `', ` @@ -215,14 +274,14 @@ ifdef(`NOJACK', `', # The NOT_USED_IGNORED is due to dependencies and is adjusted later with an explicit dapm line. DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, - 1, ALH, eval(UAJ_LINK * 256 + 2), `SDW'eval(UAJ_LINK)`-Playback', + 1, ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), ALH_JACK_OUT_NAME, NOT_USE_IGNORED, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) # capture DAI is ALH(UAJ_LINK PIN3) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 2, ALH, eval(UAJ_LINK * 256 + 3), `SDW'eval(UAJ_LINK)`-Capture', + 2, ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), ALH_JACK_IN_NAME, PIPELINE_SINK_2, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) @@ -271,13 +330,13 @@ ifdef(`NOAMP', `', # playback DAI is ALH(AMP_1_LINK PIN2/AMP_2_LINK PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, - 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', + 3, ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), ALH_AMP_OUT_NAME, PIPELINE_SOURCE_3, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) ifdef(`MONO', `', `DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 4, ALH, eval(AMP_2_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', + 4, ALH, eval(AMP_2_LINK * 256 + ALH_AMP_OUT_PIN), ALH_AMP_OUT_NAME, PIPELINE_SOURCE_4, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, PIPELINE_PLAYBACK_SCHED_COMP_3) @@ -299,7 +358,7 @@ ifdef(`NO_LOCAL_MIC', `', # capture DAI is ALH(MIC_LINK PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 5, ALH, eval(MIC_LINK * 256 + 2), `SDW'eval(MIC_LINK)`-Capture', + 5, ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), ALH_DMIC_IN_NAME, PIPELINE_SINK_5, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) ') @@ -362,26 +421,26 @@ ifdef(`NOJACK', `', ` #ALH dai index = ((link_id << 8) | PDI id) #ALH UAJ_LINK Pin2 (ID: 0) -DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 2), 0, `SDW'eval(UAJ_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 2), 48000, 2))) +DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), 0, ALH_JACK_OUT_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), 48000, 2))) -#ALH UAJ_LINK Pin3 (ID: 1) -DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 3), 1, `SDW'eval(UAJ_LINK)`-Capture', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 3), 48000, 2))) +#ALH UAJ_LINK Pin3/4 (ID: 1) +DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), 1, ALH_JACK_IN_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), 48000, 2))) ') ifdef(`NOAMP', `', ` -#ALH AMP_1_LINK Pin2 (ID: 2) -DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) +#ALH AMP_1_LINK Pin2/5 (ID: 2) +DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), 2, ALH_AMP_OUT_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), 48000, 2))) ') ifdef(`NO_LOCAL_MIC', `', ` -#ALH MIC_LINK Pin2 (ID: 4) -DAI_CONFIG(ALH, eval(MIC_LINK * 256 + 2), 4, `SDW'eval(MIC_LINK)`-Capture', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + 2), 48000, 2))) +#ALH MIC_LINK Pin2/3 (ID: 4) +DAI_CONFIG(ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), 4, ALH_DMIC_IN_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), 48000, 2))) ') ifdef(`NOHDMI', `', diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index 89fb7045f344..14da0da4d346 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -1,5 +1,8 @@ # -# Topology for JasperLake with rt5682 codec + DMIC + 3 HDMI + Speaker amp +# Topology for JasperLake with rt5682 or cs42l42 codec + +# DMIC + +# 3 HDMI + +# speaker amp # # Include topology builder @@ -23,8 +26,9 @@ DEBUG_START # # Define the pipelines # -# PCM0 ----> volume -----> SSP1 (Speaker - ALC1015) -# PCM1 <---> volume <----> SSP0 (Headset - ALC5682) +ifdef(`NO_AMP',`',` +# PCM0 ----> volume -----> SSP1 (Speaker - ALC1015)') +`# PCM1 <---> volume <----> SSP0 (Headset - 'HEADPHONE`)' # PCM2 ----> volume -----> iDisp1 # PCM3 ----> volume -----> iDisp2 # PCM4 ----> volume -----> iDisp3 @@ -55,6 +59,7 @@ dnl PIPELINE_PCM_ADD(pipeline, dnl pipe id, pcm, max channels, format, dnl frames, deadline, priority, core) +ifdef(`NO_AMP',`',` # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 define(ENDPOINT_NAME, `Speakers') @@ -63,7 +68,7 @@ PIPELINE_PCM_ADD( 1, 0, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) -undefine(ENDPOINT_NAME) +undefine(`ENDPOINT_NAME')') # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 @@ -75,7 +80,7 @@ PIPELINE_PCM_ADD( 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) -undefine(ENDPOINT_NAME) +undefine(`ENDPOINT_NAME') # Low Latency capture pipeline 3 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 @@ -113,12 +118,13 @@ dnl pipe id, dai type, dai_index, dai_be, dnl buffer, periods, format, dnl frames, deadline, priority, core) +ifdef(`NO_AMP',`',` # playback DAI is SSP1 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, SPK_INDEX, SPK_NAME, PIPELINE_SOURCE_1, 2, SPK_DATA_FORMAT, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP0 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 @@ -157,7 +163,8 @@ DAI_ADD(sof/pipe-dai-playback.m4, # PCM Low Latency, id 0 dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1) +ifdef(`NO_AMP',`',` +PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1)') PCM_DUPLEX_ADD(Headset, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_5) PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_6) @@ -172,17 +179,36 @@ dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data) dnl SSP_CLOCK(clock, freq, codec_master, polarity) dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id) +ifelse(HEADPHONE, `rt5682', ` # SSP 0 (ID: 0) ALC5682 +DAI_CONFIG(SSP, 0, 0, SSP0-Codec, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), + SSP_CLOCK(bclk, 2400000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 25, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON))) +', HEADPHONE, `cs42l42', ` +# SSP 0 (ID: 0) CS42L42 DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES))) +', HEADPHONE, `rt5650', ` +# SSP 0 (ID: 0) ALC5650-I2S1 +DAI_CONFIG(SSP, 0, 0, SSP0-Codec, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON))) +', ) +ifdef(`NO_AMP',`',` # SSP 1 (ID: 6) DAI_CONFIG(SSP, SPK_INDEX, 6, SPK_NAME, - SET_SSP_CONFIG) + SET_SSP_CONFIG)') # 4 HDMI/DP outputs (ID: 3,4,5) DAI_CONFIG(HDA, 0, 3, iDisp1, diff --git a/tools/topology/topology1/sof-smart-amplifier.m4 b/tools/topology/topology1/sof-smart-amplifier.m4 index b96f7f163480..6896419b8719 100644 --- a/tools/topology/topology1/sof-smart-amplifier.m4 +++ b/tools/topology/topology1/sof-smart-amplifier.m4 @@ -19,6 +19,11 @@ DEBUG_START # define the default macros. # define them in your specific platform .m4 if needed. +#undefine the DYNAMIC flag (if enabled, save it) for smart amplifier as it uses volatile kcontrols +ifdef(`DYNAMIC', `define(`SAVED_DYNAMIC', DYNAMIC)',`') +undefine(`DYNAMIC') + + # define(`SMART_AMP_CORE', 1) define the DSP core that the DSM pipeline will be run on, if not done yet ifdef(`SMART_AMP_CORE',`',`define(`SMART_AMP_CORE', 0)') @@ -236,4 +241,7 @@ DAI_CONFIG(SSP, SMART_SSP_INDEX, SMART_BE_ID, SMART_SSP_NAME, SSP_CONFIG_DATA(SSP, SMART_SSP_INDEX, 32, 0, SMART_SSP_QUIRK))) ') +#Re-enable DYNAMIC flag if it was enabled for other pipelines +ifdef(`SAVED_DYNAMIC', `define(`DYNAMIC', 1)',`') + DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 679efc658967..d69b2c6a581d 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -30,6 +30,25 @@ DEBUG_START # ifdef(`2CH_2WAY', `ifdef(`4CH_PASSTHROUGH', `fatal_error(note: 2CH_2WAY and 4CH_PASSTHROUGH are mutually exclusive)')') +# +# Set headphone type, default is RT5682 +# +ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',` + ifdef(`USE_RT5650',`define(HEADPHONE, `RT5650')',`define(HEADPHONE, `RT5682')')') + +# +# Set the MCLK rate for headphone and amplifier SSP ports +# +ifelse( + HEADPHONE, `DA7219', ` + define(MCLK_RATE, `24576000')', + HEADPHONE, `RT5650', ` + define(MCLK_RATE, `24576000') + define(CODEC, `RT5650')', + HEADPHONE, `RT5682', ` + define(MCLK_RATE, `19200000')', + `fatal_error(note: unknown HEADPHONE type)') + # # Define the demux configure # @@ -114,7 +133,7 @@ ifdef(`WAVES',` # PCM99 <---- volume <---- DMIC01 (dmic 48k capture) # PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', `define(`SPK_MIC_PERIOD_US', 10000)', `define(`SPK_MIC_PERIOD_US', 1000)') +ifdef(`SPK_MIC_PERIOD_US',`', `define(`SPK_MIC_PERIOD_US', 1000)') ifdef(`NO_AMP',`',` # Define pipeline id for sof-tgl-CODEC-rt5682.m4 @@ -133,7 +152,7 @@ define(`SPK_REF_DAI_NAME', concat(concat(`SSP', SPK_SSP_INDEX),`.IN'))') # to generate dmic setting with kwd when we have dmic # define channel -define(CHANNELS, `4') +ifdef(`CHANNELS', `', `define(`CHANNELS', 4)') # define kfbm with volume define(KFBM_TYPE, `vol-kfbm') # define pcm, pipeline and dai id @@ -165,6 +184,8 @@ define(KWD_PIPE_SCH_DEADLINE_US, 5000) ifdef(`NOHOTWORD', ` define(NO16KDMIC) +define(DMIC_48k_CORE_ID, 1) +ifdef(`DMICPROC',`',`define(`DMICPROC', passthrough)') include(`platform/intel/intel-generic-dmic.m4')', `include(`platform/intel/intel-generic-dmic-kwd.m4')') @@ -198,11 +219,14 @@ PIPELINE_PCM_ADD( undefine(`ENDPOINT_NAME')') ifdef(`NO_HEADPHONE',`',` +# define Waves integration on Headphones = WAVES && !WAVES_SPK_ONLY +ifdef(`WAVES', `ifdef(`WAVES_SPK_ONLY', `', `define(`WAVES_HEADPHONE')')', `') + # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s24le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 define(`ENDPOINT_NAME', `Headphones') PIPELINE_PCM_ADD( - ifdef(`WAVES', sof/pipe-waves-codec-playback.m4, sof/pipe-volume-playback.m4), + ifdef(`WAVES_HEADPHONE', sof/pipe-waves-codec-playback.m4, sof/pipe-volume-playback.m4), 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) @@ -411,57 +435,78 @@ ifdef(`NO_AMP',`',` DAI_CONFIG(SSP, SPK_SSP_INDEX, SPK_BE_ID, SPK_SSP_NAME, ifelse( CODEC, `MAX98357A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 1536000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 16, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', CODEC, `MAX98360A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `MAX98360A_TDM', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 12288000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(8, 32, 15, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `RT1011', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 4800000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 25, 3, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', CODEC, `MAX98390', ` - SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 6144000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 32, 3, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `RT1019', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', CODEC, `CS35L41', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 6144000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 32, 3, 15), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24, 0, 0, 0, SSP_CC_BCLK_ES)))', + CODEC, `RT5650', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24, 0, 0, 0, SSP_CC_MCLK_AON)))', )') ifdef(`NO_HEADPHONE',`',` # SSP 0 (ID: BOARD_HP_BE_ID) DAI_CONFIG(SSP, 0, BOARD_HP_BE_ID, SSP0-Codec, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), +ifelse( + HEADPHONE, `DA7219', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24)))', + HEADPHONE, `RT5682', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))') + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, eval(SSP_CC_BCLK_ES | SSP_CC_MCLK_AON))))', + HEADPHONE, `RT5650', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON)))', + )') # 4 HDMI/DP outputs (ID: 3,4,5,6) DAI_CONFIG(HDA, 0, BOARD_HDMI_BE_ID_BASE, iDisp1, diff --git a/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 index 7c71cc44a309..455347f74127 100644 --- a/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 @@ -238,7 +238,7 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 32))) + SSP_CONFIG_DATA(SSP, 0, 32, 0, 0, 0, SSP_CC_MCLK_AON))) # 4 HDMI/DP outputs (ID: 3,4,5,6) DAI_CONFIG(HDA, 0, 3, iDisp1, diff --git a/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 b/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 new file mode 100644 index 000000000000..a10cd51c05f8 --- /dev/null +++ b/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 @@ -0,0 +1,219 @@ +# +# Topology for Tigerlake with rt1308 codec + DMIC + 3 HDMI out + 2 HDMI-in capture +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`ssp.m4') +include(`hda.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Tigerlake DSP configuration +include(`platform/intel/'PLATFORM`.m4') +include(`platform/intel/dmic.m4') + +define(`HDMI1_SSP_NAME', concat(concat(`SSP', HDMI_1_SSP_NUM),`-HDMI')) +define(`HDMI2_SSP_NAME', concat(concat(`SSP', HDMI_2_SSP_NUM),`-HDMI')) +define(`AMP_SSP_NAME', concat(concat(`SSP', AMP_SSP_NUM),`-Codec')) + +ifdef(`NO_AMP',`',` +ifdef(`AMP_SSP_NUM',`',`fatal_error(note: Define AMP_SSP_NUM for speaker amp SSP)')') + +DEBUG_START +# +# Define the pipelines +# +# PCM0 <---- volume <----- HDMI-1 SSP +# PCM1 <---- volume <----- HDMI-2 SSP +# PCM2 ----> volume -----> Codec SSP +# PCM3 <---- volume <----- DMIC01 (dmic0 capture) +# + +# PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5) +# PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6) +# PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7) + + +dnl PIPELINE_PCM_ADD(pipeline, +dnl pipe id, pcm, max channels, format, +dnl frames, deadline, priority, core) + +# Low Latency capture pipeline 1 on PCM 0 using max 2 channels of s16le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, + 1, 0, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + + +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s16le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, + 2, 1, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +ifdef(`NO_AMP',`',` +# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 3, 2, 2, s24le, + 1000, 0, 0, + 48000, 48000, 48000)') + +# Passthrough capture pipeline 4 on PCM 3 using max 4 channels. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 4, 3, 4, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 5, 5, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 6 on PCM 6 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 6, 6, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 7 on PCM 7 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 7, 7, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl frames, deadline, priority, core) + +# capture DAI using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 1, SSP, HDMI_1_SSP_NUM, HDMI1_SSP_NAME, + PIPELINE_SINK_1, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# capture DAI using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, HDMI_2_SSP_NUM, HDMI2_SSP_NAME, + PIPELINE_SINK_2, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +ifdef(`NO_AMP',`',` +# playback DAI using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 3, SSP, AMP_SSP_NUM, AMP_SSP_NAME, + PIPELINE_SOURCE_3, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)') + +# capture DAI is DMIC01 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 4, DMIC, 0, dmic01, + PIPELINE_SINK_4, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp1 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 5, HDA, 5, iDisp1, + PIPELINE_SOURCE_5, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp2 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 6, HDA, 6, iDisp2, + PIPELINE_SOURCE_6, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp3 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 7, HDA, 7, iDisp3, + PIPELINE_SOURCE_7, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# PCM Low Latency, id 0 +dnl PCM_CAPTURE_ADD(name, pcm_id, capture) +PCM_CAPTURE_ADD(HDMI-IN-1, 0, PIPELINE_PCM_1) + +dnl PCM_CAPTURE_ADD(name, pcm_id, capture) +PCM_CAPTURE_ADD(HDMI-IN-2, 1, PIPELINE_PCM_2) + +ifdef(`NO_AMP',`',` +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3)') +PCM_CAPTURE_ADD(DMIC01, 3, PIPELINE_PCM_4) + +PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_5) +PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_6) +PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_7) + +# +# BE configurations - overrides config in ACPI if present +# + +#HDMI-1 SSP (ID: 0) +#MCLK is not required and won't impact for HDMI-in capture use case. +DAI_CONFIG(SSP, HDMI_1_SSP_NUM, 0, HDMI1_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_master), + SSP_CLOCK(fsync, 48000, codec_master), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, HDMI_1_SSP_NUM, 32, 0))) + +#HDMI-2 SSP (ID: 1) +#MCLK is not required and won't impact for HDMI-in capture use case. +DAI_CONFIG(SSP, HDMI_2_SSP_NUM, 1, HDMI2_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_master), + SSP_CLOCK(fsync, 48000, codec_master), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, HDMI_2_SSP_NUM, 32, 0))) + +ifdef(`NO_AMP',`',` +#Amplifier Codec SSP (ID: 2) +DAI_CONFIG(SSP, AMP_SSP_NUM, 2, AMP_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), + SSP_CLOCK(bclk, 2400000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 25, 3, 3), + SSP_CONFIG_DATA(SSP, AMP_SSP_NUM, 24)))') + +# dmic01 (ID: 3) +DAI_CONFIG(DMIC, 0, 3, dmic01, + DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000, + DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, + PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) + + +# 3 HDMI/DP outputs (ID: 5,6,7) +DAI_CONFIG(HDA, 5, 5, iDisp1, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) +DAI_CONFIG(HDA, 6, 6, iDisp2, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2))) +DAI_CONFIG(HDA, 7, 7, iDisp3, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 7, 48000, 2))) +DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 index 702b171e3307..73f3bc7b67ae 100644 --- a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 +++ b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 @@ -30,6 +30,8 @@ define(JACK_OFFSET, `0') define(JACK_OFFSET, `2') ') +ifdef(`AMP_1_LINK',`', +`define(AMP_1_LINK, `1')') # if there is an external RT1308 amplifier connected over SoundWire, # enable "EXT_AMP" option in the CMakefile. @@ -74,12 +76,7 @@ define(DMIC_OFFSET, `2') define(HDMI_BE_ID_BASE, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+DMIC_OFFSET)) -# Add Bluetooth Audio Offload pass-through for ADL -ifelse(PLATFORM, `adl', -` -define(BT_OFFLOAD) -' -) +# Add Bluetooth Audio Offload pass-through ifdef(`BT_OFFLOAD', ` define(`BT_PIPELINE_PB_ID', `13') @@ -100,7 +97,7 @@ DEBUG_START # PCM31 ---> volume ------^ # PCM1 <--- volume <---- ALH 3 BE dailink 1 ifdef(`EXT_AMP', ` -# PCM2 ---> volume ----> ALH 2 BE dailink 2 +# PCM2 ---> volume ----> ALH 2 BE dailink AMP_1_LINK ') # PCM5 ---> volume <---- iDisp1 # PCM6 ---> volume <---- iDisp2 @@ -108,13 +105,14 @@ ifdef(`EXT_AMP', ` # PCM8 ---> volume <---- iDisp4 # PCM10 <----volume <---- DMIC01 # PCM11 <----volume <---- DMIC16k -ifelse(PLATFORM, `adl', ` +ifdef(`BT_OFFLOAD', +` # PCM14 <---> passthrough <---> SSP2 BT playback/capture -', `') +') # Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, +PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) @@ -219,10 +217,10 @@ ifdef(`HEADSET_DEEP_BUFFER', ifdef(`EXT_AMP', ` -# playback DAI is ALH(SDW1 PIN2) using 2 periods +# playback DAI is ALH(AMP_1_LINK PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, - 3, ALH, 0x102, SDW1-Playback, + 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', PIPELINE_SOURCE_3, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) ') @@ -287,9 +285,9 @@ DAI_CONFIG(ALH, 3, 1, SDW0-Capture, ifdef(`EXT_AMP', ` -#ALH SDW1 Pin2 (ID: 2) -DAI_CONFIG(ALH, 0x102, 2, SDW1-Playback, - ALH_CONFIG(ALH_CONFIG_DATA(ALH, 0x102, 48000, 2))) +#ALH SDW AMP_1_LINK Pin2 (ID: 2) +DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) ') # 3 HDMI/DP outputs diff --git a/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 b/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 index c62fe1b975b3..eb3350a493a2 100644 --- a/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 +++ b/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 @@ -38,7 +38,8 @@ include(`bytecontrol.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID (when supporting multiple codecs, 0 otherwise) # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 b/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 index eb75022e1276..32bef3a1d3e7 100644 --- a/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 +++ b/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 @@ -38,7 +38,8 @@ include(`bytecontrol.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID (when supporting multiple codecs, 0 otherwise) # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 b/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 index 647e32756750..82f846707ec0 100644 --- a/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 +++ b/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 @@ -39,7 +39,8 @@ include(`eq_iir.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID (when supporting multiple codecs, 0 otherwise) # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 b/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 index c4deb6ff2606..96b62685a53b 100644 --- a/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 +++ b/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 @@ -47,9 +47,9 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, ) # RTNR Bytes control with max value of 255 -C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, - CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), - CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), +C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get handlers, 258), , , , CONTROLBYTES_MAX(, 256), , diff --git a/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 b/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 index e34b454d662c..04f668aac112 100644 --- a/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 +++ b/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 @@ -38,7 +38,7 @@ C_CONTROLMIXER(Master Capture Switch, PIPELINE_ID, , Channel register and shift for Front Left/Right, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)), - "1", "1") + "0", "0") # # Volume Configuration # diff --git a/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 b/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 index b5a5dc25e40f..9a9b7af650c4 100644 --- a/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 +++ b/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 @@ -38,7 +38,8 @@ include(`bytecontrol.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID, when supporting multiple codecs, 0 otherwise # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-rtnr-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-capture.m4 index cffa27c82833..c5d180f4567e 100644 --- a/tools/topology/topology1/sof/pipe-rtnr-capture.m4 +++ b/tools/topology/topology1/sof/pipe-rtnr-capture.m4 @@ -38,8 +38,8 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, ) # RTNR Bytes control with max value of 255 -C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, - CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), +C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get handlers, 258), CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), , , , CONTROLBYTES_MAX(, 256), diff --git a/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 new file mode 100644 index 000000000000..8ea4352e724c --- /dev/null +++ b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 @@ -0,0 +1,132 @@ +# Acoustic echo cancelling Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <- NC <-- B1 <-- AEC <-- B2 <-- source DAI0 +# ^----- B3 <-- AEC reference + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`dai.m4') +include(`mixercontrol.m4') +include(`pipeline.m4') +include(`bytecontrol.m4') +include(`enumcontrol.m4') +include(`google_rtc_audio_processing.m4') +include(`rtnr.m4') + +define(GOOGLE_RTC_AUDIO_PROCESSING_priv, concat(`google_rtc_audio_processing_bytes_', PIPELINE_ID)) +define(GOOGLE_RTC_AUDIO_PROCESSING_CTRL, concat(`google_rtc_audio_processing_control_', PIPELINE_ID)) + +include(`google_rtc_audio_processing_default.m4') + +define(DEF_RTNR_PRIV, concat(`rtnr_priv_', PIPELINE_ID)) +define(DEF_RTNR_BYTES, concat(`rtnr_bytes_', PIPELINE_ID)) + +ifdef(`RTNR_BUFFER_SIZE_MIN',`', define(RTNR_BUFFER_SIZE_MIN, `65536')) +ifdef(`RTNR_BUFFER_SIZE_MAX',`', define(RTNR_BUFFER_SIZE_MAX, `65536')) + +CONTROLBYTES_PRIV(DEF_RTNR_PRIV, +` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,' +` 0x20,0x00,0x00,0x00,0x00,0x30,0x01,0x03,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,' +` 0x80,0xbb,0x00,0x00,0x00,0x00,0x00,0x00"' +) + +# RTNR Bytes control with max value of 255 +C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), + , , , + CONTROLBYTES_MAX(, 256), + , + DEF_RTNR_PRIV) + +# RTNR Enable switch +define(DEF_RTNR_ENABLE, concat(`rtnr_enable_', PIPELINE_ID)) +define(`CONTROL_NAME', `DEF_RTNR_ENABLE') + +C_CONTROLMIXER(DEF_RTNR_ENABLE, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259), + CONTROLMIXER_MAX(max 1 indicates switch type control, 1), + false, + , + Channel register and shift for Front Center, + LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)), + "1") +undefine(`CONTROL_NAME') + +C_CONTROLBYTES(`Config', PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the control to bytes get/put handlers, 258, 258), + CONTROLBYTES_EXTOPS(258 binds the control to bytes get/put handlers, 258, 258), + , , , + CONTROLBYTES_MAX(, 2048), + , + GOOGLE_RTC_AUDIO_PROCESSING_priv) + +# +# Components and Buffers +# + +# Host "Google RTC Audio Processing Capture" PCM +# with 0 sink and 2 source periods +W_PCM_CAPTURE(PCM_ID, Google RTC Audio Processing, 0, DAI_PERIODS, SCHEDULE_CORE) + +W_GOOGLE_RTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, + `', + LIST(` ', "Config")) + +# "RTNR 0" has 2 sink period and 2 source periods +W_RTNR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, LIST(` ', "DEF_RTNR_BYTES"), LIST(` ', "DEF_RTNR_ENABLE")) + +# Capture Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_HOST_MEM_CAP) +W_BUFFER(1, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) +W_BUFFER(2, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) +W_BUFFER(3, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) + +define(`N_AEC_REF_BUF',`BUF'PIPELINE_ID`.'3) +# +# Pipeline Graph +# +# host PCM_P <-- B0 <-- RTNR0 <-- B1 <-- AEC0 <-- B2 <-- sink DAI0 +# ^------- B3 <-- AEC ref + +P_GRAPH(pipe-google-aec-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMC(PCM_ID), N_BUFFER(0))', + `dapm(N_BUFFER(0), N_RTNR(0))', + `dapm(N_RTNR(0), N_BUFFER(1))', + `dapm(N_BUFFER(1), N_GOOGLE_RTC_AUDIO_PROCESSING(0))', + `dapm(N_GOOGLE_RTC_AUDIO_PROCESSING(0), N_BUFFER(2))', + `dapm(N_GOOGLE_RTC_AUDIO_PROCESSING(0), N_BUFFER(3))')) + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(2)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Google RTC Audio Processing PCM_ID) + +# +# PCM Configuration +# + +PCM_CAPABILITIES(Google RTC Audio Processing PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), + PCM_MIN_RATE, PCM_MAX_RATE, PIPELINE_CHANNELS, PIPELINE_CHANNELS, + 2, 16, 192, 16384, 65536, 65536) + +undefine(`DEF_RTNR_ENABLE') diff --git a/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 b/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 index e61cd45afc4b..7d713a424b1c 100644 --- a/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 +++ b/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 @@ -32,7 +32,7 @@ C_CONTROLMIXER(Master Capture Switch, PIPELINE_ID, , Channel register and shift for Front Left/Right, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)), - "1", "1") + "0", "0") # # Volume Configuration diff --git a/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 b/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 index 71775b68bf82..a29e43a3bfdb 100644 --- a/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 +++ b/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 @@ -31,7 +31,9 @@ include(`codec_adapter.m4') ifdef(`ENDPOINT_NAME',`',`fatal_error(`Pipe requires ENDPOINT_NAME to be defined: Speakers, Headphones, etc.')') -define(`SETUP_PARAMS_NAME', `Waves' `ENDPOINT_NAME' `Setup' PIPELINE_ID) +ifelse(PLATFORM, `tgl', ` + define(SETUP_PARAMS_NAME, `MaxxChrome Setup' PIPELINE_ID)', ` + define(SETUP_PARAMS_NAME, `Waves' `ENDPOINT_NAME' `Setup' PIPELINE_ID)') CONTROLBYTES_PRIV(PP_SETUP_CONFIG, ` bytes "0x53,0x4f,0x46,0x00,' diff --git a/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 b/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 index 2c19ec0f19a2..ee13918b69ab 100644 --- a/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 +++ b/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 @@ -22,7 +22,10 @@ define(`CA_SETUP_CONTROLBYTES', ` 0x00,0x00,0x00,0x00"'' ) define(`CA_SETUP_CONTROLBYTES_MAX', 8192) -define(`CA_SETUP_CONTROLBYTES_NAME', `Waves' `ENDPOINT_NAME' `Setup ') + +ifelse(PLATFORM, `tgl', ` + define(CA_SETUP_CONTROLBYTES_NAME, `MaxxChrome Setup ')', ` + define(CA_SETUP_CONTROLBYTES_NAME, `Waves' `ENDPOINT_NAME' `Setup ')') define(`CA_SCHEDULE_CORE', 0) diff --git a/zephyr/docker-build.sh b/zephyr/docker-build.sh index 191fa7b45975..77c7b2875efa 100755 --- a/zephyr/docker-build.sh +++ b/zephyr/docker-build.sh @@ -52,7 +52,7 @@ exec_as_sof_uid() # Double sudo to work around some funny restriction in # zephyr-build:/etc/sudoers: 'user' can do anything but... only as # root. - sudo sudo -u "$sof_user" "$0" "$@" + sudo sudo -u "$sof_user" http_proxy="$http_proxy" https_proxy="$https_proxy" "$0" "$@" exit "$?" }