Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 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> |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 20 | #include <asm/kvm_coproc.h> |
Jonathan Austin | e8c2d99 | 2013-09-26 16:49:28 +0100 | [diff] [blame] | 21 | #include <asm/kvm_emulate.h> |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 22 | #include <linux/init.h> |
| 23 | |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 24 | #include "coproc.h" |
| 25 | |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 26 | /* |
| 27 | * A15-specific CP15 registers. |
Christoffer Dall | 240e99c | 2013-08-05 18:08:41 -0700 | [diff] [blame] | 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. |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 33 | */ |
| 34 | static const struct coproc_reg a15_regs[] = { |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 35 | /* SCTLR: swapped by interrupt.S. */ |
| 36 | { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, |
Marc Zyngier | 8034699 | 2014-01-14 18:00:55 +0000 | [diff] [blame^] | 37 | access_sctlr, reset_val, c1_SCTLR, 0x00C50078 }, |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | static 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 | |
| 46 | static int __init coproc_a15_init(void) |
| 47 | { |
Christoffer Dall | 5b3e5e5 | 2013-01-20 18:28:09 -0500 | [diff] [blame] | 48 | kvm_register_target_coproc_table(&a15_target_table); |
| 49 | return 0; |
| 50 | } |
| 51 | late_initcall(coproc_a15_init); |