arm: Add first models of Xilinx Versal SoC
v3 cover arm: Add first models of Xilinx Versal SoC
From: "Edgar E. Iglesias" <[email protected]>
This patch series adds initial support for Xilinx's Versal SoC. Xilinx is introducing Versal, an adaptive compute acceleration platform (ACAP), built on 7nm FinFET process technology. Versal ACAPs combine Scalar Processing Engines, Adaptable Hardware Engines, and Intelligent Engines with leading-edge memory and interfacing technologies to deliver powerful heterogeneous acceleration for any application. The Versal AI Core series has five devices, offering 128 to 400 AI Engines. The series includes dual-core Arm Cortex-A72 application processors, dual-core Arm Cortex-R5 real-time processors, 256KB of on-chip memory with ECC, more than 1,900 DSP engines optimized for high-precision floating point with low latency.
More info can be found here:
https://www.xilinx.com/news/press/2018/xilinx-unveils-versal-the-first-in-a-new-category-of-platforms-delivering-rapid-innovation-with-software-programmability-and-scalable-ai-inference.html
In QEMU we'd like to have a virtual developer board with the Versal SoC and a selected set of peripherals under the control of QEMU. We'd like to gradually extend this board as QEMU gains more support for Versal hardware components. QEMU will generate a device-tree describing only the components it supports and includes in the virtual dev board.
Before adding Versal support, this series starts with a few fixes to the GEM that I ran into when running recent kernels on the Versal and ZynqMP models.
I also noticed a problem with HVC insns not being enabled when using QEMU's PSCI implementation on CPU's with EL2 and EL3 enabled. This causes problems for Linux/KVM guests, also fixed in this series.
Best regards,
Edgar
ChangeLog:
v2 -> v3:
* Fix DESCONF6 queue mask generation for GEMs with only one queue.
v1 -> v2:
* Spell out OCM as On Chip Memory
* apperture -> aperture
* Remove copy+pasted virt board comment
* Remove VMSD for Versal SoC (with a comment on why it's not needed)
* Embedd AddressSpace dma object in GEM
* Remove debug left-overs in arm-powerctl
* Enable PMU in Cortex-A72
* Rename cortex_a57_a53_cp_reginfo -> cortex_a72_a57_a53_cp_reginfo
Edgar E. Iglesias (4):
net: cadence_gem: Announce availability of priority queues
net: cadence_gem: Announce 64bit addressing support hw/arm: versal: Add a model of Xilinx Versal SoC hw/arm: versal: Add a virtual Xilinx Versal board
default-configs/aarch64-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/xlnx-versal-virt.c | 494 ++++++++++++++++++++++++++++ hw/arm/xlnx-versal.c | 324 ++++++++++++++++++ hw/net/cadence_gem.c | 9 +- include/hw/arm/xlnx-versal.h | 122 +++++++ 6 files changed, 950 insertions(+), 1 deletion(-) create mode 100644 hw/arm/xlnx-versal-virt.c create mode 100644 hw/arm/xlnx-versal.c create mode 100644 include/hw/arm/xlnx-versal.h
Signature · 1 line
2.17.1
PATCH v3 1/4 net: cadence_gem: Announce availability of priority queues
From: "Edgar E. Iglesias" <[email protected]>
Announce the availability of the various priority queues. This fixes an issue where guest kernels would miss to configure secondary queues due to inproper feature bits.
--- hw/net/cadence_gem.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
hw/net/cadence_gem.c +7 -1
@@ -1283,6 +1283,7 @@ static void gem_reset(DeviceState *d)int i;CadenceGEMState *s =CADENCE_GEM (d);const uint8_t *a; +uint32_t queues_mask =0 ;DB_PRINT ("\n" );
@@ -1299,7 +1300,12 @@ static void gem_reset(DeviceState *d) s->regs[GEM_DESCONF ] =0x02500111 ; s->regs[GEM_DESCONF2 ] =0x2ab13fff ; s->regs[GEM_DESCONF5 ] =0x002f2045 ; - s->regs[GEM_DESCONF6 ] =0x00000200 ; + s->regs[GEM_DESCONF6 ] =0x0 ; + +if (s->num_priority_queues >1 ) { + queues_mask =MAKE_64BIT_MASK (1 , s->num_priority_queues -1 ); + s->regs[GEM_DESCONF6 ] |= queues_mask; + }/* Set MAC address */ a = &s->conf.macaddr.a[0 ];
Signature · 1 line
2.17.1
PATCH v3 2/4 net: cadence_gem: Announce 64bit addressing support
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Announce 64bit addressing support.
--- hw/net/cadence_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/net/cadence_gem.c +2 -1
@@ -142,6 +142,7 @@#define GEM_DESCONF4 (0x0000028C/4)#define GEM_DESCONF5 (0x00000290/4)#define GEM_DESCONF6 (0x00000294/4) +#define GEM_DESCONF6_64B_MASK (1U << 23)#define GEM_DESCONF7 (0x00000298/4)#define GEM_INT_Q1_STATUS (0x00000400 / 4)
@@ -1300,7 +1301,7 @@ static void gem_reset(DeviceState *d) s->regs[GEM_DESCONF ] =0x02500111 ; s->regs[GEM_DESCONF2 ] =0x2ab13fff ; s->regs[GEM_DESCONF5 ] =0x002f2045 ; - s->regs[GEM_DESCONF6 ] =0x0 ; + s->regs[GEM_DESCONF6 ] =GEM_DESCONF6_64B_MASK ;if (s->num_priority_queues >1 ) { queues_mask =MAKE_64BIT_MASK (1 , s->num_priority_queues -1 );
Signature · 1 line
2.17.1
PATCH v3 3/4 hw/arm: versal: Add a model of Xilinx Versal SoC
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Add a model of Xilinx Versal SoC.
--- default-configs/aarch64-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/xlnx-versal.c | 324 ++++++++++++++++++++++++++++ include/hw/arm/xlnx-versal.h | 122 +++++++++++ 4 files changed, 448 insertions(+) create mode 100644 hw/arm/xlnx-versal.c create mode 100644 include/hw/arm/xlnx-versal.h
default-configs/aarch64-softmmu.mak +1 -0
@@ -8,4 +8,5 @@ CONFIG_DDC=y CONFIG_DPCD=y CONFIG_XLNX_ZYNQMP=y CONFIG_XLNX_ZYNQMP_ARM=y +CONFIG_XLNX_VERSAL=y CONFIG_ARM_SMMUV3=y
hw/arm/Makefile.objs +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o +obj-$(CONFIG_XLNX_VERSAL) += xlnx-versal.o obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
hw/arm/xlnx-versal.c new file +324 -0
324 lines not on this page · raw message
include/hw/arm/xlnx-versal.h new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [Qemu-arm] [PATCH v3 3/4] hw/arm: versal: Add a model of Xilinx Versal SoC
Quoted 14 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Add a model of Xilinx Versal SoC.
Signed-off-by Edgar E. Iglesias <[email protected]>--- default-configs/aarch64-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/xlnx-versal.c | 324 ++++++++++++++++++++++++++++ include/hw/arm/xlnx-versal.h | 122 +++++++++++ 4 files changed, 448 insertions(+) create mode 100644 hw/arm/xlnx-versal.c create mode 100644 include/hw/arm/xlnx-versal.h
hw/arm/xlnx-versal.c line 88
Quoted 3 lines
hw/arm/xlnx-versal.c new file +3
-0+if (!kvm_irqchip_in_kernel ()) { +qdev_prop_set_bit (gicdev,"has-security-extensions" , true); + }
Do you really support KVM for this board/SoC ?
thanks
-- PMM
Re: [Qemu-arm] [PATCH v3 3/4] hw/arm: versal: Add a model of Xilinx Versal SoC
Quoted 15 lines · Peter Maydell
Quoted 13 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Add a model of Xilinx Versal SoC.
Signed-off-by Edgar E. Iglesias <[email protected]>--- default-configs/aarch64-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/xlnx-versal.c | 324 ++++++++++++++++++++++++++++ include/hw/arm/xlnx-versal.h | 122 +++++++++++ 4 files changed, 448 insertions(+) create mode 100644 hw/arm/xlnx-versal.c create mode 100644 include/hw/arm/xlnx-versal.h
Quoted 6 lines
hw/arm/xlnx-versal.c line 88
Quoted 3 lines
hw/arm/xlnx-versal.c new file +3
-0+if (!kvm_irqchip_in_kernel ()) { +qdev_prop_set_bit (gicdev,"has-security-extensions" , true); + }Do you really support KVM for this board/SoC ?
I haven't tried yet, so probably not, but KVM is something we'd like to support further down the road... If you prefer, we can remove this kvm specific check for now though.
Cheers,
Edgar
Re: [Qemu-arm] [PATCH v3 3/4] hw/arm: versal: Add a model of Xilinx Versal SoC
Quoted 20 lines · Edgar E. Iglesias
Quoted 19 lines · Peter Maydell
Quoted 17 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Add a model of Xilinx Versal SoC.
Signed-off-by Edgar E. Iglesias <[email protected]>--- default-configs/aarch64-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/xlnx-versal.c | 324 ++++++++++++++++++++++++++++ include/hw/arm/xlnx-versal.h | 122 +++++++++++ 4 files changed, 448 insertions(+) create mode 100644 hw/arm/xlnx-versal.c create mode 100644 include/hw/arm/xlnx-versal.hhw/arm/xlnx-versal.c new file +3
-0+if (!kvm_irqchip_in_kernel ()) { +qdev_prop_set_bit (gicdev,"has-security-extensions" , true); + }
Quoted 6 lines
Quoted 2 lines
Do you really support KVM for this board/SoC ?
I haven't tried yet, so probably not, but KVM is something we'd like to support further down the road... If you prefer, we can remove this kvm specific check for now though.
I think there's other things you need to do to support KVM (for instance, you need to disable EL2 and EL3 on all the CPUs, and you need to either handle a GICv2 or error out properly if the host system doesn't have a GICv3), so maybe it would be better to add support properly later. This isn't a subtle check we'll forget to add in later either -- if you set has-security-extensions on a KVM GICv3 then the device will fail its 'realize' method with a suitable error.
...which leads me to notice that here:
+ object_property_set_bool(OBJECT(&s->fpd.apu.gic), true, "realized", errp);
we capture the possible error from realize in errp, but we don't actually check whether it failed, so the rest of the function will plough ahead and try to wire up IRQs and MemoryRegions that won't have been created.
thanks
-- PMM
Re: [Qemu-devel] [PATCH v3 3/4] hw/arm: versal: Add a model of Xilinx Versal SoC
Quoted 29 lines · Peter Maydell
Quoted 20 lines · Edgar E. Iglesias
Quoted 19 lines · Peter Maydell
Quoted 17 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Add a model of Xilinx Versal SoC.
Signed-off-by Edgar E. Iglesias <[email protected]>--- default-configs/aarch64-softmmu.mak | 1 + hw/arm/Makefile.objs | 1 + hw/arm/xlnx-versal.c | 324 ++++++++++++++++++++++++++++ include/hw/arm/xlnx-versal.h | 122 +++++++++++ 4 files changed, 448 insertions(+) create mode 100644 hw/arm/xlnx-versal.c create mode 100644 include/hw/arm/xlnx-versal.hhw/arm/xlnx-versal.c new file +3
-0+if (!kvm_irqchip_in_kernel ()) { +qdev_prop_set_bit (gicdev,"has-security-extensions" , true); + }Quoted 6 lines
Quoted 2 lines
Do you really support KVM for this board/SoC ?
I haven't tried yet, so probably not, but KVM is something we'd like to support further down the road... If you prefer, we can remove this kvm specific check for now though.
Quoted 8 lines
I think there's other things you need to do to support KVM (for instance, you need to disable EL2 and EL3 on all the CPUs, and you need to either handle a GICv2 or error out properly if the host system doesn't have a GICv3), so maybe it would be better to add support properly later. This isn't a subtle check we'll forget to add in later either -- if you set has-security-extensions on a KVM GICv3 then the device will fail its 'realize' method with a suitable error.
Thanks, yes, we can do that later. I'll remove this check for now.
Quoted 9 lines
...which leads me to notice that here:
+
object_property_set_bool(OBJECT(&s->fpd.apu.gic), true, "realized", errp);we capture the possible error from realize in errp, but we don't actually check whether it failed, so the rest of the function will plough ahead and try to wire up IRQs and MemoryRegions that won't have been created.
Thanks, I'll fix that in the next version!
Cheers,
Edgar
PATCH v3 4/4 hw/arm: versal: Add a virtual Xilinx Versal board
In reply to Edgar E. IglesiasFrom: "Edgar E. Iglesias" <[email protected]>
Add a virtual Xilinx Versal board.
This board is based on the Xilinx Versal SoC. The exact details of what peripherals are attached to this board will remain in control of QEMU. QEMU will generate an FDT on the fly for Linux and other software to auto-discover peripherals.
--- hw/arm/Makefile.objs | 2 +- hw/arm/xlnx-versal-virt.c | 494 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 495 insertions(+), 1 deletion(-) create mode 100644 hw/arm/xlnx-versal-virt.c
hw/arm/Makefile.objs +1 -1
@@ -26,7 +26,7 @@ obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o -obj-$(CONFIG_XLNX_VERSAL) += xlnx-versal.o +obj-$(CONFIG_XLNX_VERSAL) += xlnx-versal.o xlnx-versal-virt.o obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
hw/arm/xlnx-versal-virt.c new file +494 -0
494 lines not on this page · raw message
Signature · 1 line
2.17.1