Skip to contentSkip to conversation

target/arm: Add Kunpeng-920

PATCH In review KevinZ 2 participants 2 messages Apr 9, 2020

lore
Share & tools
lore

KevinZ

author
#0 lore raw

PATCH 1/1 target/arm: Add Kunpeng-920

HiSilicon Kunpeng-920 CPU is one of the commonly used data center CPUs, this patch adds it to target.

---
 hw/arm/virt.c      |  1 +  target/arm/cpu64.c | 20 ++++++++++++++++++++  2 files changed, 21 insertions(+)

hw/arm/virt.c +0 -0
index 7dc96abf72..8457d9deee 100644
@@ -197,6 +197,7 @@ static const char *valid_cpus[] = {

     ARM_CPU_TYPE_NAME("cortex-a53"),      ARM_CPU_TYPE_NAME("cortex-a57"),      ARM_CPU_TYPE_NAME("cortex-a72"), +    ARM_CPU_TYPE_NAME("Kunpeng-920"),      ARM_CPU_TYPE_NAME("host"),      ARM_CPU_TYPE_NAME("max"),  };

target/arm/cpu64.c +0 -0
index 62d36f9e8d..efe1676263 100644
@@ -253,6 +253,25 @@ static void aarch64_a72_initfn(Object *obj)

     define_arm_cp_regs(cpu, cortex_a72_a57_a53_cp_reginfo);
 }
 
+static void aarch64_kunpeng_920_initfn(Object *obj)
+{
+    ARMCPU *cpu = ARM_CPU(obj);
+
+    /*
+     * HiSilicon Kunpeng-920 CPU is similar to cortex-a72,
+     * so first initialize cpu data as cortex-a72 CPU,
+     * and then update the corresponding registers.
+     */
+    aarch64_a72_initfn(obj);
+
+    cpu->midr = 0x480fd010;
+    cpu->ctr = 0x84448004;
+    cpu->isar.id_aa64pfr0 = 0x11001111;
+    cpu->isar.id_aa64dfr0 = 0x110305408;
+    cpu->isar.id_aa64isar0 = 0x10211120;
+    cpu->isar.id_aa64mmfr0 = 0x101125;
+}
+
 void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp)
 {
     /*
@@ -747,6 +766,7 @@ static const ARMCPUInfo aarch64_cpus[] = {
     { .name = "cortex-a57",         .initfn = aarch64_a57_initfn },      { .name = "cortex-a53",         .initfn = aarch64_a53_initfn },      { .name = "cortex-a72",         .initfn = aarch64_a72_initfn }, +    { .name = "Kunpeng-920",        .initfn = aarch64_kunpeng_920_initfn},      { .name = "max",                .initfn = aarch64_max_initfn },      { .name = NULL }
 };

Signature · 1 line
2.26.0.windows.1
#1 lore raw
Quoted 5 lines · KevinZ

HiSilicon Kunpeng-920 CPU is one of the commonly used data center CPUs, this patch adds it to target.

Could you explain what this provides that you couldn't get with either -cpu cortex-a72 or -cpu host ?

Also, is there a reference manual/datasheet for this CPU to check whether we're implementing the right set of features and ID register values?

thanks
-- PMM