From 61a707833714fd3535fabf41ce30c73bbeb199d4 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 5 Dec 2023 04:47:25 +0000 Subject: [PATCH] set_xtensa_params.sh: add missing LNL, ACP_6_3 and vangogh This adds support for: ./scripts/rebuild-testbench.sh -p lnl Also clean-up, re-order and add comments to set_xtensa_params.sh Signed-off-by: Marc Herbert --- scripts/set_xtensa_params.sh | 65 +++++++++++++++++++++++++++++----- scripts/xtensa-build-zephyr.py | 1 + 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/scripts/set_xtensa_params.sh b/scripts/set_xtensa_params.sh index 169e9c15ab5f..32ec351de505 100644 --- a/scripts/set_xtensa_params.sh +++ b/scripts/set_xtensa_params.sh @@ -1,12 +1,33 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2023 Intel Corporation. All rights reserved. -# Sourced script argument is a non-standard bash extension -platform=$1 +### XTENSA_ toolchain configuration shared across projects ### + +# These variables are currently used in/by: +# +# - xtensa-build-all.sh (XTOS) +# - script/rebuild-testbench.sh +# - before Zephyr's `twister` or `west build` +# +# Not all variables are used in all use cases. Some are. +# +# The variables used by Zephyr are duplicated in +# xtensa-build-zephyr.py, please keep in sync! + +# To maximize reuse, keep this script very basic and minimal and don't +# `export`: leave which the decision for each variable to the caller. -# Note: This duplicates xtensa-build-zephyr.py + +# Sourced script argument $1 is a non-standard bash extension +[ -n "$1" ] || { + >&2 printf 'Missing platform argument\n' + return 1 # Not exit! +} +platform=$1 case "$platform" in + + # Intel tgl) PLATFORM="tgplp" XTENSA_CORE="cavs2x_LX6HiFi3_2017_8" @@ -26,6 +47,17 @@ case "$platform" in # default key for TGL PLATFORM_PRIVATE_KEY="-D${SIGNING_TOOL}_PRIVATE_KEY=$SOF_TOP/keys/otc_private_key_3k.pem" ;; + mtl|lnl) + PLATFORM="$platform" + XTENSA_CORE="ace10_LX7HiFi4_2022_10" + XTENSA_TOOLS_VERSION="RI-2022.10-linux" + # TODO: to reduce duplication, make rebuild-testbench "smarter" + # and able to decode ZEPHYR_TOOLCHAIN_VARIANT (even when it does + # not care about Zephyr) + COMPILER="xt-clang" + ;; + + # NXP imx8) PLATFORM="imx8" XTENSA_CORE="hifi4_nxp_v3_3_1_2_2017" @@ -50,6 +82,8 @@ case "$platform" in HOST="xtensa-imx8ulp-elf" XTENSA_TOOLS_VERSION="RG-2017.8-linux" ;; + + # AMD rn) PLATFORM="renoir" XTENSA_CORE="ACP_3_1_001_PROD_2019_1" @@ -63,6 +97,22 @@ case "$platform" in HOST="xtensa-rmb-elf" XTENSA_TOOLS_VERSION="RI-2019.1-linux" ;; + vangogh) + PLATFORM="vangogh" + ARCH="xtensa" + XTENSA_CORE="ACP_5_0_001_PROD" + HOST="xtensa-vangogh-elf" + XTENSA_TOOLS_VERSION="RI-2019.1-linux" + ;; + acp_6_3) + PLATFORM="acp_6_3" + ARCH="xtensa" + XTENSA_CORE="ACP_6_3_HiFi5_PROD_Linux" + HOST="xtensa-acp_6_3-elf" + XTENSA_TOOLS_VERSION="RI-2021.6-linux" + ;; + + # Mediatek mt8186) PLATFORM="mt8186" XTENSA_CORE="hifi5_7stg_I64D128" @@ -81,10 +131,9 @@ case "$platform" in HOST="xtensa-mt8195-elf" XTENSA_TOOLS_VERSION="RI-2019.1-linux" ;; - mtl) - PLATFORM="mtl" - XTENSA_CORE="ace10_LX7HiFi4_2022_10" - XTENSA_TOOLS_VERSION="RI-2022.10-linux" - COMPILER="xt-clang" + + *) + >&2 printf 'Unknown xtensa platform=%s\n' "$platform" + return 1 ;; esac diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 3d2563df6921..0a2de11723b8 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -87,6 +87,7 @@ class PlatformConfig: aliases: list = dataclasses.field(default_factory=list) # These can all be built out of the box. --all builds all these. +# Some of these values are duplicated in sof/scripts/set_xtensa_param.sh: keep them in sync. platform_configs_all = { # Intel platforms "tgl" : PlatformConfig(