target-arm queue
Hi; not so many patches in this one, but notably it includes the fix for various Avocado CI tests failing (incorrectly reported by Avocado as a timeout, but really a QEMU exit-with-error).
thanks
-- PMM
The following changes since commit c8de6ec63d766ca1998c5af468483ce912fdc0c2:
Merge tag 'pull-request-2022-09-28' of https://gitlab.com/thuth/qemu into staging (2022-09-28 17:04:11 -0400)
are available in the Git repository at:
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20220930
for you to fetch changes up to beeec926d24aac28f95cc7694ef3837d7a4cd3bb:
target/arm: mark SP_EL1 with ARM_CP_EL3_NO_EL2_KEEP (2022-09-29 18:01:09 +0100)
----------------------------------------------------------------
target-arm queue:
* Fix breakage of icount mode when guest touches MDCR_EL3, MDCR_EL2, PMCNTENSET_EL0 or PMCNTENCLR_EL0
* Make writes to MDCR_EL3 use PMU start/finish calls
* Let AArch32 write to SDCR.SCCD
* Rearrange cpu64.c so all the CPU initfns are together
* hw/arm/xlnx-zynqmp: Connect ZynqMP's USB controllers
* hw/arm/virt: fix some minor issues with generated device tree
* Fix regression where EL3 could not write to SP_EL1 if there is no EL2
----------------------------------------------------------------
Francisco Iglesias (1):
hw/arm/xlnx-zynqmp: Connect ZynqMP's USB controllers
Jean-Philippe Brucker (4):
hw/arm/virt: Fix devicetree warning about the root node hw/arm/virt: Fix devicetree warning about the GIC node hw/arm/virt: Use "msi-map" devicetree property for PCI hw/arm/virt: Fix devicetree warning about the SMMU node
Jerome Forissier (1):
target/arm: mark SP_EL1 with ARM_CP_EL3_NO_EL2_KEEP
Peter Maydell (4):
target/arm: Mark registers which call pmu_op_start() as ARM_CP_IO target/arm: Make writes to MDCR_EL3 use PMU start/finish calls target/arm: Update SDCR_VALID_MASK to include SCCD target/arm: Rearrange cpu64.c so all the CPU initfns are together
include/hw/arm/xlnx-zynqmp.h | 3 + target/arm/cpu.h | 8 +- hw/arm/virt.c | 8 +- hw/arm/xlnx-zynqmp.c | 36 +++ target/arm/cpu64.c | 712 +++++++++++++++++++++---------------------- target/arm/helper.c | 32 +- 6 files changed, 427 insertions(+), 372 deletions(-)
[PULL 06/10] hw/arm/virt: Fix devicetree warning about the root node
From: Jean-Philippe Brucker <[email protected]>
The devicetree specification requires a 'model' property in the root node. Fix the corresponding dt-validate warning:
/: 'model' is a required property
From schema: dtschema/schemas/root-node.yaml
Use the same name for model as for compatible. The specification recommends that 'compatible' follows the format 'manufacturer,model' and 'model' follows the format 'manufacturer,model-number'. Since our 'compatible' doesn't observe this, 'model' doesn't really need to either.
Message-id: [email protected]
--- hw/arm/virt.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/virt.c +1 -0
@@ -253,6 +253,7 @@ static void create_fdt(VirtMachineState *vms)qemu_fdt_setprop_string (fdt,"/" ,"compatible" ,"linux,dummy-virt" );qemu_fdt_setprop_cell (fdt,"/" ,"#address-cells" ,0x2 );qemu_fdt_setprop_cell (fdt,"/" ,"#size-cells" ,0x2 ); +qemu_fdt_setprop_string (fdt,"/" ,"model" ,"linux,dummy-virt" );/* /chosen must exist for load_dtb to fill in necessary properties later */ qemu_fdt_add_subnode (fdt,"/chosen" );
Signature · 1 line
2.25.1
[PULL 07/10] hw/arm/virt: Fix devicetree warning about the GIC node
In reply to Peter MaydellFrom: Jean-Philippe Brucker <[email protected]>
The GICv3 bindings requires a #msi-cells property for the ITS node. Fix the corresponding dt-validate warning:
interrupt-controller@8000000: msi-controller@8080000: '#msi-cells' is a required property From schema: linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
Message-id: [email protected]
--- hw/arm/virt.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/virt.c +1 -0
@@ -488,6 +488,7 @@ static void fdt_add_its_gic_node(VirtMachineState *vms)qemu_fdt_setprop_string (ms->fdt, nodename,"compatible" ,"arm,gic-v3-its" );qemu_fdt_setprop (ms->fdt, nodename,"msi-controller" ,NULL ,0 ); +qemu_fdt_setprop_cell (ms->fdt, nodename,"#msi-cells" ,1 );qemu_fdt_setprop_sized_cells (ms->fdt, nodename,"reg" ,2 , vms->memmap[VIRT_GIC_ITS ].base,2 , vms->memmap[VIRT_GIC_ITS ].size);
Signature · 1 line
2.25.1
[PULL 04/10] target/arm: Rearrange cpu64.c so all the CPU initfns are together
In reply to Peter Maydellcpu64.c has ended up in a slightly odd order -- it starts with the initfns for most of the models-real-hardware CPUs; after that comes a bunch of support code for SVE, SME, pauth and LPA2 properties. Then come the initfns for the 'host' and 'max' CPU types, and then after that one more models-real-hardware CPU initfn, for a64fx. (This ordering is partly historical and partly required because a64fx needs the SVE properties.)
Reorder the file into:
* CPU property support functions
* initfns for real hardware CPUs
* initfns for host and max
* class boilerplate
--- target/arm/cpu64.c | 712 ++++++++++++++++++++++----------------------- 1 file changed, 356 insertions(+), 356 deletions(-)
target/arm/cpu64.c +356 -356
@@ -116,313 +116,6 @@ static void aarch64_a35_initfn(Object *obj)define_cortex_a72_a57_a53_cp_reginfo (cpu); } -static void aarch64_a57_initfn (Object *obj) -{ -ARMCPU *cpu =ARM_CPU (obj); - - cpu->dtb_compatible ="arm,cortex-a57" ; -set_feature (&cpu->env,ARM_FEATURE_V8 ); -set_feature (&cpu->env,ARM_FEATURE_NEON ); -set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); -set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); -set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); -set_feature (&cpu->env,ARM_FEATURE_EL2 ); -set_feature (&cpu->env,ARM_FEATURE_EL3 ); -set_feature (&cpu->env,ARM_FEATURE_PMU ); - cpu->kvm_target =QEMU_KVM_ARM_TARGET_CORTEX_A57 ; - cpu->midr =0x411fd070 ; - cpu->revidr =0x00000000 ; - cpu->reset_fpsid =0x41034070 ; - cpu->isar.mvfr0 =0x10110222 ; - cpu->isar.mvfr1 =0x12111111 ; - cpu->isar.mvfr2 =0x00000043 ; - cpu->ctr =0x8444c004 ; - cpu->reset_sctlr =0x00c50838 ; - cpu->isar.id_pfr0 =0x00000131 ; - cpu->isar.id_pfr1 =0x00011011 ; - cpu->isar.id_dfr0 =0x03010066 ; - cpu->id_afr0 =0x00000000 ; - cpu->isar.id_mmfr0 =0x10101105 ; - cpu->isar.id_mmfr1 =0x40000000 ; - cpu->isar.id_mmfr2 =0x01260000 ; - cpu->isar.id_mmfr3 =0x02102211 ; - cpu->isar.id_isar0 =0x02101110 ; - cpu->isar.id_isar1 =0x13112111 ; - cpu->isar.id_isar2 =0x21232042 ; - cpu->isar.id_isar3 =0x01112131 ; - cpu->isar.id_isar4 =0x00011142 ; - cpu->isar.id_isar5 =0x00011121 ; - cpu->isar.id_isar6 =0 ; - cpu->isar.id_aa64pfr0 =0x00002222 ; - cpu->isar.id_aa64dfr0 =0x10305106 ; - cpu->isar.id_aa64isar0 =0x00011120 ; - cpu->isar.id_aa64mmfr0 =0x00001124 ; - cpu->isar.dbgdidr =0x3516d000 ; - cpu->isar.dbgdevid =0x01110f13 ; - cpu->isar.dbgdevid1 =0x2 ; - cpu->isar.reset_pmcr_el0 =0x41013000 ; - cpu->clidr =0x0a200023 ; - cpu->ccsidr[0 ] =0x701fe00a ;/* 32KB L1 dcache */ - cpu->ccsidr[1 ] =0x201fe012 ;/* 48KB L1 icache */ - cpu->ccsidr[2 ] =0x70ffe07a ;/* 2048KB L2 cache */ - cpu->dcz_blocksize =4 ;/* 64 bytes */ - cpu->gic_num_lrs =4 ; - cpu->gic_vpribits =5 ; - cpu->gic_vprebits =5 ; - cpu->gic_pribits =5 ; -define_cortex_a72_a57_a53_cp_reginfo (cpu); -} - -static void aarch64_a53_initfn (Object *obj) -{ -ARMCPU *cpu =ARM_CPU (obj); - - cpu->dtb_compatible ="arm,cortex-a53" ; -set_feature (&cpu->env,ARM_FEATURE_V8 ); -set_feature (&cpu->env,ARM_FEATURE_NEON ); -set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); -set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); -set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); -set_feature (&cpu->env,ARM_FEATURE_EL2 ); -set_feature (&cpu->env,ARM_FEATURE_EL3 ); -set_feature (&cpu->env,ARM_FEATURE_PMU ); - cpu->kvm_target =QEMU_KVM_ARM_TARGET_CORTEX_A53 ; - cpu->midr =0x410fd034 ; - cpu->revidr =0x00000000 ; - cpu->reset_fpsid =0x41034070 ; - cpu->isar.mvfr0 =0x10110222 ; - cpu->isar.mvfr1 =0x12111111 ; - cpu->isar.mvfr2 =0x00000043 ; - cpu->ctr =0x84448004 ;/* L1Ip = VIPT */ - cpu->reset_sctlr =0x00c50838 ; - cpu->isar.id_pfr0 =0x00000131 ; - cpu->isar.id_pfr1 =0x00011011 ; - cpu->isar.id_dfr0 =0x03010066 ; - cpu->id_afr0 =0x00000000 ; - cpu->isar.id_mmfr0 =0x10101105 ; - cpu->isar.id_mmfr1 =0x40000000 ; - cpu->isar.id_mmfr2 =0x01260000 ; - cpu->isar.id_mmfr3 =0x02102211 ; - cpu->isar.id_isar0 =0x02101110 ; - cpu->isar.id_isar1 =0x13112111 ; - cpu->isar.id_isar2 =0x21232042 ; - cpu->isar.id_isar3 =0x01112131 ; - cpu->isar.id_isar4 =0x00011142 ; - cpu->isar.id_isar5 =0x00011121 ; - cpu->isar.id_isar6 =0 ; - cpu->isar.id_aa64pfr0 =0x00002222 ; - cpu->isar.id_aa64dfr0 =0x10305106 ; - cpu->isar.id_aa64isar0 =0x00011120 ; - cpu->isar.id_aa64mmfr0 =0x00001122 ;/* 40 bit physical addr */ - cpu->isar.dbgdidr =0x3516d000 ; - cpu->isar.dbgdevid =0x00110f13 ; - cpu->isar.dbgdevid1 =0x1 ; - cpu->isar.reset_pmcr_el0 =0x41033000 ; - cpu->clidr =0x0a200023 ; - cpu->ccsidr[0 ] =0x700fe01a ;/* 32KB L1 dcache */ - cpu->ccsidr[1 ] =0x201fe00a ;/* 32KB L1 icache */ - cpu->ccsidr[2 ] =0x707fe07a ;/* 1024KB L2 cache */ - cpu->dcz_blocksize =4 ;/* 64 bytes */ - cpu->gic_num_lrs =4 ; - cpu->gic_vpribits =5 ; - cpu->gic_vprebits =5 ; - cpu->gic_pribits =5 ; -define_cortex_a72_a57_a53_cp_reginfo (cpu); -} - -static void aarch64_a72_initfn (Object *obj) -{ -ARMCPU *cpu =ARM_CPU (obj); - - cpu->dtb_compatible ="arm,cortex-a72" ; -set_feature (&cpu->env,ARM_FEATURE_V8 ); -set_feature (&cpu->env,ARM_FEATURE_NEON ); -set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); -set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); -set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); -set_feature (&cpu->env,ARM_FEATURE_EL2 ); -set_feature (&cpu->env,ARM_FEATURE_EL3 ); -set_feature (&cpu->env,ARM_FEATURE_PMU ); - cpu->midr =0x410fd083 ; - cpu->revidr =0x00000000 ; - cpu->reset_fpsid =0x41034080 ; - cpu->isar.mvfr0 =0x10110222 ; - cpu->isar.mvfr1 =0x12111111 ; - cpu->isar.mvfr2 =0x00000043 ; - cpu->ctr =0x8444c004 ; - cpu->reset_sctlr =0x00c50838 ; - cpu->isar.id_pfr0 =0x00000131 ; - cpu->isar.id_pfr1 =0x00011011 ; - cpu->isar.id_dfr0 =0x03010066 ; - cpu->id_afr0 =0x00000000 ; - cpu->isar.id_mmfr0 =0x10201105 ; - cpu->isar.id_mmfr1 =0x40000000 ; - cpu->isar.id_mmfr2 =0x01260000 ; - cpu->isar.id_mmfr3 =0x02102211 ; - cpu->isar.id_isar0 =0x02101110 ; - cpu->isar.id_isar1 =0x13112111 ; - cpu->isar.id_isar2 =0x21232042 ; - cpu->isar.id_isar3 =0x01112131 ; - cpu->isar.id_isar4 =0x00011142 ; - cpu->isar.id_isar5 =0x00011121 ; - cpu->isar.id_aa64pfr0 =0x00002222 ; - cpu->isar.id_aa64dfr0 =0x10305106 ; - cpu->isar.id_aa64isar0 =0x00011120 ; - cpu->isar.id_aa64mmfr0 =0x00001124 ; - cpu->isar.dbgdidr =0x3516d000 ; - cpu->isar.dbgdevid =0x01110f13 ; - cpu->isar.dbgdevid1 =0x2 ; - cpu->isar.reset_pmcr_el0 =0x41023000 ; - cpu->clidr =0x0a200023 ; - cpu->ccsidr[0 ] =0x701fe00a ;/* 32KB L1 dcache */ - cpu->ccsidr[1 ] =0x201fe012 ;/* 48KB L1 icache */ - cpu->ccsidr[2 ] =0x707fe07a ;/* 1MB L2 cache */ - cpu->dcz_blocksize =4 ;/* 64 bytes */ - cpu->gic_num_lrs =4 ; - cpu->gic_vpribits =5 ; - cpu->gic_vprebits =5 ; - cpu->gic_pribits =5 ; -define_cortex_a72_a57_a53_cp_reginfo (cpu); -} - -static void aarch64_a76_initfn (Object *obj) -{ -ARMCPU *cpu =ARM_CPU (obj); - - cpu->dtb_compatible ="arm,cortex-a76" ; -set_feature (&cpu->env,ARM_FEATURE_V8 ); -set_feature (&cpu->env,ARM_FEATURE_NEON ); -set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); -set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); -set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); -set_feature (&cpu->env,ARM_FEATURE_EL2 ); -set_feature (&cpu->env,ARM_FEATURE_EL3 ); -set_feature (&cpu->env,ARM_FEATURE_PMU ); - -/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; - cpu->ctr =0x8444C004 ; - cpu->dcz_blocksize =4 ; - cpu->isar.id_aa64dfr0 =0x0000000010305408ull ; - cpu->isar.id_aa64isar0 =0x0000100010211120ull ; - cpu->isar.id_aa64isar1 =0x0000000000100001ull ; - cpu->isar.id_aa64mmfr0 =0x0000000000101122ull ; - cpu->isar.id_aa64mmfr1 =0x0000000010212122ull ; - cpu->isar.id_aa64mmfr2 =0x0000000000001011ull ; - cpu->isar.id_aa64pfr0 =0x1100000010111112ull ;/* GIC filled in later */ - cpu->isar.id_aa64pfr1 =0x0000000000000010ull ; - cpu->id_afr0 =0x00000000 ; - cpu->isar.id_dfr0 =0x04010088 ; - cpu->isar.id_isar0 =0x02101110 ; - cpu->isar.id_isar1 =0x13112111 ; - cpu->isar.id_isar2 =0x21232042 ; - cpu->isar.id_isar3 =0x01112131 ; - cpu->isar.id_isar4 =0x00010142 ; - cpu->isar.id_isar5 =0x01011121 ; - cpu->isar.id_isar6 =0x00000010 ; - cpu->isar.id_mmfr0 =0x10201105 ; - cpu->isar.id_mmfr1 =0x40000000 ; - cpu->isar.id_mmfr2 =0x01260000 ; - cpu->isar.id_mmfr3 =0x02122211 ; - cpu->isar.id_mmfr4 =0x00021110 ; - cpu->isar.id_pfr0 =0x10010131 ; - cpu->isar.id_pfr1 =0x00010000 ;/* GIC filled in later */ - cpu->isar.id_pfr2 =0x00000011 ; - cpu->midr =0x414fd0b1 ;/* r4p1 */ - cpu->revidr =0 ; - -/* From B2.18 CCSIDR_EL1 */ - cpu->ccsidr[0 ] =0x701fe01a ;/* 64KB L1 dcache */ - cpu->ccsidr[1 ] =0x201fe01a ;/* 64KB L1 icache */ - cpu->ccsidr[2 ] =0x707fe03a ;/* 512KB L2 cache */ - -/* From B2.93 SCTLR_EL3 */ - cpu->reset_sctlr =0x30c50838 ; - -/* From B4.23 ICH_VTR_EL2 */ - cpu->gic_num_lrs =4 ; - cpu->gic_vpribits =5 ; - cpu->gic_vprebits =5 ; - cpu->gic_pribits =5 ; - -/* From B5.1 AdvSIMD AArch64 register summary */ - cpu->isar.mvfr0 =0x10110222 ; - cpu->isar.mvfr1 =0x13211111 ; - cpu->isar.mvfr2 =0x00000043 ; - -/* From D5.1 AArch64 PMU register summary */ - cpu->isar.reset_pmcr_el0 =0x410b3000 ; -} - -static void aarch64_neoverse_n1_initfn (Object *obj) -{ -ARMCPU *cpu =ARM_CPU (obj); - - cpu->dtb_compatible ="arm,neoverse-n1" ; -set_feature (&cpu->env,ARM_FEATURE_V8 ); -set_feature (&cpu->env,ARM_FEATURE_NEON ); -set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); -set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); -set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); -set_feature (&cpu->env,ARM_FEATURE_EL2 ); -set_feature (&cpu->env,ARM_FEATURE_EL3 ); -set_feature (&cpu->env,ARM_FEATURE_PMU ); - -/* Ordered by B2.4 AArch64 registers by functional group */ - cpu->clidr =0x82000023 ; - cpu->ctr =0x8444c004 ; - cpu->dcz_blocksize =4 ; - cpu->isar.id_aa64dfr0 =0x0000000110305408ull ; - cpu->isar.id_aa64isar0 =0x0000100010211120ull ; - cpu->isar.id_aa64isar1 =0x0000000000100001ull ; - cpu->isar.id_aa64mmfr0 =0x0000000000101125ull ; - cpu->isar.id_aa64mmfr1 =0x0000000010212122ull ; - cpu->isar.id_aa64mmfr2 =0x0000000000001011ull ; - cpu->isar.id_aa64pfr0 =0x1100000010111112ull ;/* GIC filled in later */ - cpu->isar.id_aa64pfr1 =0x0000000000000020ull ; - cpu->id_afr0 =0x00000000 ; - cpu->isar.id_dfr0 =0x04010088 ; - cpu->isar.id_isar0 =0x02101110 ; - cpu->isar.id_isar1 =0x13112111 ; - cpu->isar.id_isar2 =0x21232042 ; - cpu->isar.id_isar3 =0x01112131 ; - cpu->isar.id_isar4 =0x00010142 ; - cpu->isar.id_isar5 =0x01011121 ; - cpu->isar.id_isar6 =0x00000010 ; - cpu->isar.id_mmfr0 =0x10201105 ; - cpu->isar.id_mmfr1 =0x40000000 ; - cpu->isar.id_mmfr2 =0x01260000 ; - cpu->isar.id_mmfr3 =0x02122211 ; - cpu->isar.id_mmfr4 =0x00021110 ; - cpu->isar.id_pfr0 =0x10010131 ; - cpu->isar.id_pfr1 =0x00010000 ;/* GIC filled in later */ - cpu->isar.id_pfr2 =0x00000011 ; - cpu->midr =0x414fd0c1 ;/* r4p1 */ - cpu->revidr =0 ; - -/* From B2.23 CCSIDR_EL1 */ - cpu->ccsidr[0 ] =0x701fe01a ;/* 64KB L1 dcache */ - cpu->ccsidr[1 ] =0x201fe01a ;/* 64KB L1 icache */ - cpu->ccsidr[2 ] =0x70ffe03a ;/* 1MB L2 cache */ - -/* From B2.98 SCTLR_EL3 */ - cpu->reset_sctlr =0x30c50838 ; - -/* From B4.23 ICH_VTR_EL2 */ - cpu->gic_num_lrs =4 ; - cpu->gic_vpribits =5 ; - cpu->gic_vprebits =5 ; - cpu->gic_pribits =5 ; - -/* From B5.1 AdvSIMD AArch64 register summary */ - cpu->isar.mvfr0 =0x10110222 ; - cpu->isar.mvfr1 =0x13211111 ; - cpu->isar.mvfr2 =0x00000043 ; - -/* From D5.1 AArch64 PMU register summary */ - cpu->isar.reset_pmcr_el0 =0x410c3000 ; -} -void arm_cpu_sve_finalize (ARMCPU *cpu,Error **errp) {/*
@@ -985,6 +678,362 @@ void arm_cpu_lpa2_finalize(ARMCPU *cpu, Error **errp) cpu->isar.id_aa64mmfr0 = t; } +static void aarch64_a57_initfn (Object *obj) +{ +ARMCPU *cpu =ARM_CPU (obj); + + cpu->dtb_compatible ="arm,cortex-a57" ; +set_feature (&cpu->env,ARM_FEATURE_V8 ); +set_feature (&cpu->env,ARM_FEATURE_NEON ); +set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); +set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); +set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); +set_feature (&cpu->env,ARM_FEATURE_EL2 ); +set_feature (&cpu->env,ARM_FEATURE_EL3 ); +set_feature (&cpu->env,ARM_FEATURE_PMU ); + cpu->kvm_target =QEMU_KVM_ARM_TARGET_CORTEX_A57 ; + cpu->midr =0x411fd070 ; + cpu->revidr =0x00000000 ; + cpu->reset_fpsid =0x41034070 ; + cpu->isar.mvfr0 =0x10110222 ; + cpu->isar.mvfr1 =0x12111111 ; + cpu->isar.mvfr2 =0x00000043 ; + cpu->ctr =0x8444c004 ; + cpu->reset_sctlr =0x00c50838 ; + cpu->isar.id_pfr0 =0x00000131 ; + cpu->isar.id_pfr1 =0x00011011 ; + cpu->isar.id_dfr0 =0x03010066 ; + cpu->id_afr0 =0x00000000 ; + cpu->isar.id_mmfr0 =0x10101105 ; + cpu->isar.id_mmfr1 =0x40000000 ; + cpu->isar.id_mmfr2 =0x01260000 ; + cpu->isar.id_mmfr3 =0x02102211 ; + cpu->isar.id_isar0 =0x02101110 ; + cpu->isar.id_isar1 =0x13112111 ; + cpu->isar.id_isar2 =0x21232042 ; + cpu->isar.id_isar3 =0x01112131 ; + cpu->isar.id_isar4 =0x00011142 ; + cpu->isar.id_isar5 =0x00011121 ; + cpu->isar.id_isar6 =0 ; + cpu->isar.id_aa64pfr0 =0x00002222 ; + cpu->isar.id_aa64dfr0 =0x10305106 ; + cpu->isar.id_aa64isar0 =0x00011120 ; + cpu->isar.id_aa64mmfr0 =0x00001124 ; + cpu->isar.dbgdidr =0x3516d000 ; + cpu->isar.dbgdevid =0x01110f13 ; + cpu->isar.dbgdevid1 =0x2 ; + cpu->isar.reset_pmcr_el0 =0x41013000 ; + cpu->clidr =0x0a200023 ; + cpu->ccsidr[0 ] =0x701fe00a ;/* 32KB L1 dcache */ + cpu->ccsidr[1 ] =0x201fe012 ;/* 48KB L1 icache */ + cpu->ccsidr[2 ] =0x70ffe07a ;/* 2048KB L2 cache */ + cpu->dcz_blocksize =4 ;/* 64 bytes */ + cpu->gic_num_lrs =4 ; + cpu->gic_vpribits =5 ; + cpu->gic_vprebits =5 ; + cpu->gic_pribits =5 ; +define_cortex_a72_a57_a53_cp_reginfo (cpu); +} + +static void aarch64_a53_initfn (Object *obj) +{ +ARMCPU *cpu =ARM_CPU (obj); + + cpu->dtb_compatible ="arm,cortex-a53" ; +set_feature (&cpu->env,ARM_FEATURE_V8 ); +set_feature (&cpu->env,ARM_FEATURE_NEON ); +set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); +set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); +set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); +set_feature (&cpu->env,ARM_FEATURE_EL2 ); +set_feature (&cpu->env,ARM_FEATURE_EL3 ); +set_feature (&cpu->env,ARM_FEATURE_PMU ); + cpu->kvm_target =QEMU_KVM_ARM_TARGET_CORTEX_A53 ; + cpu->midr =0x410fd034 ; + cpu->revidr =0x00000000 ; + cpu->reset_fpsid =0x41034070 ; + cpu->isar.mvfr0 =0x10110222 ; + cpu->isar.mvfr1 =0x12111111 ; + cpu->isar.mvfr2 =0x00000043 ; + cpu->ctr =0x84448004 ;/* L1Ip = VIPT */ + cpu->reset_sctlr =0x00c50838 ; + cpu->isar.id_pfr0 =0x00000131 ; + cpu->isar.id_pfr1 =0x00011011 ; + cpu->isar.id_dfr0 =0x03010066 ; + cpu->id_afr0 =0x00000000 ; + cpu->isar.id_mmfr0 =0x10101105 ; + cpu->isar.id_mmfr1 =0x40000000 ; + cpu->isar.id_mmfr2 =0x01260000 ; + cpu->isar.id_mmfr3 =0x02102211 ; + cpu->isar.id_isar0 =0x02101110 ; + cpu->isar.id_isar1 =0x13112111 ; + cpu->isar.id_isar2 =0x21232042 ; + cpu->isar.id_isar3 =0x01112131 ; + cpu->isar.id_isar4 =0x00011142 ; + cpu->isar.id_isar5 =0x00011121 ; + cpu->isar.id_isar6 =0 ; + cpu->isar.id_aa64pfr0 =0x00002222 ; + cpu->isar.id_aa64dfr0 =0x10305106 ; + cpu->isar.id_aa64isar0 =0x00011120 ; + cpu->isar.id_aa64mmfr0 =0x00001122 ;/* 40 bit physical addr */ + cpu->isar.dbgdidr =0x3516d000 ; + cpu->isar.dbgdevid =0x00110f13 ; + cpu->isar.dbgdevid1 =0x1 ; + cpu->isar.reset_pmcr_el0 =0x41033000 ; + cpu->clidr =0x0a200023 ; + cpu->ccsidr[0 ] =0x700fe01a ;/* 32KB L1 dcache */ + cpu->ccsidr[1 ] =0x201fe00a ;/* 32KB L1 icache */ + cpu->ccsidr[2 ] =0x707fe07a ;/* 1024KB L2 cache */ + cpu->dcz_blocksize =4 ;/* 64 bytes */ + cpu->gic_num_lrs =4 ; + cpu->gic_vpribits =5 ; + cpu->gic_vprebits =5 ; + cpu->gic_pribits =5 ; +define_cortex_a72_a57_a53_cp_reginfo (cpu); +} + +static void aarch64_a72_initfn (Object *obj) +{ +ARMCPU *cpu =ARM_CPU (obj); + + cpu->dtb_compatible ="arm,cortex-a72" ; +set_feature (&cpu->env,ARM_FEATURE_V8 ); +set_feature (&cpu->env,ARM_FEATURE_NEON ); +set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); +set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); +set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); +set_feature (&cpu->env,ARM_FEATURE_EL2 ); +set_feature (&cpu->env,ARM_FEATURE_EL3 ); +set_feature (&cpu->env,ARM_FEATURE_PMU ); + cpu->midr =0x410fd083 ; + cpu->revidr =0x00000000 ; + cpu->reset_fpsid =0x41034080 ; + cpu->isar.mvfr0 =0x10110222 ; + cpu->isar.mvfr1 =0x12111111 ; + cpu->isar.mvfr2 =0x00000043 ; + cpu->ctr =0x8444c004 ; + cpu->reset_sctlr =0x00c50838 ; + cpu->isar.id_pfr0 =0x00000131 ; + cpu->isar.id_pfr1 =0x00011011 ; + cpu->isar.id_dfr0 =0x03010066 ; + cpu->id_afr0 =0x00000000 ; + cpu->isar.id_mmfr0 =0x10201105 ; + cpu->isar.id_mmfr1 =0x40000000 ; + cpu->isar.id_mmfr2 =0x01260000 ; + cpu->isar.id_mmfr3 =0x02102211 ; + cpu->isar.id_isar0 =0x02101110 ; + cpu->isar.id_isar1 =0x13112111 ; + cpu->isar.id_isar2 =0x21232042 ; + cpu->isar.id_isar3 =0x01112131 ; + cpu->isar.id_isar4 =0x00011142 ; + cpu->isar.id_isar5 =0x00011121 ; + cpu->isar.id_aa64pfr0 =0x00002222 ; + cpu->isar.id_aa64dfr0 =0x10305106 ; + cpu->isar.id_aa64isar0 =0x00011120 ; + cpu->isar.id_aa64mmfr0 =0x00001124 ; + cpu->isar.dbgdidr =0x3516d000 ; + cpu->isar.dbgdevid =0x01110f13 ; + cpu->isar.dbgdevid1 =0x2 ; + cpu->isar.reset_pmcr_el0 =0x41023000 ; + cpu->clidr =0x0a200023 ; + cpu->ccsidr[0 ] =0x701fe00a ;/* 32KB L1 dcache */ + cpu->ccsidr[1 ] =0x201fe012 ;/* 48KB L1 icache */ + cpu->ccsidr[2 ] =0x707fe07a ;/* 1MB L2 cache */ + cpu->dcz_blocksize =4 ;/* 64 bytes */ + cpu->gic_num_lrs =4 ; + cpu->gic_vpribits =5 ; + cpu->gic_vprebits =5 ; + cpu->gic_pribits =5 ; +define_cortex_a72_a57_a53_cp_reginfo (cpu); +} + +static void aarch64_a76_initfn (Object *obj) +{ +ARMCPU *cpu =ARM_CPU (obj); + + cpu->dtb_compatible ="arm,cortex-a76" ; +set_feature (&cpu->env,ARM_FEATURE_V8 ); +set_feature (&cpu->env,ARM_FEATURE_NEON ); +set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); +set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); +set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); +set_feature (&cpu->env,ARM_FEATURE_EL2 ); +set_feature (&cpu->env,ARM_FEATURE_EL3 ); +set_feature (&cpu->env,ARM_FEATURE_PMU ); + +/* Ordered by B2.4 AArch64 registers by functional group */ + cpu->clidr =0x82000023 ; + cpu->ctr =0x8444C004 ; + cpu->dcz_blocksize =4 ; + cpu->isar.id_aa64dfr0 =0x0000000010305408ull ; + cpu->isar.id_aa64isar0 =0x0000100010211120ull ; + cpu->isar.id_aa64isar1 =0x0000000000100001ull ; + cpu->isar.id_aa64mmfr0 =0x0000000000101122ull ; + cpu->isar.id_aa64mmfr1 =0x0000000010212122ull ; + cpu->isar.id_aa64mmfr2 =0x0000000000001011ull ; + cpu->isar.id_aa64pfr0 =0x1100000010111112ull ;/* GIC filled in later */ + cpu->isar.id_aa64pfr1 =0x0000000000000010ull ; + cpu->id_afr0 =0x00000000 ; + cpu->isar.id_dfr0 =0x04010088 ; + cpu->isar.id_isar0 =0x02101110 ; + cpu->isar.id_isar1 =0x13112111 ; + cpu->isar.id_isar2 =0x21232042 ; + cpu->isar.id_isar3 =0x01112131 ; + cpu->isar.id_isar4 =0x00010142 ; + cpu->isar.id_isar5 =0x01011121 ; + cpu->isar.id_isar6 =0x00000010 ; + cpu->isar.id_mmfr0 =0x10201105 ; + cpu->isar.id_mmfr1 =0x40000000 ; + cpu->isar.id_mmfr2 =0x01260000 ; + cpu->isar.id_mmfr3 =0x02122211 ; + cpu->isar.id_mmfr4 =0x00021110 ; + cpu->isar.id_pfr0 =0x10010131 ; + cpu->isar.id_pfr1 =0x00010000 ;/* GIC filled in later */ + cpu->isar.id_pfr2 =0x00000011 ; + cpu->midr =0x414fd0b1 ;/* r4p1 */ + cpu->revidr =0 ; + +/* From B2.18 CCSIDR_EL1 */ + cpu->ccsidr[0 ] =0x701fe01a ;/* 64KB L1 dcache */ + cpu->ccsidr[1 ] =0x201fe01a ;/* 64KB L1 icache */ + cpu->ccsidr[2 ] =0x707fe03a ;/* 512KB L2 cache */ + +/* From B2.93 SCTLR_EL3 */ + cpu->reset_sctlr =0x30c50838 ; + +/* From B4.23 ICH_VTR_EL2 */ + cpu->gic_num_lrs =4 ; + cpu->gic_vpribits =5 ; + cpu->gic_vprebits =5 ; + cpu->gic_pribits =5 ; + +/* From B5.1 AdvSIMD AArch64 register summary */ + cpu->isar.mvfr0 =0x10110222 ; + cpu->isar.mvfr1 =0x13211111 ; + cpu->isar.mvfr2 =0x00000043 ; + +/* From D5.1 AArch64 PMU register summary */ + cpu->isar.reset_pmcr_el0 =0x410b3000 ; +} + +static void aarch64_a64fx_initfn (Object *obj) +{ +ARMCPU *cpu =ARM_CPU (obj); + + cpu->dtb_compatible ="arm,a64fx" ; +set_feature (&cpu->env,ARM_FEATURE_V8 ); +set_feature (&cpu->env,ARM_FEATURE_NEON ); +set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); +set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); +set_feature (&cpu->env,ARM_FEATURE_EL2 ); +set_feature (&cpu->env,ARM_FEATURE_EL3 ); +set_feature (&cpu->env,ARM_FEATURE_PMU ); + cpu->midr =0x461f0010 ; + cpu->revidr =0x00000000 ; + cpu->ctr =0x86668006 ; + cpu->reset_sctlr =0x30000180 ; + cpu->isar.id_aa64pfr0 =0x0000000101111111 ;/* No RAS Extensions */ + cpu->isar.id_aa64pfr1 =0x0000000000000000 ; + cpu->isar.id_aa64dfr0 =0x0000000010305408 ; + cpu->isar.id_aa64dfr1 =0x0000000000000000 ; + cpu->id_aa64afr0 =0x0000000000000000 ; + cpu->id_aa64afr1 =0x0000000000000000 ; + cpu->isar.id_aa64mmfr0 =0x0000000000001122 ; + cpu->isar.id_aa64mmfr1 =0x0000000011212100 ; + cpu->isar.id_aa64mmfr2 =0x0000000000001011 ; + cpu->isar.id_aa64isar0 =0x0000000010211120 ; + cpu->isar.id_aa64isar1 =0x0000000000010001 ; + cpu->isar.id_aa64zfr0 =0x0000000000000000 ; + cpu->clidr =0x0000000080000023 ; + cpu->ccsidr[0 ] =0x7007e01c ;/* 64KB L1 dcache */ + cpu->ccsidr[1 ] =0x2007e01c ;/* 64KB L1 icache */ + cpu->ccsidr[2 ] =0x70ffe07c ;/* 8MB L2 cache */ + cpu->dcz_blocksize =6 ;/* 256 bytes */ + cpu->gic_num_lrs =4 ; + cpu->gic_vpribits =5 ; + cpu->gic_vprebits =5 ; + cpu->gic_pribits =5 ; + +/* The A64FX supports only 128, 256 and 512 bit vector lengths */ +aarch64_add_sve_properties (obj); + cpu->sve_vq.supported = (1 <<0 )/* 128bit */ + | (1 <<1 )/* 256bit */ + | (1 <<3 );/* 512bit */ + + cpu->isar.reset_pmcr_el0 =0x46014040 ; + +/* TODO: Add A64FX specific HPC extension registers */ +} + +static void aarch64_neoverse_n1_initfn (Object *obj) +{ +ARMCPU *cpu =ARM_CPU (obj); + + cpu->dtb_compatible ="arm,neoverse-n1" ; +set_feature (&cpu->env,ARM_FEATURE_V8 ); +set_feature (&cpu->env,ARM_FEATURE_NEON ); +set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); +set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); +set_feature (&cpu->env,ARM_FEATURE_CBAR_RO ); +set_feature (&cpu->env,ARM_FEATURE_EL2 ); +set_feature (&cpu->env,ARM_FEATURE_EL3 ); +set_feature (&cpu->env,ARM_FEATURE_PMU ); + +/* Ordered by B2.4 AArch64 registers by functional group */ + cpu->clidr =0x82000023 ; + cpu->ctr =0x8444c004 ; + cpu->dcz_blocksize =4 ; + cpu->isar.id_aa64dfr0 =0x0000000110305408ull ; + cpu->isar.id_aa64isar0 =0x0000100010211120ull ; + cpu->isar.id_aa64isar1 =0x0000000000100001ull ; + cpu->isar.id_aa64mmfr0 =0x0000000000101125ull ; + cpu->isar.id_aa64mmfr1 =0x0000000010212122ull ; + cpu->isar.id_aa64mmfr2 =0x0000000000001011ull ; + cpu->isar.id_aa64pfr0 =0x1100000010111112ull ;/* GIC filled in later */ + cpu->isar.id_aa64pfr1 =0x0000000000000020ull ; + cpu->id_afr0 =0x00000000 ; + cpu->isar.id_dfr0 =0x04010088 ; + cpu->isar.id_isar0 =0x02101110 ; + cpu->isar.id_isar1 =0x13112111 ; + cpu->isar.id_isar2 =0x21232042 ; + cpu->isar.id_isar3 =0x01112131 ; + cpu->isar.id_isar4 =0x00010142 ; + cpu->isar.id_isar5 =0x01011121 ; + cpu->isar.id_isar6 =0x00000010 ; + cpu->isar.id_mmfr0 =0x10201105 ; + cpu->isar.id_mmfr1 =0x40000000 ; + cpu->isar.id_mmfr2 =0x01260000 ; + cpu->isar.id_mmfr3 =0x02122211 ; + cpu->isar.id_mmfr4 =0x00021110 ; + cpu->isar.id_pfr0 =0x10010131 ; + cpu->isar.id_pfr1 =0x00010000 ;/* GIC filled in later */ + cpu->isar.id_pfr2 =0x00000011 ; + cpu->midr =0x414fd0c1 ;/* r4p1 */ + cpu->revidr =0 ; + +/* From B2.23 CCSIDR_EL1 */ + cpu->ccsidr[0 ] =0x701fe01a ;/* 64KB L1 dcache */ + cpu->ccsidr[1 ] =0x201fe01a ;/* 64KB L1 icache */ + cpu->ccsidr[2 ] =0x70ffe03a ;/* 1MB L2 cache */ + +/* From B2.98 SCTLR_EL3 */ + cpu->reset_sctlr =0x30c50838 ; + +/* From B4.23 ICH_VTR_EL2 */ + cpu->gic_num_lrs =4 ; + cpu->gic_vpribits =5 ; + cpu->gic_vprebits =5 ; + cpu->gic_pribits =5 ; + +/* From B5.1 AdvSIMD AArch64 register summary */ + cpu->isar.mvfr0 =0x10110222 ; + cpu->isar.mvfr1 =0x13211111 ; + cpu->isar.mvfr2 =0x00000043 ; + +/* From D5.1 AArch64 PMU register summary */ + cpu->isar.reset_pmcr_el0 =0x410c3000 ; +} +static void aarch64_host_initfn (Object *obj) {#if defined(CONFIG_KVM )
@@ -1188,55 +1237,6 @@ static void aarch64_max_initfn(Object *obj)qdev_property_add_static (DEVICE (obj), &arm_cpu_lpa2_property); } -static void aarch64_a64fx_initfn (Object *obj) -{ -ARMCPU *cpu =ARM_CPU (obj); - - cpu->dtb_compatible ="arm,a64fx" ; -set_feature (&cpu->env,ARM_FEATURE_V8 ); -set_feature (&cpu->env,ARM_FEATURE_NEON ); -set_feature (&cpu->env,ARM_FEATURE_GENERIC_TIMER ); -set_feature (&cpu->env,ARM_FEATURE_AARCH64 ); -set_feature (&cpu->env,ARM_FEATURE_EL2 ); -set_feature (&cpu->env,ARM_FEATURE_EL3 ); -set_feature (&cpu->env,ARM_FEATURE_PMU ); - cpu->midr =0x461f0010 ; - cpu->revidr =0x00000000 ; - cpu->ctr =0x86668006 ; - cpu->reset_sctlr =0x30000180 ; - cpu->isar.id_aa64pfr0 =0x0000000101111111 ;/* No RAS Extensions */ - cpu->isar.id_aa64pfr1 =0x0000000000000000 ; - cpu->isar.id_aa64dfr0 =0x0000000010305408 ; - cpu->isar.id_aa64dfr1 =0x0000000000000000 ; - cpu->id_aa64afr0 =0x0000000000000000 ; - cpu->id_aa64afr1 =0x0000000000000000 ; - cpu->isar.id_aa64mmfr0 =0x0000000000001122 ; - cpu->isar.id_aa64mmfr1 =0x0000000011212100 ; - cpu->isar.id_aa64mmfr2 =0x0000000000001011 ; - cpu->isar.id_aa64isar0 =0x0000000010211120 ; - cpu->isar.id_aa64isar1 =0x0000000000010001 ; - cpu->isar.id_aa64zfr0 =0x0000000000000000 ; - cpu->clidr =0x0000000080000023 ; - cpu->ccsidr[0 ] =0x7007e01c ;/* 64KB L1 dcache */ - cpu->ccsidr[1 ] =0x2007e01c ;/* 64KB L1 icache */ - cpu->ccsidr[2 ] =0x70ffe07c ;/* 8MB L2 cache */ - cpu->dcz_blocksize =6 ;/* 256 bytes */ - cpu->gic_num_lrs =4 ; - cpu->gic_vpribits =5 ; - cpu->gic_vprebits =5 ; - cpu->gic_pribits =5 ; - -/* The A64FX supports only 128, 256 and 512 bit vector lengths */ -aarch64_add_sve_properties (obj); - cpu->sve_vq.supported = (1 <<0 )/* 128bit */ - | (1 <<1 )/* 256bit */ - | (1 <<3 );/* 512bit */ - - cpu->isar.reset_pmcr_el0 =0x46014040 ; - -/* TODO: Add A64FX specific HPC extension registers */ -} -static const ARMCPUInfo aarch64_cpus[] = { { .name ="cortex-a35" , .initfn = aarch64_a35_initfn }, { .name ="cortex-a57" , .initfn = aarch64_a57_initfn },
Signature · 1 line
2.25.1
[PULL 05/10] hw/arm/xlnx-zynqmp: Connect ZynqMP's USB controllers
In reply to Peter MaydellFrom: Francisco Iglesias <[email protected]>
Connect ZynqMP's USB controllers.
Message-id: [email protected]
--- include/hw/arm/xlnx-zynqmp.h | 3 +++ hw/arm/xlnx-zynqmp.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)
include/hw/arm/xlnx-zynqmp.h +3 -0
@@ -42,6 +42,7 @@#include "hw/misc/xlnx-zynqmp-apu-ctrl.h" #include "hw/misc/xlnx-zynqmp-crf.h" #include "hw/timer/cadence_ttc.h" +#include "hw/usb/hcd-dwc3.h" #define TYPE_XLNX_ZYNQMP "xlnx-zynqmp"OBJECT_DECLARE_SIMPLE_TYPE (XlnxZynqMPState,XLNX_ZYNQMP )
@@ -56,6 +57,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPState, XLNX_ZYNQMP)#define XLNX_ZYNQMP_NUM_SPIS 2#define XLNX_ZYNQMP_NUM_GDMA_CH 8#define XLNX_ZYNQMP_NUM_ADMA_CH 8 +#define XLNX_ZYNQMP_NUM_USB 2#define XLNX_ZYNQMP_NUM_QSPI_BUS 2#define XLNX_ZYNQMP_NUM_QSPI_BUS_CS 2
@@ -132,6 +134,7 @@ struct XlnxZynqMPState {XlnxZynqMPAPUCtrl apu_ctrl;XlnxZynqMPCRF crf;CadenceTTCState ttc[XLNX_ZYNQMP_NUM_TTC ]; +USBDWC3 usb[XLNX_ZYNQMP_NUM_USB ];char *boot_cpu;ARMCPU *boot_cpu_ptr;
hw/arm/xlnx-zynqmp.c +36 -0
@@ -143,6 +143,14 @@ static const int adma_ch_intr[XLNX_ZYNQMP_NUM_ADMA_CH] = {77 ,78 ,79 ,80 ,81 ,82 ,83 ,84 }; +static const uint64_t usb_addr[XLNX_ZYNQMP_NUM_USB ] = { +0xFE200000 ,0xFE300000 +}; + +static const int usb_intr[XLNX_ZYNQMP_NUM_USB ] = { +65 ,70 +}; + typedef struct XlnxZynqMPGICRegion { int region_index; uint32_t address;
@@ -428,6 +436,10 @@ static void xlnx_zynqmp_init(Object *obj)object_initialize_child (obj,"qspi-dma" , &s->qspi_dma,TYPE_XLNX_CSU_DMA );object_initialize_child (obj,"qspi-irq-orgate" , &s->qspi_irq_orgate,TYPE_OR_IRQ ); + +for (i =0 ; i <XLNX_ZYNQMP_NUM_USB ; i++) { +object_initialize_child (obj,"usb[*]" , &s->usb[i],TYPE_USB_DWC3 ); + } }static void xlnx_zynqmp_realize (DeviceState *dev,Error **errp)
@@ -814,6 +826,30 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)object_property_add_alias (OBJECT (s), bus_name,OBJECT (&s->qspi), target_bus); } + +for (i =0 ; i <XLNX_ZYNQMP_NUM_USB ; i++) { +if (!object_property_set_link (OBJECT (&s->usb[i].sysbus_xhci),"dma" , +OBJECT (system_memory), errp)) { +return ; + } + +qdev_prop_set_uint32 (DEVICE (&s->usb[i].sysbus_xhci),"intrs" ,4 ); +qdev_prop_set_uint32 (DEVICE (&s->usb[i].sysbus_xhci),"slots" ,2 ); + +if (!sysbus_realize (SYS_BUS_DEVICE (&s->usb[i]), errp)) { +return ; + } + +sysbus_mmio_map (SYS_BUS_DEVICE (&s->usb[i]),0 , usb_addr[i]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->usb[i].sysbus_xhci),0 , + gic_spi[usb_intr[i]]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->usb[i].sysbus_xhci),1 , + gic_spi[usb_intr[i] +1 ]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->usb[i].sysbus_xhci),2 , + gic_spi[usb_intr[i] +2 ]); +sysbus_connect_irq (SYS_BUS_DEVICE (&s->usb[i].sysbus_xhci),3 , + gic_spi[usb_intr[i] +3 ]); + } }static Property xlnx_zynqmp_props[] = {
Signature · 1 line
2.25.1
[PULL 03/10] target/arm: Update SDCR_VALID_MASK to include SCCD
In reply to Peter MaydellOur SDCR_VALID_MASK doesn't include all of the bits which are defined by the current architecture. In particular in commit 0b42f4fab9d3 we forgot to add SCCD, which meant that an AArch32 guest couldn't actually use the SCCD bit to disable counting in Secure state.
Add all the currently defined bits; we don't implement all of them, but this makes them be reads-as-written, which is architecturally valid and matches how we currently handle most of the others in the mask.
Message-id: [email protected]
--- target/arm/cpu.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
target/arm/cpu.h +7 -1
@@ -1334,11 +1334,15 @@ FIELD(CPTR_EL3, TTA, 20, 1) FIELD(CPTR_EL3, TAM, 30, 1) FIELD(CPTR_EL3, TCPAC, 31, 1) +#define MDCR_MTPME (1U << 28) +#define MDCR_TDCC (1U << 27)#define MDCR_HLP (1U << 26)/* MDCR_EL2 */ #define MDCR_SCCD (1U << 23)/* MDCR_EL3 */ #define MDCR_HCCD (1U << 23)/* MDCR_EL2 */ #define MDCR_EPMAD (1U << 21)#define MDCR_EDAD (1U << 20) +#define MDCR_TTRF (1U << 19) +#define MDCR_STE (1U << 18)/* MDCR_EL3 */ #define MDCR_SPME (1U << 17)/* MDCR_EL3 */ #define MDCR_HPMD (1U << 17)/* MDCR_EL2 */ #define MDCR_SDD (1U << 16)
@@ -1353,7 +1357,9 @@ FIELD(CPTR_EL3, TCPAC, 31, 1)#define MDCR_HPMN (0x1fU)/* Not all of the MDCR_EL3 bits are present in the 32-bit SDCR */ -#define SDCR_VALID_MASK (MDCR_EPMAD | MDCR_EDAD | MDCR_SPME | MDCR_SPD) +#define SDCR_VALID_MASK (MDCR_MTPME | MDCR_TDCC | MDCR_SCCD | \ + MDCR_EPMAD | MDCR_EDAD | MDCR_TTRF | \ + MDCR_STE | MDCR_SPME | MDCR_SPD)#define CPSR_M (0x1fU)#define CPSR_T (1U << 5)
Signature · 1 line
2.25.1
[PULL 08/10] hw/arm/virt: Use "msi-map" devicetree property for PCI
In reply to Peter MaydellFrom: Jean-Philippe Brucker <[email protected]>
The "msi-parent" property can be used on the PCI node when MSIs do not contain sideband data (device IDs) [1]. In QEMU, MSI transactions contain the requester ID, so the PCI node should use the "msi-map" property instead of "msi-parent". In our case the property describes an identity map between requester ID and sideband data.
This fixes a warning when passing the DTB generated by QEMU to dtc, following a recent change to the GICv3 node:
Warning (msi_parent_property): /pcie@10000000:msi-parent: property size (4) too small for cell size 1
[1] linux/Documentation/devicetree/bindings/pci/pci-msi.txt
Message-id: [email protected]
--- hw/arm/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/virt.c +2 -2
@@ -1490,8 +1490,8 @@ static void create_pcie(VirtMachineState *vms)qemu_fdt_setprop (ms->fdt, nodename,"dma-coherent" ,NULL ,0 );if (vms->msi_phandle) { -qemu_fdt_setprop_cells (ms->fdt, nodename,"msi-parent" , - vms->msi_phandle); +qemu_fdt_setprop_cells (ms->fdt, nodename,"msi-map" , +0 , vms->msi_phandle,0 ,0x10000 ); } qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg",
Signature · 1 line
2.25.1
[PULL 01/10] target/arm: Mark registers which call pmu_op_start() as ARM_CP_IO
In reply to Peter MaydellIn commit 01765386a888 we made some system register write functions call pmu_op_start()/pmu_op_finish(). This means that they now touch timers, so for icount to work these registers must have the ARM_CP_IO flag set.
This fixes a bug where when icount is enabled a guest that touches MDCR_EL3, MDCR_EL2, PMCNTENSET_EL0 or PMCNTENCLR_EL0 would cause QEMU to print an error message and exit, for example:
[ 2.495971] TCP: Hash tables configured (established 1024 bind 1024) [ 2.496213] UDP hash table entries: 256 (order: 1, 8192 bytes) [ 2.496386] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) [ 2.496917] NET: Registered protocol family 1
qemu-system-aarch64: Bad icount read
Message-id: [email protected]
--- target/arm/helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
target/arm/helper.c +6 -6
@@ -1927,12 +1927,12 @@ static const ARMCPRegInfo v7_cp_reginfo[] = {* or PL0_RO as appropriate and then check PMUSERENR in the helper fn. */ { .name = "PMCNTENSET", .cp = 15, .crn = 9, .crm = 12, .opc1 = 0, .opc2 = 1, - .access = PL0_RW, .type = ARM_CP_ALIAS, + .access = PL0_RW, .type = ARM_CP_ALIAS | ARM_CP_IO, .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmcnten), .writefn = pmcntenset_write, .accessfn = pmreg_access, .raw_writefn = raw_write }, - { .name = "PMCNTENSET_EL0", .state = ARM_CP_STATE_AA64, + { .name = "PMCNTENSET_EL0", .state = ARM_CP_STATE_AA64, .type = ARM_CP_IO, .opc0 = 3, .opc1 = 3, .crn = 9, .crm = 12, .opc2 = 1, .access = PL0_RW, .accessfn = pmreg_access, .fieldoffset = offsetof(CPUARMState, cp15.c9_pmcnten), .resetvalue = 0,
@@ -1942,11 +1942,11 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmcnten), .accessfn = pmreg_access, .writefn = pmcntenclr_write, - .type = ARM_CP_ALIAS }, + .type = ARM_CP_ALIAS | ARM_CP_IO }, { .name = "PMCNTENCLR_EL0", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 3, .crn = 9, .crm = 12, .opc2 = 2, .access = PL0_RW, .accessfn = pmreg_access, - .type = ARM_CP_ALIAS, + .type = ARM_CP_ALIAS | ARM_CP_IO, .fieldoffset = offsetof(CPUARMState, cp15.c9_pmcnten), .writefn = pmcntenclr_write }, { .name = "PMOVSR", .cp = 15, .crn = 9, .crm = 12, .opc1 = 0, .opc2 = 3,
@@ -5125,7 +5125,7 @@ static const ARMCPRegInfo v8_cp_reginfo[] = { .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 3, .opc2 = 1, .resetvalue = 0, .access = PL3_RW, .fieldoffset = offsetof(CPUARMState, cp15.mdcr_el3) }, - { .name = "SDCR", .type = ARM_CP_ALIAS, + { .name = "SDCR", .type = ARM_CP_ALIAS | ARM_CP_IO, .cp = 15, .opc1 = 0, .crn = 1, .crm = 3, .opc2 = 1, .access = PL1_RW, .accessfn = access_trap_aa32s_el1, .writefn = sdcr_write,
@@ -7832,7 +7832,7 @@ void register_cp_regs_for_features(ARMCPU *cpu)* value is MDCR_EL2.HPMN which should reset to the value of PMCR_EL0.N. */ ARMCPRegInfo mdcr_el2 = { - .name ="MDCR_EL2" , .state =ARM_CP_STATE_BOTH , + .name ="MDCR_EL2" , .state =ARM_CP_STATE_BOTH , .type =ARM_CP_IO , .opc0 =3 , .opc1 =4 , .crn =1 , .crm =1 , .opc2 =1 , .writefn = mdcr_el2_write, .access =PL2_RW , .resetvalue =pmu_num_counters (env),
Signature · 1 line
2.25.1
[PULL 09/10] hw/arm/virt: Fix devicetree warning about the SMMU node
In reply to Peter MaydellFrom: Jean-Philippe Brucker <[email protected]>
The SMMUv3 node isn't expected to have clock properties (unlike the SMMUv2). Fix the corresponding dt-validate warning:
smmuv3@9050000: 'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+' From schema: linux/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml
Message-id: [email protected]
--- hw/arm/virt.c | 2 -- 1 file changed, 2 deletions(-)
hw/arm/virt.c +0 -2
@@ -1361,8 +1361,6 @@ static void create_smmu(const VirtMachineState *vms,qemu_fdt_setprop (ms->fdt, node,"interrupt-names" , irq_names,sizeof (irq_names)); -qemu_fdt_setprop_cell (ms->fdt, node,"clocks" , vms->clock_phandle); -qemu_fdt_setprop_string (ms->fdt, node,"clock-names" ,"apb_pclk" );qemu_fdt_setprop (ms->fdt, node,"dma-coherent" ,NULL ,0 );qemu_fdt_setprop_cell (ms->fdt, node,"#iommu-cells" ,1 );
Signature · 1 line
2.25.1
[PULL 10/10] target/arm: mark SP_EL1 with ARM_CP_EL3_NO_EL2_KEEP
In reply to Peter MaydellFrom: Jerome Forissier <[email protected]>
SP_EL1 must be kept when EL3 is present but EL2 is not. Therefore mark it with ARM_CP_EL3_NO_EL2_KEEP.
Message-id: [email protected]
--- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/helper.c +1 -1
@@ -5088,7 +5088,7 @@ static const ARMCPRegInfo v8_cp_reginfo[] = { .fieldoffset = offsetof(CPUARMState, sp_el[0]) }, { .name = "SP_EL1", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 4, .crn = 4, .crm = 1, .opc2 = 0, - .access = PL2_RW, .type = ARM_CP_ALIAS, + .access = PL2_RW, .type = ARM_CP_ALIAS | ARM_CP_EL3_NO_EL2_KEEP, .fieldoffset = offsetof(CPUARMState, sp_el[1]) }, { .name = "SPSel", .state = ARM_CP_STATE_AA64, .opc0 = 3, .opc1 = 0, .crn = 4, .crm = 2, .opc2 = 0,
Signature · 1 line
2.25.1
[PULL 02/10] target/arm: Make writes to MDCR_EL3 use PMU start/finish calls
In reply to Peter MaydellIn commit 01765386a88868 we fixed a bug where we weren't correctly bracketing changes to some registers with pmu_op_start() and pmu_op_finish() calls for changes which affect whether the PMU counters might be enabled. However, we missed the case of writes to the AArch64 MDCR_EL3 register, because (unlike its AArch32 counterpart) they are currently done directly to the CPU state struct without going through the sdcr_write() function.
Give MDCR_EL3 a writefn which handles the PMU start/finish calls. The SDCR writefn then simplfies to "call the MDCR_EL3 writefn after masking off the bits which don't exist in the AArch32 register".
Message-id: [email protected]
--- target/arm/helper.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
target/arm/helper.c +14 -4
@@ -4756,8 +4756,8 @@ static void sctlr_write(CPUARMState *env, const ARMCPRegInfo *ri, } } -static void sdcr_write (CPUARMState *env,const ARMCPRegInfo *ri, -uint64_t value) +static void mdcr_el3_write (CPUARMState *env,const ARMCPRegInfo *ri, +uint64_t value) {/* * Some MDCR_EL3 bits affect whether PMU counters are running:
@@ -4769,12 +4769,19 @@ static void sdcr_write(CPUARMState *env, const ARMCPRegInfo *ri,if (pmu_op) {pmu_op_start (env); } - env->cp15.mdcr_el3 = value &SDCR_VALID_MASK ; + env->cp15.mdcr_el3 = value;if (pmu_op) {pmu_op_finish (env); } } +static void sdcr_write (CPUARMState *env,const ARMCPRegInfo *ri, +uint64_t value) +{ +/* Not all bits defined for MDCR_EL3 exist in the AArch32 SDCR */ +mdcr_el3_write (env, ri, value &SDCR_VALID_MASK ); +} +static void mdcr_el2_write (CPUARMState *env,const ARMCPRegInfo *ri,uint64_t value) {
@@ -5122,9 +5129,12 @@ static const ARMCPRegInfo v8_cp_reginfo[] = { .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, banked_spsr[BANK_FIQ]) }, { .name = "MDCR_EL3", .state = ARM_CP_STATE_AA64, + .type = ARM_CP_IO, .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 3, .opc2 = 1, .resetvalue = 0, - .access = PL3_RW, .fieldoffset = offsetof(CPUARMState, cp15.mdcr_el3) }, + .access = PL3_RW, + .writefn = mdcr_el3_write, + .fieldoffset = offsetof(CPUARMState, cp15.mdcr_el3) }, { .name = "SDCR", .type = ARM_CP_ALIAS | ARM_CP_IO, .cp = 15, .opc1 = 0, .crn = 1, .crm = 3, .opc2 = 1, .access = PL1_RW, .accessfn = access_trap_aa32s_el1,
Signature · 1 line
2.25.1
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.