1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Authors: Rusty Russell <rusty@rustcorp.au>
4 *          Christoffer Dall <c.dall@virtualopensystems.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 */
19#include <linux/kvm_host.h>
20#include <asm/kvm_coproc.h>
21#include <asm/kvm_emulate.h>
22#include <linux/init.h>
23
24#include "coproc.h"
25
26/*
27 * A15-specific CP15 registers.
28 * CRn denotes the primary register number, but is copied to the CRm in the
29 * user space API for 64-bit register access in line with the terminology used
30 * in the ARM ARM.
31 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit
32 *            registers preceding 32-bit ones.
33 */
34static const struct coproc_reg a15_regs[] = {
35	/* SCTLR: swapped by interrupt.S. */
36	{ CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
37			access_vm_reg, reset_val, c1_SCTLR, 0x00C50078 },
38};
39
40static struct kvm_coproc_target_table a15_target_table = {
41	.target = KVM_ARM_TARGET_CORTEX_A15,
42	.table = a15_regs,
43	.num = ARRAY_SIZE(a15_regs),
44};
45
46static int __init coproc_a15_init(void)
47{
48	kvm_register_target_coproc_table(&a15_target_table);
49	return 0;
50}
51late_initcall(coproc_a15_init);
52