1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 3 #include <asm/cpu-features.h> 4 5 extern const struct raid6_calls raid6_lsx; 6 extern const struct raid6_calls raid6_lasx; 7 8 extern const struct raid6_recov_calls raid6_recov_lsx; 9 extern const struct raid6_recov_calls raid6_recov_lasx; 10 11 static __always_inline void __init arch_raid6_init(void) 12 { 13 raid6_algo_add_default(); 14 if (IS_ENABLED(CONFIG_CPU_HAS_LSX) && cpu_has_lsx) 15 raid6_algo_add(&raid6_lsx); 16 if (IS_ENABLED(CONFIG_CPU_HAS_LASX) && cpu_has_lasx) 17 raid6_algo_add(&raid6_lasx); 18 19 if (IS_ENABLED(CONFIG_CPU_HAS_LASX) && cpu_has_lasx) 20 raid6_recov_algo_add(&raid6_recov_lasx); 21 else if (IS_ENABLED(CONFIG_CPU_HAS_LSX) && cpu_has_lsx) 22 raid6_recov_algo_add(&raid6_recov_lsx); 23 } 24