1f0a902f7SPeter Crosthwaite /* 2f0a902f7SPeter Crosthwaite * Xilinx Zynq MPSoC emulation 3f0a902f7SPeter Crosthwaite * 4f0a902f7SPeter Crosthwaite * Copyright (C) 2015 Xilinx Inc 5f0a902f7SPeter Crosthwaite * Written by Peter Crosthwaite <peter.crosthwaite@xilinx.com> 6f0a902f7SPeter Crosthwaite * 7f0a902f7SPeter Crosthwaite * This program is free software; you can redistribute it and/or modify it 8f0a902f7SPeter Crosthwaite * under the terms of the GNU General Public License as published by the 9f0a902f7SPeter Crosthwaite * Free Software Foundation; either version 2 of the License, or 10f0a902f7SPeter Crosthwaite * (at your option) any later version. 11f0a902f7SPeter Crosthwaite * 12f0a902f7SPeter Crosthwaite * This program is distributed in the hope that it will be useful, but WITHOUT 13f0a902f7SPeter Crosthwaite * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14f0a902f7SPeter Crosthwaite * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15f0a902f7SPeter Crosthwaite * for more details. 16f0a902f7SPeter Crosthwaite */ 17f0a902f7SPeter Crosthwaite 18f0a902f7SPeter Crosthwaite #ifndef XLNX_ZYNQMP_H 19f0a902f7SPeter Crosthwaite 20f0a902f7SPeter Crosthwaite #include "qemu-common.h" 21f0a902f7SPeter Crosthwaite #include "hw/arm/arm.h" 227729e1f4SPeter Crosthwaite #include "hw/intc/arm_gic.h" 2314ca2e46SPeter Crosthwaite #include "hw/net/cadence_gem.h" 243bade2a9SPeter Crosthwaite #include "hw/char/cadence_uart.h" 256fdf3282SAlistair Francis #include "hw/ide/pci.h" 266fdf3282SAlistair Francis #include "hw/ide/ahci.h" 2733108e9fSSai Pavan Boddu #include "hw/sd/sdhci.h" 2802d07eb4SAlistair Francis #include "hw/ssi/xilinx_spips.h" 29b93dbcddSKONRAD Frederic #include "hw/dma/xlnx_dpdma.h" 3004965bcaSFrancisco Iglesias #include "hw/dma/xlnx-zdma.h" 31b93dbcddSKONRAD Frederic #include "hw/display/xlnx_dp.h" 320ab7bbc7SAlistair Francis #include "hw/intc/xlnx-zynqmp-ipi.h" 3308b2f15eSAlistair Francis #include "hw/timer/xlnx-zynqmp-rtc.h" 34f0a902f7SPeter Crosthwaite 35f0a902f7SPeter Crosthwaite #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" 36f0a902f7SPeter Crosthwaite #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ 37f0a902f7SPeter Crosthwaite TYPE_XLNX_ZYNQMP) 38f0a902f7SPeter Crosthwaite 392e5577bcSPeter Crosthwaite #define XLNX_ZYNQMP_NUM_APU_CPUS 4 40b58850e7SPeter Crosthwaite #define XLNX_ZYNQMP_NUM_RPU_CPUS 2 4114ca2e46SPeter Crosthwaite #define XLNX_ZYNQMP_NUM_GEMS 4 423bade2a9SPeter Crosthwaite #define XLNX_ZYNQMP_NUM_UARTS 2 4333108e9fSSai Pavan Boddu #define XLNX_ZYNQMP_NUM_SDHCI 2 4402d07eb4SAlistair Francis #define XLNX_ZYNQMP_NUM_SPIS 2 4504965bcaSFrancisco Iglesias #define XLNX_ZYNQMP_NUM_GDMA_CH 8 4604965bcaSFrancisco Iglesias #define XLNX_ZYNQMP_NUM_ADMA_CH 8 47f0a902f7SPeter Crosthwaite 48babc1f30SFrancisco Iglesias #define XLNX_ZYNQMP_NUM_QSPI_BUS 2 49babc1f30SFrancisco Iglesias #define XLNX_ZYNQMP_NUM_QSPI_BUS_CS 2 50babc1f30SFrancisco Iglesias #define XLNX_ZYNQMP_NUM_QSPI_FLASH 4 51babc1f30SFrancisco Iglesias 526675d719SAlistair Francis #define XLNX_ZYNQMP_NUM_OCM_BANKS 4 536675d719SAlistair Francis #define XLNX_ZYNQMP_OCM_RAM_0_ADDRESS 0xFFFC0000 546675d719SAlistair Francis #define XLNX_ZYNQMP_OCM_RAM_SIZE 0x10000 556675d719SAlistair Francis 56*75b749afSLuc Michel #define XLNX_ZYNQMP_GIC_REGIONS 6 577729e1f4SPeter Crosthwaite 587729e1f4SPeter Crosthwaite /* ZynqMP maps the ARM GIC regions (GICC, GICD ...) at consecutive 64k offsets 597729e1f4SPeter Crosthwaite * and under-decodes the 64k region. This mirrors the 4k regions to every 4k 607729e1f4SPeter Crosthwaite * aligned address in the 64k region. To implement each GIC region needs a 617729e1f4SPeter Crosthwaite * number of memory region aliases. 627729e1f4SPeter Crosthwaite */ 637729e1f4SPeter Crosthwaite 6452c16b45SNathan Rossi #define XLNX_ZYNQMP_GIC_REGION_SIZE 0x1000 65*75b749afSLuc Michel #define XLNX_ZYNQMP_GIC_ALIASES (0x10000 / XLNX_ZYNQMP_GIC_REGION_SIZE) 667729e1f4SPeter Crosthwaite 67dc3b89efSAlistair Francis #define XLNX_ZYNQMP_MAX_LOW_RAM_SIZE 0x80000000ull 68dc3b89efSAlistair Francis 69dc3b89efSAlistair Francis #define XLNX_ZYNQMP_MAX_HIGH_RAM_SIZE 0x800000000ull 70dc3b89efSAlistair Francis #define XLNX_ZYNQMP_HIGH_RAM_START 0x800000000ull 71dc3b89efSAlistair Francis 72dc3b89efSAlistair Francis #define XLNX_ZYNQMP_MAX_RAM_SIZE (XLNX_ZYNQMP_MAX_LOW_RAM_SIZE + \ 73dc3b89efSAlistair Francis XLNX_ZYNQMP_MAX_HIGH_RAM_SIZE) 74dc3b89efSAlistair Francis 75f0a902f7SPeter Crosthwaite typedef struct XlnxZynqMPState { 76f0a902f7SPeter Crosthwaite /*< private >*/ 77f0a902f7SPeter Crosthwaite DeviceState parent_obj; 78f0a902f7SPeter Crosthwaite 79f0a902f7SPeter Crosthwaite /*< public >*/ 802e5577bcSPeter Crosthwaite ARMCPU apu_cpu[XLNX_ZYNQMP_NUM_APU_CPUS]; 81b58850e7SPeter Crosthwaite ARMCPU rpu_cpu[XLNX_ZYNQMP_NUM_RPU_CPUS]; 827729e1f4SPeter Crosthwaite GICState gic; 837729e1f4SPeter Crosthwaite MemoryRegion gic_mr[XLNX_ZYNQMP_GIC_REGIONS][XLNX_ZYNQMP_GIC_ALIASES]; 84dc3b89efSAlistair Francis 856675d719SAlistair Francis MemoryRegion ocm_ram[XLNX_ZYNQMP_NUM_OCM_BANKS]; 866675d719SAlistair Francis 87dc3b89efSAlistair Francis MemoryRegion *ddr_ram; 88dc3b89efSAlistair Francis MemoryRegion ddr_ram_low, ddr_ram_high; 89dc3b89efSAlistair Francis 9014ca2e46SPeter Crosthwaite CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS]; 913bade2a9SPeter Crosthwaite CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS]; 926fdf3282SAlistair Francis SysbusAHCIState sata; 9333108e9fSSai Pavan Boddu SDHCIState sdhci[XLNX_ZYNQMP_NUM_SDHCI]; 9402d07eb4SAlistair Francis XilinxSPIPS spi[XLNX_ZYNQMP_NUM_SPIS]; 95babc1f30SFrancisco Iglesias XlnxZynqMPQSPIPS qspi; 96b93dbcddSKONRAD Frederic XlnxDPState dp; 97b93dbcddSKONRAD Frederic XlnxDPDMAState dpdma; 980ab7bbc7SAlistair Francis XlnxZynqMPIPI ipi; 9908b2f15eSAlistair Francis XlnxZynqMPRTC rtc; 10004965bcaSFrancisco Iglesias XlnxZDMA gdma[XLNX_ZYNQMP_NUM_GDMA_CH]; 10104965bcaSFrancisco Iglesias XlnxZDMA adma[XLNX_ZYNQMP_NUM_ADMA_CH]; 1026396a193SPeter Crosthwaite 1036396a193SPeter Crosthwaite char *boot_cpu; 1046396a193SPeter Crosthwaite ARMCPU *boot_cpu_ptr; 10537d42473SEdgar E. Iglesias 10637d42473SEdgar E. Iglesias /* Has the ARM Security extensions? */ 10737d42473SEdgar E. Iglesias bool secure; 1081946809eSAlistair Francis /* Has the ARM Virtualization extensions? */ 1091946809eSAlistair Francis bool virt; 1106ed92b14SEdgar E. Iglesias /* Has the RPU subsystem? */ 1116ed92b14SEdgar E. Iglesias bool has_rpu; 112f0a902f7SPeter Crosthwaite } XlnxZynqMPState; 113f0a902f7SPeter Crosthwaite 114f0a902f7SPeter Crosthwaite #define XLNX_ZYNQMP_H 115f0a902f7SPeter Crosthwaite #endif 116