1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2017 Intel Corporation. All rights reserved.
4  *
5  * Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
6  *         Liam Girdwood <liam.r.girdwood@linux.intel.com>
7  *         Keyon Jie <yang.jie@linux.intel.com>
8  */
9 
10 #ifndef __SOF_AUDIO_EQ_FIR_FIR_CONFIG_H__
11 #define __SOF_AUDIO_EQ_FIR_FIR_CONFIG_H__
12 
13 /* Prevent xtensa gcc built firmware to be configured for longer
14  * filter that it can process. This length limitation (# of taps) is for one
15  * channel, for stereo the channel specific limit is this divided by two,
16  * etc.
17  */
18 #ifndef __XCC__
19 #ifdef __XTENSA__
20 #define FIR_MAX_LENGTH_BUILD_SPECIFIC	80
21 #endif
22 #endif
23 
24 /* If next defines are set to 1 the EQ is configured automatically. Setting
25  * to zero temporarily is useful is for testing needs.
26  * Setting EQ_FIR_AUTOARCH to 0 allows to manually set the code variant.
27  */
28 #define FIR_AUTOARCH    1
29 
30 /* Force manually some code variant when EQ_FIR_AUTODSP is set to zero. These
31  * are useful in code debugging.
32  */
33 #if FIR_AUTOARCH == 0
34 #define FIR_GENERIC	0
35 #define FIR_HIFIEP	0
36 #define FIR_HIFI3	1
37 #endif
38 
39 /* Select optimized code variant when xt-xcc compiler is used */
40 #if FIR_AUTOARCH == 1
41 #if defined __XCC__
42 #include <xtensa/config/core-isa.h>
43 #define FIR_GENERIC	0
44 #if XCHAL_HAVE_HIFI2EP == 1
45 #define FIR_HIFIEP	1
46 #define FIR_HIFI3	0
47 #elif XCHAL_HAVE_HIFI3 == 1
48 #define FIR_HIFI3	1
49 #define FIR_HIFIEP	0
50 #else
51 #error "No HIFIEP or HIFI3 found. Cannot build FIR module."
52 #endif
53 #else
54 /* GCC */
55 #define FIR_GENERIC	1
56 #define FIR_HIFIEP	0
57 #define FIR_HIFI3	0
58 #endif
59 #endif
60 
61 #endif /* __SOF_AUDIO_EQ_FIR_FIR_CONFIG_H__ */
62