summaryrefslogtreecommitdiff
path: root/lib/raid/xor/sparc/xor_arch.h
blob: af288abe4e917638ad0462fa73829e895a33bc0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)
 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
 */
#if defined(__sparc__) && defined(__arch64__)
#include <asm/spitfire.h>

extern struct xor_block_template xor_block_VIS;
extern struct xor_block_template xor_block_niagara;

static __always_inline void __init arch_xor_init(void)
{
	/* Force VIS for everything except Niagara.  */
	if (tlb_type == hypervisor &&
	    (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 ||
	     sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
	     sun4v_chip_type == SUN4V_CHIP_NIAGARA3 ||
	     sun4v_chip_type == SUN4V_CHIP_NIAGARA4 ||
	     sun4v_chip_type == SUN4V_CHIP_NIAGARA5))
		xor_force(&xor_block_niagara);
	else
		xor_force(&xor_block_VIS);
}
#else /* sparc64 */

extern struct xor_block_template xor_block_SPARC;

static __always_inline void __init arch_xor_init(void)
{
	xor_register(&xor_block_8regs);
	xor_register(&xor_block_32regs);
	xor_register(&xor_block_SPARC);
}
#endif /* !sparc64 */