4 * Copyright (c) 2017 Linaro Ltd
5 * Written by Peter Maydell <peter.maydell@linaro.org>
7 * This code is licensed under the GPL version 2 or later.
10 #ifndef HW_ARM_ARMV7M_H
11 #define HW_ARM_ARMV7M_H
13 #include "hw/sysbus.h"
14 #include "hw/intc/armv7m_nvic.h"
15 #include "target/arm/idau.h"
17 #define TYPE_BITBAND "ARM,bitband-memory"
18 #define BITBAND(obj) OBJECT_CHECK(BitBandState, (obj), TYPE_BITBAND)
22 SysBusDevice parent_obj
;
25 AddressSpace source_as
;
28 MemoryRegion
*source_memory
;
31 #define TYPE_ARMV7M "armv7m"
32 #define ARMV7M(obj) OBJECT_CHECK(ARMv7MState, (obj), TYPE_ARMV7M)
34 #define ARMV7M_NUM_BITBANDS 2
36 /* ARMv7M container object.
37 * + Unnamed GPIO input lines: external IRQ lines for the NVIC
38 * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ
39 * + Property "cpu-type": CPU type to instantiate
40 * + Property "num-irq": number of external IRQ lines
41 * + Property "memory": MemoryRegion defining the physical address space
42 * that CPU accesses see. (The NVIC, bitbanding and other CPU-internal
43 * devices will be automatically layered on top of this view.)
44 * + Property "idau": IDAU interface (forwarded to CPU object)
45 * + Property "init-svtor": secure VTOR reset value (forwarded to CPU object)
46 * + Property "enable-bitband": expose bitbanded IO
48 typedef struct ARMv7MState
{
50 SysBusDevice parent_obj
;
53 BitBandState bitband
[ARMV7M_NUM_BITBANDS
];
56 /* MemoryRegion we pass to the CPU, with our devices layered on
57 * top of the ones the board provides in board_memory.
59 MemoryRegion container
;
63 /* MemoryRegion the board provides to us (with its devices, RAM, etc) */
64 MemoryRegion
*board_memory
;