Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * CPU feature definitions for module loading, used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * module_cpu_feature_match(), see asm/cputable.h for powerpc CPU features.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * Copyright 2016 Alastair D'Silva, IBM Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #ifndef __ASM_POWERPC_CPUFEATURE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define __ASM_POWERPC_CPUFEATURE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <asm/cputable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* Keep these in step with powerpc/include/asm/cputable.h */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define MAX_CPU_FEATURES (2 * 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  * Currently we don't have a need for any of the feature bits defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)  * cpu_user_features. When we do, they should be defined such as:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  * #define PPC_MODULE_FEATURE_32 (ilog2(PPC_FEATURE_32))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define PPC_MODULE_FEATURE_VEC_CRYPTO			(32 + ilog2(PPC_FEATURE2_VEC_CRYPTO))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define cpu_feature(x)		(x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) static inline bool cpu_have_feature(unsigned int num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	if (num < 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		return !!(cur_cpu_spec->cpu_user_features & 1UL << num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 		return !!(cur_cpu_spec->cpu_user_features2 & 1UL << (num - 32));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif /* __ASM_POWERPC_CPUFEATURE_H */