├── .gitmodules ├── EULA.txt ├── Makefile ├── README ├── SCR-imx-audio-framework.txt ├── common ├── include │ ├── fsl_unia │ │ ├── dsp_codec_interface.h │ │ └── fsl_unia.h │ └── library_load.h └── src │ ├── library_load.c │ ├── xaf-fsl-api.c │ └── xf-fsl-ipc.c ├── dsp_framework ├── Makefile ├── include │ ├── board.h │ ├── debug.h │ ├── dpu_lib_load.h │ ├── driver │ │ ├── asrc.h │ │ ├── dsp_irq_handler.h │ │ ├── easrc.h │ │ ├── easrc_firmware.h │ │ ├── edma.h │ │ ├── esai.h │ │ ├── fsl_dma.h │ │ ├── fsl_lpuart.h │ │ ├── fsl_mu.h │ │ ├── fsl_uart.h │ │ ├── i2c.h │ │ ├── io.h │ │ ├── irqstr.h │ │ ├── micfil.h │ │ ├── sai.h │ │ ├── sdma.h │ │ ├── sdma_script_code_imx7d_4_5.h │ │ ├── wm8960.h │ │ └── wm8962.h │ ├── hardware.h │ ├── libloader │ │ ├── elf.h │ │ ├── loader_internal.h │ │ └── pi_library_load.h │ ├── memory.h │ ├── mydefs.h │ ├── plugins │ │ ├── xa-unia-codec.h │ │ ├── xa-voiceprocess-api.h │ │ └── xf-audio-apicmd.h │ ├── printf.h │ ├── remoteproc.h │ ├── rpmsg_config.h │ ├── rpmsg_platform.h │ ├── rsc_table.h │ └── types.h ├── memmap │ ├── imx8 │ │ ├── ldscripts │ │ │ ├── elf32xtensa.x │ │ │ ├── elf32xtensa.xbn │ │ │ ├── elf32xtensa.xn │ │ │ ├── elf32xtensa.xr │ │ │ └── elf32xtensa.xu │ │ ├── memmap.xmm │ │ ├── sim.parm │ │ └── specs │ ├── imx8m │ │ ├── ldscripts │ │ │ ├── elf32xtensa.x │ │ │ ├── elf32xtensa.xbn │ │ │ ├── elf32xtensa.xn │ │ │ ├── elf32xtensa.xr │ │ │ └── elf32xtensa.xu │ │ ├── memmap.xmm │ │ ├── sim.parm │ │ └── specs │ └── imx8ulp │ │ ├── ldscripts │ │ ├── elf32xtensa.x │ │ ├── elf32xtensa.xbn │ │ ├── elf32xtensa.xn │ │ ├── elf32xtensa.xr │ │ └── elf32xtensa.xu │ │ ├── memmap.xmm │ │ └── specs ├── src │ ├── board.c │ ├── driver │ │ ├── asrc.c │ │ ├── dsp_irq_handler.c │ │ ├── easrc.c │ │ ├── edma.c │ │ ├── esai.c │ │ ├── fsl_dma.c │ │ ├── fsl_lpuart.c │ │ ├── fsl_mu.c │ │ ├── fsl_uart.c │ │ ├── i2c.c │ │ ├── io.c │ │ ├── irqstr.c │ │ ├── micfil.c │ │ ├── sai.c │ │ ├── sdma.c │ │ ├── wm8960.c │ │ └── wm8962.c │ ├── fsl_msgq.c │ ├── libloader │ │ ├── common.c │ │ ├── dpu_lib_load.c │ │ ├── pi_library_load.c │ │ └── pi_relocate_lib.c │ ├── main.c │ ├── memory.c │ ├── plugins │ │ ├── xa-fsl-capturer.c │ │ ├── xa-fsl-renderer.c │ │ ├── xa-unia-codec.c │ │ └── xa-voiceprocess.c │ ├── printf.c │ ├── rpmsg_env_bm.c │ ├── rpmsg_platform.c │ └── rsc_table.c └── tensorflow_lite_micro.inc ├── dsp_voice_process ├── Makefile ├── include │ └── voice_process.h └── src │ ├── voice_process_dummy.c │ └── voice_process_wrap.c ├── dsp_wrapper ├── Makefile ├── common.mk ├── include │ └── dsp_wrap.h ├── lib_dsp_wrap.mk └── src │ ├── dsp_dec.c │ └── dsp_wrap.c ├── libxa_af_hostless ├── .cproject ├── .project ├── .settings │ ├── org.eclipse.cdt.core.prefs │ └── targets │ │ └── xtensa │ │ ├── CommonTarget.bts │ │ ├── Debug.bts │ │ └── Release.bts ├── .xxproject ├── Makefile ├── Makefile.include ├── README.html ├── README.txt ├── algo │ ├── hifi-dpf │ │ ├── include │ │ │ ├── audio │ │ │ │ └── xa-class-base.h │ │ │ ├── lib │ │ │ │ └── rbtree.h │ │ │ ├── sys │ │ │ │ └── xos-msgq │ │ │ │ │ ├── iss │ │ │ │ │ └── xf-board.h │ │ │ │ │ ├── xf-dp_config.h │ │ │ │ │ ├── xf-dp_hal.h │ │ │ │ │ ├── xf-dp_ipc.h │ │ │ │ │ ├── xf-dp_runtime.h │ │ │ │ │ ├── xf-dp_types.h │ │ │ │ │ ├── xf-mem.h │ │ │ │ │ ├── xf-shmem.h │ │ │ │ │ └── xf-sys.h │ │ │ ├── xf-component.h │ │ │ ├── xf-core.h │ │ │ ├── xf-dp.h │ │ │ ├── xf-dp_opcode.h │ │ │ ├── xf-dp_proxy.h │ │ │ ├── xf-flx-lock-if.h │ │ │ ├── xf-io.h │ │ │ ├── xf-mm.h │ │ │ ├── xf-msg.h │ │ │ ├── xf-plugin.h │ │ │ ├── xf-probe.h │ │ │ ├── xf-sched.h │ │ │ ├── xf-timebase.h │ │ │ └── xf-trace.h │ │ └── src │ │ │ ├── rbtree.c │ │ │ ├── xa-class-audio-codec.c │ │ │ ├── xa-class-base.c │ │ │ ├── xa-class-capturer.c │ │ │ ├── xa-class-mimo-proc.c │ │ │ ├── xa-class-mixer.c │ │ │ ├── xa-class-renderer.c │ │ │ ├── xf-core.c │ │ │ ├── xf-io.c │ │ │ ├── xf-ipi.c │ │ │ ├── xf-isr.c │ │ │ ├── xf-main.c │ │ │ ├── xf-mem.c │ │ │ ├── xf-msg.c │ │ │ ├── xf-msgq.c │ │ │ ├── xf-msgq1.c │ │ │ └── xf-sched.c │ ├── host-apf │ │ ├── include │ │ │ ├── sys │ │ │ │ ├── linux-msgq │ │ │ │ │ ├── xf-config.h │ │ │ │ │ ├── xf-hal.h │ │ │ │ │ ├── xf-ipc.h │ │ │ │ │ ├── xf-runtime.h │ │ │ │ │ └── xf-types.h │ │ │ │ └── xos-msgq │ │ │ │ │ ├── xf-config.h │ │ │ │ │ ├── xf-hal.h │ │ │ │ │ ├── xf-ipc.h │ │ │ │ │ ├── xf-runtime.h │ │ │ │ │ └── xf-types.h │ │ │ ├── xaf-structs.h │ │ │ ├── xaf-threads-priority.h │ │ │ ├── xaf-version.h │ │ │ ├── xf-opcode.h │ │ │ ├── xf-proto.h │ │ │ ├── xf-proxy.h │ │ │ └── xf.h │ │ └── src │ │ │ ├── xaf-api.c │ │ │ ├── xf-proxy.c │ │ │ └── xf-trace.c │ └── xa_af_hostless │ │ └── include │ │ ├── xa_af_hostless_definitions.h │ │ ├── xa_api_defs.h │ │ ├── xf-ap-dp-common.h │ │ └── xf-msgq-if.h ├── build │ ├── common.mk │ ├── getFreeRTOS.sh │ ├── ldscript_af_hostless.txt │ ├── makefile │ └── symbols_af_hostless.txt ├── doc │ ├── HiFi-AF-Hostless-ProgrammersGuide.pdf │ ├── HiFi-Audio-Codec-API-Definition.pdf │ └── HiFi-Speech-Codec-API-Definition.pdf ├── include │ ├── audio │ │ ├── xa-audio-decoder-api.h │ │ ├── xa-capturer-api.h │ │ ├── xa-mimo-proc-api.h │ │ ├── xa-mixer-api.h │ │ ├── xa-renderer-api.h │ │ ├── xa_apicmd_standards.h │ │ ├── xa_error_standards.h │ │ ├── xa_memory_standards.h │ │ └── xa_type_def.h │ ├── sysdeps │ │ ├── freertos │ │ │ └── include │ │ │ │ ├── osal-isr.h │ │ │ │ ├── osal-msgq.h │ │ │ │ ├── osal-thread.h │ │ │ │ └── osal-timer.h │ │ ├── linux │ │ │ └── include │ │ │ │ ├── osal-msgq.h │ │ │ │ └── osal-thread.h │ │ └── xos │ │ │ └── include │ │ │ ├── osal-isr.h │ │ │ ├── osal-msgq.h │ │ │ ├── osal-thread.h │ │ │ └── osal-timer.h │ ├── xaf-api.h │ └── xf-debug.h ├── ldscript.txt └── license.txt ├── release ├── build_dsp │ ├── AUTHORS │ ├── ChangeLog │ ├── EULA.txt │ ├── INSTALL │ ├── Makefile.am │ ├── NEWS │ ├── README │ ├── autogen.sh │ ├── configure.ac │ ├── ghdr │ ├── libfsldspframework.pc.in │ └── release └── hifi4_tflm_imx8ulp.bin ├── testxa_af_hostless ├── .cproject ├── .project ├── .settings │ ├── org.eclipse.cdt.core.prefs │ └── targets │ │ └── xtensa │ │ ├── CommonTarget.bts │ │ ├── Debug.bts │ │ └── Release.bts ├── .xxproject ├── Makefile ├── README.html ├── launch │ ├── af_hostless_cycle.launch │ └── af_hostless_turbo.launch └── test │ ├── build │ ├── makefile_testbench │ └── makefile_testbench_sample │ ├── include │ ├── audio │ │ ├── xa-aec22-api.h │ │ ├── xa-aec23-api.h │ │ ├── xa-microspeech-frontend-api.h │ │ ├── xa-microspeech-inference-api.h │ │ ├── xa-mimo-mix-api.h │ │ ├── xa-opus-encoder-api.h │ │ ├── xa-pcm-gain-api.h │ │ ├── xa-pcm-split-api.h │ │ ├── xa-person-detect-inference-api.h │ │ └── xa_amr_wb_dec_definitions.h │ ├── host_fio.h │ ├── xaf-app-threads-priority.h │ ├── xaf-clk-test.h │ ├── xaf-fio-test.h │ ├── xaf-mem.h │ ├── xaf-test.h │ └── xaf-utils-test.h │ ├── plugins │ ├── cadence │ │ ├── aac_dec │ │ │ ├── lib │ │ │ │ └── empty.txt │ │ │ └── xa-aac-decoder.c │ │ ├── aec22 │ │ │ └── xa-aec22.c │ │ ├── aec23 │ │ │ └── xa-aec23.c │ │ ├── amr_wb │ │ │ ├── lib │ │ │ │ └── empty.txt │ │ │ └── xa-amr-wb-decoder.c │ │ ├── capturer │ │ │ └── xa-capturer.c │ │ ├── mimo_mix │ │ │ └── xa-mimo-mix.c │ │ ├── mixer │ │ │ └── xa-mixer.c │ │ ├── mp3_dec │ │ │ ├── lib │ │ │ │ └── empty.txt │ │ │ └── xa-mp3-decoder.c │ │ ├── mp3_enc │ │ │ ├── lib │ │ │ │ └── empty.txt │ │ │ └── xa-mp3-encoder.c │ │ ├── opus │ │ │ ├── lib │ │ │ │ └── empty.txt │ │ │ └── xa-opus-encoder.c │ │ ├── pcm_gain │ │ │ └── xa-pcm-gain.c │ │ ├── pcm_split │ │ │ └── xa-pcm-split.c │ │ ├── renderer │ │ │ └── xa-renderer.c │ │ ├── src-pp │ │ │ ├── lib │ │ │ │ └── empty.txt │ │ │ └── xa-src-pp.c │ │ ├── tflm_common │ │ │ ├── tflm-inference-api.cpp │ │ │ ├── tflm-inference-api.h │ │ │ ├── xa-tflm-inference-api.c │ │ │ └── xa-tflm-inference-api.h │ │ ├── tflm_microspeech │ │ │ ├── microspeech-frontend-wrapper-api.cpp │ │ │ ├── microspeech-inference-wrapper-api.cpp │ │ │ ├── microspeech_model_data.c │ │ │ ├── microspeech_model_data.h │ │ │ └── xa-microspeech-frontend.c │ │ ├── tflm_person_detect │ │ │ ├── person-detect-wrapper-api.cpp │ │ │ ├── person_detect_model_data.c │ │ │ └── person_detect_model_data.h │ │ └── vorbis_dec │ │ │ ├── lib │ │ │ └── empty.txt │ │ │ └── xa-vorbis-decoder.c │ ├── xa-factory.c │ └── xa-gain-factor-event.h │ ├── src │ ├── xaf-aac-dec-test.c │ ├── xaf-amr-wb-dec-test.c │ ├── xaf-capturer-mp3-enc-test.c │ ├── xaf-capturer-pcm-gain-test.c │ ├── xaf-clk-test.c │ ├── xaf-dec-mix-test.c │ ├── xaf-dec-test.c │ ├── xaf-fio-test.c │ ├── xaf-full-duplex-test.c │ ├── xaf-gain-renderer-test.c │ ├── xaf-mem-test.c │ ├── xaf-mimo-mix-test.c │ ├── xaf-mp3-dec-rend-test.c │ ├── xaf-pcm-gain-test.c │ ├── xaf-playback-usecase-test.c │ ├── xaf-renderer-ref-port-test.c │ ├── xaf-src-test.c │ ├── xaf-utils-test.c │ └── xaf-vorbis-dec-test.c │ ├── test_inp │ ├── hihat.mp3 │ ├── hihat.ogg │ ├── hihat.pcm │ ├── hihat_1ch_16b_192kbps_cbr.mp3 │ ├── hihat_1ch_16b_44.1kHz.adts │ ├── hihat_hw.mp3 │ ├── perf_aacplusv1_stereo_56Kbps_48kHz.adts │ ├── sine.pcm │ ├── spch_le_dtx.cod │ └── src_48k_16bit_stereo.pcm │ ├── test_out │ └── empty.txt │ └── test_ref │ ├── gain_renderer_out.pcm │ ├── hihat_dec_out.pcm │ ├── hihat_decmix_out.pcm │ ├── hihat_full_duplex_dec_out.pcm │ ├── hihat_full_duplex_enc_out.mp3 │ ├── hihat_renderer_out.pcm │ ├── hihat_vorbis_dec_out.pcm │ ├── mimo21_mimo_mix_out.pcm │ ├── perf_aacplusv1_stereo_56Kbps_48kHz.pcm │ ├── playback_usecase_out1.pcm │ ├── playback_usecase_out2.pcm │ ├── playback_usecase_out2_hifi3.pcm │ ├── rend_ref_port.aec_out0.pcm │ ├── rend_ref_port.aec_out1.pcm │ ├── rend_ref_port.rend_out.pcm │ ├── sine_capturer.mp3 │ ├── sine_capturer.pcm │ ├── sine_pcmgain_out.pcm │ ├── spch_le_dtx.out │ └── src_16k_16bit_stereo_out.pcm └── unit_test ├── Makefile ├── include ├── get_pcm_info.h └── id3_tag_decode.h └── src ├── dsp_tflm_test.c ├── get_pcm_info.c ├── id3_tag_decode.c ├── tflm ├── no_1000ms_audio_data.cc ├── no_1000ms_audio_data.h ├── yes_1000ms_audio_data.cc └── yes_1000ms_audio_data.h ├── xaf-fsl-capturer-pcm-gain-test.c ├── xaf-fsl-dec-test.c ├── xaf-fsl-mimo-voice-process-test.c └── xaf-fsl-mp3-dec-rend-test.c /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "rpmsg-lite"] 2 | path = rpmsg-lite 3 | url = https://github.com/NXPmicro/rpmsg-lite.git 4 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | 1. set up related build toolchain 3 | Before you build the case, you should set up related build toolchain firstly, 4 | you can see the DSP User's Guide to know how to install these toolchians. 5 | This document is placed in the following location: 6 | https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX 7 | 8 | 2. Build the DSP framework 9 | 10 | 1). build all 11 | make all 12 | 13 | 2). only build DSP framework 14 | make DSP_FRAMEWORK 15 | 16 | 3). only build DSP wrapper lib 17 | make DSP_WRAPPER 18 | 19 | 4). only build DSP unit test 20 | make UNIT_TEST 21 | 22 | 5). clean the folder 23 | make clean 24 | 25 | 3. Get the executed file and lib file 26 | All the output files are placed in release folder. 27 | -------------------------------------------------------------------------------- /SCR-imx-audio-framework.txt: -------------------------------------------------------------------------------- 1 | NXP Software Content Register 2 | 3 | Package: imx-audio-framework 4 | Outgoing License: LA_OPT_NXP_Software_License v45 May 2023 - Production Use, Section 2.3 applies 5 | Release Location: Moderated download 6 | 7 | 8 | Component: dsp_framework 9 | Outgoing License: LA_OPT_NXP_Software_License v45 May 2023 - Production Use, Section 2.3 applies 10 | Type of Content: source 11 | Description: The firmware running on the DSP core 12 | Origin: NXP (proprietary) 13 | NXP (BSD-3-clause) 14 | Matt Redfearn (BSD-3-clause) 15 | Tensilica (MIT) 16 | Cadence (MIT) 17 | 18 | Component: dsp_wrapper 19 | Outgoing License: LA_OPT_NXP_Software_License v45 May 2023 - Production Use, Section 2.3 applies 20 | Type of Content: source 21 | Description: User space application providing a unified calling interface for GStreamer 22 | Origin: NXP (MIT) 23 | 24 | Component: unit_test 25 | Outgoing License: LA_OPT_NXP_Software_License v45 May 2023 - Production Use, Section 2.3 applies 26 | Type of Content: source 27 | Description: User space test application 28 | Origin: NXP (MIT) 29 | Cadence (MIT) 30 | 31 | 32 | Component: include 33 | Outgoing License: LA_OPT_NXP_Software_License v45 May 2023 - Production Use, Section 2.3 applies 34 | Type of Content: source 35 | Description: Interface command definitions 36 | Origin: NXP (BSD-2-clause) 37 | 38 | -------------------------------------------------------------------------------- /common/include/fsl_unia/dsp_codec_interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2020 NXP 3 | * 4 | * This header file is used to wrapper the Cadence codec's header files 5 | * and provide new interface for the dsp framework to use. 6 | */ 7 | #ifndef DSP_CODEC_INTERFACE_H 8 | #define DSP_CODEC_INTERFACE_H 9 | 10 | #include "fsl_unia.h" 11 | 12 | #ifdef TGT_OS_ANDROID 13 | #define CORE_LIB_PATH "/vendor/lib/" 14 | #else 15 | #define CORE_LIB_PATH "/usr/lib/imx-mm/audio-codec/dsp/" 16 | #endif 17 | 18 | /* codec comp define range: 0x1 ~ 0x1F */ 19 | typedef enum { 20 | CODEC_MP3_DEC = 1, 21 | CODEC_AAC_DEC, 22 | CODEC_DAB_DEC, 23 | CODEC_MP2_DEC, 24 | CODEC_BSAC_DEC, 25 | CODEC_DRM_DEC, 26 | CODEC_SBC_DEC, 27 | CODEC_SBC_ENC, 28 | /* Carefully add fsl codecs for it may cause bad performace 29 | * on some platforms. 30 | */ 31 | CODEC_FSL_OGG_DEC, 32 | CODEC_FSL_MP3_DEC, 33 | CODEC_FSL_AAC_DEC, 34 | CODEC_FSL_AAC_PLUS_DEC, 35 | CODEC_FSL_AC3_DEC, 36 | CODEC_FSL_DDP_DEC, 37 | CODEC_FSL_NBAMR_DEC, 38 | CODEC_FSL_WBAMR_DEC, 39 | CODEC_FSL_WMA_DEC, 40 | CODEC_OPUS_DEC, 41 | CODEC_PCM_GAIN, 42 | CODEC_DEMO_DEC, 43 | 44 | } AUDIOCODECFORMAT; 45 | 46 | typedef struct { 47 | AUDIOCODECFORMAT codec_type; 48 | const char *dec_id; 49 | const char *codec_name; 50 | const char *codecwrap_name; 51 | /* ...Codec data ignored */ 52 | WORD32 codecdata_ignored; 53 | } CODECINFO; 54 | 55 | enum lib_type { 56 | DSP_CODEC_LIB = 1, 57 | DSP_CODEC_WRAP_LIB 58 | }; 59 | 60 | #define CODEC_LIB_MASK 0x3 61 | #define GET_LIB_TYPE(a) (a & CODEC_LIB_MASK) 62 | #define GET_CODEC_TYPE(a) ((a >> 2) & 0x1F) 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /dsp_framework/include/debug.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | 5 | #ifndef __DEBUG_H 6 | #define __DEBUG_H 7 | 8 | 9 | #ifdef DEBUG 10 | #define dsp_printf(...) __dsp_printf(__VA_ARGS__) 11 | #define LOG(msg) { dsp_printf(msg); } 12 | #define LOG1(msg, arg1) { dsp_printf(msg, arg1); } 13 | #define LOG2(msg, arg1, arg2) { dsp_printf(msg, arg1, arg2); } 14 | #define LOG3(msg, arg1, arg2, arg3) { dsp_printf(msg, arg1, arg2, arg3); } 15 | #define LOG4(msg, arg1, arg2, arg3, arg4) { dsp_printf(msg, arg1, arg2, arg3, arg4); } 16 | #else 17 | #define dsp_printf(...) 18 | #define LOG(msg) { } 19 | #define LOG1(msg, arg1) { } 20 | #define LOG2(msg, arg1, arg2) { } 21 | #define LOG3(msg, arg1, arg2, arg3) { } 22 | #define LOG4(msg, arg1, arg2, arg3, arg4) { } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /dsp_framework/include/dpu_lib_load.h: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * Copyright 2018 NXP 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | *****************************************************************/ 24 | 25 | #ifndef _DPU_LIB_LOAD_ 26 | #define _DPU_LIB_LOAD_ 27 | 28 | #include "xa_type_def.h" 29 | #include "xt_library_loader.h" 30 | #include "loader_internal.h" 31 | #include "debug.h" 32 | 33 | enum pilib_status_t { 34 | lib_unloaded = 0, 35 | lib_loaded, 36 | lib_in_use 37 | }; 38 | 39 | struct icm_xtlib_pil_info { 40 | xtlib_pil_info pil_info; 41 | UWORD32 lib_type; 42 | }; 43 | 44 | struct xtlib_overlay_info { 45 | UWORD32 start_addr; 46 | UWORD32 codec_type; 47 | }; 48 | 49 | struct dpu_lib_stat_t { 50 | UWORD32 type: 16; /* codec type; e.g., 1: mp3dec */ 51 | UWORD32 stat: 16; /* loaded, init_done, active, closed */ 52 | UWORD32 size_libtext; 53 | UWORD32 size_libdata; 54 | struct xtlib_overlay_info ol_inf_dspLib_dpu; 55 | xtlib_pil_info pil_inf_dspLib_dpu; 56 | }; 57 | 58 | void *dpu_process_init_pi_lib(xtlib_pil_info *pil_info, 59 | struct dpu_lib_stat_t *lib_stat, 60 | UWORD32 byteswap); 61 | void dpu_process_unload_pi_lib(struct dpu_lib_stat_t *lib_stat); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/dsp_irq_handler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 NXP 3 | * SPDX-License-Identifier: BSD-3-Clause 4 | */ 5 | 6 | #ifndef DSP_IRQ_HANDLER_H 7 | #define DSP_IRQ_HANDLER_H 8 | 9 | void xa_hw_comp_isr(); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/edma.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * Copyright 2018-2020 NXP 4 | */ 5 | 6 | #ifndef _EDMA_H 7 | #define _EDMA_H 8 | 9 | #include "fsl_dma.h" 10 | 11 | dma_t *edma_probe(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/fsl_lpuart.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | #ifndef _FSL_LPUART_H_ 5 | #define _FSL_LPUART_H_ 6 | 7 | #include "types.h" 8 | 9 | #define LPUART_STAT_TDRE (1 << 23) 10 | #define LPUART_FIFO_TXFE 0x80 11 | #define LPUART_FIFO_RXFE 0x40 12 | 13 | #define LPUART_BAUD_SBR_MASK (0x1FFFU) 14 | #define LPUART_BAUD_SBR_SHIFT (0U) 15 | #define LPUART_BAUD_SBR(x) (((u32)(((u32)(x)) << LPUART_BAUD_SBR_SHIFT)) & LPUART_BAUD_SBR_MASK) 16 | #define LPUART_BAUD_SBNS_MASK (0x2000U) 17 | #define LPUART_BAUD_SBNS_SHIFT (13U) 18 | #define LPUART_BAUD_SBNS(x) (((u32)(((u32)(x)) << LPUART_BAUD_SBNS_SHIFT)) & LPUART_BAUD_SBNS_MASK) 19 | #define LPUART_BAUD_BOTHEDGE_MASK (0x20000U) 20 | #define LPUART_BAUD_BOTHEDGE_SHIFT (17U) 21 | #define LPUART_BAUD_BOTHEDGE(x) (((u32)(((u32)(x)) << LPUART_BAUD_BOTHEDGE_SHIFT)) & LPUART_BAUD_BOTHEDGE_MASK) 22 | #define LPUART_BAUD_OSR_MASK (0x1F000000U) 23 | #define LPUART_BAUD_OSR_SHIFT (24U) 24 | #define LPUART_BAUD_OSR(x) (((u32)(((u32)(x)) << LPUART_BAUD_OSR_SHIFT)) & LPUART_BAUD_OSR_MASK) 25 | #define LPUART_BAUD_M10_MASK (0x20000000U) 26 | #define LPUART_BAUD_M10_SHIFT (29U) 27 | #define LPUART_BAUD_M10(x) (((u32)(((u32)(x)) << LPUART_BAUD_M10_SHIFT)) & LPUART_BAUD_M10_MASK) 28 | 29 | #define LPUART_CTRL_TE (1 << 19) 30 | #define LPUART_CTRL_RE (1 << 18) 31 | #define LPUART_CTRL_PT_MASK (0x1U) 32 | #define LPUART_CTRL_PE_MASK (0x2U) 33 | #define LPUART_CTRL_M_MASK (0x10U) 34 | 35 | #define BAUDRATE (115200) 36 | 37 | struct nxp_lpuart { 38 | volatile u32 verid; 39 | volatile u32 param; 40 | volatile u32 global; 41 | volatile u32 pincfg; 42 | volatile u32 baud; 43 | volatile u32 stat; 44 | volatile u32 ctrl; 45 | volatile u32 data; 46 | volatile u32 match; 47 | volatile u32 modir; 48 | volatile u32 fifo; 49 | volatile u32 water; 50 | }; 51 | 52 | #endif /* _FSL_LPUART_H_ */ 53 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/fsl_mu.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | #ifndef _FSL_MU_H_ 5 | #define _FSL_MU_H_ 6 | 7 | #include 8 | #include "types.h" 9 | 10 | enum mu_type { 11 | MU_V1, 12 | MU_V2, 13 | }; 14 | 15 | enum mu_ch_type { 16 | MU_TX, /* Tx */ 17 | MU_RX, /* Rx */ 18 | MU_TXDB, /* Tx doorbell */ 19 | MU_RXDB, /* Rx doorbell */ 20 | }; 21 | 22 | enum mu_xcr { 23 | MU_GIER, 24 | MU_GCR, 25 | MU_TCR, 26 | MU_RCR, 27 | }; 28 | 29 | enum mu_xsr { 30 | MU_SR, 31 | MU_GSR, 32 | MU_TSR, 33 | MU_RSR, 34 | }; 35 | 36 | struct mu_cfg { 37 | enum mu_type type; 38 | u32 xTR; /* Tx Reg0 */ 39 | u32 xRR; /* Rx Reg0 */ 40 | u32 xSR[4]; /* Status Reg */ 41 | u32 xCR[4]; /* Control Reg*/ 42 | }; 43 | 44 | #define MU_xSR_GIPn(type, x) (type & MU_V2 ? BIT(x) : BIT(28 + (3 - (x)))) 45 | #define MU_xSR_RFn(type, x) (type & MU_V2 ? BIT(x) : BIT(24 + (3 - (x)))) 46 | #define MU_xSR_TEn(type, x) (type & MU_V2 ? BIT(x) : BIT(20 + (3 - (x)))) 47 | 48 | /* General Purpose Interrupt Enable */ 49 | #define MU_xCR_GIEn(type, x) (type & MU_V2 ? BIT(x) : BIT(28 + (3 - (x)))) 50 | /* Receive Interrupt Enable */ 51 | #define MU_xCR_RIEn(type, x) (type & MU_V2 ? BIT(x) : BIT(24 + (3 - (x)))) 52 | /* Transmit Interrupt Enable */ 53 | #define MU_xCR_TIEn(type, x) (type & MU_V2 ? BIT(x) : BIT(20 + (3 - (x)))) 54 | /* General Purpose Interrupt Request */ 55 | #define MU_xCR_GIRn(type, x) (type & MU_V2 ? BIT(x) : BIT(16 + (3 - (x)))) 56 | 57 | void MU_Init(void *base); 58 | void MU_Deinit(void *base); 59 | int MU_txdb(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 60 | void MU_SendMsg(void *base, struct mu_cfg *cfg, uint32_t ch_idx, uint32_t msg); 61 | uint32_t MU_ReceiveMsgNonBlocking(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 62 | void MU_EnableInterrupts(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 63 | void MU_DisableInterrupts(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 64 | void MU_EnableRxInterrupts(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 65 | void MU_DisableRxInterrupts(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 66 | uint32_t MU_GetRxStatusFlags(void *base, struct mu_cfg *cfg, uint32_t ch_idx); 67 | 68 | #endif /* _FSL_MU_H_*/ 69 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/fsl_uart.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | 5 | #ifndef _FSL_UART_H_ 6 | #define _FSL_UART_H_ 7 | 8 | /* Register definitions */ 9 | #define URXD0 0x0 /* Receiver Register */ 10 | #define URTX0 0x40 /* Transmitter Register */ 11 | #define UCR1 0x80 /* Control Register 1 */ 12 | #define UCR2 0x84 /* Control Register 2 */ 13 | #define UCR3 0x88 /* Control Register 3 */ 14 | #define UCR4 0x8c /* Control Register 4 */ 15 | #define UFCR 0x90 /* FIFO Control Register */ 16 | #define USR1 0x94 /* Status Register 1 */ 17 | #define USR2 0x98 /* Status Register 2 */ 18 | #define UESC 0x9c /* Escape Character Register */ 19 | #define UTIM 0xa0 /* Escape Timer Register */ 20 | #define UBIR 0xa4 /* BRM Incremental Register */ 21 | #define UBMR 0xa8 /* BRM Modulator Register */ 22 | #define UBRC 0xac /* Baud Rate Count Register */ 23 | #define IMX21_ONEMS 0xb0 /* One Millisecond register */ 24 | #define IMX1_UTS 0xd0 /* UART Test Register on i.mx1 */ 25 | #define IMX21_UTS 0xb4 /* UART Test Register on all other i.mx*/ 26 | #define UMCR 0xb8 27 | 28 | #define USR1_TRDY (1<<13) /* Transmitter ready interrupt/dma flag */ 29 | #define USR2_TXDC (1<<3) /* Transmitter complete */ 30 | 31 | #define BAUDRATE (115200) 32 | 33 | int uart_init(void); 34 | void uart_putc(const char c); 35 | 36 | #endif /* _FSL_UART_H_ */ 37 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/i2c.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* Copyright 2024 NXP */ 3 | 4 | #ifndef I2C_HEADER 5 | #define I2C_HEADER 6 | 7 | #define OFFSET 0x2 8 | 9 | #define IMX_I2C_IADR 0x00 /* i2c slave address */ 10 | #define IMX_I2C_IFDR 0x01 /* i2c frequency divider */ 11 | #define IMX_I2C_I2CR 0x02 /* i2c control */ 12 | #define IMX_I2C_I2SR 0x03 /* i2c status */ 13 | #define IMX_I2C_I2DR 0x04 /* i2c transfer data */ 14 | 15 | /* Bits of IMX I2C registers */ 16 | #define I2SR_RXAK 0x01 17 | #define I2SR_IIF 0x02 18 | #define I2SR_SRW 0x04 19 | #define I2SR_IAL 0x10 20 | #define I2SR_IBB 0x20 21 | #define I2SR_IAAS 0x40 22 | #define I2SR_ICF 0x80 23 | #define I2CR_DMAEN 0x02 24 | #define I2CR_RSTA 0x04 25 | #define I2CR_TXAK 0x08 26 | #define I2CR_MTX 0x10 27 | #define I2CR_MSTA 0x20 28 | #define I2CR_IIEN 0x40 29 | #define I2CR_IEN 0x80 30 | 31 | 32 | #define WD 0 33 | #define RD 1 34 | 35 | int i2c_transfer_data(uint32_t slave_addr, int reg, uint32_t data, int32_t data_width); 36 | void i2c_start(); 37 | void i2c_stop(); 38 | void i2c_reset(); 39 | int i2c_read_data(uint32_t slave_addr, int reg, uint32_t *data, int32_t data_width); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/io.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * io.h - I/O abstraction header API 4 | */ 5 | #ifndef _IO_H 6 | #define _IO_H 7 | 8 | #include "types.h" 9 | 10 | void write16(volatile void * addr, u16 data); 11 | u16 read16(volatile void * addr); 12 | void write32(volatile void * addr, u32 data); 13 | void write32_bit(volatile void * addr, u32 mask, u32 data); 14 | u32 read32(volatile void * addr); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/irqstr.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * irqstr.h - IRQ steer header 4 | * 5 | * Copyright 2018-2020 NXP 6 | */ 7 | #ifndef _IRQSTR_H 8 | #define _IRQSTR_H 9 | 10 | #define IRQSTEER_CHnCTL 0x0 11 | #define IRQSTEER_CHnCTL_CH(n) BIT(n) 12 | #define IRQSTEER_CHnMASK(n) ((n) + 4) 13 | #define IRQ_TO_MASK_SHIFT(n) ((n) % 32) 14 | 15 | #ifdef PLATF_8M 16 | #define IRQ_TO_MASK_OFFSET(n) ((5 - ((n) / 32)) * 4) 17 | #define IRQSTEER_CHnSTATUS(n) ((n) + 0x2c) 18 | #else 19 | #define IRQ_TO_MASK_OFFSET(n) ((15 - ((n) / 32)) * 4) 20 | #define IRQSTEER_CHnSTATUS(n) ((n) + 0x84) 21 | #endif 22 | 23 | void irqstr_init(volatile void * irqstr_addr, int dev_Int, int dma_Int); 24 | void irqstr_start(volatile void * irqstr_addr, int dev_Int, int dma_Int); 25 | void irqstr_stop(volatile void * irqstr_addr, int dev_Int, int dma_Int); 26 | 27 | #if 0 28 | void irqstr_handler(struct dsp_main_struct * hifi_config); 29 | #endif 30 | 31 | void irqstr_dump(volatile void * irqstr_addr); 32 | 33 | #endif /* _IRQSTR_H */ 34 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/micfil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 NXP 3 | * SPDX-License-Identifier: BSD-3-Clause 4 | */ 5 | 6 | #ifndef MICFIL_H 7 | #define MICFIL_H 8 | 9 | #include "mydefs.h" 10 | #include "fsl_unia.h" 11 | 12 | #define ERROR (-1) 13 | #define OK 0 14 | 15 | enum micfil_quality { 16 | HIGH_QUALITY, 17 | MEDIUM_QUALITY, 18 | LOW_QUALITY, 19 | VLOW0_QUALITY, 20 | VLOW1_QUALITY, 21 | VLOW2_QUALITY 22 | }; 23 | 24 | void micfil_probe(struct dsp_main_struct *dsp); 25 | 26 | int micfil_get_dma_event_id(void *p_micfil); 27 | int micfil_get_irqnum(void *p_micfil); 28 | void *micfil_get_datach0_addr(void *p_micfil); 29 | 30 | int micfil_init(void *p_micfil); 31 | int micfil_release(void *p_micfil); 32 | int micfil_set_param(void *p_micfil, int i_idx, unsigned int *p_vaule); 33 | int micfil_get_param(void *p_micfil, int i_idx, unsigned int *p_vaule); 34 | int micfil_start(void *p_micfil); 35 | int micfil_stop(void *p_micfil); 36 | void micfil_irq_handler(void *p_micfil); 37 | void micfil_suspend(void *p_micfil); 38 | void micfil_resume(void *p_micfil); 39 | 40 | void micfil_dump(void *p_micfil); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /dsp_framework/include/driver/sdma.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * Copyright 2020 NXP 4 | */ 5 | 6 | #ifndef _SDMA_H 7 | #define _SDMA_H 8 | 9 | #include "fsl_dma.h" 10 | 11 | dma_t *sdma_probe(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /dsp_framework/include/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2020 NXP 3 | */ 4 | 5 | #ifndef _DSP_RENDER_INTERFACE_H_ 6 | #define _DSP_RENDER_INTERFACE_H_ 7 | 8 | #include "board.h" 9 | 10 | #include "sai.h" 11 | #include "esai.h" 12 | #include "asrc.h" 13 | #include "easrc.h" 14 | #include "irqstr.h" 15 | #include "fsl_dma.h" 16 | #include "wm8960.h" 17 | #include "micfil.h" 18 | #include "wm8962.h" 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /dsp_framework/include/libloader/loader_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2013 by Tensilica Inc. ALL RIGHTS RESERVED. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | #ifndef _LOADER_INTERNAL_H_ 24 | #define _LOADER_INTERNAL_H_ 25 | 26 | #include "elf.h" 27 | 28 | typedef struct xtlib_loader_globals 29 | { 30 | int err; 31 | int byteswap; 32 | } xtlib_loader_globals; 33 | 34 | typedef struct { 35 | memcpy_func mcpy; 36 | memset_func mset; 37 | } user_funcs; 38 | 39 | int 40 | xtlib_verify_magic(Elf32_Ehdr *header, xtlib_loader_globals *xtlib_globals); 41 | 42 | void 43 | xtlib_load_seg(Elf32_Phdr * pheader, void *src_addr, xt_ptr dst_addr, 44 | memcpy_func_ex mcpy, memset_func_ex mset, void * user, 45 | xtlib_loader_globals *xtlib_globals); 46 | 47 | Elf32_Half 48 | xtlib_host_half(Elf32_Half v, xtlib_loader_globals *xtlib_globals); 49 | 50 | Elf32_Word 51 | xtlib_host_word(Elf32_Word v, xtlib_loader_globals *xtlib_globals); 52 | 53 | #define xtlib_xt_half xtlib_host_half 54 | #define xtlib_xt_word xtlib_host_word 55 | 56 | #ifdef __XTENSA__ 57 | 58 | void 59 | xtlib_sync (); 60 | 61 | /* xtlib_user_memcpy and xtlib_user_memset are helper functions 62 | with memcpy_func_ex and memset_func_ex signature. They are 63 | expecting to point at user_funcs structure and 64 | they call appropriate member of this structure. 65 | */ 66 | 67 | xt_ptr 68 | xtlib_user_memcpy (xt_ptr dest, const void * src, unsigned int n, void *user); 69 | 70 | xt_ptr 71 | xtlib_user_memset (xt_ptr s, int c, unsigned int n, void *user); 72 | 73 | int 74 | xtlib_relocate_pi_lib (xtlib_pil_info * lib_info, xtlib_loader_globals *xtlib_globals); 75 | 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /dsp_framework/include/memory.h: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * Copyright 2018 NXP 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | *****************************************************************/ 24 | 25 | #ifndef __MEMORY_H_ 26 | #define __MEMORY_H_ 27 | 28 | #include "types.h" 29 | 30 | void *xf_uniacodec_malloc(size_t size); 31 | void xf_uniacodec_free(void *buf_ptr); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /dsp_framework/include/plugins/xa-unia-codec.h: -------------------------------------------------------------------------------- 1 | #ifndef __XA_UNIA_CODEC_H__ 2 | #define __XA_UNIA_CODEC_H__ 3 | 4 | /******************************************************************************* 5 | * Includes 6 | ******************************************************************************/ 7 | 8 | #include "xa-audio-decoder-api.h" 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /dsp_framework/include/plugins/xa-voiceprocess-api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 NXP. 3 | * SPDX-License-Identifier: BSD-3-Clause 4 | * 5 | */ 6 | /******************************************************************************* 7 | * xa-voice_proc-api.h 8 | * 9 | * voice process component API 10 | ******************************************************************************/ 11 | 12 | #ifndef __XA_VOICE_PROC_API_H__ 13 | #define __XA_VOICE_PROC_API_H__ 14 | 15 | /******************************************************************************* 16 | * Includes 17 | ******************************************************************************/ 18 | 19 | #include "xa_memory_standards.h" 20 | 21 | /* ...generic commands */ 22 | #include "xa_apicmd_standards.h" 23 | 24 | /* ...generic error codes */ 25 | #include "xa_error_standards.h" 26 | 27 | /* ...common types */ 28 | #include "xa_type_def.h" 29 | 30 | /* ...component identifier (informative) */ 31 | #define XA_MIMO_PROC_VOICE_PROC 0x80 32 | 33 | /******************************************************************************* 34 | * Class 1: Configuration Errors 35 | ******************************************************************************/ 36 | 37 | enum xa_error_nonfatal_config_voice_proc { 38 | XA_VOICE_PROC_CONFIG_NONFATAL_RANGE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_MIMO_PROC_VOICE_PROC, 0), 39 | }; 40 | 41 | enum xa_error_fatal_config_voice_proc { 42 | XA_VOICE_PROC_CONFIG_FATAL_RANGE = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_MIMO_PROC_VOICE_PROC, 0), 43 | }; 44 | 45 | /******************************************************************************* 46 | * Class 2: Execution Class Errors 47 | ******************************************************************************/ 48 | 49 | enum xa_error_nonfatal_execute_voice_proc { 50 | XA_VOICE_PROC_EXEC_NONFATAL_NO_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_MIMO_PROC_VOICE_PROC, 0), 51 | }; 52 | 53 | enum xa_error_fatal_execute_voice_proc { 54 | XA_VOICE_PROC_EXEC_FATAL_STATE = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_MIMO_PROC_VOICE_PROC, 0), 55 | }; 56 | 57 | #endif /* __XA_VOICE_PROC_API_H__ */ 58 | -------------------------------------------------------------------------------- /dsp_framework/include/plugins/xf-audio-apicmd.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2018 NXP 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | ******************************************************************************/ 23 | 24 | #ifndef _XF_AUDIO_APICMD_H 25 | #define _XF_AUDIO_APICMD_H 26 | 27 | typedef void * xf_codec_handle_t; 28 | 29 | typedef UWORD32 xf_codec_func_t(xf_codec_handle_t handle, 30 | UWORD32 cmd, 31 | UWORD32 idx, 32 | void *p_value); 33 | 34 | /*****************************************************************************/ 35 | /* Standard API commands */ 36 | /*****************************************************************************/ 37 | 38 | enum xf_api_cmd_generic { 39 | XF_API_CMD_GET_API_SIZE = 0x0001, 40 | 41 | XF_API_CMD_PRE_INIT = 0x0002, 42 | XF_API_CMD_INIT = 0x0003, 43 | XF_API_CMD_POST_INIT = 0x0004, 44 | 45 | XF_API_CMD_SET_PARAM = 0x0005, 46 | XF_API_CMD_GET_PARAM = 0x0006, 47 | 48 | XF_API_CMD_EXECUTE = 0x0007, 49 | 50 | XF_API_CMD_SET_INPUT_PTR = 0x0008, 51 | XF_API_CMD_SET_OUTPUT_PTR = 0x0009, 52 | 53 | XF_API_CMD_SET_INPUT_BYTES = 0x000A, 54 | XF_API_CMD_GET_OUTPUT_BYTES = 0x000B, 55 | XF_API_CMD_GET_CONSUMED_BYTES = 0x000C, 56 | XF_API_CMD_INPUT_OVER = 0x000D, 57 | XF_API_CMD_RUNTIME_INIT = 0x000E, 58 | XF_API_CMD_CLEANUP = 0x000F, 59 | XF_API_CMD_SET_LIB_ENTRY = 0x0010, 60 | XF_API_CMD_SUSPEND = 0x0011, 61 | XF_API_CMD_RESUME = 0x0012, 62 | XF_API_CMD_PAUSE = 0x0013, 63 | XF_API_CMD_PAUSE_RELEASE = 0x0014, 64 | 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /dsp_framework/include/printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * printf.h - simple printf interface 3 | * 4 | * Copyright (c) 2016, Matt Redfearn 5 | * Copyright 2017 NXP 6 | * 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 19 | * 3. Neither the name of the copyright holder nor the names of its 20 | * contributors may be used to endorse or promote products derived from this 21 | * software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | * 36 | * This library provides a simple implementation of printf and sprintf. I wrote 37 | * it because I could not find a good BSD licensed printf that may be built in 38 | * to proprietary software. 39 | * 40 | * The formats specifiers supported by this implementation are: 41 | * 'd' 'u' 'x' 'X' 'c' 's'. 42 | * 43 | * Zero padding and field width are also supported, as well as pad right and 44 | * variable pad width. 45 | * 46 | * To use printf() your program should provide an implementation of putchar() 47 | * to output a character, for example: 48 | * 49 | * void putchar(char c) 50 | * { 51 | * while(!SERIAL_PORT_EMPTY); 52 | * SERIAL_PORT_TX_REGISTER = c; 53 | * } 54 | * 55 | * The code is re-entrant, so it is safe to call from any context, though you 56 | * will probably get interleaved output. This means that your putchar() 57 | * function should also be reentrant. 58 | */ 59 | 60 | #ifndef __SIMPLE_PRINTF__ 61 | #define __SIMPLE_PRINTF__ 62 | 63 | /* Platform must supply this function to output a character */ 64 | //int putchar(char c); 65 | 66 | #ifdef DEBUG 67 | int __dsp_printf(const char *fmt, ...); 68 | int __dsp_sprintf(char *buf, const char *fmt, ...); 69 | #endif /* DEBUG */ 70 | 71 | #endif /* __SIMPLE_PRINTF__ */ 72 | -------------------------------------------------------------------------------- /dsp_framework/include/rpmsg_config.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | 5 | #ifndef _RPMSG_CONFIG_H 6 | #define _RPMSG_CONFIG_H 7 | 8 | /*! 9 | * @addtogroup config 10 | * @{ 11 | * @file 12 | */ 13 | 14 | //! @name Configuration options 15 | //@{ 16 | 17 | //! @def RL_MS_PER_INTERVAL 18 | //! 19 | //! Delay in milliseconds used in non-blocking API functions for polling. 20 | //! The default value is 1. 21 | #define RL_MS_PER_INTERVAL (1) 22 | 23 | //! @def RL_BUFFER_PAYLOAD_SIZE 24 | //! 25 | //! Size of the buffer payload, it must be equal to (240, 496, 1008, ...) 26 | //! [2^n - 16]. 27 | //! The default value is 496U. 28 | #define RL_BUFFER_PAYLOAD_SIZE (496U) 29 | 30 | //! @def RL_BUFFER_COUNT 31 | //! 32 | //! Number of the buffers, it must be power of two (2, 4, ...). 33 | //! The default value is 2U. 34 | #define RL_BUFFER_COUNT (256U) 35 | 36 | //! @def RL_API_HAS_ZEROCOPY 37 | //! 38 | //! Zero-copy API functions enabled/disabled. 39 | //! The default value is 1 (enabled). 40 | #define RL_API_HAS_ZEROCOPY (1) 41 | 42 | //! @def RL_USE_STATIC_API 43 | //! 44 | //! Static API functions (no dynamic allocation) enabled/disabled. 45 | //! The default value is 0 (static API disabled). 46 | #define RL_USE_STATIC_API (1) 47 | 48 | //! @def RL_CLEAR_USED_BUFFERS 49 | //! 50 | //! Clearing used buffers before returning back to the pool of free buffers 51 | //! enabled/disabled. 52 | //! The default value is 0 (disabled). 53 | #define RL_CLEAR_USED_BUFFERS (0) 54 | 55 | //! @def RL_USE_MCMGR_IPC_ISR_HANDLER 56 | //! 57 | //! When enabled IPC interrupts are managed by the Multicore Manager (IPC 58 | //! interrupts router), when disabled RPMsg-Lite manages IPC interrupts 59 | //! by itself. 60 | //! The default value is 0 (no MCMGR IPC ISR handler used). 61 | #define RL_USE_MCMGR_IPC_ISR_HANDLER (0) 62 | 63 | //! @def RL_USE_ENVIRONMENT_CONTEXT 64 | //! 65 | //! When enabled the environment layer uses its own context. 66 | //! Added for QNX port mainly, but can be used if required. 67 | //! The default value is 0 (no context, saves some RAM). 68 | #define RL_USE_ENVIRONMENT_CONTEXT (0) 69 | 70 | //! @def RL_DEBUG_CHECK_BUFFERS 71 | //! 72 | //! Do not use in RPMsg-Lite to Linux configuration 73 | #define RL_DEBUG_CHECK_BUFFERS (0) 74 | //@} 75 | 76 | #endif /* _RPMSG_CONFIG_H */ 77 | -------------------------------------------------------------------------------- /dsp_framework/include/rpmsg_platform.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | 5 | #ifndef RPMSG_PLATFORM_H_ 6 | #define RPMSG_PLATFORM_H_ 7 | 8 | #include 9 | #include "xa_type_def.h" 10 | #include "xf-debug.h" 11 | 12 | /* RPMSG MU channel index */ 13 | #define RPMSG_MU_CHANNEL (0) 14 | 15 | /* 16 | * Linux requires the ALIGN to 0x1000(4KB) instead of 0x80 17 | */ 18 | #ifndef VRING_ALIGN 19 | #define VRING_ALIGN (0x1000U) 20 | #endif 21 | 22 | /* contains pool of descriptos and two circular buffers */ 23 | #ifndef VRING_SIZE 24 | #define VRING_SIZE (0x8000UL) 25 | #endif 26 | 27 | /* size of shared memory + 2*VRING size */ 28 | #define RL_VRING_OVERHEAD (2UL * VRING_SIZE) 29 | 30 | #define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU)) 31 | #define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U) 32 | #define RL_GET_Q_ID(id) ((id)&0x1U) 33 | 34 | #define RL_PLATFORM_DSP_LINK_ID (0U) 35 | #define RL_PLATFORM_HIGHEST_LINK_ID (0U) 36 | 37 | /* platform interrupt related functions */ 38 | int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data); 39 | int32_t platform_deinit_interrupt(uint32_t vector_id); 40 | int32_t platform_interrupt_enable(uint32_t vector_id); 41 | int32_t platform_interrupt_disable(uint32_t vector_id); 42 | int32_t platform_in_isr(void); 43 | void platform_notify(uint32_t vector_id); 44 | 45 | /* platform low-level time-delay (busy loop) */ 46 | void platform_time_delay(uint32_t num_msec); 47 | 48 | /* platform memory functions */ 49 | void platform_map_mem_region(uint32_t vrt_addr, uint32_t phy_addr, uint32_t size, uint32_t flags); 50 | void platform_cache_all_flush_invalidate(void); 51 | void platform_cache_disable(void); 52 | uint32_t platform_vatopa(void *addr); 53 | void *platform_patova(uint32_t addr); 54 | 55 | /* platform init/deinit */ 56 | int32_t platform_init(void); 57 | int32_t platform_deinit(void); 58 | 59 | void rpmsg_response(UWORD32 core); 60 | 61 | #endif /* RPMSG_PLATFORM_H_ */ 62 | -------------------------------------------------------------------------------- /dsp_framework/include/rsc_table.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | * 4 | * This file populates resource table for BM remote 5 | * for use by the Linux Master 6 | */ 7 | 8 | #ifndef RSC_TABLE_H_ 9 | #define RSC_TABLE_H_ 10 | 11 | #include 12 | #include 13 | 14 | #if defined __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #define NO_RESOURCE_ENTRIES (1) 19 | #define RSC_VDEV_FEATURE_NS (1) /* Support name service announcement */ 20 | 21 | /* Resource table for the given remote */ 22 | METAL_PACKED_BEGIN 23 | struct remote_resource_table { 24 | uint32_t version; 25 | uint32_t num; 26 | uint32_t reserved[2]; 27 | uint32_t offset[NO_RESOURCE_ENTRIES]; 28 | 29 | /* rpmsg vdev entry for user app communication */ 30 | struct fw_rsc_vdev user_vdev; 31 | struct fw_rsc_vdev_vring user_vring0; 32 | struct fw_rsc_vdev_vring user_vring1; 33 | } METAL_PACKED_END; 34 | 35 | #if defined __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* RSC_TABLE_H_ */ 40 | -------------------------------------------------------------------------------- /dsp_framework/include/types.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause 2 | * Copyright 2021 NXP 3 | */ 4 | #ifndef __TYPES_H 5 | #define __TYPES_H 6 | 7 | typedef unsigned int u32; 8 | typedef signed int s32; 9 | typedef unsigned short u16; 10 | typedef signed short s16; 11 | typedef unsigned char u8; 12 | typedef signed char s8; 13 | 14 | #define BIT(x) (1 << (x)) 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8/ldscripts/elf32xtensa.xr: -------------------------------------------------------------------------------- 1 | /* This linker script generated from xt-genldscripts.tpp for LSP dsp_framework/memmap/imx8 */ 2 | /* Linker Script for ld -r or ld -i */ 3 | 4 | 5 | SECTIONS 6 | { 7 | 8 | .text 0 : 9 | { 10 | *(.init.literal) 11 | KEEP(*(.init)) 12 | *(.literal .text) 13 | *(.fini.literal) 14 | KEEP(*(.fini)) 15 | } 16 | 17 | .data 0 : 18 | { 19 | *(.rodata) 20 | *(.rodata.*) 21 | *(.data) 22 | } 23 | 24 | .bss 0 : 25 | { 26 | *(.dynsbss) 27 | *(.sbss) 28 | *(.scommon) 29 | *(.dynbss) 30 | *(.bss) 31 | *(COMMON) 32 | } 33 | .debug 0 : { *(.debug) } 34 | .line 0 : { *(.line) } 35 | .debug_srcinfo 0 : { *(.debug_srcinfo) } 36 | .debug_sfnames 0 : { *(.debug_sfnames) } 37 | .debug_aranges 0 : { *(.debug_aranges) } 38 | .debug_ranges 0 : { *(.debug_ranges) } 39 | .debug_pubnames 0 : { *(.debug_pubnames) } 40 | .debug_info 0 : { *(.debug_info) } 41 | .debug_abbrev 0 : { *(.debug_abbrev) } 42 | .debug_line 0 : { *(.debug_line) } 43 | .debug_frame 0 : { *(.debug_frame) } 44 | .debug_str 0 : { *(.debug_str) } 45 | .debug_loc 0 : { *(.debug_loc) } 46 | .debug_macinfo 0 : { *(.debug_macinfo) } 47 | .debug_weaknames 0 : { *(.debug_weaknames) } 48 | .debug_funcnames 0 : { *(.debug_funcnames) } 49 | .debug_typenames 0 : { *(.debug_typenames) } 50 | .debug_varnames 0 : { *(.debug_varnames) } 51 | .debug.xt.map 0 : { *(.debug.xt.map) } 52 | .xt.insn 0 : 53 | { 54 | KEEP (*(.xt.insn)) 55 | KEEP (*(.gnu.linkonce.x.*)) 56 | } 57 | .xt.prop 0 : 58 | { 59 | *(.xt.prop) 60 | *(.xt.prop.*) 61 | *(.gnu.linkonce.prop.*) 62 | } 63 | .xt.lit 0 : 64 | { 65 | *(.xt.lit) 66 | *(.xt.lit.*) 67 | *(.gnu.linkonce.p.*) 68 | } 69 | .xtensa.info 0 : 70 | { 71 | *(.xtensa.info) 72 | } 73 | .debug.xt.callgraph 0 : 74 | { 75 | KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) 76 | } 77 | .comment 0 : 78 | { 79 | KEEP(*(.comment)) 80 | } 81 | .note.GNU-stack 0 : 82 | { 83 | *(.note.GNU-stack) 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8/ldscripts/elf32xtensa.xu: -------------------------------------------------------------------------------- 1 | /* This linker script generated from xt-genldscripts.tpp for LSP dsp_framework/memmap/imx8 */ 2 | /* Linker Script for ld -Ur */ 3 | 4 | 5 | SECTIONS 6 | { 7 | 8 | .text 0 : 9 | { 10 | *(.init.literal) 11 | KEEP(*(.init)) 12 | *(.literal .text) 13 | *(.fini.literal) 14 | KEEP(*(.fini)) 15 | } 16 | 17 | .data 0 : 18 | { 19 | *(.rodata) 20 | *(.rodata.*) 21 | *(.data) 22 | } 23 | 24 | .bss 0 : 25 | { 26 | *(.dynsbss) 27 | *(.sbss) 28 | *(.scommon) 29 | *(.dynbss) 30 | *(.bss) 31 | *(COMMON) 32 | } 33 | .debug 0 : { *(.debug) } 34 | .line 0 : { *(.line) } 35 | .debug_srcinfo 0 : { *(.debug_srcinfo) } 36 | .debug_sfnames 0 : { *(.debug_sfnames) } 37 | .debug_aranges 0 : { *(.debug_aranges) } 38 | .debug_ranges 0 : { *(.debug_ranges) } 39 | .debug_pubnames 0 : { *(.debug_pubnames) } 40 | .debug_info 0 : { *(.debug_info) } 41 | .debug_abbrev 0 : { *(.debug_abbrev) } 42 | .debug_line 0 : { *(.debug_line) } 43 | .debug_frame 0 : { *(.debug_frame) } 44 | .debug_str 0 : { *(.debug_str) } 45 | .debug_loc 0 : { *(.debug_loc) } 46 | .debug_macinfo 0 : { *(.debug_macinfo) } 47 | .debug_weaknames 0 : { *(.debug_weaknames) } 48 | .debug_funcnames 0 : { *(.debug_funcnames) } 49 | .debug_typenames 0 : { *(.debug_typenames) } 50 | .debug_varnames 0 : { *(.debug_varnames) } 51 | .debug.xt.map 0 : { *(.debug.xt.map) } 52 | .xt.insn 0 : 53 | { 54 | KEEP (*(.xt.insn)) 55 | KEEP (*(.gnu.linkonce.x.*)) 56 | } 57 | .xt.prop 0 : 58 | { 59 | *(.xt.prop) 60 | *(.xt.prop.*) 61 | *(.gnu.linkonce.prop.*) 62 | } 63 | .xt.lit 0 : 64 | { 65 | *(.xt.lit) 66 | *(.xt.lit.*) 67 | *(.gnu.linkonce.p.*) 68 | } 69 | .xtensa.info 0 : 70 | { 71 | *(.xtensa.info) 72 | } 73 | .debug.xt.callgraph 0 : 74 | { 75 | KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) 76 | } 77 | .comment 0 : 78 | { 79 | KEEP(*(.comment)) 80 | } 81 | .note.GNU-stack 0 : 82 | { 83 | *(.note.GNU-stack) 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8/sim.parm: -------------------------------------------------------------------------------- 1 | // Memory map file to generate linker scripts for programs run on the ISS. 2 | 3 | // Customer ID=12445; Build=0x6ded3; Copyright (c) 2004-2015 Cadence Design Systems, Inc. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining 6 | // a copy of this software and associated documentation files (the 7 | // "Software"), to deal in the Software without restriction, including 8 | // without limitation the rights to use, copy, modify, merge, publish, 9 | // distribute, sublicense, and/or sell copies of the Software, and to 10 | // permit persons to whom the Software is furnished to do so, subject to 11 | // the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included 14 | // in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8/specs: -------------------------------------------------------------------------------- 1 | # Customer ID=12445; Build=0x6ded3; Copyright (c) 2004-2015 Cadence Design Systems, Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | 23 | # The %O suffix on the start and end files indicates that the system's 24 | # standard suffix for object files (e.g., ".o") should be appended. 25 | # The %s suffix tells the compiler driver to search for the file in the 26 | # list of known locations for startfiles. 27 | 28 | *startfile: 29 | crt1-sim%O%s crti%O%s crtbegin%O%s _sharedvectors%O%s _vectors%O%s 30 | 31 | *endfile: 32 | crtend%O%s crtn%O%s 33 | 34 | *lib: 35 | -lc -lsim -lc -lhandler-reset -lhandlers-sim -lhal -lc 36 | 37 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8m/ldscripts/elf32xtensa.xr: -------------------------------------------------------------------------------- 1 | /* This linker script generated from xt-genldscripts.tpp for LSP imx8m */ 2 | /* Linker Script for ld -r or ld -i */ 3 | 4 | 5 | SECTIONS 6 | { 7 | 8 | .text 0 : 9 | { 10 | *(.init.literal) 11 | KEEP(*(.init)) 12 | *(.literal .text) 13 | *(.fini.literal) 14 | KEEP(*(.fini)) 15 | } 16 | 17 | .data 0 : 18 | { 19 | *(.rodata) 20 | *(.rodata.*) 21 | *(.data) 22 | } 23 | 24 | .bss 0 : 25 | { 26 | *(.dynsbss) 27 | *(.sbss) 28 | *(.scommon) 29 | *(.dynbss) 30 | *(.bss) 31 | *(COMMON) 32 | } 33 | .debug 0 : { *(.debug) } 34 | .line 0 : { *(.line) } 35 | .debug_srcinfo 0 : { *(.debug_srcinfo) } 36 | .debug_sfnames 0 : { *(.debug_sfnames) } 37 | .debug_aranges 0 : { *(.debug_aranges) } 38 | .debug_ranges 0 : { *(.debug_ranges) } 39 | .debug_pubnames 0 : { *(.debug_pubnames) } 40 | .debug_info 0 : { *(.debug_info) } 41 | .debug_abbrev 0 : { *(.debug_abbrev) } 42 | .debug_line 0 : { *(.debug_line) } 43 | .debug_frame 0 : { *(.debug_frame) } 44 | .debug_str 0 : { *(.debug_str) } 45 | .debug_loc 0 : { *(.debug_loc) } 46 | .debug_macinfo 0 : { *(.debug_macinfo) } 47 | .debug_weaknames 0 : { *(.debug_weaknames) } 48 | .debug_funcnames 0 : { *(.debug_funcnames) } 49 | .debug_typenames 0 : { *(.debug_typenames) } 50 | .debug_varnames 0 : { *(.debug_varnames) } 51 | .debug.xt.map 0 : { *(.debug.xt.map) } 52 | .xt.insn 0 : 53 | { 54 | KEEP (*(.xt.insn)) 55 | KEEP (*(.gnu.linkonce.x.*)) 56 | } 57 | .xt.prop 0 : 58 | { 59 | *(.xt.prop) 60 | *(.xt.prop.*) 61 | *(.gnu.linkonce.prop.*) 62 | } 63 | .xt.lit 0 : 64 | { 65 | *(.xt.lit) 66 | *(.xt.lit.*) 67 | *(.gnu.linkonce.p.*) 68 | } 69 | .xtensa.info 0 : 70 | { 71 | *(.xtensa.info) 72 | } 73 | .debug.xt.callgraph 0 : 74 | { 75 | KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) 76 | } 77 | .comment 0 : 78 | { 79 | KEEP(*(.comment)) 80 | } 81 | .note.GNU-stack 0 : 82 | { 83 | *(.note.GNU-stack) 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8m/ldscripts/elf32xtensa.xu: -------------------------------------------------------------------------------- 1 | /* This linker script generated from xt-genldscripts.tpp for LSP imx8m */ 2 | /* Linker Script for ld -Ur */ 3 | 4 | 5 | SECTIONS 6 | { 7 | 8 | .text 0 : 9 | { 10 | *(.init.literal) 11 | KEEP(*(.init)) 12 | *(.literal .text) 13 | *(.fini.literal) 14 | KEEP(*(.fini)) 15 | } 16 | 17 | .data 0 : 18 | { 19 | *(.rodata) 20 | *(.rodata.*) 21 | *(.data) 22 | } 23 | 24 | .bss 0 : 25 | { 26 | *(.dynsbss) 27 | *(.sbss) 28 | *(.scommon) 29 | *(.dynbss) 30 | *(.bss) 31 | *(COMMON) 32 | } 33 | .debug 0 : { *(.debug) } 34 | .line 0 : { *(.line) } 35 | .debug_srcinfo 0 : { *(.debug_srcinfo) } 36 | .debug_sfnames 0 : { *(.debug_sfnames) } 37 | .debug_aranges 0 : { *(.debug_aranges) } 38 | .debug_ranges 0 : { *(.debug_ranges) } 39 | .debug_pubnames 0 : { *(.debug_pubnames) } 40 | .debug_info 0 : { *(.debug_info) } 41 | .debug_abbrev 0 : { *(.debug_abbrev) } 42 | .debug_line 0 : { *(.debug_line) } 43 | .debug_frame 0 : { *(.debug_frame) } 44 | .debug_str 0 : { *(.debug_str) } 45 | .debug_loc 0 : { *(.debug_loc) } 46 | .debug_macinfo 0 : { *(.debug_macinfo) } 47 | .debug_weaknames 0 : { *(.debug_weaknames) } 48 | .debug_funcnames 0 : { *(.debug_funcnames) } 49 | .debug_typenames 0 : { *(.debug_typenames) } 50 | .debug_varnames 0 : { *(.debug_varnames) } 51 | .debug.xt.map 0 : { *(.debug.xt.map) } 52 | .xt.insn 0 : 53 | { 54 | KEEP (*(.xt.insn)) 55 | KEEP (*(.gnu.linkonce.x.*)) 56 | } 57 | .xt.prop 0 : 58 | { 59 | *(.xt.prop) 60 | *(.xt.prop.*) 61 | *(.gnu.linkonce.prop.*) 62 | } 63 | .xt.lit 0 : 64 | { 65 | *(.xt.lit) 66 | *(.xt.lit.*) 67 | *(.gnu.linkonce.p.*) 68 | } 69 | .xtensa.info 0 : 70 | { 71 | *(.xtensa.info) 72 | } 73 | .debug.xt.callgraph 0 : 74 | { 75 | KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) 76 | } 77 | .comment 0 : 78 | { 79 | KEEP(*(.comment)) 80 | } 81 | .note.GNU-stack 0 : 82 | { 83 | *(.note.GNU-stack) 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8m/sim.parm: -------------------------------------------------------------------------------- 1 | // Memory map file to generate linker scripts for programs run on the ISS. 2 | 3 | // Customer ID=14556; Build=0x7ef28; Copyright (c) 2004-2015 Cadence Design Systems, Inc. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining 6 | // a copy of this software and associated documentation files (the 7 | // "Software"), to deal in the Software without restriction, including 8 | // without limitation the rights to use, copy, modify, merge, publish, 9 | // distribute, sublicense, and/or sell copies of the Software, and to 10 | // permit persons to whom the Software is furnished to do so, subject to 11 | // the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included 14 | // in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8m/specs: -------------------------------------------------------------------------------- 1 | # Customer ID=14556; Build=0x7ef28; Copyright (c) 2004-2015 Cadence Design Systems, Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | 23 | # The %O suffix on the start and end files indicates that the system's 24 | # standard suffix for object files (e.g., ".o") should be appended. 25 | # The %s suffix tells the compiler driver to search for the file in the 26 | # list of known locations for startfiles. 27 | 28 | *startfile: 29 | crt1-sim%O%s crti%O%s crtbegin%O%s _sharedvectors%O%s _vectors%O%s 30 | 31 | *endfile: 32 | crtend%O%s crtn%O%s 33 | 34 | *lib: 35 | -lc -lsim -lc -lhandler-reset -lhandlers-sim -lhal -lc 36 | 37 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8ulp/ldscripts/elf32xtensa.xr: -------------------------------------------------------------------------------- 1 | /* This linker script generated from xt-genldscripts.tpp for LSP dsp_framework/memmap/imx8ulp */ 2 | /* Linker Script for ld -r or ld -i */ 3 | 4 | 5 | SECTIONS 6 | { 7 | 8 | .text 0 : 9 | { 10 | *(.init.literal) 11 | KEEP(*(.init)) 12 | *(.literal .text) 13 | *(.fini.literal) 14 | KEEP(*(.fini)) 15 | } 16 | 17 | .data 0 : 18 | { 19 | *(.rodata) 20 | *(.rodata.*) 21 | *(.data) 22 | } 23 | 24 | .bss 0 : 25 | { 26 | *(.dynsbss) 27 | *(.sbss) 28 | *(.scommon) 29 | *(.dynbss) 30 | *(.bss) 31 | *(COMMON) 32 | } 33 | .debug 0 : { *(.debug) } 34 | .line 0 : { *(.line) } 35 | .debug_srcinfo 0 : { *(.debug_srcinfo) } 36 | .debug_sfnames 0 : { *(.debug_sfnames) } 37 | .debug_aranges 0 : { *(.debug_aranges) } 38 | .debug_ranges 0 : { *(.debug_ranges) } 39 | .debug_pubnames 0 : { *(.debug_pubnames) } 40 | .debug_info 0 : { *(.debug_info) } 41 | .debug_abbrev 0 : { *(.debug_abbrev) } 42 | .debug_line 0 : { *(.debug_line) } 43 | .debug_frame 0 : { *(.debug_frame) } 44 | .debug_str 0 : { *(.debug_str) } 45 | .debug_loc 0 : { *(.debug_loc) } 46 | .debug_macinfo 0 : { *(.debug_macinfo) } 47 | .debug_weaknames 0 : { *(.debug_weaknames) } 48 | .debug_funcnames 0 : { *(.debug_funcnames) } 49 | .debug_typenames 0 : { *(.debug_typenames) } 50 | .debug_varnames 0 : { *(.debug_varnames) } 51 | .debug.xt.map 0 : { *(.debug.xt.map) } 52 | .xt.insn 0 : 53 | { 54 | KEEP (*(.xt.insn)) 55 | KEEP (*(.gnu.linkonce.x.*)) 56 | } 57 | .xt.prop 0 : 58 | { 59 | *(.xt.prop) 60 | *(.xt.prop.*) 61 | *(.gnu.linkonce.prop.*) 62 | } 63 | .xt.lit 0 : 64 | { 65 | *(.xt.lit) 66 | *(.xt.lit.*) 67 | *(.gnu.linkonce.p.*) 68 | } 69 | .xtensa.info 0 : 70 | { 71 | *(.xtensa.info) 72 | } 73 | .debug.xt.callgraph 0 : 74 | { 75 | KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) 76 | } 77 | .comment 0 : 78 | { 79 | KEEP(*(.comment)) 80 | } 81 | .note.GNU-stack 0 : 82 | { 83 | *(.note.GNU-stack) 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8ulp/ldscripts/elf32xtensa.xu: -------------------------------------------------------------------------------- 1 | /* This linker script generated from xt-genldscripts.tpp for LSP dsp_framework/memmap/imx8ulp */ 2 | /* Linker Script for ld -Ur */ 3 | 4 | 5 | SECTIONS 6 | { 7 | 8 | .text 0 : 9 | { 10 | *(.init.literal) 11 | KEEP(*(.init)) 12 | *(.literal .text) 13 | *(.fini.literal) 14 | KEEP(*(.fini)) 15 | } 16 | 17 | .data 0 : 18 | { 19 | *(.rodata) 20 | *(.rodata.*) 21 | *(.data) 22 | } 23 | 24 | .bss 0 : 25 | { 26 | *(.dynsbss) 27 | *(.sbss) 28 | *(.scommon) 29 | *(.dynbss) 30 | *(.bss) 31 | *(COMMON) 32 | } 33 | .debug 0 : { *(.debug) } 34 | .line 0 : { *(.line) } 35 | .debug_srcinfo 0 : { *(.debug_srcinfo) } 36 | .debug_sfnames 0 : { *(.debug_sfnames) } 37 | .debug_aranges 0 : { *(.debug_aranges) } 38 | .debug_ranges 0 : { *(.debug_ranges) } 39 | .debug_pubnames 0 : { *(.debug_pubnames) } 40 | .debug_info 0 : { *(.debug_info) } 41 | .debug_abbrev 0 : { *(.debug_abbrev) } 42 | .debug_line 0 : { *(.debug_line) } 43 | .debug_frame 0 : { *(.debug_frame) } 44 | .debug_str 0 : { *(.debug_str) } 45 | .debug_loc 0 : { *(.debug_loc) } 46 | .debug_macinfo 0 : { *(.debug_macinfo) } 47 | .debug_weaknames 0 : { *(.debug_weaknames) } 48 | .debug_funcnames 0 : { *(.debug_funcnames) } 49 | .debug_typenames 0 : { *(.debug_typenames) } 50 | .debug_varnames 0 : { *(.debug_varnames) } 51 | .debug.xt.map 0 : { *(.debug.xt.map) } 52 | .xt.insn 0 : 53 | { 54 | KEEP (*(.xt.insn)) 55 | KEEP (*(.gnu.linkonce.x.*)) 56 | } 57 | .xt.prop 0 : 58 | { 59 | *(.xt.prop) 60 | *(.xt.prop.*) 61 | *(.gnu.linkonce.prop.*) 62 | } 63 | .xt.lit 0 : 64 | { 65 | *(.xt.lit) 66 | *(.xt.lit.*) 67 | *(.gnu.linkonce.p.*) 68 | } 69 | .xtensa.info 0 : 70 | { 71 | *(.xtensa.info) 72 | } 73 | .debug.xt.callgraph 0 : 74 | { 75 | KEEP (*(.debug.xt.callgraph .debug.xt.callgraph.* .gnu.linkonce.xt.callgraph.*)) 76 | } 77 | .comment 0 : 78 | { 79 | KEEP(*(.comment)) 80 | } 81 | .note.GNU-stack 0 : 82 | { 83 | *(.note.GNU-stack) 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /dsp_framework/memmap/imx8ulp/specs: -------------------------------------------------------------------------------- 1 | # Customer ID=15782; Build=0x8a8c2; Copyright (c) 2004-2015 Cadence Design Systems, Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | 23 | # The %O suffix on the start and end files indicates that the system's 24 | # standard suffix for object files (e.g., ".o") should be appended. 25 | # The %s suffix tells the compiler driver to search for the file in the 26 | # list of known locations for startfiles. 27 | 28 | *startfile: 29 | crt1-sim%O%s crti%O%s crtbegin%O%s _sharedvectors%O%s _vectors%O%s 30 | 31 | *endfile: 32 | crtend%O%s crtn%O%s 33 | 34 | *lib: 35 | -lc -lsim -lc -lhandler-reset -lhandlers-sim -lhal -lc 36 | 37 | -------------------------------------------------------------------------------- /dsp_framework/src/board.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Copyright 2021 NXP 3 | 4 | #include "mydefs.h" 5 | #include "fsl_mu.h" 6 | 7 | #ifdef PLATF_8M 8 | struct mem_att dsp_mem_att[] = { 9 | /* DDR (Data) */ 10 | { 0x40000000, 0x40000000, 0x80000000, 0}, 11 | }; 12 | 13 | struct mem_cfg dsp_mem_cfg = { 14 | .att = dsp_mem_att, 15 | .att_size = 1, 16 | }; 17 | 18 | struct mu_cfg dsp_mu_cfg = { 19 | .type = MU_V1, 20 | .xTR = 0x0, 21 | .xRR = 0x10, 22 | .xSR = {0x20, 0x20, 0x20, 0x20}, 23 | .xCR = {0x24, 0x24, 0x24, 0x24}, 24 | }; 25 | 26 | #else /* PLATF_8M */ 27 | #ifdef PLATF_8ULP 28 | struct mem_att dsp_mem_att[] = { 29 | /* DDR (Data) */ 30 | { 0x0c000000, 0x80000000, 0x10000000, 0}, 31 | { 0x30000000, 0x90000000, 0x10000000, 0}, 32 | }; 33 | 34 | struct mem_cfg dsp_mem_cfg = { 35 | .att = dsp_mem_att, 36 | .att_size = 2, 37 | }; 38 | 39 | struct mu_cfg dsp_mu_cfg = { 40 | .type = MU_V2, 41 | .xTR = 0x200, 42 | .xRR = 0x280, 43 | .xSR = {0xC, 0x118, 0x124, 0x12C}, 44 | .xCR = {0x110, 0x114, 0x120, 0x128}, 45 | }; 46 | 47 | #else /* !PLATF_8ULP && ! PLATF_8M -> (8QXP || 8QM)*/ 48 | struct mem_att dsp_mem_att[] = { 49 | /* DDR (Data) */ 50 | { 0x80000000, 0x80000000, 0x60000000, 0}, 51 | }; 52 | 53 | struct mem_cfg dsp_mem_cfg = { 54 | .att = dsp_mem_att, 55 | .att_size = 1, 56 | }; 57 | 58 | struct mu_cfg dsp_mu_cfg = { 59 | .type = MU_V1, 60 | .xTR = 0x0, 61 | .xRR = 0x10, 62 | .xSR = {0x20, 0x20, 0x20, 0x20}, 63 | .xCR = {0x24, 0x24, 0x24, 0x24}, 64 | }; 65 | 66 | #endif /* PLATF_8ULP */ 67 | #endif /* PLATF_8M */ 68 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/dsp_irq_handler.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 NXP 2 | // SPDX-License-Identifier: BSD-3-Clause 3 | 4 | #include "mydefs.h" 5 | #include "io.h" 6 | #include "hardware.h" 7 | 8 | #include "debug.h" 9 | 10 | void xa_hw_comp_isr() 11 | { 12 | struct dsp_main_struct *dsp; 13 | s32 avail; 14 | u32 status; 15 | u32 num; 16 | 17 | if (IRQ_STR_ADDR == 0) 18 | return; 19 | dsp = get_main_struct(); 20 | 21 | /* process hw interrupt if dev exist */ 22 | if (SAI_INT != 0) { 23 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(SAI_INT + 32))); 24 | if (status & (1 << IRQ_TO_MASK_SHIFT(SAI_INT + 32))) 25 | sai_irq_handler((void *)SAI_ADDR); 26 | } 27 | 28 | if (ESAI_INT != 0) { 29 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(ESAI_INT + 32))); 30 | if (status & (1 << IRQ_TO_MASK_SHIFT(ESAI_INT + 32))) 31 | esai_irq_handler((void *)ESAI_ADDR); 32 | } 33 | 34 | if (ASRC_INT != 0) { 35 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(ASRC_INT + 32))); 36 | if (status & (1 << IRQ_TO_MASK_SHIFT(ASRC_INT + 32))) 37 | asrc_irq_handler((void *)ASRC_ADDR); 38 | } 39 | 40 | if (EASRC_INT != 0) { 41 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(EASRC_INT + 32))); 42 | if (status & (1 << IRQ_TO_MASK_SHIFT(EASRC_INT + 32))) 43 | easrc_irq_handler((void *)EASRC_ADDR); 44 | } 45 | 46 | if (MICFIL_INT != 0) { 47 | void *micfil = dsp->micfil; 48 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(MICFIL_INT + 32))); 49 | if (status & (1 << IRQ_TO_MASK_SHIFT(MICFIL_INT + 32))) 50 | micfil_irq_handler(micfil); 51 | } 52 | 53 | if (SDMA_INT != 0) { 54 | dma_t *dma = dsp->dma_device; 55 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(SDMA_INT + 32))); 56 | if (status & (1 << IRQ_TO_MASK_SHIFT(SDMA_INT + 32))) 57 | dma_irq_handler(dma); 58 | } 59 | 60 | if (EDMA_ESAI_INT_NUM != 0) { 61 | dma_t *dma = dsp->dma_device; 62 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(EDMA_ESAI_INT_NUM + 32))); 63 | if (status & (1 << IRQ_TO_MASK_SHIFT(EDMA_ESAI_INT_NUM + 32))) 64 | dma_irq_handler(dma); 65 | } 66 | if (EDMA_ASRC_INT_NUM != 0) { 67 | dma_t *dma = dsp->dma_device; 68 | status = read32((void *)IRQ_STR_ADDR + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(EDMA_ASRC_INT_NUM + 32))); 69 | if (status & (1 << IRQ_TO_MASK_SHIFT(EDMA_ASRC_INT_NUM + 32))) 70 | dma_irq_handler(dma); 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/fsl_dma.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 NXP 2 | // SPDX-License-Identifier: BSD-3-Clause 3 | 4 | #include 5 | 6 | #include "board.h" 7 | #include "edma.h" 8 | 9 | #include "fsl_dma.h" 10 | 11 | #include "sdma.h" 12 | 13 | void dma_probe(struct dsp_main_struct *dsp) 14 | { 15 | void *dma = NULL; 16 | unsigned int board_type = BOARD_TYPE; 17 | 18 | if (dsp->dma_device) 19 | return; 20 | 21 | if (board_type == DSP_IMX8MP_TYPE) 22 | dma = (void *)sdma_probe(); 23 | else 24 | dma = (void *)edma_probe(); 25 | 26 | dsp->dma_device = dma; 27 | } 28 | 29 | int get_dma_para(void *p_dma, dmac_t *p_dma_ch, int para, void *vaule) 30 | { 31 | dma_t *dma = (dma_t *)p_dma; 32 | if (!dma) 33 | return -EINVAL; 34 | return dma->get_para(dma, p_dma_ch, para, vaule); 35 | } 36 | 37 | int dma_init(void *p_dma) 38 | { 39 | dma_t *dma = (dma_t *)p_dma; 40 | if (!dma) 41 | return -EINVAL; 42 | return dma->init(dma); 43 | } 44 | 45 | void dma_release(void *p_dma) 46 | { 47 | dma_t *dma = (dma_t *)p_dma; 48 | if (!dma) 49 | return; 50 | dma->release(dma); 51 | } 52 | 53 | int dma_irq_handler(void *p_dma) 54 | { 55 | dma_t *dma = (dma_t *)p_dma; 56 | if (!dma) 57 | return -EINVAL; 58 | return dma->irq_handler(dma); 59 | } 60 | 61 | int dma_suspend(void *p_dma) 62 | { 63 | dma_t *dma = (dma_t *)p_dma; 64 | if (!dma) 65 | return -EINVAL; 66 | return dma->suspend(dma); 67 | } 68 | 69 | int dma_resume(void *p_dma) 70 | { 71 | dma_t *dma = (dma_t *)p_dma; 72 | if (!dma) 73 | return -EINVAL; 74 | return dma->resume(dma); 75 | } 76 | 77 | dmac_t *request_dma_chan(void *p_dma, int dev_type) 78 | { 79 | dmac_t *dma_ch = NULL; 80 | dma_t *dma = (dma_t *)p_dma; 81 | if (!dma) 82 | return NULL; 83 | dma_ch = (dmac_t *)dma->request_dma_chan(dma, dev_type); 84 | return dma_ch; 85 | } 86 | 87 | void release_dma_chan(dmac_t *p_dma_ch) 88 | { 89 | if (!p_dma_ch) 90 | return; 91 | dma_t *dma = (dma_t *)p_dma_ch->dma_device; 92 | if (!dma) 93 | return; 94 | dma->release_dma_chan(p_dma_ch); 95 | } 96 | 97 | int dma_chan_start(dmac_t *p_dma_ch) 98 | { 99 | if (!p_dma_ch) 100 | return -EINVAL; 101 | dma_t *dma = (dma_t *)p_dma_ch->dma_device; 102 | if (!dma) 103 | return -EINVAL; 104 | return dma->chan_start(p_dma_ch); 105 | } 106 | 107 | int dma_chan_stop(dmac_t *p_dma_ch) 108 | { 109 | if (!p_dma_ch) 110 | return -EINVAL; 111 | dma_t *dma = (dma_t *)p_dma_ch->dma_device; 112 | if (!dma) 113 | return -EINVAL; 114 | return dma->chan_stop(p_dma_ch); 115 | } 116 | 117 | int dma_chan_config(dmac_t *p_dma_ch, dmac_cfg_t *p_config) 118 | { 119 | if (!p_dma_ch || !p_config) 120 | return -EINVAL; 121 | dma_t *dma = (dma_t *)p_dma_ch->dma_device; 122 | if (!dma) 123 | return -EINVAL; 124 | return dma->chan_config(p_dma_ch, p_config); 125 | } 126 | 127 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/fsl_lpuart.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Copyright 2021 NXP 3 | 4 | #include "fsl_lpuart.h" 5 | #include "board.h" 6 | 7 | int lpuart_init(void) 8 | { 9 | volatile int *lpuart1 = (volatile int *)LPUART_BASE; 10 | struct nxp_lpuart *base = (struct nxp_lpuart *)lpuart1; 11 | 12 | u32 tmp; 13 | u32 sbr, osr, baud_diff, tmp_osr, tmp_sbr, tmp_diff; 14 | u32 clk = UART_CLK_ROOT; 15 | u32 baudrate = BAUDRATE; 16 | 17 | tmp = base->ctrl; 18 | tmp &= ~(LPUART_CTRL_TE | LPUART_CTRL_RE); 19 | base->ctrl = tmp; 20 | base->modir = 0; 21 | base->fifo = ~(LPUART_FIFO_TXFE | LPUART_FIFO_RXFE); 22 | base->match = 0; 23 | 24 | baud_diff = BAUDRATE; 25 | osr = 0; 26 | sbr = 0; 27 | for (tmp_osr = 4; tmp_osr <= 32; tmp_osr++) { 28 | tmp_sbr = (clk / (baudrate * tmp_osr)); 29 | if (tmp_sbr == 0) 30 | tmp_sbr = 1; 31 | 32 | tmp_diff = (clk / (tmp_osr * tmp_sbr)); 33 | tmp_diff = tmp_diff - baudrate; 34 | 35 | if (tmp_diff > (baudrate - (clk / (tmp_osr * (tmp_sbr + 1))))) { 36 | tmp_diff = baudrate - (clk / (tmp_osr * (tmp_sbr + 1))); 37 | tmp_sbr++; 38 | } 39 | 40 | if (tmp_diff <= baud_diff) { 41 | baud_diff = tmp_diff; 42 | osr = tmp_osr; 43 | sbr = tmp_sbr; 44 | } 45 | } 46 | 47 | tmp = base->baud; 48 | 49 | if ((osr > 3) && (osr < 8)) 50 | tmp |= LPUART_BAUD_BOTHEDGE_MASK; 51 | 52 | tmp &= ~LPUART_BAUD_OSR_MASK; 53 | tmp |= LPUART_BAUD_OSR(osr - 1); 54 | 55 | tmp &= ~LPUART_BAUD_SBR_MASK; 56 | tmp |= LPUART_BAUD_SBR(sbr); 57 | tmp &= ~(LPUART_BAUD_M10_MASK | LPUART_BAUD_SBNS_MASK); 58 | 59 | base->baud = tmp; 60 | 61 | tmp = base->ctrl; 62 | tmp &= ~(LPUART_CTRL_PE_MASK | 63 | LPUART_CTRL_PT_MASK | 64 | LPUART_CTRL_M_MASK); 65 | base->ctrl = tmp; 66 | 67 | base->ctrl = LPUART_CTRL_RE | LPUART_CTRL_TE; 68 | 69 | return 0; 70 | } 71 | 72 | void lpuart_putc(const char c) 73 | { 74 | volatile int *lpuart1 = (volatile int *)LPUART_BASE; 75 | struct nxp_lpuart *base = (struct nxp_lpuart *)lpuart1; 76 | 77 | if (c == '\n') 78 | lpuart_putc('\r'); 79 | 80 | while (!(base->stat & LPUART_STAT_TDRE)) 81 | ; 82 | 83 | base->data = c; 84 | } 85 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/fsl_mu.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Copyright 2021 NXP 3 | 4 | #include "board.h" 5 | #include "fsl_mu.h" 6 | #include "io.h" 7 | 8 | void MU_Init(void *base) 9 | { 10 | } 11 | 12 | void MU_Deinit(void *base) 13 | { 14 | } 15 | 16 | int MU_txdb(void *base, struct mu_cfg *cfg, uint32_t ch_idx) 17 | { 18 | u32 val; 19 | 20 | val = read32(base + cfg->xCR[MU_GCR]); 21 | val |= MU_xCR_GIRn(cfg->type, ch_idx); 22 | write32(base + cfg->xCR[MU_GCR], val); 23 | 24 | return 0; 25 | } 26 | 27 | void MU_SendMsg(void *base, struct mu_cfg *cfg, uint32_t ch_idx, uint32_t msg) 28 | { 29 | write32(base + cfg->xTR + ch_idx * 4, msg); 30 | } 31 | 32 | uint32_t MU_ReceiveMsgNonBlocking(void *base, struct mu_cfg *cfg, uint32_t ch_idx) 33 | { 34 | return read32(base + cfg->xRR + ch_idx * 4); 35 | } 36 | 37 | void MU_EnableRxInterrupts(void *base, struct mu_cfg *cfg, uint32_t ch_idx) 38 | { 39 | u32 val; 40 | 41 | val = read32(base + cfg->xCR[MU_RCR]); 42 | val |= MU_xCR_RIEn(cfg->type, ch_idx); 43 | write32(base + cfg->xCR[MU_RCR], val); 44 | } 45 | 46 | void MU_DisableRxInterrupts(void *base, struct mu_cfg *cfg, uint32_t ch_idx) 47 | { 48 | u32 val; 49 | 50 | val = read32(base + cfg->xCR[MU_RCR]); 51 | val &= ~MU_xCR_RIEn(cfg->type, ch_idx); 52 | write32(base + cfg->xCR[MU_RCR], val); 53 | } 54 | 55 | uint32_t MU_GetRxStatusFlags(void *base, struct mu_cfg *cfg, uint32_t ch_idx) 56 | { 57 | return read32(base + cfg->xSR[MU_RSR]) & MU_xSR_RFn(cfg->type, ch_idx); 58 | } 59 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/fsl_uart.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Copyright 2021 NXP 3 | 4 | #include "fsl_uart.h" 5 | #include "board.h" 6 | #include "io.h" 7 | 8 | void uart_putc(const char c) 9 | { 10 | volatile char *uart_base = (volatile char *)UART_BASE; 11 | unsigned int status; 12 | unsigned int count = 0; 13 | 14 | if (c == '\n') 15 | uart_putc('\r'); 16 | 17 | /* drain */ 18 | do { 19 | status = read32(uart_base + USR1); 20 | count++; 21 | } while (count <= 600); 22 | 23 | write32(uart_base + URTX0, c); 24 | } 25 | 26 | int uart_init(void) 27 | { 28 | volatile char *uart_base = (volatile char *)UART_BASE; 29 | 30 | /* enable UART */ 31 | write32(uart_base + UCR1, 0x0001); 32 | 33 | write32(uart_base + UCR2, 0x5027); 34 | 35 | /* Set UCR3[RXDMUXSEL] = 1. */ 36 | write32(uart_base + UCR3, 0x0084); 37 | 38 | write32(uart_base + UCR4, 0x4002); 39 | 40 | /* Set internal clock divider = 1 */ 41 | write32(uart_base + UFCR, 0x0A81); 42 | 43 | write32(uart_base + UBIR, 0x3E7); 44 | write32(uart_base + UBMR, 0x32DC); 45 | 46 | write32(uart_base + UCR1, 0x2201); 47 | write32(uart_base + UMCR, 0x0000); 48 | 49 | return 0; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/io.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | /* 3 | * io.c - I/O abstraction layer 4 | * 5 | * Copyright 2018 NXP 6 | */ 7 | #include "io.h" 8 | 9 | void write16(volatile void * addr, u16 data) { 10 | *(volatile unsigned short *)(addr) = (data); 11 | } 12 | 13 | u16 read16(volatile void * addr) { 14 | u16 read_data = *(volatile unsigned short *)(addr); 15 | return read_data; 16 | } 17 | 18 | void write32(volatile void * addr, u32 data) { 19 | *(volatile unsigned int *)(addr) = (data); 20 | } 21 | 22 | void write32_bit(volatile void * addr, u32 mask, u32 data) { 23 | u32 read_data = *(volatile unsigned int *)(addr); 24 | read_data = (read_data & (~mask)) | data; 25 | *(volatile unsigned int *)(addr) = (read_data); 26 | } 27 | 28 | u32 read32(volatile void * addr) { 29 | u32 read_data = *(volatile unsigned int *)(addr); 30 | return read_data; 31 | } 32 | -------------------------------------------------------------------------------- /dsp_framework/src/driver/irqstr.c: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-3-Clause */ 2 | /* 3 | * irqstr.c - IRQ steer driver 4 | * 5 | * Copyright 2018-2020 NXP 6 | */ 7 | #include "mydefs.h" 8 | #include "irqstr.h" 9 | #include "debug.h" 10 | #include "io.h" 11 | 12 | void irqstr_init(volatile void *irqstr_addr, int dev_Int, int dma_Int) { 13 | #ifndef PLATF_8M 14 | write32_bit(irqstr_addr + IRQSTEER_CHnMASK(IRQ_TO_MASK_OFFSET(dev_Int + 32)), 15 | 1 << IRQ_TO_MASK_SHIFT(dev_Int + 32), 16 | 1 << IRQ_TO_MASK_SHIFT(dev_Int + 32)); 17 | write32_bit(irqstr_addr + IRQSTEER_CHnMASK(IRQ_TO_MASK_OFFSET(dma_Int + 32)), 18 | 1 << IRQ_TO_MASK_SHIFT(dma_Int + 32), 19 | 1 << IRQ_TO_MASK_SHIFT(dma_Int + 32)); 20 | #endif 21 | } 22 | 23 | void irqstr_start(volatile void *irqstr_addr, int dev_Int, int dma_Int) { 24 | #ifndef PLATF_8M 25 | write32(irqstr_addr + IRQSTEER_CHnCTL, 0x1); 26 | #else 27 | write32_bit(irqstr_addr + IRQSTEER_CHnMASK(IRQ_TO_MASK_OFFSET(dev_Int + 32)), 28 | 1 << IRQ_TO_MASK_SHIFT(dev_Int + 32), 29 | 1 << IRQ_TO_MASK_SHIFT(dev_Int + 32)); 30 | write32_bit(irqstr_addr + IRQSTEER_CHnMASK(IRQ_TO_MASK_OFFSET(dma_Int + 32)), 31 | 1 << IRQ_TO_MASK_SHIFT(dma_Int + 32), 32 | 1 << IRQ_TO_MASK_SHIFT(dma_Int + 32)); 33 | #endif 34 | } 35 | 36 | void irqstr_stop(volatile void *irqstr_addr, int dev_Int, int dma_Int) { 37 | #ifndef PLATF_8M 38 | write32(irqstr_addr + IRQSTEER_CHnCTL, 0x0); 39 | #else 40 | write32_bit(irqstr_addr + IRQSTEER_CHnMASK(IRQ_TO_MASK_OFFSET(dev_Int + 32)), 41 | 1 << IRQ_TO_MASK_SHIFT(dev_Int + 32), 42 | 0); 43 | write32_bit(irqstr_addr + IRQSTEER_CHnMASK(IRQ_TO_MASK_OFFSET(dma_Int + 32)), 44 | 1 << IRQ_TO_MASK_SHIFT(dma_Int + 32), 45 | 0); 46 | #endif 47 | } 48 | 49 | #if 0 50 | void irqstr_handler(struct dsp_main_struct *hifi_config) { 51 | u32 status; 52 | void *sai_addr = hifi_config->tx.sai_addr; 53 | void *edma_addr_tx = hifi_config->tx.edma_addr; 54 | void *edma_addr_rx = hifi_config->rx.edma_addr; 55 | void *irqstr_addr = hifi_config->irqstr_addr; 56 | 57 | status = read32(irqstr_addr + IRQSTEER_CHnSTATUS(IRQ_TO_MASK_OFFSET(314+32))); 58 | 59 | if (status & (1 << IRQ_TO_MASK_SHIFT(314+32))) 60 | return sai_irq_handler(sai_addr); 61 | 62 | if (status & (1 << IRQ_TO_MASK_SHIFT(315+32))) { 63 | edma_irq_handler(edma_addr_tx); 64 | edma_irq_handler(edma_addr_rx); 65 | } 66 | 67 | return; 68 | } 69 | #endif 70 | 71 | void irqstr_dump(volatile void *irqstr_addr) { 72 | int i; 73 | 74 | LOG1("IRQSTEER_CHnCTL %x\n", read32(irqstr_addr + IRQSTEER_CHnCTL)); 75 | for (i = 0; i < 16; i ++) 76 | LOG1("IRQSTEER_CHnMASK %x\n", read32(irqstr_addr + IRQSTEER_CHnMASK(i*4))); 77 | 78 | for (i = 0; i < 16; i ++) 79 | LOG1("IRQSTEER_CHnSTATUS %x\n", read32(irqstr_addr + IRQSTEER_CHnSTATUS(i*4))); 80 | 81 | return; 82 | } 83 | -------------------------------------------------------------------------------- /dsp_framework/src/libloader/dpu_lib_load.c: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * Copyright (c) 2017 Cadence Design Systems, Inc. 3 | * Copyright 2018 NXP 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included 14 | * in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | *****************************************************************/ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "dpu_lib_load.h" 31 | #include "pi_library_load.h" 32 | 33 | enum sram_data_type_t { 34 | DTYP_DPUSW = 0, 35 | DTYP_DPULIB_MP3DEC, 36 | DTYP_DPULIB_CUSTOM, 37 | DTYP_AUD_MP3DAT = 16, 38 | DTYP_AUD_AACDAT 39 | }; 40 | 41 | struct dpu_data_t { 42 | int data_type; // dpu_sw, mp3dec lib, ..., mp3data, aacdata 43 | unsigned char *ppkg_in_sram; // address in System Ram 44 | int data_size; // size of this data 45 | }; 46 | 47 | void *dpu_process_init_pi_lib(xtlib_pil_info *pil_info, 48 | struct dpu_lib_stat_t *lib_stat, 49 | UWORD32 byteswap) 50 | { 51 | xtlib_loader_globals xtlib_globals = {0, 0}; 52 | UWORD32 (*plib_entry_func)() = 0; 53 | void *pg_xa_process_api; 54 | 55 | xtlib_globals.byteswap = byteswap; 56 | 57 | memcpy((char *)&lib_stat->pil_inf_dspLib_dpu, 58 | (char *)pil_info, 59 | sizeof(xtlib_pil_info)); 60 | plib_entry_func = 61 | (void *)xtlib_target_init_pi_library_s(&lib_stat->pil_inf_dspLib_dpu, 62 | &xtlib_globals); 63 | LOG1("xtlib_target_init_pi_library, %x\n", plib_entry_func); 64 | 65 | //get the codec_api_function 66 | pg_xa_process_api = (void *)(plib_entry_func)(); 67 | if (!pg_xa_process_api) { 68 | lib_stat->stat = lib_unloaded; 69 | return NULL; 70 | } 71 | 72 | lib_stat->stat = lib_loaded; 73 | 74 | return pg_xa_process_api; 75 | } 76 | 77 | void dpu_process_unload_pi_lib(struct dpu_lib_stat_t *lib_stat) 78 | { 79 | /* 80 | * When the library is no longer needed, call the following function 81 | * on the target processor before releasing the memory allocated for 82 | * the library: void xtlib_unload_pi_library(xtlib_pil_info *lib_info); 83 | */ 84 | // xtlib_unload_pi_library (&(lib_stat->pil_inf_dspLib_dpu)); 85 | memset((char *)&lib_stat->pil_inf_dspLib_dpu, 86 | 0, 87 | sizeof(xtlib_pil_info)); 88 | lib_stat->stat = lib_unloaded; 89 | 90 | LOG("PIL library unloaded\n"); 91 | } 92 | -------------------------------------------------------------------------------- /dsp_framework/src/memory.c: -------------------------------------------------------------------------------- 1 | /***************************************************************** 2 | * Copyright 2018-2020 NXP 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | *****************************************************************/ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "types.h" 31 | #include "memory.h" 32 | #include "mydefs.h" 33 | #include "board.h" 34 | #include "debug.h" 35 | 36 | #define ALLOC_ALIGNMENT 16 37 | 38 | XAF_ERR_CODE xaf_malloc(void **buf_ptr, int size, int id) 39 | { 40 | int obj_size = size + ALLOC_ALIGNMENT; 41 | int *ptr; 42 | 43 | ptr = xf_mem_alloc(obj_size, ALLOC_ALIGNMENT, 0, 0); 44 | if (!ptr) { 45 | LOG("malloc failed!\n"); 46 | return XAF_MEMORY_ERR; 47 | } 48 | 49 | /* first word for store the size, which used for free */ 50 | *ptr = obj_size; 51 | 52 | *buf_ptr = (void *)ptr + ALLOC_ALIGNMENT; 53 | 54 | return XAF_NO_ERR; 55 | } 56 | 57 | void xaf_free(void *buf_ptr, int id) 58 | { 59 | if (!buf_ptr) { 60 | LOG("invailed memory pointer!\n"); 61 | return; 62 | } 63 | 64 | int *ptr = buf_ptr - ALLOC_ALIGNMENT; 65 | int obj_size = *ptr; 66 | 67 | xf_mem_free(ptr, obj_size, 0, 0); 68 | } 69 | 70 | void *xf_uniacodec_malloc(size_t size) 71 | { 72 | int *buf_ptr; 73 | int ret; 74 | ret = xaf_malloc((void **)&buf_ptr, size, 0); 75 | if (ret) 76 | return NULL; 77 | else 78 | return buf_ptr; 79 | } 80 | 81 | void xf_uniacodec_free(void *buf_ptr) 82 | { 83 | if (!buf_ptr) 84 | return; 85 | xaf_free(buf_ptr, 0); 86 | } 87 | -------------------------------------------------------------------------------- /dsp_framework/src/rsc_table.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | /* 3 | * Copyright 2021 NXP. 4 | * 5 | * This file populates resource table for BM remote 6 | * for use by the Linux Master 7 | */ 8 | 9 | #include "board.h" 10 | #include "rsc_table.h" 11 | #include "rpmsg_lite.h" 12 | #include 13 | 14 | #define NUM_VRINGS 0x02 15 | 16 | /* Place resource table in special ELF section */ 17 | __attribute__((section(".resource_table"))) 18 | 19 | const struct remote_resource_table resources = { 20 | /* Version */ 21 | 1, 22 | 23 | /* NUmber of table entries */ 24 | NO_RESOURCE_ENTRIES, 25 | /* reserved fields */ 26 | { 27 | 0, 28 | 0, 29 | }, 30 | 31 | /* Offsets of rsc entries */ 32 | { 33 | offsetof(struct remote_resource_table, user_vdev), 34 | }, 35 | 36 | /* SRTM virtio device entry */ 37 | { 38 | RSC_VDEV, 39 | 7, 40 | 0, 41 | RSC_VDEV_FEATURE_NS, 42 | 0, 43 | 0, 44 | 0, 45 | NUM_VRINGS, 46 | {0, 0}, 47 | }, 48 | 49 | /* Vring rsc entry - part of vdev rsc entry */ 50 | {VDEV0_VRING_DA_BASE, VRING_ALIGN, RL_BUFFER_COUNT, 0, 0}, 51 | {VDEV0_VRING_DA_BASE + VRING_SIZE, VRING_ALIGN, RL_BUFFER_COUNT, 1, 0}, 52 | }; 53 | -------------------------------------------------------------------------------- /dsp_voice_process/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2023 NXP 2 | # 3 | 4 | #*************************************************************************** 5 | # 6 | # DSP voice audio library Makefile 7 | # 8 | #*************************************************************************** 9 | 10 | # export for sub-makes 11 | export CCACHE= 12 | ifeq ($(USE_CCACHE), 1) 13 | CCACHE=$(shell which ccache) 14 | endif 15 | 16 | CC = $(CCACHE) xt-clang 17 | CPLUS = $(CCACHE) xt-clang++ 18 | OBJCOPY = xt-objcopy 19 | PKG_LOADLIB = xt-pkg-loadlib 20 | XTENSA_CORE = hifi4_nxp_v5_3_1_prod 21 | 22 | ifeq ($(PLATF), imx8m) 23 | XTENSA_CORE = hifi4_mscale_v2_0_2_prod 24 | endif 25 | 26 | ifeq ($(PLATF), imx8ulp) 27 | XTENSA_CORE = hifi4_nxp2_s7_v2_1a_prod 28 | CFLAGS += -DPLATF_8ULP 29 | endif 30 | 31 | TOOL_PATH := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))../../imx-audio-toolchain/Xtensa_Tool 32 | 33 | LINK_DIR = ./memmap/$(PLATF) 34 | SYSTEM_DIR = $(TOOL_PATH)/builds/RI-2023.11-linux/$(XTENSA_CORE)/config 35 | 36 | CFLAGS = -O3 37 | 38 | CFLAGS += -mlongcalls -fmessage-length=0 -fPIC 39 | 40 | XTENSA_FLAGS = --xtensa-core=$(XTENSA_CORE) \ 41 | --xtensa-system=$(SYSTEM_DIR) 42 | 43 | LINK_FLAGS = -mlsp=pisplitload -Wl,--shared-pagesize=128 -Wl,-pie \ 44 | $(XTENSA_FLAGS) -lc 45 | 46 | CFLAGS += $(XTENSA_FLAGS) 47 | 48 | RELEASE_DIR = release 49 | 50 | ifeq ($(DEBUG), 1) 51 | CFLAGS += -DDEBUG_BASE -DDEBUG_1 52 | endif 53 | ifeq ($(DEBUG), 2) 54 | CFLAGS += -DDEBUG_BASE -DDEBUG_2 55 | endif 56 | 57 | export CC CPLUS OBJCOPY XTENSA_CORE PKG_LOADLIB TOOL_PATH CFLAGS LINK_FLAGS 58 | 59 | ROOT_DIR = ../ 60 | COM_DIR = $(ROOT_DIR)/common 61 | SRC_DIR = ./src 62 | 63 | INCLUDE_DIR = ./include 64 | 65 | INCLUDES = -I$(INCLUDE_DIR) -I$(COM_DIR)/include/fsl_unia 66 | 67 | VOICE_LIB = voice_process_dummy 68 | 69 | C_OBJS = $(SRC_DIR)/voice_process_wrap.o \ 70 | $(SRC_DIR)/voice_process_dummy.o 71 | 72 | all: $(C_OBJS) 73 | echo "--- Build audio process library ---" 74 | $(CPLUS) $(C_OBJS) $(LINK_FLAGS) -o lib_dsp_$(VOICE_LIB).so 75 | 76 | help: 77 | @echo "make all to build the library" 78 | 79 | %.o: %.c 80 | $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< 81 | 82 | clean: 83 | rm -f $(C_OBJS) 84 | rm -rf ./*.so 85 | 86 | -------------------------------------------------------------------------------- /dsp_wrapper/Makefile: -------------------------------------------------------------------------------- 1 | #***************************************************************** 2 | # Copyright 2018 NXP 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining 5 | # a copy of this software and associated documentation files (the 6 | # "Software"), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, 8 | # distribute, sublicense, and/or sell copies of the Software, and to 9 | # permit persons to whom the Software is furnished to do so, subject to 10 | # the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included 13 | # in all copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | # 23 | #***************************************************************** 24 | 25 | #***************************************************************** 26 | # This is the makefile of lib & test program. 27 | # Usage: 28 | # make BUILD="build type" 29 | # make clean BUILD="build type" 30 | # 31 | # Build types: 32 | # ARM12ANDROID: armv7 CPU, ANDROID 33 | # ARMV8ELINUX: armv8 CPU, LINUX 34 | # ARMV8ANDROID: armv8 CPU, ANDROID 35 | # 36 | # For definition of differenet build types, please refer to 37 | # file "common.mk" under the same directory. 38 | ############################################################### 39 | 40 | all: library 41 | @+echo "--- dsp wrapper lib" 42 | 43 | library: 44 | $(MAKE) -f lib_dsp_wrap.mk 45 | 46 | .PHONEY: clean 47 | 48 | clean: 49 | $(MAKE) clean -f lib_dsp_wrap.mk 50 | 51 | usage: 52 | @echo "--------------------------------------------------------------" 53 | @echo " Makefile for dsp wrapper Library & Test Program " 54 | @echo "--------------------------------------------------------------" 55 | @echo "" 56 | @echo "Usage: $(MAKE) [options] [targets] [flags]" 57 | @echo " flags:" 58 | @echo " clean - clean all" 59 | @echo " BUILD=ARM12ANDROID clean - clean ARM12ANDROID" 60 | @echo " BUILD=ARMV8ELINUX clean - clean ARMV8ELINUX" 61 | @echo " BUILD=ARMV8ANDROID clean - clean ARMV8ANDROID" 62 | @echo " BUILD=ARM12ANDROID - builds for ARM12 " 63 | @echo " BUILD=ARMV8ELINUX - builds for ARMV8 " 64 | @echo " BUILD=ARMV8ANDROID - builds for ARMV8 " 65 | @echo " " 66 | -------------------------------------------------------------------------------- /libxa_af_hostless/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | libxa_af_hostless 4 | 5 | 6 | 7 | XtensaInfo 8 | 9 | 10 | 11 | com.tensilica.xide.cdt.xtensamanagedbuilder 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.ccnature 23 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.core.cnature 26 | com.tensilica.xide.cdt.XtensaCProjectNature 27 | com.tensilica.xide.cdt.XideManagedProjectNature 28 | com.tensilica.xide.cdt.XtensaCProjectLibraryNature 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /libxa_af_hostless/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | indexer/filesToParseUpFront=stdarg.h, stddef.h, sys/types.h 3 | indexer/indexAllFiles=false 4 | indexer/indexImportLocation=.settings/cdt-index.zip 5 | indexer/indexerId=org.eclipse.cdt.core.fastIndexer 6 | indexer/preferenceScope=1 7 | indexer/skipReferences=false 8 | indexer/skipTypeReferences=false 9 | indexer/updatePolicy=0 10 | 11 | -------------------------------------------------------------------------------- /libxa_af_hostless/.settings/targets/xtensa/CommonTarget.bts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Includes 10 | 11 | 12 | ${workspace_loc}/libxa_af_hostless/build/../include/sysdeps/xos/include 13 | ${workspace_loc}/libxa_af_hostless/build/../algo/hifi-dpf/include 14 | ${workspace_loc}/libxa_af_hostless/build/../algo/hifi-dpf/include/audio 15 | ${workspace_loc}/libxa_af_hostless/build/../algo/hifi-dpf/include/lib 16 | ${workspace_loc}/libxa_af_hostless/build/../algo/hifi-dpf/include/sys/xos-msgq 17 | ${workspace_loc}/libxa_af_hostless/build/../algo/host-apf/include 18 | ${workspace_loc}/libxa_af_hostless/build/../algo/xa_af_hostless/include 19 | ${workspace_loc}/libxa_af_hostless/build/../include 20 | ${workspace_loc}/libxa_af_hostless/build/../include/audio 21 | ${workspace_loc}/libxa_af_hostless/build/../algo/host-apf/include/sys/xos-msgq 22 | ${workspace_loc}/libxa_af_hostless/build/../algo/hifi-dpf/include/sys/xos-msgq/iss 23 | 24 | 25 | 26 | 27 | 28 | 29 | Defines 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Debug 41 | 42 | 43 | 44 | 45 | 46 | WarningSetting 47 | 48 | 49 | 50 | WarningAsError 51 | 52 | 53 | 54 | CompilerEnableLongCall 55 | 56 | 57 | 58 | 59 | 60 | CompilerAdditionalOptions 61 | 62 | -mno-mul16 -mno-mul32 -mno-div32 -fsigned-char -INLINE:requested 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | AssemblerIncludeDebug 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /libxa_af_hostless/.xxproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /libxa_af_hostless/Makefile: -------------------------------------------------------------------------------- 1 | # Generated by Xplorer, do not modify. 2 | # This Makefile builds _single_build Release 3 | 4 | %:: RCS/%,v 5 | %:: RCS/% 6 | %:: s.% 7 | %:: SCCS/s.% 8 | .SUFFIXES: 9 | .SUFFIXES: .a .o .c .cc .C .cpp .s .S .h 10 | 11 | 12 | # There should not be an 'sh.exe' in path 13 | export SHELL = cmd 14 | 15 | 16 | # There should never be any unknown unix-like tools on the path 17 | # In particular there should not be an 'sh.exe' in the system32 directory 18 | export PATH = C:\usr\xtensa\XtDevTools\install\tools\RI-2020.4-win32\XtensaTools\bin\;C:\usr\xtensa\XtDevTools\install\tools\RI-2020.4-win32\XtensaTools\lib\iss\;C:\WINDOWS\system32 19 | 20 | all: 21 | cmd /c "cd /D ""C:\\usr\\xtensa\\Xplorer-8.0.13-workspaces\\workspace2\\libxa_af_hostless\\bin\\hifi4_mscale_v1_0_2_prod\\Release"" && $(MAKE) all " 22 | 23 | clean: 24 | cmd /c "cd /D ""C:\\usr\\xtensa\\Xplorer-8.0.13-workspaces\\workspace2\\libxa_af_hostless\\bin\\hifi4_mscale_v1_0_2_prod\\Release"" && $(MAKE) clean " 25 | -------------------------------------------------------------------------------- /libxa_af_hostless/Makefile.include: -------------------------------------------------------------------------------- 1 | 2 | include ${xt_tools}/misc/version.mk 3 | 4 | ifeq ($(ARCH_OSTYPE), unix) 5 | MI_RM = rm -f 6 | else 7 | MI_RM = cmd /c del 8 | endif 9 | 10 | 11 | 12 | # Object file list for each release from target 13 | # 14 | 15 | OBJS = algo/hifi-dpf/src/xa-class-audio-codec.o algo/host-apf/src/xaf-api.o algo/hifi-dpf/src/xf-isr.o algo/hifi-dpf/src/xf-sched.o algo/hifi-dpf/src/xa-class-capturer.o algo/hifi-dpf/src/xf-core.o algo/hifi-dpf/src/xf-ipi.o algo/hifi-dpf/src/xa-class-mixer.o algo/host-apf/src/xf-proxy.o algo/hifi-dpf/src/xf-mem.o algo/hifi-dpf/src/xf-msgq1.o algo/hifi-dpf/src/xa-class-renderer.o algo/hifi-dpf/src/xa-class-mimo-proc.o algo/hifi-dpf/src/xf-msg.o algo/hifi-dpf/src/xa-class-base.o algo/hifi-dpf/src/xf-io.o algo/hifi-dpf/src/xf-msgq.o algo/hifi-dpf/src/rbtree.o algo/hifi-dpf/src/xf-main.o algo/host-apf/src/xf-trace.o 16 | 17 | # 18 | # IPA settings for each release from target 19 | # 20 | 21 | LDFLAGS_IPA_Debug = 22 | LDFLAGS_IPA_Debug_Feedback = 23 | LDFLAGS_IPA_Release = 24 | LDFLAGS_IPA_Release_Feedback = 25 | 26 | 27 | IPA_Debug = 28 | IPA_Release = 29 | IPA_Debug_Feedback = 30 | IPA_Release_Feedback = 31 | 32 | 33 | post-all: 34 | -$(MI_RM) $(PROJECT_NAME).a 35 | xt-xcc ${xt_sysargs} -o $(PROJECT_NAME).o.1 $(OBJS) \ 36 | --no-standard-libraries -Wl,-r,-Map,$(PROJECT_NAME).map.txt \ 37 | $(IPA_${xt_target}) -Wl,--script,$(PROJECT_HOME)/ldscript.txt 38 | xt-objcopy ${xt_sysargs} --keep-global-symbols=$(PROJECT_HOME)/build/symbols_af_hostless.txt $(PROJECT_NAME).o.1 $(PROJECT_NAME).o 39 | -$(MI_RM) $(PROJECT_NAME).o.1 40 | xt-ar rc $(PROJECT_NAME).a $(PROJECT_NAME).o 41 | -------------------------------------------------------------------------------- /libxa_af_hostless/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | README.html 4 | 5 | 6 | 7 |

