xref: /openbmc/qemu/include/hw/arm/xlnx-zynqmp.h (revision 3bade2a9e6336e0eb7cc5ad7425994f1143c5cfa)
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"
24*3bade2a9SPeter Crosthwaite #include "hw/char/cadence_uart.h"
25f0a902f7SPeter Crosthwaite 
26f0a902f7SPeter Crosthwaite #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp"
27f0a902f7SPeter Crosthwaite #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \
28f0a902f7SPeter Crosthwaite                                        TYPE_XLNX_ZYNQMP)
29f0a902f7SPeter Crosthwaite 
30f0a902f7SPeter Crosthwaite #define XLNX_ZYNQMP_NUM_CPUS 4
3114ca2e46SPeter Crosthwaite #define XLNX_ZYNQMP_NUM_GEMS 4
32*3bade2a9SPeter Crosthwaite #define XLNX_ZYNQMP_NUM_UARTS 2
33f0a902f7SPeter Crosthwaite 
347729e1f4SPeter Crosthwaite #define XLNX_ZYNQMP_GIC_REGIONS 2
357729e1f4SPeter Crosthwaite 
367729e1f4SPeter Crosthwaite /* ZynqMP maps the ARM GIC regions (GICC, GICD ...) at consecutive 64k offsets
377729e1f4SPeter Crosthwaite  * and under-decodes the 64k region. This mirrors the 4k regions to every 4k
387729e1f4SPeter Crosthwaite  * aligned address in the 64k region. To implement each GIC region needs a
397729e1f4SPeter Crosthwaite  * number of memory region aliases.
407729e1f4SPeter Crosthwaite  */
417729e1f4SPeter Crosthwaite 
427729e1f4SPeter Crosthwaite #define XLNX_ZYNQMP_GIC_REGION_SIZE 0x4000
437729e1f4SPeter Crosthwaite #define XLNX_ZYNQMP_GIC_ALIASES     (0x10000 / XLNX_ZYNQMP_GIC_REGION_SIZE - 1)
447729e1f4SPeter Crosthwaite 
45f0a902f7SPeter Crosthwaite typedef struct XlnxZynqMPState {
46f0a902f7SPeter Crosthwaite     /*< private >*/
47f0a902f7SPeter Crosthwaite     DeviceState parent_obj;
48f0a902f7SPeter Crosthwaite 
49f0a902f7SPeter Crosthwaite     /*< public >*/
50f0a902f7SPeter Crosthwaite     ARMCPU cpu[XLNX_ZYNQMP_NUM_CPUS];
517729e1f4SPeter Crosthwaite     GICState gic;
527729e1f4SPeter Crosthwaite     MemoryRegion gic_mr[XLNX_ZYNQMP_GIC_REGIONS][XLNX_ZYNQMP_GIC_ALIASES];
5314ca2e46SPeter Crosthwaite     CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS];
54*3bade2a9SPeter Crosthwaite     CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS];
55f0a902f7SPeter Crosthwaite }  XlnxZynqMPState;
56f0a902f7SPeter Crosthwaite 
57f0a902f7SPeter Crosthwaite #define XLNX_ZYNQMP_H
58f0a902f7SPeter Crosthwaite #endif
59