4 * Copyright (c) 2017 Linaro Ltd
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 "hw/misc/armv7m_ras.h"
16 #include "target/arm/idau.h"
17 #include "qom/object.h"
20 #define TYPE_BITBAND "ARM-bitband-memory"
21 OBJECT_DECLARE_SIMPLE_TYPE(BitBandState, BITBAND)
25 SysBusDevice parent_obj;
28 AddressSpace source_as;
31 MemoryRegion *source_memory;
34 #define TYPE_ARMV7M "armv7m"
35 OBJECT_DECLARE_SIMPLE_TYPE(ARMv7MState, ARMV7M)
37 #define ARMV7M_NUM_BITBANDS 2
39 /* ARMv7M container object.
40 * + Unnamed GPIO input lines: external IRQ lines for the NVIC
41 * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ.
42 * If this GPIO is not wired up then the NVIC will default to performing
43 * a qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET).
44 * + Property "cpu-type": CPU type to instantiate
45 * + Property "num-irq": number of external IRQ lines
46 * + Property "memory": MemoryRegion defining the physical address space
47 * that CPU accesses see. (The NVIC, bitbanding and other CPU-internal
48 * devices will be automatically layered on top of this view.)
49 * + Property "idau": IDAU interface (forwarded to CPU object)
50 * + Property "init-svtor": secure VTOR reset value (forwarded to CPU object)
51 * + Property "init-nsvtor": non-secure VTOR reset value (forwarded to CPU object)
52 * + Property "vfp": enable VFP (forwarded to CPU object)
53 * + Property "dsp": enable DSP (forwarded to CPU object)
54 * + Property "enable-bitband": expose bitbanded IO
55 * + Clock input "refclk" is the external reference clock for the systick timers
56 * + Clock input "cpuclk" is the main CPU clock
60 SysBusDevice parent_obj;
63 BitBandState bitband[ARMV7M_NUM_BITBANDS];
66 SysTickState systick[M_REG_NUM_BANKS];
68 /* MemoryRegion we pass to the CPU, with our devices layered on
69 * top of the ones the board provides in board_memory.
71 MemoryRegion container;
73 * MemoryRegion which passes the transaction to either the S or the
74 * NS systick device depending on the transaction attributes
76 MemoryRegion systickmem;
78 * MemoryRegion which enforces the S/NS handling of the systick
79 * device NS alias region and passes the transaction to the
80 * NS systick device if appropriate.
82 MemoryRegion systick_ns_mem;
83 /* Ditto, for the sysregs region provided by the NVIC */
84 MemoryRegion sysreg_ns_mem;
85 /* MR providing default PPB behaviour */
86 MemoryRegion defaultmem;
93 /* MemoryRegion the board provides to us (with its devices, RAM, etc) */
94 MemoryRegion *board_memory;
99 bool start_powered_off;