xref: /linux/arch/xtensa/include/asm/core.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
18f8d5745SMax Filippov /* SPDX-License-Identifier: GPL-2.0 */
28f8d5745SMax Filippov /* Copyright (C) 2019 Cadence Design Systems Inc. */
38f8d5745SMax Filippov 
48f8d5745SMax Filippov #ifndef _ASM_XTENSA_CORE_H
58f8d5745SMax Filippov #define _ASM_XTENSA_CORE_H
68f8d5745SMax Filippov 
78f8d5745SMax Filippov #include <variant/core.h>
88f8d5745SMax Filippov 
9*494e87ffSMax Filippov #ifndef XCHAL_HAVE_DIV32
10*494e87ffSMax Filippov #define XCHAL_HAVE_DIV32 0
11*494e87ffSMax Filippov #endif
12*494e87ffSMax Filippov 
13f7c34874SMax Filippov #ifndef XCHAL_HAVE_EXCLUSIVE
14f7c34874SMax Filippov #define XCHAL_HAVE_EXCLUSIVE 0
15f7c34874SMax Filippov #endif
16f7c34874SMax Filippov 
17a922b156SMax Filippov #ifndef XCHAL_HAVE_EXTERN_REGS
18a922b156SMax Filippov #define XCHAL_HAVE_EXTERN_REGS 0
19a922b156SMax Filippov #endif
20a922b156SMax Filippov 
21a5944195SMax Filippov #ifndef XCHAL_HAVE_MPU
22a5944195SMax Filippov #define XCHAL_HAVE_MPU 0
23a5944195SMax Filippov #endif
24a5944195SMax Filippov 
25a922b156SMax Filippov #ifndef XCHAL_HAVE_VECBASE
26a922b156SMax Filippov #define XCHAL_HAVE_VECBASE 0
27a922b156SMax Filippov #endif
28a922b156SMax Filippov 
298f8d5745SMax Filippov #ifndef XCHAL_SPANNING_WAY
308f8d5745SMax Filippov #define XCHAL_SPANNING_WAY 0
318f8d5745SMax Filippov #endif
328f8d5745SMax Filippov 
33e6807b44SMax Filippov #ifndef XCHAL_HAVE_TRAX
34e6807b44SMax Filippov #define XCHAL_HAVE_TRAX 0
35e6807b44SMax Filippov #endif
36e6807b44SMax Filippov 
37e6807b44SMax Filippov #ifndef XCHAL_NUM_PERF_COUNTERS
38e6807b44SMax Filippov #define XCHAL_NUM_PERF_COUNTERS 0
39e6807b44SMax Filippov #endif
40e6807b44SMax Filippov 
415cce39b6SMax Filippov #if XCHAL_HAVE_WINDOWED
425cce39b6SMax Filippov #if defined(CONFIG_USER_ABI_DEFAULT) || defined(CONFIG_USER_ABI_CALL0_PROBE)
435cce39b6SMax Filippov /* Whether windowed ABI is supported in userspace. */
445cce39b6SMax Filippov #define USER_SUPPORT_WINDOWED
455cce39b6SMax Filippov #endif
465cce39b6SMax Filippov #if defined(__XTENSA_WINDOWED_ABI__) || defined(USER_SUPPORT_WINDOWED)
475cce39b6SMax Filippov /* Whether windowed ABI is supported either in userspace or in the kernel. */
485cce39b6SMax Filippov #define SUPPORT_WINDOWED
495cce39b6SMax Filippov #endif
505cce39b6SMax Filippov #endif
515cce39b6SMax Filippov 
52e94dc6bbSMax Filippov /* Xtensa ABI requires stack alignment to be at least 16 */
53e94dc6bbSMax Filippov #if XCHAL_DATA_WIDTH > 16
54e94dc6bbSMax Filippov #define XTENSA_STACK_ALIGNMENT	XCHAL_DATA_WIDTH
55e94dc6bbSMax Filippov #else
56e94dc6bbSMax Filippov #define XTENSA_STACK_ALIGNMENT	16
57e94dc6bbSMax Filippov #endif
58e94dc6bbSMax Filippov 
59687eb3c4SMax Filippov #ifndef XCHAL_HW_MIN_VERSION
60687eb3c4SMax Filippov #if defined(XCHAL_HW_MIN_VERSION_MAJOR) && defined(XCHAL_HW_MIN_VERSION_MINOR)
61687eb3c4SMax Filippov #define XCHAL_HW_MIN_VERSION (XCHAL_HW_MIN_VERSION_MAJOR * 100 + \
62687eb3c4SMax Filippov 			      XCHAL_HW_MIN_VERSION_MINOR)
63687eb3c4SMax Filippov #else
64687eb3c4SMax Filippov #define XCHAL_HW_MIN_VERSION 0
65687eb3c4SMax Filippov #endif
66687eb3c4SMax Filippov #endif
67687eb3c4SMax Filippov 
688f8d5745SMax Filippov #endif
69