diff options
author | Huacai Chen <chenhc@lemote.com> | 2020-07-29 08:58:37 +0200 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2020-08-04 09:39:29 +0200 |
commit | 39c1485c8baa47aa20caefc1ec0a3410fbad6c81 (patch) | |
tree | 36e9f28ada3c449934aef97da6d99aa0e9c913b3 /arch/mips/loongson64 | |
parent | dt-bindings: mips: Document Loongson kvm guest board (diff) | |
download | linux-39c1485c8baa47aa20caefc1ec0a3410fbad6c81.tar.xz linux-39c1485c8baa47aa20caefc1ec0a3410fbad6c81.zip |
MIPS: KVM: Add kvm guest support for Loongson-3
Loongson-3 KVM guest is based on virtio, it use liointc as its interrupt
controller and use GPEX as the pci controller.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/loongson64')
-rw-r--r-- | arch/mips/loongson64/env.c | 14 | ||||
-rw-r--r-- | arch/mips/loongson64/init.c | 5 |
2 files changed, 17 insertions, 2 deletions
diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c index 2cb9573d3d2d..134cb8e9efc2 100644 --- a/arch/mips/loongson64/env.c +++ b/arch/mips/loongson64/env.c @@ -167,14 +167,24 @@ void __init prom_init_env(void) vendor = id & 0xffff; device = (id >> 16) & 0xffff; - if (vendor == PCI_VENDOR_ID_LOONGSON && device == 0x7a00) { + switch (vendor) { + case PCI_VENDOR_ID_LOONGSON: pr_info("The bridge chip is LS7A\n"); loongson_sysconf.bridgetype = LS7A; loongson_sysconf.early_config = ls7a_early_config; - } else { + break; + case PCI_VENDOR_ID_AMD: + case PCI_VENDOR_ID_ATI: pr_info("The bridge chip is RS780E or SR5690\n"); loongson_sysconf.bridgetype = RS780E; loongson_sysconf.early_config = rs780e_early_config; + break; + default: + pr_info("The bridge chip is VIRTUAL\n"); + loongson_sysconf.bridgetype = VIRTUAL; + loongson_sysconf.early_config = virtual_early_config; + loongson_fdt_blob = __dtb_loongson64v_4core_virtio_begin; + break; } if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64C) { diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index 8ba22c30f312..ed75f7971261 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -42,6 +42,11 @@ void rs780e_early_config(void) node_id_offset = 37; } +void virtual_early_config(void) +{ + node_id_offset = 44; +} + void __init prom_init(void) { fw_init_cmdline(); |