xref: /openbmc/qemu/target/arm/cpu-qom.h (revision b36a32ea)
1fcf5ef2aSThomas Huth /*
2336588a2SPhilippe Mathieu-Daudé  * QEMU ARM CPU QOM header (target agnostic)
3fcf5ef2aSThomas Huth  *
4fcf5ef2aSThomas Huth  * Copyright (c) 2012 SUSE LINUX Products GmbH
5fcf5ef2aSThomas Huth  *
6fcf5ef2aSThomas Huth  * This program is free software; you can redistribute it and/or
7fcf5ef2aSThomas Huth  * modify it under the terms of the GNU General Public License
8fcf5ef2aSThomas Huth  * as published by the Free Software Foundation; either version 2
9fcf5ef2aSThomas Huth  * of the License, or (at your option) any later version.
10fcf5ef2aSThomas Huth  *
11fcf5ef2aSThomas Huth  * This program is distributed in the hope that it will be useful,
12fcf5ef2aSThomas Huth  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13fcf5ef2aSThomas Huth  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14fcf5ef2aSThomas Huth  * GNU General Public License for more details.
15fcf5ef2aSThomas Huth  *
16fcf5ef2aSThomas Huth  * You should have received a copy of the GNU General Public License
17fcf5ef2aSThomas Huth  * along with this program; if not, see
18fcf5ef2aSThomas Huth  * <http://www.gnu.org/licenses/gpl-2.0.html>
19fcf5ef2aSThomas Huth  */
20fcf5ef2aSThomas Huth #ifndef QEMU_ARM_CPU_QOM_H
21fcf5ef2aSThomas Huth #define QEMU_ARM_CPU_QOM_H
22fcf5ef2aSThomas Huth 
232e5b09fdSMarkus Armbruster #include "hw/core/cpu.h"
24fcf5ef2aSThomas Huth 
25fcf5ef2aSThomas Huth #define TYPE_ARM_CPU "arm-cpu"
26fcf5ef2aSThomas Huth 
279295b1aaSPhilippe Mathieu-Daudé OBJECT_DECLARE_CPU_TYPE(ARMCPU, ARMCPUClass, ARM_CPU)
28fcf5ef2aSThomas Huth 
29bab52d4bSPeter Maydell #define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU
30bab52d4bSPeter Maydell 
31fcf5ef2aSThomas Huth #define TYPE_AARCH64_CPU "aarch64-cpu"
32db1015e9SEduardo Habkost typedef struct AArch64CPUClass AArch64CPUClass;
338110fa1dSEduardo Habkost DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU,
348110fa1dSEduardo Habkost                        TYPE_AARCH64_CPU)
35fcf5ef2aSThomas Huth 
369ab3ac5aSPhilippe Mathieu-Daudé #define ARM_CPU_TYPE_SUFFIX "-" TYPE_ARM_CPU
379ab3ac5aSPhilippe Mathieu-Daudé #define ARM_CPU_TYPE_NAME(name) (name ARM_CPU_TYPE_SUFFIX)
389ab3ac5aSPhilippe Mathieu-Daudé 
39*b36a32eaSJinjie Ruan /* Meanings of the ARMCPU object's seven inbound GPIO lines */
40d780d056SPhilippe Mathieu-Daudé #define ARM_CPU_IRQ 0
41d780d056SPhilippe Mathieu-Daudé #define ARM_CPU_FIQ 1
42d780d056SPhilippe Mathieu-Daudé #define ARM_CPU_VIRQ 2
43d780d056SPhilippe Mathieu-Daudé #define ARM_CPU_VFIQ 3
44*b36a32eaSJinjie Ruan #define ARM_CPU_NMI 4
45*b36a32eaSJinjie Ruan #define ARM_CPU_VINMI 5
46*b36a32eaSJinjie Ruan #define ARM_CPU_VFNMI 6
47d780d056SPhilippe Mathieu-Daudé 
4822036ae5SPhilippe Mathieu-Daudé /* For M profile, some registers are banked secure vs non-secure;
4922036ae5SPhilippe Mathieu-Daudé  * these are represented as a 2-element array where the first element
5022036ae5SPhilippe Mathieu-Daudé  * is the non-secure copy and the second is the secure copy.
5122036ae5SPhilippe Mathieu-Daudé  * When the CPU does not have implement the security extension then
5222036ae5SPhilippe Mathieu-Daudé  * only the first element is used.
5322036ae5SPhilippe Mathieu-Daudé  * This means that the copy for the current security state can be
5422036ae5SPhilippe Mathieu-Daudé  * accessed via env->registerfield[env->v7m.secure] (whether the security
5522036ae5SPhilippe Mathieu-Daudé  * extension is implemented or not).
5622036ae5SPhilippe Mathieu-Daudé  */
5722036ae5SPhilippe Mathieu-Daudé enum {
5822036ae5SPhilippe Mathieu-Daudé     M_REG_NS = 0,
5922036ae5SPhilippe Mathieu-Daudé     M_REG_S = 1,
6022036ae5SPhilippe Mathieu-Daudé     M_REG_NUM_BANKS = 2,
6122036ae5SPhilippe Mathieu-Daudé };
6222036ae5SPhilippe Mathieu-Daudé 
63fcf5ef2aSThomas Huth #endif
64