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