[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/5] target/loongarch: Add a new cpu_type la664
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/5] target/loongarch: Add a new cpu_type la664 |
Date: |
Thu, 5 Sep 2024 12:32:48 +0200 |
User-agent: |
Mozilla Thunderbird |
Hi,
On 29/7/24 03:39, Song Gao wrote:
Add a new LoongArch cpu type la664. The la664 has many new features,
such as new atomic instructions, hardware page table walk, etc.
We will implement them later.
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
target/loongarch/cpu.c | 48 +++++++++++++++++++++++++++++++-----------
1 file changed, 36 insertions(+), 12 deletions(-)
+static void loongarch_la664_initfn(Object *obj)
+{
+ LoongArchCPU *cpu = LOONGARCH_CPU(obj);
+ CPULoongArchState *env = &cpu->env;
+ int i;
+
+ for (i = 0; i < 21; i++) {
In order to remove the '21' magic value, can we use:
for (unsigned i = 0; i < ARRAY_SIZE(env->cpucfg); i++) {
+ env->cpucfg[i] = 0x0;
+ }
+
+ cpu->dtb_compatible = "loongarch,Loongson-3A6000";
+ env->cpucfg[0] = 0x14d000; /* PRID */
+
+ loongarch_common_initfn(env, obj);
+}
+
+static void loongarch_la464_initfn(Object *obj)
+{
+ LoongArchCPU *cpu = LOONGARCH_CPU(obj);
+ CPULoongArchState *env = &cpu->env;
+ int i;
+
+ for (i = 0; i < 21; i++) {
Ditto.
+ env->cpucfg[i] = 0x0;
+ }
+
+ cpu->dtb_compatible = "loongarch,Loongson-3A5000";
+ env->cpucfg[0] = 0x14c010; /* PRID */
+
+ loongarch_common_initfn(env, obj);
+}
- Re: [PATCH 1/5] target/loongarch: Add a new cpu_type la664,
Philippe Mathieu-Daudé <=