aboutsummaryrefslogtreecommitdiff
path: root/hw/intc/arm_gic_common.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-05-12 12:11:32 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-05-12 12:11:32 +0100
commit968bb75c348a401b85e08d5eb1887a3e6c3185f5 (patch)
tree9a7a773e344aa200cdc85a0edd41baaf73ce770b /hw/intc/arm_gic_common.c
parent19fbe5084c1da6af95177c86e4cab64241d479a8 (diff)
parent5ae79fe825bedc89db8b6bde9d0ed0bb5d59558c (diff)
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150512' into staging
target-arm queue: * Support TZ and grouping in the GIC * hw/sd: sd_reset cleanup * armv7m_nvic: fix bug in systick device # gpg: Signature made Tue May 12 12:02:26 2015 BST using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-target-arm-20150512: hw/arm/highbank.c: Wire FIQ between CPU <> GIC hw/arm/vexpress.c: Wire FIQ between CPU <> GIC hw/arm/virt.c: Wire FIQ between CPU <> GIC hw/intc/arm_gic: Add grouping support to gic_update() hw/intc/arm_gic: Change behavior of IAR writes hw/intc/arm_gic: Change behavior of EOIR writes hw/intc/arm_gic: Handle grouping for GICC_HPPIR hw/intc/arm_gic: Restrict priority view hw/intc/arm_gic: Implement Non-secure view of RPR hw/intc/arm_gic: Make ICCICR/GICC_CTLR banked hw/intc/arm_gic: Make ICCBPR/GICC_BPR banked hw/intc/arm_gic: Make ICDDCR/GICD_CTLR banked hw/intc/arm_gic_kvm.c: Save and restore GICD_IGROUPRn state hw/intc/arm_gic: Add Interrupt Group Registers hw/intc/arm_gic: Switch to read/write callbacks with tx attributes hw/intc/arm_gic: Add Security Extensions property hw/intc/arm_gic: Create outbound FIQ lines hw/sd: Don't pass BlockBackend to sd_reset() armv7m_nvic: systick: Reload the RELOAD value and count down only if ENABLE bit is set Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/intc/arm_gic_common.c')
-rw-r--r--hw/intc/arm_gic_common.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c
index 18b01ba0c7..044ad66730 100644
--- a/hw/intc/arm_gic_common.c
+++ b/hw/intc/arm_gic_common.c
@@ -52,19 +52,20 @@ static const VMStateDescription vmstate_gic_irq_state = {
VMSTATE_UINT8(level, gic_irq_state),
VMSTATE_BOOL(model, gic_irq_state),
VMSTATE_BOOL(edge_trigger, gic_irq_state),
+ VMSTATE_UINT8(group, gic_irq_state),
VMSTATE_END_OF_LIST()
}
};
static const VMStateDescription vmstate_gic = {
.name = "arm_gic",
- .version_id = 7,
- .minimum_version_id = 7,
+ .version_id = 10,
+ .minimum_version_id = 10,
.pre_save = gic_pre_save,
.post_load = gic_post_load,
.fields = (VMStateField[]) {
- VMSTATE_BOOL(enabled, GICState),
- VMSTATE_BOOL_ARRAY(cpu_enabled, GICState, GIC_NCPU),
+ VMSTATE_UINT32(ctlr, GICState),
+ VMSTATE_UINT32_ARRAY(cpu_ctlr, GICState, GIC_NCPU),
VMSTATE_STRUCT_ARRAY(irq_state, GICState, GIC_MAXIRQ, 1,
vmstate_gic_irq_state, gic_irq_state),
VMSTATE_UINT8_ARRAY(irq_target, GICState, GIC_MAXIRQ),
@@ -110,6 +111,13 @@ static void arm_gic_common_realize(DeviceState *dev, Error **errp)
num_irq);
return;
}
+
+ if (s->security_extn &&
+ (s->revision == REV_11MPCORE || s->revision == REV_NVIC)) {
+ error_setg(errp, "this GIC revision does not implement "
+ "the security extensions");
+ return;
+ }
}
static void arm_gic_common_reset(DeviceState *dev)
@@ -126,7 +134,7 @@ static void arm_gic_common_reset(DeviceState *dev)
s->current_pending[i] = 1023;
s->running_irq[i] = 1023;
s->running_priority[i] = 0x100;
- s->cpu_enabled[i] = false;
+ s->cpu_ctlr[i] = 0;
}
for (i = 0; i < GIC_NR_SGIS; i++) {
GIC_SET_ENABLED(i, ALL_CPU_MASK);
@@ -138,7 +146,7 @@ static void arm_gic_common_reset(DeviceState *dev)
s->irq_target[i] = 1;
}
}
- s->enabled = false;
+ s->ctlr = 0;
}
static Property arm_gic_common_properties[] = {
@@ -149,6 +157,8 @@ static Property arm_gic_common_properties[] = {
* (Internally, 0xffffffff also indicates "not a GIC but an NVIC".)
*/
DEFINE_PROP_UINT32("revision", GICState, revision, 1),
+ /* True if the GIC should implement the security extensions */
+ DEFINE_PROP_BOOL("has-security-extensions", GICState, security_extn, 0),
DEFINE_PROP_END_OF_LIST(),
};