diff options
author | Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com> | 2023-10-10 11:40:56 +0000 |
---|---|---|
committer | Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com> | 2023-10-10 11:40:56 +0000 |
commit | e02cda008591317b1625707ff8e115a4841aa889 (patch) | |
tree | aee302e3cf8b59ec2d32ec481be3d1afddfc8968 /include/hw/mips | |
parent | cc668e6b7e0ffd8c9d130513d12053cf5eda1d3b (diff) |
Introduce Virtio-loopback epsilon release:
Epsilon release introduces a new compatibility layer which make virtio-loopback
design to work with QEMU and rust-vmm vhost-user backend without require any
changes.
Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
Change-Id: I52e57563e08a7d0bdc002f8e928ee61ba0c53dd9
Diffstat (limited to 'include/hw/mips')
-rw-r--r-- | include/hw/mips/bios.h | 14 | ||||
-rw-r--r-- | include/hw/mips/bootloader.h | 22 | ||||
-rw-r--r-- | include/hw/mips/cps.h | 52 | ||||
-rw-r--r-- | include/hw/mips/cpudevs.h | 14 | ||||
-rw-r--r-- | include/hw/mips/mips.h | 25 |
5 files changed, 127 insertions, 0 deletions
diff --git a/include/hw/mips/bios.h b/include/hw/mips/bios.h new file mode 100644 index 000000000..c03007999 --- /dev/null +++ b/include/hw/mips/bios.h @@ -0,0 +1,14 @@ +#ifndef HW_MIPS_BIOS_H +#define HW_MIPS_BIOS_H + +#include "qemu/units.h" +#include "cpu.h" + +#define BIOS_SIZE (4 * MiB) +#ifdef TARGET_WORDS_BIGENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif + +#endif diff --git a/include/hw/mips/bootloader.h b/include/hw/mips/bootloader.h new file mode 100644 index 000000000..b5f48d71b --- /dev/null +++ b/include/hw/mips/bootloader.h @@ -0,0 +1,22 @@ +/* + * Utility for QEMU MIPS to generate it's simple bootloader + * + * Copyright (C) 2020 Jiaxun Yang <jiaxun.yang@flygoat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_MIPS_BOOTLOADER_H +#define HW_MIPS_BOOTLOADER_H + +#include "exec/cpu-defs.h" + +void bl_gen_jump_to(uint32_t **p, target_ulong jump_addr); +void bl_gen_jump_kernel(uint32_t **p, target_ulong sp, target_ulong a0, + target_ulong a1, target_ulong a2, target_ulong a3, + target_ulong kernel_addr); +void bl_gen_write_ulong(uint32_t **p, target_ulong addr, target_ulong val); +void bl_gen_write_u32(uint32_t **p, target_ulong addr, uint32_t val); +void bl_gen_write_u64(uint32_t **p, target_ulong addr, uint64_t val); + +#endif diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h new file mode 100644 index 000000000..04d636246 --- /dev/null +++ b/include/hw/mips/cps.h @@ -0,0 +1,52 @@ +/* + * Coherent Processing System emulation. + * + * Copyright (c) 2016 Imagination Technologies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef MIPS_CPS_H +#define MIPS_CPS_H + +#include "hw/sysbus.h" +#include "hw/clock.h" +#include "hw/misc/mips_cmgcr.h" +#include "hw/intc/mips_gic.h" +#include "hw/misc/mips_cpc.h" +#include "hw/misc/mips_itu.h" +#include "target/mips/cpu.h" +#include "qom/object.h" + +#define TYPE_MIPS_CPS "mips-cps" +OBJECT_DECLARE_SIMPLE_TYPE(MIPSCPSState, MIPS_CPS) + +struct MIPSCPSState { + SysBusDevice parent_obj; + + uint32_t num_vp; + uint32_t num_irq; + char *cpu_type; + + MemoryRegion container; + MIPSGCRState gcr; + MIPSGICState gic; + MIPSCPCState cpc; + MIPSITUState itu; + Clock *clock; +}; + +qemu_irq get_cps_irq(MIPSCPSState *cps, int pin_number); + +#endif diff --git a/include/hw/mips/cpudevs.h b/include/hw/mips/cpudevs.h new file mode 100644 index 000000000..f7c9728fa --- /dev/null +++ b/include/hw/mips/cpudevs.h @@ -0,0 +1,14 @@ +#ifndef HW_MIPS_CPUDEVS_H +#define HW_MIPS_CPUDEVS_H + +#include "target/mips/cpu-qom.h" + +/* Definitions for MIPS CPU internal devices. */ + +/* mips_int.c */ +void cpu_mips_irq_init_cpu(MIPSCPU *cpu); + +/* mips_timer.c */ +void cpu_mips_clock_init(MIPSCPU *cpu); + +#endif diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h new file mode 100644 index 000000000..6c9c8805f --- /dev/null +++ b/include/hw/mips/mips.h @@ -0,0 +1,25 @@ +#ifndef HW_MIPS_H +#define HW_MIPS_H +/* Definitions for mips board emulation. */ + +#include "qemu/units.h" + +/* Kernels can be configured with 64KB pages */ +#define INITRD_PAGE_SIZE (64 * KiB) + +#include "exec/memory.h" + +/* gt64xxx.c */ +PCIBus *gt64120_register(qemu_irq *pic); + +/* bonito.c */ +PCIBus *bonito_init(qemu_irq *pic); + +/* rc4030.c */ +typedef struct rc4030DMAState *rc4030_dma; +void rc4030_dma_read(void *dma, uint8_t *buf, int len); +void rc4030_dma_write(void *dma, uint8_t *buf, int len); + +DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr); + +#endif |