From eb0850cfbef2edc35c2a10d660fc6c8cb98fc318 Mon Sep 17 00:00:00 2001 From: Annemarie Porter Date: Fri, 19 Dec 2025 14:14:20 -0800 Subject: [PATCH] Fix hexagon compilation Add the hexagon defconfig file and make some minor updates to re-enable hexagon compilation. Signed-off-by: Annemarie Porter --- CMakeLists.txt | 4 ++- arch/hexagon/configs/defconfig | 25 +++++++++++++++++++ .../cmn/common/utils/inc/audio_iir_tdf2_asm.h | 19 ++++++++++++++ modules/cmn/common/utils/src/audio_filter.cpp | 6 ++--- 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 arch/hexagon/configs/defconfig create mode 100644 modules/cmn/common/utils/inc/audio_iir_tdf2_asm.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 07ab58a..f491ce1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,10 +167,12 @@ include_directories( set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-dynamic") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/empty.c" "") + if (${CONFIG_SPF_AS_STATIC_LIB} MATCHES "y") add_library(spf STATIC "" ) else() - add_library(spf SHARED "" ) + add_library(spf SHARED "${CMAKE_CURRENT_BINARY_DIR}/empty.c" ) endif() message (STATUS "Generating AMDB configs") diff --git a/arch/hexagon/configs/defconfig b/arch/hexagon/configs/defconfig new file mode 100644 index 0000000..b1327ac --- /dev/null +++ b/arch/hexagon/configs/defconfig @@ -0,0 +1,25 @@ +# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) +CONFIG_ARCH_HEXAGON=y +CONFIG_HEXAGON_TOOLS_ROOT="/pkg/qct/software/hexagon/releases/tools/8.6.01" +CONFIG_HEXAGON_SDK_ROOT="/pkg/qct/software/hexagon/hexagonsdk/4.5.0" +CONFIG_DISABLE_PLATFORM=y +# CONFIG_COMPILE_POSAL is not set +CONFIG_PROC_DOMAIN="ADSP" +# +# Modules +# +CONFIG_MODULES=y +CONFIG_MODULES_DEBUG=n +CONFIG_ENCODER=n +CONFIG_ECHO_CANCELLATION=n +CONFIG_EXAMPLE_GAIN=n + +# +# Signal Processing Framework +# +# CONFIG_SPF_AS_STATIC_LIB is not set +# CONFIG_SPF_DEBUG is not set + +# +# Signal Processing Framework Modules +# diff --git a/modules/cmn/common/utils/inc/audio_iir_tdf2_asm.h b/modules/cmn/common/utils/inc/audio_iir_tdf2_asm.h new file mode 100644 index 0000000..c6efdb8 --- /dev/null +++ b/modules/cmn/common/utils/inc/audio_iir_tdf2_asm.h @@ -0,0 +1,19 @@ +/*========================================================================*/ +/** +@file audio_iir_tdf2_asm.h + +This file defines flags to use Q6 ASM of IIR TDF2 functions. +*/ + +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All Rights Reserved. + * SPDX-License-Identifier: BSD-3-Clause-Clear + */ + +#ifndef _AUDIO_IIRTDF2_ASM_H_ +#define _AUDIO_IIRTDF2_ASM_H_ + +#define QDSP6_ASM_IIRTDF2_32 +#define QDSP6_ASM_IIRTDF2_16 + +#endif /* _AUDIO_IIRTDF2_ASM_H_ */ diff --git a/modules/cmn/common/utils/src/audio_filter.cpp b/modules/cmn/common/utils/src/audio_filter.cpp index d4cae53..f8fdd5d 100644 --- a/modules/cmn/common/utils/src/audio_filter.cpp +++ b/modules/cmn/common/utils/src/audio_filter.cpp @@ -450,7 +450,7 @@ void biquad_process_io ) { -/*#if ((defined __hexagon__) || (defined __qdsp6__)) +#if ((defined __hexagon__) || (defined __qdsp6__)) int16 *bufPtr = srcBuf; int16 *coeffptr = &filter->coeffsL16Q13[filter->coeffIndex]; @@ -459,7 +459,7 @@ void biquad_process_io -#else */ +#else int32 i; int16 xInL16; int16 *yL16 = filter->yL16; @@ -520,7 +520,7 @@ void biquad_process_io } /*-- store accumulator value back --*/ filter->yL32 = s32_extract_s40_l(yL40); -//#endif +#endif } /*----------------- end of function biquad_process_io --------------------*/