mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
arch/arm64: GICv2 detection is compatible with different qemu versions
Summary: - GICv2 cannot be detected on the golsfish platform - Golsfish uses version 2.12.0 of qemu with a GICC_IIDR value of 0, read ICPIDR2 to determine the GIC version Signed-off-by: wangming9 <wangming9@xiaomi.com>
This commit is contained in:
@@ -786,14 +786,24 @@ static int gic_validate_dist_version(void)
|
|||||||
if (reg == (0x2 << GIC_ICCIDR_ARCHNO_SHIFT))
|
if (reg == (0x2 << GIC_ICCIDR_ARCHNO_SHIFT))
|
||||||
{
|
{
|
||||||
sinfo("GICv2 detected\n");
|
sinfo("GICv2 detected\n");
|
||||||
}
|
return 0;
|
||||||
else
|
|
||||||
{
|
|
||||||
sinfo("GICv2 not detected\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
/* Read the Peripheral ID2 Register (ICPIDR2) */
|
||||||
|
|
||||||
|
reg = getreg32(GIC_ICDPIDR(GIC_ICPIDR2)) & GICD_PIDR2_ARCH_MASK;
|
||||||
|
|
||||||
|
/* GIC Version should be 2 */
|
||||||
|
|
||||||
|
if (reg == GICD_PIDR2_ARCH_GICV2)
|
||||||
|
{
|
||||||
|
sinfo("GICv2 detected\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sinfo("GICv2 not detected\n");
|
||||||
|
|
||||||
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user