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