xref: /qemu/include/hw/arm/virt.h (revision afe0b380)
1*afe0b380SShannon Zhao /*
2*afe0b380SShannon Zhao  *
3*afe0b380SShannon Zhao  * Copyright (c) 2015 Linaro Limited
4*afe0b380SShannon Zhao  *
5*afe0b380SShannon Zhao  * This program is free software; you can redistribute it and/or modify it
6*afe0b380SShannon Zhao  * under the terms and conditions of the GNU General Public License,
7*afe0b380SShannon Zhao  * version 2 or later, as published by the Free Software Foundation.
8*afe0b380SShannon Zhao  *
9*afe0b380SShannon Zhao  * This program is distributed in the hope it will be useful, but WITHOUT
10*afe0b380SShannon Zhao  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11*afe0b380SShannon Zhao  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12*afe0b380SShannon Zhao  * more details.
13*afe0b380SShannon Zhao  *
14*afe0b380SShannon Zhao  * You should have received a copy of the GNU General Public License along with
15*afe0b380SShannon Zhao  * this program.  If not, see <http://www.gnu.org/licenses/>.
16*afe0b380SShannon Zhao  *
17*afe0b380SShannon Zhao  * Emulate a virtual board which works by passing Linux all the information
18*afe0b380SShannon Zhao  * it needs about what devices are present via the device tree.
19*afe0b380SShannon Zhao  * There are some restrictions about what we can do here:
20*afe0b380SShannon Zhao  *  + we can only present devices whose Linux drivers will work based
21*afe0b380SShannon Zhao  *    purely on the device tree with no platform data at all
22*afe0b380SShannon Zhao  *  + we want to present a very stripped-down minimalist platform,
23*afe0b380SShannon Zhao  *    both because this reduces the security attack surface from the guest
24*afe0b380SShannon Zhao  *    and also because it reduces our exposure to being broken when
25*afe0b380SShannon Zhao  *    the kernel updates its device tree bindings and requires further
26*afe0b380SShannon Zhao  *    information in a device binding that we aren't providing.
27*afe0b380SShannon Zhao  * This is essentially the same approach kvmtool uses.
28*afe0b380SShannon Zhao  */
29*afe0b380SShannon Zhao 
30*afe0b380SShannon Zhao #ifndef QEMU_ARM_VIRT_H
31*afe0b380SShannon Zhao #define QEMU_ARM_VIRT_H
32*afe0b380SShannon Zhao 
33*afe0b380SShannon Zhao #include "qemu-common.h"
34*afe0b380SShannon Zhao 
35*afe0b380SShannon Zhao #define NUM_VIRTIO_TRANSPORTS 32
36*afe0b380SShannon Zhao 
37*afe0b380SShannon Zhao enum {
38*afe0b380SShannon Zhao     VIRT_FLASH,
39*afe0b380SShannon Zhao     VIRT_MEM,
40*afe0b380SShannon Zhao     VIRT_CPUPERIPHS,
41*afe0b380SShannon Zhao     VIRT_GIC_DIST,
42*afe0b380SShannon Zhao     VIRT_GIC_CPU,
43*afe0b380SShannon Zhao     VIRT_UART,
44*afe0b380SShannon Zhao     VIRT_MMIO,
45*afe0b380SShannon Zhao     VIRT_RTC,
46*afe0b380SShannon Zhao     VIRT_FW_CFG,
47*afe0b380SShannon Zhao     VIRT_PCIE,
48*afe0b380SShannon Zhao };
49*afe0b380SShannon Zhao 
50*afe0b380SShannon Zhao typedef struct MemMapEntry {
51*afe0b380SShannon Zhao     hwaddr base;
52*afe0b380SShannon Zhao     hwaddr size;
53*afe0b380SShannon Zhao } MemMapEntry;
54*afe0b380SShannon Zhao 
55*afe0b380SShannon Zhao 
56*afe0b380SShannon Zhao #endif
57