xref: /linux/lib/raid/xor/sparc/xor_arch.h (revision 440d6635b20037bc9ad46b20817d7b61cef0fc1b)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
4  * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
5  */
6 #if defined(__sparc__) && defined(__arch64__)
7 #include <asm/spitfire.h>
8 
9 extern struct xor_block_template xor_block_VIS;
10 extern struct xor_block_template xor_block_niagara;
11 
12 static __always_inline void __init arch_xor_init(void)
13 {
14 	/* Force VIS for everything except Niagara.  */
15 	if (tlb_type == hypervisor &&
16 	    (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 ||
17 	     sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
18 	     sun4v_chip_type == SUN4V_CHIP_NIAGARA3 ||
19 	     sun4v_chip_type == SUN4V_CHIP_NIAGARA4 ||
20 	     sun4v_chip_type == SUN4V_CHIP_NIAGARA5))
21 		xor_force(&xor_block_niagara);
22 	else
23 		xor_force(&xor_block_VIS);
24 }
25 #else /* sparc64 */
26 
27 extern struct xor_block_template xor_block_SPARC;
28 
29 static __always_inline void __init arch_xor_init(void)
30 {
31 	xor_register(&xor_block_8regs);
32 	xor_register(&xor_block_32regs);
33 	xor_register(&xor_block_SPARC);
34 }
35 #endif /* !sparc64 */
36