libxa_af_hostless Audio Software Source Library

8 | 9 |

This library project contains library source files, header files and 10 | documentation, and is part of the source release package of the xa_af_hostless audio software. It is a managed Xtensa library project. 11 | See Xplorer Help "Xtensa Xplorer > Concepts > Software Projects" for more details regarding managed Xtensa projects.

12 | 13 |

Usage

14 | 15 |

This library project is already completely configured to build inside Xplorer 16 | as a managed project. It is provided together with one or more projects containing test programs 17 | which depend on this project and reference the header files here.

18 | 19 |

The build properties for this project have already been set, and include appropriate 20 | compiler flags and include directories. Where the values are common to both Debug 21 | and Release targets, they are set on the Common target; where they differ, 22 | they are set on the appropriate target.

23 | 24 |

To build this library alone, simply select this project, an appropriate HiFi processor 25 | configuration and a build target in the active set toolbar, and click [Build Active].

26 | 27 |

To build a test program that uses this library, select that project in the active 28 | set toolbar. The README.html for that test project has more information.

29 | 30 |

See also the README.txt for audio software release history and details.

31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/include/sys/xos-msgq/xf-dp_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-config.h 25 | * 26 | * Xtensa target configuration parameters 27 | *******************************************************************************/ 28 | 29 | /* ...number of DSP cores */ 30 | #define XF_CFG_CORES_NUM 1 31 | 32 | /* ...size of the internal message pool (make it equal to at least ring-buffer) */ 33 | #define XF_CFG_MESSAGE_POOL_SIZE 256 34 | 35 | /* ...local IPC is coherent (say) */ 36 | #define XF_LOCAL_IPC_NON_COHERENT 0 37 | 38 | /* ...remote IPC is coherent for hostless xaf (say) */ 39 | #define XF_REMOTE_IPC_NON_COHERENT 0 40 | 41 | /* ...size of the local memory pool (in bytes) */ 42 | #define XF_CFG_LOCAL_POOL_SIZE (1024 << 10) 43 | 44 | /* ...size of the shared memory pool (in bytes) */ 45 | #define XF_CFG_REMOTE_IPC_POOL_SIZE (256 << 10) 46 | 47 | /* ...size of the local memory pool (in bytes) */ 48 | #define XF_CFG_LOCAL_IPC_POOL_SIZE (1024 << 10) 49 | 50 | /* ...scratch memory is 8-bytes aligned */ 51 | #define XF_CFG_CODEC_SCRATCHMEM_ALIGN 8 52 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/include/sys/xos-msgq/xf-dp_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-dp_types.h 25 | * 26 | * Platform-specific typedefs 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-dp_types.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Includes 35 | ******************************************************************************/ 36 | #include 37 | #include 38 | #include "xa_type_def.h" 39 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/include/sys/xos-msgq/xf-sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-sys.h 25 | * 26 | * Definitions for Xtensa SHMEM configuration 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-sys.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Standard system includes 35 | ******************************************************************************/ 36 | 37 | /* ...from directory ./board-BOARDNAME */ 38 | #include "xf-board.h" 39 | 40 | /******************************************************************************* 41 | * Global abstractions 42 | ******************************************************************************/ 43 | 44 | /* ...prevent instructions reordering */ 45 | #define barrier() \ 46 | __asm__ __volatile__("": : : "memory") 47 | 48 | /* ...memory barrier */ 49 | #define XF_PROXY_BARRIER() \ 50 | __asm__ __volatile__("memw": : : "memory") 51 | 52 | /* ...memory invalidation */ 53 | #define XF_PROXY_INVALIDATE(buf, length) \ 54 | ({ if ((length)) { xthal_dcache_region_invalidate((buf), (length)); barrier(); } buf; }) 55 | 56 | /* ...memory flushing */ 57 | #define XF_PROXY_FLUSH(buf, length) \ 58 | ({ if ((length)) { barrier(); xthal_dcache_region_writeback((buf), (length)); XF_PROXY_BARRIER(); } buf; }) 59 | 60 | /******************************************************************************* 61 | * Core-specific data accessor 62 | ******************************************************************************/ 63 | 64 | /* ...per-core execution data */ 65 | extern xf_dsp_t *xf_g_dsp; 66 | 67 | /* ...local memory accessor */ 68 | #define XF_CORE_DATA(core) (&(xf_g_dsp->xf_core_data[core])) 69 | 70 | /******************************************************************************* 71 | * Inter-processor communication and shared memory interface definition 72 | ******************************************************************************/ 73 | 74 | #include "xf-dp_ipc.h" 75 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/include/xf-dp_proxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-proxy.h 25 | * 26 | * Proxy commmand/response messages 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-proxy.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Types definitions 35 | ******************************************************************************/ 36 | 37 | /* ...command/response message */ 38 | typedef struct xf_proxy_message 39 | { 40 | /* ...session ID */ 41 | UWORD32 session_id; 42 | 43 | /* ...proxy API command/reponse code */ 44 | UWORD32 opcode; 45 | 46 | /* ...length of attached buffer */ 47 | UWORD32 length; 48 | 49 | /* ...physical address of message buffer */ 50 | UWORD32 address; 51 | 52 | } __attribute__((__packed__)) xf_proxy_message_t; 53 | 54 | /******************************************************************************* 55 | * Ring buffer support 56 | ******************************************************************************/ 57 | 58 | /* ...total length of shared memory queue (for commands and responses) */ 59 | #define XF_PROXY_MESSAGE_QUEUE_LENGTH (1 << 8) 60 | 61 | /* ...index mask */ 62 | #define XF_PROXY_MESSAGE_QUEUE_MASK 0xFF 63 | 64 | /* ...ring-buffer index */ 65 | #define __XF_QUEUE_IDX(idx, counter) \ 66 | (((idx) & XF_PROXY_MESSAGE_QUEUE_MASK) | ((counter) << 16)) 67 | 68 | /* ...retrieve ring-buffer index */ 69 | #define XF_QUEUE_IDX(idx) \ 70 | ((idx) & XF_PROXY_MESSAGE_QUEUE_MASK) 71 | 72 | /* ...increment ring-buffer index */ 73 | #define XF_QUEUE_ADVANCE_IDX(idx) \ 74 | (((idx) + 0x10001) & (0xFFFF0000 | XF_PROXY_MESSAGE_QUEUE_MASK)) 75 | 76 | /* ...test if ring buffer is empty */ 77 | #define XF_QUEUE_EMPTY(read, write) \ 78 | ((read) == (write)) 79 | 80 | /* ...test if ring buffer is full */ 81 | #define XF_QUEUE_FULL(read, write) \ 82 | ((write) == (read) + (XF_PROXY_MESSAGE_QUEUE_LENGTH << 16)) 83 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/include/xf-plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-plugin.h 25 | * 26 | * Xtensa audio processing framework - plugin infrastructure. 27 | ******************************************************************************/ 28 | 29 | #ifdef __XF_H 30 | #error "xf-plugin.h cannot be used together with xf.h" 31 | #endif 32 | 33 | #define __XF_H 34 | 35 | /******************************************************************************* 36 | * Plugin debugging interface 37 | ******************************************************************************/ 38 | 39 | /* ...platform-specific HAL */ 40 | #include "xf-dp_hal.h" 41 | 42 | //#define XF_TRACE 1 43 | //#define XF_DEBUG 1 44 | 45 | /* ...debugging facilities */ 46 | #include "xf-debug.h" 47 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/include/xf-trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-debug.h 25 | * 26 | * Debugging interface for Xtensa Audio DSP codec server 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-debug.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Types definitions 35 | ******************************************************************************/ 36 | 37 | #if XF_TRACE 38 | 39 | /* ...trace data definition */ 40 | typedef struct xf_trace_data 41 | { 42 | /* ...current write position in tracing buffer */ 43 | char *p; 44 | 45 | /* ...threshold position for buffer submission */ 46 | char *end; 47 | 48 | #if XF_TRACE_REMOTE 49 | /* ...beginning of non-commited internal tracing buffer */ 50 | char *start; 51 | 52 | /* ...message queue */ 53 | xf_msg_queue_t queue; 54 | #endif 55 | 56 | } xf_trace_data_t; 57 | 58 | #else 59 | 60 | /* ...stub for disabled tracing */ 61 | typedef UWORD32 xf_trace_data_t[0]; 62 | 63 | #endif /* XF_TRACE */ 64 | 65 | /******************************************************************************* 66 | * Internal API functions 67 | ******************************************************************************/ 68 | 69 | #if XF_TRACE_REMOTE 70 | /* ...submit buffer for tracing */ 71 | extern void xf_trace_submit(UWORD32 core, xf_message_t *m); 72 | 73 | /* ...flush current buffer */ 74 | extern void xf_trace_flush(UWORD32 core, xf_message_t *m); 75 | 76 | #else 77 | 78 | #define xf_trace_submit(core, m) (void)0 79 | #define xf_trace_flush(core, m) (void)0 80 | 81 | #endif /* XF_TRACE_REMOTE */ 82 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/src/xf-ipi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-ipi.c 25 | * 26 | * Inter-processor interrupt handling code 27 | ******************************************************************************/ 28 | 29 | #define MODULE_TAG IPI 30 | 31 | /******************************************************************************* 32 | * Includes 33 | ******************************************************************************/ 34 | 35 | #include "xf-dp.h" 36 | 37 | /******************************************************************************* 38 | * Interrupt handler code 39 | ******************************************************************************/ 40 | 41 | /* ...IPI handler on core #0 */ 42 | static void xf_ipi_0(void *arg) 43 | { 44 | TRACE(ISR, _b("ipi-0 received")); 45 | xf_ipi_resume(0); 46 | } 47 | 48 | #if XF_CFG_CORES_NUM > 1 49 | /* ...IPI handler on core #1 */ 50 | static void xf_ipi_1(void *arg) 51 | { 52 | xf_ipi_resume(1); 53 | } 54 | #endif 55 | 56 | #if XF_CFG_CORES_NUM > 2 57 | /* ...IPI handler on core #2 */ 58 | static void xf_ipi_2(void *arg) 59 | { 60 | xf_ipi_resume(2); 61 | } 62 | #endif 63 | 64 | #if XF_CFG_CORES_NUM > 3 65 | /* ...IPI handler on core #3 */ 66 | static void xf_ipi_3(void *arg) 67 | { 68 | xf_ipi_resume(3); 69 | } 70 | #endif 71 | 72 | #if XF_CFG_CORES_NUM > 4 73 | #error "CPU number too high" 74 | #endif 75 | 76 | void (* const xf_ipi_handlers[XF_CFG_CORES_NUM])(void *arg) = 77 | { 78 | xf_ipi_0, 79 | #if XF_CFG_CORES_NUM > 1 80 | xf_ipi_1, 81 | #endif 82 | #if XF_CFG_CORES_NUM > 2 83 | xf_ipi_2, 84 | #endif 85 | #if XF_CFG_CORES_NUM > 3 86 | xf_ipi_3, 87 | #endif 88 | }; 89 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/hifi-dpf/src/xf-isr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-isr.c 25 | * 26 | * DSP processing framework - code running from interrupt context 27 | ******************************************************************************/ 28 | 29 | #define MODULE_TAG ISR 30 | 31 | /******************************************************************************* 32 | * Includes 33 | ******************************************************************************/ 34 | 35 | #include "xf-dp.h" 36 | 37 | /******************************************************************************* 38 | * API functions definitions 39 | ******************************************************************************/ 40 | 41 | /* ...submit command message from interrupt context on local core */ 42 | void xf_msg_schedule_isr(xf_message_t *m) 43 | { 44 | UWORD32 core = XF_MSG_DST_CORE(m->id); 45 | xf_core_data_t *cd = XF_CORE_DATA(core); 46 | 47 | /* ...interrupt masking protocol is used for protecting local message queue */ 48 | xf_sync_enqueue(&cd->queue, m); 49 | /* ...resume local scheduler */ 50 | xf_ipi_resume_dsp_isr(core); 51 | } 52 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/linux-msgq/xf-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-config.h 25 | * 26 | * TCP-shunt target configuration parameters 27 | *******************************************************************************/ 28 | 29 | /* ...number of DSP cores */ 30 | #define XF_CFG_CORES_NUM 4 31 | 32 | /* ...maximal number of clients supported by proxy */ 33 | #define XF_CFG_PROXY_MAX_CLIENTS 256 34 | 35 | /* ...size of the shared memory pool (in bytes) */ 36 | #define XF_CFG_REMOTE_IPC_POOL_SIZE (256 << 10) 37 | 38 | /* ...alignment for shared buffers */ 39 | #define XF_PROXY_ALIGNMENT 64 40 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/linux-msgq/xf-hal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-hal.h 25 | * 26 | * Platform-specific HAL definitions 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-hal.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Includes 35 | ******************************************************************************/ 36 | 37 | /* ...primitive types */ 38 | #include "xf-types.h" 39 | 40 | /* ...anything else? - tbd */ 41 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/linux-msgq/xf-runtime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-runtime.h 25 | * 26 | * Platform-specific runtime data definitions 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-runtime.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Includes 35 | ******************************************************************************/ 36 | 37 | /* ...platform HAL layer */ 38 | #include "xf-hal.h" 39 | 40 | /* message queue abstraction code */ 41 | #include "xf-msgq-if.h" 42 | 43 | /* ...OS abstraction layer */ 44 | #include "osal-thread.h" 45 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/linux-msgq/xf-types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-types.h 25 | * 26 | * Platform-specific typedefs 27 | *******************************************************************************/ 28 | 29 | /******************************************************************************* 30 | * Standard includes 31 | ******************************************************************************/ 32 | 33 | #ifndef __XF_TYPES_H__ 34 | #define __XF_TYPES_H__ 35 | 36 | #if XF_TRACE 37 | #include 38 | #include 39 | #endif // #if XF_TRACE 40 | 41 | #include "xa_type_def.h" 42 | 43 | #endif // __XF_TYPES_H__ 44 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/xos-msgq/xf-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-config.h 25 | * 26 | * TCP-shunt target configuration parameters 27 | *******************************************************************************/ 28 | 29 | /* ...number of DSP cores */ 30 | #define XF_CFG_CORES_NUM 4 31 | 32 | /* ...maximal number of clients supported by proxy */ 33 | #define XF_CFG_PROXY_MAX_CLIENTS 256 34 | 35 | /* ...size of the shared memory pool (in bytes) */ 36 | #define XF_CFG_REMOTE_IPC_POOL_SIZE (256 << 10) 37 | 38 | /* ...alignment for shared buffers */ 39 | #define XF_PROXY_ALIGNMENT 64 40 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/xos-msgq/xf-hal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-hal.h 25 | * 26 | * Platform-specific HAL definitions 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-hal.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Includes 35 | ******************************************************************************/ 36 | 37 | /* ...primitive types */ 38 | #include "xf-types.h" 39 | 40 | /* ...anything else? - tbd */ 41 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/xos-msgq/xf-runtime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-runtime.h 25 | * 26 | * Platform-specific runtime data definitions 27 | *******************************************************************************/ 28 | 29 | #ifndef __XF_H 30 | #error "xf-runtime.h mustn't be included directly" 31 | #endif 32 | 33 | /******************************************************************************* 34 | * Includes 35 | ******************************************************************************/ 36 | 37 | /* ...platform HAL layer */ 38 | #include "xf-hal.h" 39 | 40 | /* message queue abstraction code */ 41 | #include "xf-msgq-if.h" 42 | 43 | /* ...OS abstraction layer */ 44 | #include "osal-thread.h" 45 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/sys/xos-msgq/xf-types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf-types.h 25 | * 26 | * Platform-specific typedefs 27 | *******************************************************************************/ 28 | 29 | /******************************************************************************* 30 | * Standard includes 31 | ******************************************************************************/ 32 | 33 | #ifndef __XF_TYPES_H__ 34 | #define __XF_TYPES_H__ 35 | 36 | #if XF_TRACE 37 | #include 38 | #include 39 | #endif // #if XF_TRACE 40 | 41 | #include "xa_type_def.h" 42 | 43 | #endif // __XF_TYPES_H__ 44 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/xaf-threads-priority.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #define XAF_PROXY_THREAD_PRIORITY 6 25 | #define XAF_DSP_THREAD_PRIORITY 5 26 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/xaf-version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __XAF_VERSION_H__ 24 | #define __XAF_VERSION_H__ 25 | 26 | #include "xa_api_defs.h" 27 | #include "xa_af_hostless_definitions.h" 28 | 29 | /********** Structures **********/ 30 | /* Library information */ 31 | typedef struct _xa_api_info_t 32 | { 33 | char p_copyright[XA_API_COPYRIGHT_STR_LEN]; /* Copyright string */ 34 | char p_lib_name[XA_API_STR_LEN]; /* Library name */ 35 | char p_lib_ver[XA_API_STR_LEN]; /* Library version */ 36 | char p_api_ver[XA_API_STR_LEN]; /* API version */ 37 | } xa_api_info_t; 38 | 39 | #endif // __XAF_VERSION_H__ 40 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/host-apf/include/xf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xf.h 25 | * 26 | * Xtensa audio processing framework. Main header for AP-side 27 | ******************************************************************************/ 28 | 29 | #ifdef __XF_H 30 | #error "xf.h included more than once" 31 | #endif 32 | 33 | #define __XF_H 34 | 35 | /******************************************************************************* 36 | * Common runtime framework 37 | ******************************************************************************/ 38 | 39 | /* ...xaf API prototypes */ 40 | #include "xaf-api.h" 41 | 42 | /* ... common definitions */ 43 | #include "xf-ap-dp-common.h" 44 | 45 | /* ...target configuration */ 46 | #include "xf-config.h" 47 | 48 | /* ...platform run-time */ 49 | #include "xf-runtime.h" 50 | 51 | /* ...debugging facility */ 52 | #include "xf-debug.h" 53 | 54 | /* ...API prototypes */ 55 | #include "xf-proto.h" 56 | 57 | /* ...standard opcodes */ 58 | #include "xf-opcode.h" 59 | 60 | /* ...platform-specific IPC layer */ 61 | #include "xf-ipc.h" 62 | 63 | /* ...proxy definitions */ 64 | #include "xf-proxy.h" 65 | 66 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/xa_af_hostless/include/xa_af_hostless_definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #ifndef __DEFINITIONS_H__ 25 | #define __DEFINITIONS_H__ 26 | 27 | /* Identification Strings */ 28 | #define LIBNAME "Audio Framework" 29 | 30 | /* LIB/API version information is directly modified by the packing script, do not change */ 31 | #define LIBVERSION "2.6" 32 | #define LIB_APIVERSION_MAJOR 2 33 | #define LIB_APIVERSION_MINOR 0 34 | 35 | #if LIB_APIVERSION_MAJOR != XA_APIVERSION_MAJOR || \ 36 | LIB_APIVERSION_MINOR != XA_APIVERSION_MINOR 37 | #error "Version Mismatch" 38 | #endif 39 | 40 | #define LIB_APIVERSION XA_MAKE_VERSION_STR(\ 41 | LIB_APIVERSION_MAJOR, \ 42 | LIB_APIVERSION_MINOR) 43 | 44 | #endif /* __DEFINITIONS_H__ */ 45 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/xa_af_hostless/include/xa_api_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __XA_API_DEFS_H__ 24 | #define __XA_API_DEFS_H__ 25 | 26 | /*****************************************************************************/ 27 | /* Constant hash defines */ 28 | /*****************************************************************************/ 29 | /* A constant to let API copy small strings to buffers outside */ 30 | #define XA_API_COPYRIGHT_STR_LEN 100 31 | #define XA_API_STR_LEN 30 32 | 33 | /* API version information is directly modified by the packing script, do not change */ 34 | #define XA_APIVERSION_MAJOR 2 35 | #define XA_APIVERSION_MINOR 0 36 | 37 | /* last compatible version */ 38 | /* sometimes a new API version is just for a bugfix, or a added feature in */ 39 | /* this case it is better to use a newer version even though a library was */ 40 | /* made for an older version, library API can then be upgraded to newer API */ 41 | /* version after checking for compatibility or by adding features */ 42 | #define XA_LASTCOMP_APIVERSION_MAJOR 1 43 | #define XA_LASTCOMP_APIVERSION_MINOR 0 44 | 45 | #define XA_STR(str) #str 46 | #define XA_MAKE_VERSION_STR(maj, min) XA_STR(maj) "." XA_STR(min) 47 | #define XA_APIVERSION XA_MAKE_VERSION_STR(\ 48 | XA_APIVERSION_MAJOR, \ 49 | XA_APIVERSION_MINOR) 50 | 51 | #define XA_LAST_COMP_APIVERSION XA_MAKE_VERSION_STR(\ 52 | XA_LASTCOMP_APIVERSION_MAJOR, \ 53 | XA_LASTCOMP_APIVERSION_MINOR) 54 | 55 | #endif /* __XA_API_DEFS_H__ */ 56 | -------------------------------------------------------------------------------- /libxa_af_hostless/algo/xa_af_hostless/include/xf-msgq-if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #include "osal-thread.h" 24 | #include "osal-msgq.h" 25 | 26 | /******************************************************************************* 27 | * Global Definitions 28 | ******************************************************************************/ 29 | 30 | #define SEND_MSGQ_ENTRIES 16 31 | #define RECV_MSGQ_ENTRIES 16 32 | 33 | #define CMD_MSGQ_READY 0x1 34 | #define RESP_MSGQ_READY 0x2 35 | #define DIE_MSGQ_ENTRY 0x4 36 | #define DSP_DIE_MSGQ_ENTRY 0x8 37 | 38 | typedef struct IPC_MSGQ { 39 | 40 | xf_msgq_t cmd_msgq; 41 | xf_msgq_t resp_msgq; 42 | xf_event_t msgq_event; 43 | int init_done; 44 | 45 | } ipc_msgq_t; 46 | 47 | int ipc_msgq_init(xf_msgq_t *cmdq, xf_msgq_t *respq, xf_event_t **msgq_event); 48 | int ipc_msgq_delete(xf_msgq_t *cmdq, xf_msgq_t *respq); 49 | -------------------------------------------------------------------------------- /libxa_af_hostless/build/getFreeRTOS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | git clone git://github.com/foss-xtensa/amazon-freertos.git FreeRTOS 4 | cd FreeRTOS 5 | git checkout 017c01b82bbd6e507dbfd2fac6ae453a0f0f4007 6 | cd portable/XCC/Xtensa 7 | xt-make clean 8 | xt-make 9 | -------------------------------------------------------------------------------- /libxa_af_hostless/build/ldscript_af_hostless.txt: -------------------------------------------------------------------------------- 1 | /* EMPTY */ 2 | -------------------------------------------------------------------------------- /libxa_af_hostless/build/symbols_af_hostless.txt: -------------------------------------------------------------------------------- 1 | xaf_get_verinfo 2 | xaf_adev_open 3 | xaf_adev_close 4 | xaf_comp_create 5 | xaf_comp_delete 6 | xaf_comp_set_config 7 | xaf_comp_get_config 8 | xaf_comp_process 9 | xaf_comp_get_status 10 | xaf_connect 11 | xaf_disconnect 12 | xf_trace 13 | xf_trace_init 14 | xf_trace_deinit 15 | xa_audio_codec_factory 16 | xa_mixer_factory 17 | xa_renderer_factory 18 | xa_capturer_factory 19 | xa_mimo_proc_factory 20 | xaf_get_mem_stats 21 | xaf_pause 22 | xaf_resume 23 | xaf_probe_start 24 | xaf_probe_stop 25 | xaf_adev_set_priorities 26 | xaf_create_event_channel 27 | xaf_delete_event_channel 28 | xaf_adev_config_default_init 29 | xaf_comp_config_default_init 30 | __xf_timer_stop 31 | __xf_timer_start 32 | xaf_adev_open_deprecated 33 | xaf_comp_create_deprecated 34 | -------------------------------------------------------------------------------- /libxa_af_hostless/doc/HiFi-AF-Hostless-ProgrammersGuide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/libxa_af_hostless/doc/HiFi-AF-Hostless-ProgrammersGuide.pdf -------------------------------------------------------------------------------- /libxa_af_hostless/doc/HiFi-Audio-Codec-API-Definition.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/libxa_af_hostless/doc/HiFi-Audio-Codec-API-Definition.pdf -------------------------------------------------------------------------------- /libxa_af_hostless/doc/HiFi-Speech-Codec-API-Definition.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/libxa_af_hostless/doc/HiFi-Speech-Codec-API-Definition.pdf -------------------------------------------------------------------------------- /libxa_af_hostless/include/audio/xa-audio-decoder-api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xa-audio-decoder-api.h 25 | * 26 | * Generic audio decoder API 27 | ******************************************************************************/ 28 | 29 | #ifndef __XA_ADEC_API_H__ 30 | #define __XA_ADEC_API_H__ 31 | 32 | /* ...includes */ 33 | #include "xa_type_def.h" 34 | #include "xa_error_standards.h" 35 | #include "xa_apicmd_standards.h" 36 | #include "xa_memory_standards.h" 37 | 38 | /* ...generic audio-decoder configuration parameters */ 39 | enum xa_config_param_codec { 40 | XA_CODEC_CONFIG_PARAM_CHANNELS = 0x10000 + 0, 41 | XA_CODEC_CONFIG_PARAM_SAMPLE_RATE = 0x10000 + 1, 42 | XA_CODEC_CONFIG_PARAM_PCM_WIDTH = 0x10000 + 2, 43 | XA_CODEC_CONFIG_PARAM_PRODUCED = 0x10000 + 3 44 | }; 45 | 46 | /* ...ports indices */ 47 | enum xa_codec_ports { 48 | XA_CODEC_INPUT_PORT = 0, 49 | XA_CODEC_OUTPUT_PORT = 1 50 | }; 51 | 52 | /* ...non-fatal execution errors */ 53 | enum 54 | { 55 | XA_CODEC_EXEC_NO_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_GENERIC, 0) 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /libxa_af_hostless/include/audio/xa-mimo-proc-api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * xa-mimo-proc-api.h 25 | * 26 | * Generic mimo process API 27 | ******************************************************************************/ 28 | 29 | #ifndef __XA_MIMO_PROC_API_H__ 30 | #define __XA_MIMO_PROC_API_H__ 31 | 32 | /* ...includes */ 33 | #include "xa_type_def.h" 34 | #include "xa_error_standards.h" 35 | #include "xa_apicmd_standards.h" 36 | #include "xa_memory_standards.h" 37 | 38 | 39 | /* ...generic mimo-proc configuration parameters */ 40 | enum xa_config_param_mimo_proc { 41 | XA_MIMO_PROC_CONFIG_PARAM_CHANNELS = 0x10000 + 0, 42 | XA_MIMO_PROC_CONFIG_PARAM_SAMPLE_RATE = 0x10000 + 1, 43 | XA_MIMO_PROC_CONFIG_PARAM_PCM_WIDTH = 0x10000 + 2, 44 | XA_MIMO_PROC_CONFIG_PARAM_PRODUCED = 0x10000 + 3, 45 | XA_MIMO_PROC_CONFIG_PARAM_PORT_PAUSE = 0x10000 + 4, 46 | XA_MIMO_PROC_CONFIG_PARAM_PORT_RESUME = 0x10000 + 5, 47 | XA_MIMO_PROC_CONFIG_PARAM_PORT_CONNECT = 0x10000 + 6, 48 | XA_MIMO_PROC_CONFIG_PARAM_PORT_DISCONNECT = 0x10000 + 7, 49 | XA_MIMO_PROC_CONFIG_PARAM_SUSPEND = 0x10000 + 8, 50 | XA_MIMO_PROC_CONFIG_PARAM_SUSPEND_RESUME = 0x10000 + 9, 51 | }; 52 | 53 | /* ...generic mimo-proc fatal config error */ 54 | enum 55 | { 56 | XA_MIMO_PROC_CONFIG_FATAL_RANGE = XA_ERROR_CODE(xa_severity_fatal, xa_class_config, XA_CODEC_GENERIC, 0) 57 | }; 58 | 59 | /* ...generic mimo-proc non-fatal execution errors */ 60 | enum 61 | { 62 | XA_MIMO_PROC_EXEC_NONFATAL_NO_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_GENERIC, 0) 63 | }; 64 | 65 | /* ...generic mimo-proc fatal execution error */ 66 | enum 67 | { 68 | XA_MIMO_PROC_EXEC_FATAL_STATE = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_GENERIC, 0) 69 | }; 70 | #endif 71 | -------------------------------------------------------------------------------- /libxa_af_hostless/include/sysdeps/freertos/include/osal-isr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef _OSAL_ISR_H 24 | #define _OSAL_ISR_H 25 | 26 | #include 27 | #include 28 | 29 | typedef void xf_isr(void *arg); 30 | 31 | /* 32 | * Set ISR and threaded handler for an IRQ. 33 | * 34 | * ISR runs in interrupt context. It should verify that IRQ came from 35 | * the hardware and clear interrupt request in the hardware if appropriate. 36 | * All other work should be done in the threaded handler. 37 | * 38 | * Threaded handler runs in a thread context. It can interact with the 39 | * hardware as well as with the rest of XAF. 40 | * 41 | * Either irq_handler or threaded_handler may be NULL if not needed. 42 | * 43 | * arg is an arbitrary pointer passed to both irq_handler and 44 | * threaded_handler. 45 | */ 46 | int __xf_set_threaded_irq_handler(int irq, 47 | xf_isr *irq_handler, 48 | xf_isr *threaded_handler, 49 | void *arg); 50 | 51 | int __xf_unset_threaded_irq_handler(int irq); 52 | 53 | static inline unsigned long __xf_disable_interrupts(void) 54 | { 55 | return xthal_disable_interrupts(); 56 | } 57 | 58 | static inline void __xf_restore_interrupts(unsigned long prev) 59 | { 60 | xthal_restore_interrupts(prev); 61 | } 62 | 63 | static inline void __xf_enable_interrupt(int irq) 64 | { 65 | xt_interrupt_enable(irq); 66 | } 67 | 68 | static inline void __xf_disable_interrupt(int irq) 69 | { 70 | xt_interrupt_disable(irq); 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /libxa_af_hostless/include/sysdeps/freertos/include/osal-msgq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef _OSAL_MSGQ_H 24 | #define _OSAL_MSGQ_H 25 | 26 | #include 27 | #include 28 | 29 | /******************************************************************************* 30 | * Global Definitions 31 | ******************************************************************************/ 32 | 33 | typedef QueueHandle_t xf_msgq_t; 34 | 35 | /* ...open proxy interface on proper DSP partition */ 36 | static inline xf_msgq_t __xf_msgq_create(size_t n_items, size_t item_size) 37 | { 38 | return xQueueCreate(n_items, item_size); 39 | } 40 | 41 | /* ...close proxy handle */ 42 | static inline void __xf_msgq_destroy(xf_msgq_t q) 43 | { 44 | vQueueDelete(q); 45 | } 46 | 47 | static inline int __xf_msgq_send(xf_msgq_t q, const void *data, size_t sz) 48 | { 49 | if (xQueueSend(q, data, portMAX_DELAY)) 50 | return XAF_NO_ERR; 51 | else 52 | return XAF_RTOS_ERR; 53 | } 54 | 55 | #define MAXIMUM_TIMEOUT 10000 56 | 57 | static inline int __xf_msgq_recv_blocking(xf_msgq_t q, void *data, size_t sz) 58 | { 59 | int ret = xQueueReceive(q, data, portMAX_DELAY); 60 | 61 | if ( ret == pdTRUE ) 62 | { 63 | ret = XAF_NO_ERR; 64 | } 65 | else 66 | { 67 | ret = XAF_RTOS_ERR; 68 | } 69 | 70 | return ret; 71 | } 72 | 73 | static inline int __xf_msgq_recv(xf_msgq_t q, void *data, size_t sz) 74 | { 75 | int ret = xQueueReceive(q, data, pdMS_TO_TICKS(MAXIMUM_TIMEOUT)); 76 | 77 | if ( ret == pdTRUE ) 78 | { 79 | ret = XAF_NO_ERR; 80 | } 81 | else 82 | { 83 | ret = XAF_TIMEOUT_ERR; 84 | } 85 | 86 | return ret; 87 | } 88 | 89 | static inline int __xf_msgq_empty(xf_msgq_t q) 90 | { 91 | return uxQueueMessagesWaiting(q) == 0; 92 | } 93 | 94 | static inline int __xf_msgq_full(xf_msgq_t q) 95 | { 96 | return uxQueueSpacesAvailable(q) == 0; 97 | } 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /libxa_af_hostless/include/sysdeps/linux/include/osal-msgq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef _OSAL_MSGQ_H 24 | #define _OSAL_MSGQ_H 25 | 26 | typedef struct { 27 | size_t size; 28 | } *xf_msgq_t; 29 | 30 | /* ...open proxy interface on proper DSP partition */ 31 | static inline xf_msgq_t __xf_msgq_create(size_t n_items, size_t item_size) 32 | { 33 | return NULL; 34 | } 35 | 36 | /* ...close proxy handle */ 37 | static inline void __xf_msgq_destroy(xf_msgq_t q) 38 | { 39 | } 40 | 41 | static inline int __xf_msgq_send(xf_msgq_t q, const void *data, size_t sz) 42 | { 43 | return 0; 44 | } 45 | 46 | #define MAXIMUM_TIMEOUT 10000 47 | 48 | static inline int __xf_msgq_recv_blocking(xf_msgq_t q, void *data, size_t sz) 49 | { 50 | return 0; 51 | } 52 | 53 | static inline int __xf_msgq_recv(xf_msgq_t q, void *data, size_t sz) 54 | { 55 | return 0; 56 | } 57 | 58 | static inline int __xf_msgq_empty(xf_msgq_t q) 59 | { 60 | return 0; 61 | } 62 | 63 | static inline int __xf_msgq_full(xf_msgq_t q) 64 | { 65 | return 0; 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /libxa_af_hostless/include/sysdeps/xos/include/osal-isr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef _OSAL_ISR_H 24 | #define _OSAL_ISR_H 25 | 26 | #ifdef __TOOLS_RF2__ 27 | #include 28 | #else // #ifdef __TOOLS_RF2__ 29 | #include 30 | #endif // #ifdef __TOOLS_RF2__ 31 | 32 | typedef void xf_isr(void *arg); 33 | 34 | /* 35 | * Set ISR and threaded handler for an IRQ. 36 | * 37 | * ISR runs in interrupt context. It should verify that IRQ came from 38 | * the hardware and clear interrupt request in the hardware if appropriate. 39 | * All other work should be done in the threaded handler. 40 | * 41 | * Threaded handler runs in a thread context. It can interact with the 42 | * hardware as well as with the rest of XAF. 43 | * 44 | * Either irq_handler or threaded_handler may be NULL if not needed. 45 | * 46 | * arg is an arbitrary pointer passed to both irq_handler and 47 | * threaded_handler. 48 | */ 49 | int __xf_set_threaded_irq_handler(int irq, 50 | xf_isr *irq_handler, 51 | xf_isr *threaded_handler, 52 | void *arg); 53 | 54 | int __xf_unset_threaded_irq_handler(int irq); 55 | 56 | static inline unsigned long __xf_disable_interrupts(void) 57 | { 58 | return xos_disable_interrupts(); 59 | } 60 | 61 | static inline void __xf_restore_interrupts(unsigned long prev) 62 | { 63 | xos_restore_interrupts(prev); 64 | } 65 | 66 | static inline void __xf_enable_interrupt(int irq) 67 | { 68 | xos_interrupt_enable(irq); 69 | } 70 | 71 | static inline void __xf_disable_interrupt(int irq) 72 | { 73 | xos_interrupt_disable(irq); 74 | } 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /libxa_af_hostless/include/sysdeps/xos/include/osal-timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /******************************************************************************* 24 | * osal-timer.h 25 | * 26 | * OS absraction layer (minimalistic) for XOS 27 | ******************************************************************************/ 28 | 29 | /******************************************************************************* 30 | * Includes 31 | ******************************************************************************/ 32 | #ifndef _OSAL_TIMER_H 33 | #define _OSAL_TIMER_H 34 | 35 | #ifdef __TOOLS_RF2__ 36 | #include 37 | #else // #ifdef __TOOLS_RF2__ 38 | #include 39 | #endif // #ifdef __TOOLS_RF2__ 40 | #include 41 | 42 | /******************************************************************************* 43 | * Timer support 44 | ******************************************************************************/ 45 | 46 | typedef void xf_timer_fn_t(void *arg); 47 | typedef struct xf_timer { 48 | XosTimer timer; 49 | xf_timer_fn_t *fn; 50 | void *arg; 51 | int autoreload; 52 | struct xf_timer *next; 53 | int active; 54 | } xf_timer_t; 55 | 56 | static inline int __xf_timer_init(xf_timer_t *timer, xf_timer_fn_t *fn, 57 | void *arg, int autoreload) 58 | { 59 | timer->fn = fn; 60 | timer->arg = arg; 61 | timer->autoreload = autoreload; 62 | timer->next = NULL; 63 | timer->active = 0; 64 | xos_timer_init(&timer->timer); 65 | return 0; 66 | } 67 | 68 | static inline unsigned long __xf_timer_ratio_to_period(unsigned long numerator, 69 | unsigned long denominator) 70 | { 71 | return xos_usecs_to_cycles(numerator * 1000000ull / denominator); 72 | } 73 | 74 | int __xf_timer_start(xf_timer_t *timer, unsigned long period); 75 | int __xf_timer_stop(xf_timer_t *timer); 76 | 77 | static inline int __xf_timer_destroy(xf_timer_t *timer) 78 | { 79 | return 0; 80 | } 81 | 82 | #if 0 83 | static inline void __xf_sleep(unsigned long period) 84 | { 85 | xos_thread_sleep(period); 86 | } 87 | #endif 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /libxa_af_hostless/ldscript.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /libxa_af_hostless/license.txt: -------------------------------------------------------------------------------- 1 | The components of this software package from Cadence Design Systems, Inc. 2 | are subject to the licenses below. By using the software package, you 3 | agree to the legal terms of each license. 4 | 5 | 6 | 1. API header files, testbench files, library (binary) and source code to build the library 7 | /* 8 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining 11 | * a copy of this software and associated documentation files (the 12 | * "Software"), to deal in the Software without restriction, including 13 | * without limitation the rights to use, copy, modify, merge, publish, 14 | * distribute, sublicense, and/or sell copies of the Software, and to 15 | * permit persons to whom the Software is furnished to do so, subject to 16 | * the following conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be included 19 | * in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 25 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | */ 29 | 30 | 2. Makefiles 31 | # 32 | # Copyright (c) 2015-2021 Cadence Design Systems, Inc. 33 | # 34 | # Permission is hereby granted, free of charge, to any person obtaining 35 | # a copy of this software and associated documentation files (the 36 | # "Software"), to deal in the Software without restriction, including 37 | # without limitation the rights to use, copy, modify, merge, publish, 38 | # distribute, sublicense, and/or sell copies of the Software, and to 39 | # permit persons to whom the Software is furnished to do so, subject to 40 | # the following conditions: 41 | # 42 | # The above copyright notice and this permission notice shall be included 43 | # in all copies or substantial portions of the Software. 44 | # 45 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 46 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 47 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 48 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 49 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 50 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 51 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 52 | # 53 | -------------------------------------------------------------------------------- /release/build_dsp/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/release/build_dsp/AUTHORS -------------------------------------------------------------------------------- /release/build_dsp/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/release/build_dsp/ChangeLog -------------------------------------------------------------------------------- /release/build_dsp/EULA.txt: -------------------------------------------------------------------------------- 1 | ../../EULA.txt -------------------------------------------------------------------------------- /release/build_dsp/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/release/build_dsp/NEWS -------------------------------------------------------------------------------- /release/build_dsp/README: -------------------------------------------------------------------------------- 1 | 2 | Option usage: 3 | 4 | --enable-armv8: for packeting dsp core libs 5 | blank: for no dsp core libs in package 6 | -------------------------------------------------------------------------------- /release/build_dsp/configure.ac: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a configure script. 2 | 3 | AC_INIT(imx-dsp, 2.1.10) 4 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 5 | 6 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) 7 | AM_MAINTAINER_MODE 8 | 9 | PKG_PROG_PKG_CONFIG 10 | 11 | test "x$prefix" = xNONE && prefix=$ac_default_prefix 12 | 13 | AC_DEFUN([CHECK_CODEC_DISABLE], 14 | [ 15 | AC_ARG_ENABLE($1, 16 | [AS_HELP_STRING([--disable-[$1]], [$2])], 17 | [use_[$1]=$enableval], 18 | [use_[$1]=yes]) 19 | if test "$use_[$1]" = "yes"; then 20 | AM_CONDITIONAL(HAS_LIB_FSL_[$3], true) 21 | if test "$1" != "uniaudio"; then 22 | enabled_[$4]_codec="$enabled_[$4]_codec\n\t\t[$1]" 23 | fi 24 | else 25 | AM_CONDITIONAL(HAS_LIB_FSL_[$3], false) 26 | if test "$1" != "uniaudio"; then 27 | disabled_[$4]_codec="$disabled_[$4]_codec\n\t\t[$1]" 28 | fi 29 | fi 30 | ]) 31 | 32 | AC_DEFUN([CHECK_CODEC_ENABLE], 33 | [ 34 | AC_ARG_ENABLE($1, 35 | [AS_HELP_STRING([--enable-[$1]], [$2])], 36 | [use_[$1]=$enableval], 37 | [use_[$1]="no"]) 38 | if test "$use_[$1]" = "yes"; then 39 | AM_CONDITIONAL(FSL_USE_[$3], true) 40 | echo -e "\nEnable [$3] option" 41 | else 42 | AM_CONDITIONAL(FSL_USE_[$3], false) 43 | fi 44 | ]) 45 | 46 | # dsp core codecs 47 | CHECK_CODEC_DISABLE([uniaudio], [disable unified audio wrapper], [UNI_AUDIO], [audio]) 48 | CHECK_CODEC_DISABLE([dsp], [disable dsp decoder and encoder], [DSP], [audio]) 49 | 50 | # enable armv8 lib 51 | CHECK_CODEC_ENABLE([armv8], [enable armv8], [ARMV8]) 52 | 53 | AC_OUTPUT([ 54 | Makefile 55 | libfsldspframework.pc 56 | ]) 57 | 58 | echo -e "\tEnabled audio codec:$enabled_audio_codec" 59 | echo -e "\tDisabled audio codec:$disabled_audio_codec" 60 | -------------------------------------------------------------------------------- /release/build_dsp/ghdr: -------------------------------------------------------------------------------- 1 | ../../dsp_wrapper/include/ -------------------------------------------------------------------------------- /release/build_dsp/libfsldspframework.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | datadir=@datadir@ 4 | bindir=@bindir@ 5 | libdir=@libdir@/imx-mm/audio-codec 6 | includedir=@includedir@/imx-mm/audio-codec 7 | datadir=@datadir@/imx/dsp 8 | 9 | Name: NXP DSP Audio Framework 10 | Description: Audio Framework from NXP 11 | Version: @VERSION@ 12 | Libs: -L${libdir} 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /release/build_dsp/release: -------------------------------------------------------------------------------- 1 | ../../release/ -------------------------------------------------------------------------------- /release/hifi4_tflm_imx8ulp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/release/hifi4_tflm_imx8ulp.bin -------------------------------------------------------------------------------- /testxa_af_hostless/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | testxa_af_hostless 4 | 5 | 6 | XtensaInfo 7 | libxa_af_hostless 8 | 9 | 10 | 11 | com.tensilica.xide.cdt.xtensamanagedbuilder 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.ccnature 23 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.core.cnature 26 | com.tensilica.xide.cdt.XtensaCProjectNature 27 | com.tensilica.xide.cdt.XideManagedProjectNature 28 | com.tensilica.xide.cdt.XtensaCProjectExeNature 29 | 30 | 31 | -------------------------------------------------------------------------------- /testxa_af_hostless/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | indexer/filesToParseUpFront=stdarg.h, stddef.h, sys/types.h 3 | indexer/indexAllFiles=false 4 | indexer/indexImportLocation=.settings/cdt-index.zip 5 | indexer/indexerId=org.eclipse.cdt.core.fastIndexer 6 | indexer/preferenceScope=1 7 | indexer/skipReferences=false 8 | indexer/skipTypeReferences=false 9 | indexer/updatePolicy=0 10 | 11 | -------------------------------------------------------------------------------- /testxa_af_hostless/.settings/targets/xtensa/CommonTarget.bts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Includes 10 | 11 | 12 | ${workspace_loc}/libxa_af_hostless/include/sysdeps/xos/include 13 | ${workspace_loc}/testxa_af_hostless/test/build/../../test/include 14 | ${workspace_loc}/testxa_af_hostless/test/build/../../test/plugins 15 | ${workspace_loc}/testxa_af_hostless/test/build/../../test/include/audio 16 | ${workspace_loc}/libxa_af_hostless/include 17 | ${workspace_loc}/libxa_af_hostless/include/audio 18 | ${workspace_loc}/testxa_af_hostless/test/build/../../test/plugins/cadence/pcm_gain 19 | 20 | 21 | 22 | 23 | 24 | 25 | Defines 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Debug 41 | 42 | 43 | 44 | 45 | 46 | WarningSetting 47 | 48 | 49 | 50 | WarningAsError 51 | 52 | 53 | 54 | CompilerEnableLongCall 55 | 56 | 57 | 58 | 59 | 60 | CompilerAdditionalOptions 61 | 62 | -fsigned-char 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | AssemblerIncludeDebug 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | LinkerAdditionalOptions 79 | 80 | -lxos 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /testxa_af_hostless/.settings/targets/xtensa/Debug.bts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Defines 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Optimization 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /testxa_af_hostless/.settings/targets/xtensa/Release.bts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Optimization 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /testxa_af_hostless/.xxproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /testxa_af_hostless/Makefile: -------------------------------------------------------------------------------- 1 | # Generated by Xplorer, do not modify. 2 | # This Makefile builds _single_build Release 3 | 4 | %:: RCS/%,v 5 | %:: RCS/% 6 | %:: s.% 7 | %:: SCCS/s.% 8 | .SUFFIXES: 9 | .SUFFIXES: .a .o .c .cc .C .cpp .s .S .h 10 | 11 | 12 | # There should not be an 'sh.exe' in path 13 | export SHELL = cmd 14 | 15 | 16 | # There should never be any unknown unix-like tools on the path 17 | # In particular there should not be an 'sh.exe' in the system32 directory 18 | export PATH = C:\usr\xtensa\XtDevTools\install\tools\RI-2020.4-win32\XtensaTools\bin\;C:\usr\xtensa\XtDevTools\install\tools\RI-2020.4-win32\XtensaTools\lib\iss\;C:\WINDOWS\system32 19 | 20 | all: 21 | cmd /c "cd /D ""C:\\usr\\xtensa\\Xplorer-8.0.13-workspaces\\workspace2\\testxa_af_hostless\\bin\\hifi4_mscale_v1_0_2_prod\\Release"" && $(MAKE) all " 22 | 23 | clean: 24 | cmd /c "cd /D ""C:\\usr\\xtensa\\Xplorer-8.0.13-workspaces\\workspace2\\testxa_af_hostless\\bin\\hifi4_mscale_v1_0_2_prod\\Release"" && $(MAKE) clean " 25 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/build/makefile_testbench_sample: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015-2021 Cadence Design Systems, Inc. 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining 5 | # a copy of this software and associated documentation files (the 6 | # "Software"), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, 8 | # distribute, sublicense, and/or sell copies of the Software, and to 9 | # permit persons to whom the Software is furnished to do so, subject to 10 | # the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included 13 | # in all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | # 23 | 24 | .PHONY: 25 | 26 | af_hostless_test: 27 | $(MAKE) -f makefile_testbench XA_MP3_DECODER=0 XA_MP3_ENCODER=0 XA_MIXER=0 XA_AMR_WB_DEC=0 XA_SRC_PP_FX=0 XA_AAC_DECODER=0 XA_RENDERER=0 XA_CAPTURER=0 XA_VORBIS_DECODER=0 XA_AEC22=0 XA_AEC23=0 XA_PCM_SPLIT=0 XA_MIMO_MIX=0 ROOTDIR=../.. all 28 | 29 | all: 30 | $(MAKE) -f makefile_testbench XA_MP3_DECODER=0 XA_MP3_ENCODER=0 XA_MIXER=0 XA_AMR_WB_DEC=0 XA_SRC_PP_FX=0 XA_AAC_DECODER=0 XA_RENDERER=0 XA_CAPTURER=0 XA_VORBIS_DECODER=0 XA_AEC22=0 XA_AEC23=0 XA_PCM_SPLIT=0 XA_MIMO_MIX=0 ROOTDIR=../.. all 31 | 32 | all-dec: 33 | $(MAKE) -f makefile_testbench ROOTDIR=../.. all-dec 34 | 35 | run: 36 | $(MAKE) -f makefile_testbench ROOTDIR=../.. run 37 | 38 | run-dec: 39 | $(MAKE) -f makefile_testbench ROOTDIR=../.. run-dec 40 | 41 | clean: 42 | $(MAKE) -f makefile_testbench ROOTDIR=../.. clean 43 | 44 | af_hostless: all 45 | 46 | run_af_hostless: run 47 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/include/audio/xa_amr_wb_dec_definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __XA_AMR_WB_DEC_DEFINITIONS_H__ 24 | #define __XA_AMR_WB_DEC_DEFINITIONS_H__ 25 | 26 | /* commands */ 27 | #include "xa_apicmd_standards.h" 28 | 29 | /* error codes */ 30 | #include "xa_error_standards.h" 31 | 32 | /* ...component identifier (informative) */ 33 | #define XA_CODEC_AMR_WB_DEC 5 34 | 35 | /* Non Fatal Errors */ 36 | enum xa_error_nonfatal_config_amr_wb_dec { 37 | XA_AMR_WB_DEC_CONFIG_NONFATAL_RANGE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_AMR_WB_DEC, 0), 38 | XA_AMR_WB_DEC_CONFIG_NONFATAL_STATE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_AMR_WB_DEC, 1), 39 | XA_AMR_WB_DEC_CONFIG_NONFATAL_MAX = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_config, XA_CODEC_AMR_WB_DEC, 2), 40 | }; 41 | 42 | enum xa_error_nonfatal_execute_amr_wb_dec { 43 | XA_AMR_WB_DEC_EXEC_NONFATAL_STATE = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_AMR_WB_DEC, 0), 44 | XA_AMR_WB_DEC_EXEC_NONFATAL_NO_DATA = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_AMR_WB_DEC, 1), 45 | XA_AMR_WB_DEC_EXEC_NONFATAL_INPUT = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_AMR_WB_DEC, 2), 46 | XA_AMR_WB_DEC_EXEC_NONFATAL_OUTPUT = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_AMR_WB_DEC, 3), 47 | XA_AMR_WB_DEC_EXEC_NONFATAL_MAX = XA_ERROR_CODE(xa_severity_nonfatal, xa_class_execute, XA_CODEC_AMR_WB_DEC, 4) 48 | }; 49 | 50 | /* Fatal Errors */ 51 | enum xa_error_fatal_execute_amr_wb_dec { 52 | XA_AMR_WB_DEC_EXEC_FATAL_INVALID_DATA = XA_ERROR_CODE(xa_severity_fatal, xa_class_execute, XA_CODEC_AMR_WB_DEC, 0) 53 | }; 54 | 55 | enum xa_config_param_amr_wb_dec { 56 | XA_AMR_WB_DEC_CONFIG_PARAM_PCM_WDSZ = 0, 57 | XA_AMR_WB_DEC_CONFIG_PARAM_SAMP_FREQ = 1, 58 | XA_AMR_WB_DEC_CONFIG_PARAM_NUM_CHANNELS = 2, 59 | }; 60 | 61 | #define XA_AMR_WB_CONFIG_PARAM_NUM_CHANNELS 1 62 | #define XA_AMR_WB_CONFIG_PARAM_SAMP_FREQ 16000 63 | #define XA_AMR_WB_CONFIG_PARAM_PCM_WDSZ 16 64 | 65 | #endif /* __XA_AMR_WB_DEC_DEFINITIONS_H__ */ 66 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/include/host_fio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __HOST_FIO_H__ 24 | #define __HOST_FIO_H__ 25 | 26 | /* */ 27 | #define PC_REQUEST_MAGIC_NO 0xAABBCCDD 28 | #define PC_RESPONSE_MAGIC_NO 0xABCDABCD 29 | 30 | #define FIO_SHMEM_SIZE 5120 31 | #define FIO_SPI_BURST_SIZE 256 32 | 33 | #define DSP_REQ_ADDR 0x5ffdd200 34 | #define DSP_RESP_ADDR 0x5ffde600 35 | 36 | #define DSP_REQ_FLAG_ADDR 0x5ffdd000 37 | #define DSP_RESP_FLAG_ADDR 0x5ffdd100 38 | 39 | /* */ 40 | typedef enum { 41 | FIO_FOPEN = 1, 42 | FIO_FCLOSE = 2, 43 | FIO_FREAD = 3, 44 | FIO_FWRITE = 4, 45 | FIO_LOGSTR = 5 46 | } FIO_FUNCTS; 47 | 48 | /* */ 49 | typedef enum { 50 | FIO_T_INT = 1, 51 | FIO_T_VOIDP = 2 52 | } FIO_PARAM_TYPE; 53 | 54 | typedef struct{ 55 | int delimter[2]; 56 | short length; 57 | short id; 58 | short fn_id; 59 | short nparams; 60 | } st_PktHdr; 61 | 62 | typedef struct{ 63 | short size; 64 | short type; 65 | } st_Params; 66 | 67 | #endif /* __HOST_FIO_H__ */ 68 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/include/xaf-app-threads-priority.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #define XAF_MAIN_THREAD_PRIORITY 7 25 | #define XAF_APP_THREADS_PRIORITY 7 26 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/include/xaf-clk-test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __XAF_CLK_TEST_H__ 24 | #define __XAF_CLK_TEST_H__ 25 | 26 | #ifdef XAF_PROFILE 27 | /* Common clock structures and functions */ 28 | typedef enum 29 | { 30 | CLK_SELN_WALL, // Total time elapsed 31 | CLK_SELN_THREAD // Time elapsed in this thread 32 | } clk_seln_t; 33 | typedef long long clk_t; 34 | void clk_start(void); 35 | void clk_stop(void); 36 | clk_t clk_read(clk_seln_t seln); 37 | clk_t clk_read_start(clk_seln_t seln); 38 | clk_t clk_read_stop(clk_seln_t seln); 39 | clk_t clk_diff(clk_t stop, clk_t start); 40 | clk_t compute_total_frmwrk_cycles(); 41 | #endif 42 | 43 | #endif /* __XAF_CLK_TEST_H__ */ 44 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/include/xaf-mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __XAF_MEM_H__ 24 | #define __XAF_MEM_H__ 25 | 26 | 27 | typedef struct { 28 | int persi_mem_dev; 29 | int num_malloc_dev; 30 | int persi_mem_comp; 31 | int num_malloc_comp; 32 | }mem_obj_t; 33 | 34 | 35 | void* mem_malloc(mem_obj_t *g_mem_obj, int size, int id); 36 | void mem_free(mem_obj_t *g_mem_obj, void * heap_ptr, int id); 37 | void* mem_init(pVOID adev_config_ptr); 38 | void mem_exit(mem_obj_t *g_mem_obj); 39 | int mem_get_alloc_size(mem_obj_t* mem_handle, int id); 40 | 41 | #endif /* __XAF_MEM_H__ */ 42 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/aac_dec/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/aac_dec/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/amr_wb/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/amr_wb/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/mp3_dec/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/mp3_dec/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/mp3_enc/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/mp3_enc/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/opus/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/opus/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/src-pp/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/src-pp/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/tflm_microspeech/microspeech_model_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2022 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 24 | 25 | Licensed under the Apache License, Version 2.0 (the "License"); 26 | you may not use this file except in compliance with the License. 27 | You may obtain a copy of the License at 28 | 29 | http://www.apache.org/licenses/LICENSE-2.0 30 | 31 | Unless required by applicable law or agreed to in writing, software 32 | distributed under the License is distributed on an "AS IS" BASIS, 33 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | See the License for the specific language governing permissions and 35 | limitations under the License. 36 | ==============================================================================*/ 37 | 38 | // This is a standard TensorFlow Lite FlatBuffer model file that has been 39 | // converted into a C data array, so it can be easily compiled into a binary 40 | // for devices that don't have a file system. It was created using the command: 41 | // xxd -i model.tflite > model.cc 42 | 43 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MICRO_FEATURES_MODEL_H_ 44 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MICRO_FEATURES_MODEL_H_ 45 | 46 | extern const unsigned char g_model[]; 47 | extern const int g_model_len; 48 | 49 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MICRO_FEATURES_MODEL_H_ 50 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/tflm_person_detect/person_detect_model_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2022 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | 25 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 26 | 27 | Licensed under the Apache License, Version 2.0 (the "License"); 28 | you may not use this file except in compliance with the License. 29 | You may obtain a copy of the License at 30 | 31 | http://www.apache.org/licenses/LICENSE-2.0 32 | 33 | Unless required by applicable law or agreed to in writing, software 34 | distributed under the License is distributed on an "AS IS" BASIS, 35 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 36 | See the License for the specific language governing permissions and 37 | limitations under the License. 38 | ==============================================================================*/ 39 | 40 | 41 | // This is a TensorFlow Lite model file that has been converted into a C data 42 | // array using the tensorflow.lite.util.convert_bytes_to_c_source() function. 43 | // This form is useful for compiling into a binary for devices that don't have a 44 | // file system. 45 | 46 | #ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 47 | #define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 48 | 49 | extern const unsigned char g_person_detect_model_data[]; 50 | extern const int g_person_detect_model_data_len; 51 | 52 | #endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 53 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/cadence/vorbis_dec/lib/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/plugins/cadence/vorbis_dec/lib/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/plugins/xa-gain-factor-event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #ifndef __XA_MIMO_MIX_EVENT_H__ 24 | #define __XA_MIMO_MIX_EVENT_H__ 25 | 26 | /* ...wakeword detection event data */ 27 | typedef struct xa_gain_factor_event_s 28 | { 29 | UWORD32 gain_index; 30 | }xa_gain_factor_event_t; 31 | 32 | #endif /* __XA_MIMO_MIX_EVENT_H__ */ 33 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/src/xaf-mem-test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2021 Cadence Design Systems Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included 13 | * in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | #include 24 | #include 25 | 26 | #include "xa_type_def.h" 27 | 28 | /* ...debugging facility */ 29 | #include "xf-debug.h" 30 | #include "xaf-test.h" 31 | #include "xaf-api.h" 32 | #include "xaf-mem.h" 33 | 34 | #include "xaf-fio-test.h" 35 | 36 | void *mem_malloc(mem_obj_t *g_mem_obj, int size, int id) 37 | { 38 | void *heap_ptr = NULL; 39 | 40 | if (id != XAF_MEM_ID_DEV && id != XAF_MEM_ID_COMP) 41 | { 42 | return NULL; 43 | } 44 | 45 | heap_ptr = malloc(size); 46 | 47 | if (id == XAF_MEM_ID_DEV) 48 | { 49 | g_mem_obj->num_malloc_dev++; 50 | g_mem_obj->persi_mem_dev += size; 51 | } 52 | else 53 | { 54 | g_mem_obj->num_malloc_comp++; 55 | g_mem_obj->persi_mem_comp += size; 56 | } 57 | 58 | return heap_ptr; 59 | } 60 | 61 | void mem_free(mem_obj_t *g_mem_obj, void * heap_ptr, int id) 62 | { 63 | if (id == XAF_MEM_ID_DEV) 64 | g_mem_obj->num_malloc_dev--; 65 | else if (id == XAF_MEM_ID_COMP) 66 | g_mem_obj->num_malloc_comp--; 67 | 68 | free(heap_ptr); 69 | } 70 | 71 | int mem_get_alloc_size(mem_obj_t* mem_handle, int id) 72 | { 73 | int mem_size = 0; 74 | if(id == XAF_MEM_ID_DEV) 75 | mem_size = mem_handle->persi_mem_dev; 76 | else if(id == XAF_MEM_ID_COMP) 77 | mem_size = mem_handle->persi_mem_comp; 78 | return mem_size; 79 | } 80 | 81 | void* mem_init(pVOID adev_config_ptr) 82 | { 83 | xaf_adev_config_t *pconfig; 84 | void* ptr; 85 | 86 | pconfig = (xaf_adev_config_t *)adev_config_ptr; 87 | ptr = &pconfig->g_mem_obj; 88 | return ptr; 89 | } 90 | 91 | void mem_exit(mem_obj_t *g_mem_obj) 92 | { 93 | if((g_mem_obj->num_malloc_dev != 0)||(g_mem_obj->num_malloc_comp != 0)) 94 | { 95 | FIO_PRINTF(stdout,"\nMEMORY LEAK ERROR!!! All the allocated memory is not freed.\n\n\n"); 96 | } 97 | return; 98 | } 99 | -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/hihat.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/hihat.mp3 -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/hihat.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/hihat.ogg -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/hihat.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/hihat.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/hihat_1ch_16b_192kbps_cbr.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/hihat_1ch_16b_192kbps_cbr.mp3 -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/hihat_1ch_16b_44.1kHz.adts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/hihat_1ch_16b_44.1kHz.adts -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/hihat_hw.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/hihat_hw.mp3 -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/perf_aacplusv1_stereo_56Kbps_48kHz.adts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/perf_aacplusv1_stereo_56Kbps_48kHz.adts -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/sine.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/sine.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/spch_le_dtx.cod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/spch_le_dtx.cod -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_inp/src_48k_16bit_stereo.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_inp/src_48k_16bit_stereo.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_out/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_out/empty.txt -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/gain_renderer_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/gain_renderer_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/hihat_dec_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/hihat_dec_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/hihat_decmix_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/hihat_decmix_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/hihat_full_duplex_dec_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/hihat_full_duplex_dec_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/hihat_full_duplex_enc_out.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/hihat_full_duplex_enc_out.mp3 -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/hihat_renderer_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/hihat_renderer_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/hihat_vorbis_dec_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/hihat_vorbis_dec_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/mimo21_mimo_mix_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/mimo21_mimo_mix_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/perf_aacplusv1_stereo_56Kbps_48kHz.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/perf_aacplusv1_stereo_56Kbps_48kHz.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/playback_usecase_out1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/playback_usecase_out1.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/playback_usecase_out2.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/playback_usecase_out2.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/playback_usecase_out2_hifi3.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/playback_usecase_out2_hifi3.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/rend_ref_port.aec_out0.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/rend_ref_port.aec_out0.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/rend_ref_port.aec_out1.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/rend_ref_port.aec_out1.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/rend_ref_port.rend_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/rend_ref_port.rend_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/sine_capturer.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/sine_capturer.mp3 -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/sine_capturer.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/sine_capturer.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/sine_pcmgain_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/sine_pcmgain_out.pcm -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/spch_le_dtx.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/spch_le_dtx.out -------------------------------------------------------------------------------- /testxa_af_hostless/test/test_ref/src_16k_16bit_stereo_out.pcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxp-imx/imx-audio-framework/ea4fe3f6409e410f901a3cf91ba1efdbfbafd253/testxa_af_hostless/test/test_ref/src_16k_16bit_stereo_out.pcm -------------------------------------------------------------------------------- /unit_test/include/get_pcm_info.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GET_PCM_INFO_H 3 | 4 | #define GET_PCM_INFO_H 5 | 6 | int get_codec_pcm(FILE *file, xaf_format_t *dec_format); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /unit_test/src/tflm/no_1000ms_audio_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 NXP 3 | * All rights reserved. 4 | * 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | */ 7 | 8 | #include 9 | 10 | extern const unsigned int g_no_1000ms_audio_data_size;extern const int16_t g_no_1000ms_audio_data[]; 11 | -------------------------------------------------------------------------------- /unit_test/src/tflm/yes_1000ms_audio_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 NXP 3 | * All rights reserved. 4 | * 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | */ 7 | 8 | #include 9 | 10 | extern const unsigned int g_yes_1000ms_audio_data_size;extern const int16_t g_yes_1000ms_audio_data[]; 11 | --------------------------------------------------------------------------------