From 08253db46bfaa5a458e7d26c1deb1b4db545cbd5 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 30 Oct 2020 08:55:40 -0400 Subject: [PATCH] xtensa: set toolchain variant per SoC The toolchain variant per SoC is not always the soc name, so set this per SoC and use this in the SDK instead of hardcoding the soc name. Signed-off-by: Anas Nashif --- cmake/app/boilerplate.cmake | 1 + cmake/toolchain/zephyr/target.cmake | 25 +++---------------- soc/xtensa/intel_adsp/CMakeLists.txt | 1 + .../cavs_v15/Kconfig.defconfig.series | 4 +++ .../cavs_v18/Kconfig.defconfig.series | 4 +++ .../cavs_v20/Kconfig.defconfig.series | 4 +++ .../cavs_v25/Kconfig.defconfig.series | 4 +++ soc/xtensa/intel_s1000/Kconfig.defconfig | 4 +++ .../sample_controller/Kconfig.defconfig | 4 +++ 9 files changed, 29 insertions(+), 22 deletions(-) diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index 30b6dbb4bc..fd900c064e 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -508,6 +508,7 @@ include(${ZEPHYR_BASE}/cmake/kconfig.cmake) set(SOC_NAME ${CONFIG_SOC}) set(SOC_SERIES ${CONFIG_SOC_SERIES}) +set(SOC_TOOLCHAIN_NAME ${CONFIG_SOC_TOOLCHAIN_NAME}) set(SOC_FAMILY ${CONFIG_SOC_FAMILY}) if("${SOC_SERIES}" STREQUAL "") diff --git a/cmake/toolchain/zephyr/target.cmake b/cmake/toolchain/zephyr/target.cmake index 29d9b7c745..39f5cd2c1b 100644 --- a/cmake/toolchain/zephyr/target.cmake +++ b/cmake/toolchain/zephyr/target.cmake @@ -10,28 +10,9 @@ elseif(("${ARCH}" STREQUAL "sparc") AND (${SDK_VERSION} VERSION_LESS 0.12)) else() include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/target.cmake) - # Workaround, FIXME + # Workaround, FIXME: Waiting for new SDK. if("${ARCH}" STREQUAL "xtensa") - if("${SOC_SERIES}" STREQUAL "cavs_v15") - set(SR_XT_TC_SOC intel_apl_adsp) - elseif("${SOC_SERIES}" STREQUAL "cavs_v18") - set(SR_XT_TC_SOC intel_s1000) - elseif("${SOC_SERIES}" STREQUAL "cavs_v20") - set(SR_XT_TC_SOC intel_s1000) - elseif("${SOC_SERIES}" STREQUAL "cavs_v25") - set(SR_XT_TC_SOC intel_s1000) - elseif("${SOC_SERIES}" STREQUAL "baytrail_adsp") - set(SR_XT_TC_SOC intel_byt_adsp) - elseif("${SOC_SERIES}" STREQUAL "broadwell_adsp") - set(SR_XT_TC_SOC intel_bdw_adsp) - elseif("${SOC_SERIES}" STREQUAL "intel_s1000") - set(SR_XT_TC_SOC intel_s1000) - elseif("${SOC_NAME}" STREQUAL "sample_controller") - set(SR_XT_TC_SOC sample_controller) - else() - message(FATAL_ERROR "No compiler set for SOC_SERIES ${SOC_SERIES}") - endif() - set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SR_XT_TC_SOC}/${SYSROOT_TARGET}) - set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SR_XT_TC_SOC}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) + set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SOC_TOOLCHAIN_NAME}/${SYSROOT_TARGET}) + set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SOC_TOOLCHAIN_NAME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-) endif() endif() diff --git a/soc/xtensa/intel_adsp/CMakeLists.txt b/soc/xtensa/intel_adsp/CMakeLists.txt index d5989caa31..b471c55af8 100644 --- a/soc/xtensa/intel_adsp/CMakeLists.txt +++ b/soc/xtensa/intel_adsp/CMakeLists.txt @@ -3,4 +3,5 @@ # Copyright (c) 2020 Intel Corporation # SPDX-License-Identifier: Apache-2.0 + add_subdirectory(common) diff --git a/soc/xtensa/intel_adsp/cavs_v15/Kconfig.defconfig.series b/soc/xtensa/intel_adsp/cavs_v15/Kconfig.defconfig.series index e4bc11228f..850a073c84 100644 --- a/soc/xtensa/intel_adsp/cavs_v15/Kconfig.defconfig.series +++ b/soc/xtensa/intel_adsp/cavs_v15/Kconfig.defconfig.series @@ -7,6 +7,10 @@ config SOC_SERIES string default "cavs_v15" +config SOC_TOOLCHAIN_NAME + string + default "intel_apl_adsp" + config SOC string default "intel_apl_adsp" if SOC_INTEL_CAVS_APL diff --git a/soc/xtensa/intel_adsp/cavs_v18/Kconfig.defconfig.series b/soc/xtensa/intel_adsp/cavs_v18/Kconfig.defconfig.series index b063ba392c..da3f1b304e 100644 --- a/soc/xtensa/intel_adsp/cavs_v18/Kconfig.defconfig.series +++ b/soc/xtensa/intel_adsp/cavs_v18/Kconfig.defconfig.series @@ -7,6 +7,10 @@ config SOC_SERIES string default "cavs_v18" +config SOC_TOOLCHAIN_NAME + string + default "intel_s1000" + config SOC string default "intel_cavs_18" diff --git a/soc/xtensa/intel_adsp/cavs_v20/Kconfig.defconfig.series b/soc/xtensa/intel_adsp/cavs_v20/Kconfig.defconfig.series index 012a303ec0..170c4d543a 100644 --- a/soc/xtensa/intel_adsp/cavs_v20/Kconfig.defconfig.series +++ b/soc/xtensa/intel_adsp/cavs_v20/Kconfig.defconfig.series @@ -7,6 +7,10 @@ config SOC_SERIES string default "cavs_v20" +config SOC_TOOLCHAIN_NAME + string + default "intel_s1000" + config SOC string default "intel_cavs_20" diff --git a/soc/xtensa/intel_adsp/cavs_v25/Kconfig.defconfig.series b/soc/xtensa/intel_adsp/cavs_v25/Kconfig.defconfig.series index 9b91707494..b7e184b34b 100644 --- a/soc/xtensa/intel_adsp/cavs_v25/Kconfig.defconfig.series +++ b/soc/xtensa/intel_adsp/cavs_v25/Kconfig.defconfig.series @@ -7,6 +7,10 @@ config SOC_SERIES string default "cavs_v25" +config SOC_TOOLCHAIN_NAME + string + default "intel_s1000" + config SOC string default "intel_cavs_25" diff --git a/soc/xtensa/intel_s1000/Kconfig.defconfig b/soc/xtensa/intel_s1000/Kconfig.defconfig index 1d9727ea13..4a2bc7fa8b 100644 --- a/soc/xtensa/intel_s1000/Kconfig.defconfig +++ b/soc/xtensa/intel_s1000/Kconfig.defconfig @@ -12,6 +12,10 @@ config SOC_SERIES string default "intel_s1000" +config SOC_TOOLCHAIN_NAME + string + default "intel_s1000" + config IRQ_OFFLOAD_INTNUM default 0 diff --git a/soc/xtensa/sample_controller/Kconfig.defconfig b/soc/xtensa/sample_controller/Kconfig.defconfig index c0ed4c9a07..b9af0d5282 100644 --- a/soc/xtensa/sample_controller/Kconfig.defconfig +++ b/soc/xtensa/sample_controller/Kconfig.defconfig @@ -9,6 +9,10 @@ if SOC_XTENSA_SAMPLE_CONTROLLER config SOC default "sample_controller" +config SOC_TOOLCHAIN_NAME + string + default "sample_controller" + config IRQ_OFFLOAD_INTNUM default 7