2 * Copyright (C) 2014-2016 Broadcom Corporation
3 * Copyright (c) 2017 Red Hat, Inc.
4 * Written by Prem Mallappa, Eric Auger
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef HW_ARM_SMMUV3_H
20 #define HW_ARM_SMMUV3_H
22 #include "hw/arm/smmu-common.h"
23 #include "qom/object.h"
25 #define TYPE_SMMUV3_IOMMU_MEMORY_REGION "smmuv3-iommu-memory-region"
27 typedef struct SMMUQueue
{
28 uint64_t base
; /* base register */
52 uint64_t gerror_irq_cfg0
;
53 uint32_t gerror_irq_cfg1
;
54 uint32_t gerror_irq_cfg2
;
56 uint32_t strtab_base_cfg
;
57 uint64_t eventq_irq_cfg0
;
58 uint32_t eventq_irq_cfg1
;
59 uint32_t eventq_irq_cfg2
;
61 SMMUQueue eventq
, cmdq
;
77 SMMUBaseClass smmu_base_class
;
80 DeviceRealize parent_realize
;
81 ResettablePhases parent_phases
;
84 #define TYPE_ARM_SMMUV3 "arm-smmuv3"
85 OBJECT_DECLARE_TYPE(SMMUv3State
, SMMUv3Class
, ARM_SMMUV3
)
87 #define STAGE1_SUPPORTED(s) FIELD_EX32(s->idr[0], IDR0, S1P)
88 #define STAGE2_SUPPORTED(s) FIELD_EX32(s->idr[0], IDR0, S2P)