diff options
author | Xiaojuan Yang <yangxiaojuan@loongson.cn> | 2022-07-12 16:32:06 +0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2022-07-19 22:55:10 +0530 |
commit | fda3f15b0079d4bba76791502a7e00b8b747f509 (patch) | |
tree | 01e4d9a080267fb0a8a8766e421a8e767e5fc9c8 /target | |
parent | 735143f10d3e74523f25444c57d61d51ffd57167 (diff) | |
download | qemu-fda3f15b0079d4bba76791502a7e00b8b747f509.zip qemu-fda3f15b0079d4bba76791502a7e00b8b747f509.tar.gz qemu-fda3f15b0079d4bba76791502a7e00b8b747f509.tar.bz2 |
hw/loongarch: Add fdt support
Add LoongArch flatted device tree, adding cpu device node, firmware cfg node,
pcie node into it, and create fdt rom memory region. Now fdt info is not
full since only uefi bios uses fdt, linux kernel does not use fdt.
Loongarch Linux kernel uses acpi table which is full in qemu virt
machine.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
Message-Id: <20220712083206.4187715-7-yangxiaojuan@loongson.cn>
[rth: Set TARGET_NEED_FDT, add fdt to meson.build]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/loongarch/cpu.c | 1 | ||||
-rw-r--r-- | target/loongarch/cpu.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 1415793..1c69a76 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -341,6 +341,7 @@ static void loongarch_la464_initfn(Object *obj) env->cpucfg[i] = 0x0; } + cpu->dtb_compatible = "loongarch,Loongson-3A5000"; env->cpucfg[0] = 0x14c010; /* PRID */ uint32_t data = 0; diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index d141ec9..a36349d 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -326,6 +326,9 @@ struct ArchCPU { CPUNegativeOffsetState neg; CPULoongArchState env; QEMUTimer timer; + + /* 'compatible' string for this CPU for Linux device trees */ + const char *dtb_compatible; }; #define TYPE_LOONGARCH_CPU "loongarch-cpu" |