arm: Add first models of Xilinx Versal SoC
v4 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:
v3 -> v4:
* Improve error handling for CPU and GIC creation
* Remove KVM checks in GIC creation
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 | 323 ++++++++++++++++++ hw/net/cadence_gem.c | 9 +- include/hw/arm/xlnx-versal.h | 122 +++++++ 6 files changed, 949 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 v4 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 v4 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 v4 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 | 323 ++++++++++++++++++++++++++++ include/hw/arm/xlnx-versal.h | 122 +++++++++++ 4 files changed, 447 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 +323 -0
323 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
PATCH v4 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
Re: [Qemu-arm] [PATCH v4 4/4] hw/arm: versal: Add a virtual Xilinx Versal board
Quoted 12 lines · Edgar E. Iglesias
From: "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.
Signed-off-by Edgar E. Iglesias <[email protected]>
hw/arm/xlnx-versal-virt.c line 191
Quoted 8 lines
hw/arm/xlnx-versal-virt.c new file +8
-0+static void fdt_add_fixed_link_nodes (VersalVirt *s,char *gemname, +uint32_t phandle) +{ +char *name =g_strdup_printf ("%s/fixed-link" , gemname); + +qemu_fdt_add_subnode (s->fdt, name); +qemu_fdt_setprop_cell (s->fdt, name,"phandle" , phandle); +qemu_fdt_setprop_cells (s->fdt, name,"full-duplex" );
Hi. This fails to compile in a non-debug build:
In file included from /home/peter.maydell/qemu/hw/arm/xlnx-versal-virt.c:16:0:/home/peter.maydell/qemu/hw/arm/xlnx-versal-virt.c: In function 'fdt_add_fixed_link_nodes':/home/peter.maydell/qemu/include/sysemu/device_tree.h:110:23: error:
comparison of unsigned expression < 0 is always false [-Werror=type-limits]
for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) { \
^
/home/peter.maydell/qemu/hw/arm/xlnx-versal-virt.c:191:5: note: in
expansion of macro 'qemu_fdt_setprop_cells'
qemu_fdt_setprop_cells(s->fdt, name, "full-duplex");
^because qemu_fdt_setprop_cells() requires you to provide at least one cell value for the property being set. What was the intention here ?
hw/arm/xlnx-versal-virt.c line 194
Quoted 3 lines
hw/arm/xlnx-versal-virt.c new file +3
-0+qemu_fdt_setprop_cell (s->fdt, name,"speed" ,1000 ); +g_free (name); +}
In the meantime, I'm dropping the versal patches from target-arm.next.
thanks
-- PMM
Re: [Qemu-arm] [PATCH v4 4/4] hw/arm: versal: Add a virtual Xilinx Versal board
Quoted 37 lines · Peter Maydell
Quoted 12 lines · Edgar E. Iglesias
From: "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.
Signed-off-by Edgar E. Iglesias <[email protected]>hw/arm/xlnx-versal-virt.c line 191
Quoted 8 lines
hw/arm/xlnx-versal-virt.c new file +8
-0+static void fdt_add_fixed_link_nodes (VersalVirt *s,char *gemname, +uint32_t phandle) +{ +char *name =g_strdup_printf ("%s/fixed-link" , gemname); + +qemu_fdt_add_subnode (s->fdt, name); +qemu_fdt_setprop_cell (s->fdt, name,"phandle" , phandle); +qemu_fdt_setprop_cells (s->fdt, name,"full-duplex" );Hi. This fails to compile in a non-debug build:
In file included from
/home/peter.maydell/qemu/hw/arm/xlnx-versal-virt.c:16:0:/home/peter.maydell/qemu/hw/arm/xlnx-versal-virt.c: In function 'fdt_add_fixed_link_nodes':/home/peter.maydell/qemu/include/sysemu/device_tree.h:110:23: error:
comparison of unsigned expression < 0 is always false [-Werror=type-limits]for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) { \ ^ /home/peter.maydell/qemu/hw/arm/xlnx-versal-virt.c:191:5: note: in expansion of macro 'qemu_fdt_setprop_cells' qemu_fdt_setprop_cells(s->fdt, name, "full-duplex"); ^
Quoted 3 lines
because
qemu_fdt_setprop_cells()requires you to provide at least one cell value for the property being set. What was the intention here ?
Hi Peter,
The intent was to set a boolean property without a value. I'll fix this with the following and send a new version:
qemu_fdt_setprop(s->fdt, name, "full-duplex", NULL, 0);
Cheers,
Edgar
Quoted 11 lines
hw/arm/xlnx-versal-virt.c line 194
Quoted 5 lines
hw/arm/xlnx-versal-virt.c new file +3
-0+qemu_fdt_setprop_cell (s->fdt, name,"speed" ,1000 ); +g_free (name); +}In the meantime, I'm dropping the versal patches from target-arm.next.
thanks
-- PMM
Peter Maydell
AppliedQuoted 24 lines · Edgar E. Iglesias
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.htmlIn 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.
Quoted 7 lines
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.
Applied patches 3 and 4 to target-arm.next (1 and 2 being already in master), thanks.
-- PMM