[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/71] hw/mips: Inline 'bios.h' definitions
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 43/71] hw/mips: Inline 'bios.h' definitions |
Date: |
Fri, 5 Jan 2024 16:42:36 +0100 |
There is no universal BIOS, each machine needs a specific one.
Move the machine-specific definitions to each machine code and
remove this bogus header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20231122184334.18201-1-philmd@linaro.org>
---
include/hw/mips/bios.h | 14 --------------
hw/mips/jazz.c | 10 +++++++++-
hw/mips/malta.c | 9 ++++++++-
hw/mips/mipssim.c | 10 +++++++++-
4 files changed, 26 insertions(+), 17 deletions(-)
delete mode 100644 include/hw/mips/bios.h
diff --git a/include/hw/mips/bios.h b/include/hw/mips/bios.h
deleted file mode 100644
index 44acb6815b..0000000000
--- a/include/hw/mips/bios.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef HW_MIPS_BIOS_H
-#define HW_MIPS_BIOS_H
-
-#include "qemu/units.h"
-#include "cpu.h"
-
-#define BIOS_SIZE (4 * MiB)
-#if TARGET_BIG_ENDIAN
-#define BIOS_FILENAME "mips_bios.bin"
-#else
-#define BIOS_FILENAME "mipsel_bios.bin"
-#endif
-
-#endif
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index d33a76ad4d..0d2348aa5a 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -36,7 +36,6 @@
#include "hw/boards.h"
#include "net/net.h"
#include "hw/scsi/esp.h"
-#include "hw/mips/bios.h"
#include "hw/loader.h"
#include "hw/rtc/mc146818rtc.h"
#include "hw/timer/i8254.h"
@@ -53,12 +52,19 @@
#ifdef CONFIG_TCG
#include "hw/core/tcg-cpu-ops.h"
#endif /* CONFIG_TCG */
+#include "cpu.h"
enum jazz_model_e {
JAZZ_MAGNUM,
JAZZ_PICA61,
};
+#if TARGET_BIG_ENDIAN
+#define BIOS_FILENAME "mips_bios.bin"
+#else
+#define BIOS_FILENAME "mipsel_bios.bin"
+#endif
+
static void main_cpu_reset(void *opaque)
{
MIPSCPU *cpu = opaque;
@@ -147,6 +153,8 @@ static void mips_jazz_init_net(NICInfo *nd,
IOMMUMemoryRegion *rc4030_dma_mr,
prom[7] = 0xff - checksum;
}
+#define BIOS_SIZE (4 * MiB)
+
#define MAGNUM_BIOS_SIZE_MAX 0x7e000
#define MAGNUM_BIOS_SIZE
\
(BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX)
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 049de46a9e..d22bb1edef 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -40,7 +40,6 @@
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
#include "qemu/log.h"
-#include "hw/mips/bios.h"
#include "hw/ide/pci.h"
#include "hw/irq.h"
#include "hw/loader.h"
@@ -59,6 +58,7 @@
#include "hw/qdev-clock.h"
#include "target/mips/internal.h"
#include "trace.h"
+#include "cpu.h"
#define ENVP_PADDR 0x2000
#define ENVP_VADDR cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR)
@@ -71,6 +71,7 @@
#define RESET_ADDRESS 0x1fc00000ULL
#define FLASH_SIZE 0x400000
+#define BIOS_SIZE (4 * MiB)
#define PIIX4_PCI_DEVFN PCI_DEVFN(10, 0)
@@ -91,6 +92,12 @@ typedef struct {
bool display_inited;
} MaltaFPGAState;
+#if TARGET_BIG_ENDIAN
+#define BIOS_FILENAME "mips_bios.bin"
+#else
+#define BIOS_FILENAME "mipsel_bios.bin"
+#endif
+
#define TYPE_MIPS_MALTA "mips-malta"
OBJECT_DECLARE_SIMPLE_TYPE(MaltaState, MIPS_MALTA)
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index 4f743f37eb..01e323904d 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -35,7 +35,6 @@
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
-#include "hw/mips/bios.h"
#include "hw/loader.h"
#include "elf.h"
#include "hw/sysbus.h"
@@ -43,6 +42,15 @@
#include "qemu/error-report.h"
#include "sysemu/qtest.h"
#include "sysemu/reset.h"
+#include "cpu.h"
+
+#define BIOS_SIZE (4 * MiB)
+
+#if TARGET_BIG_ENDIAN
+#define BIOS_FILENAME "mips_bios.bin"
+#else
+#define BIOS_FILENAME "mipsel_bios.bin"
+#endif
static struct _loaderparams {
int ram_size;
--
2.41.0
- [PULL 30/71] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init(), (continued)
- [PULL 30/71] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init(), Philippe Mathieu-Daudé, 2024/01/05
- [PULL 31/71] hw/arm: Check CPU type in machine_run_board_init(), Philippe Mathieu-Daudé, 2024/01/05
- [PULL 35/71] hw/cpu/core: Cleanup unused included header in core.c, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 32/71] hw/riscv/shakti_c: Check CPU type in machine_run_board_init(), Philippe Mathieu-Daudé, 2024/01/05
- [PULL 33/71] hw/core/cpu: Remove final vestiges of dynamic state tracing, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 37/71] hw/audio/sb16: Do not migrate qdev properties, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 34/71] hw/core/cpu: Update description of CPUState::node, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 36/71] hw/cpu/cluster: Cleanup unused included header in cluster.c, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 39/71] hw/arm/bcm2836: Use ARM_CPU 'mp-affinity' property, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 38/71] hw/arm/bcm2836: Simplify use of 'reset-cbar' property, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 43/71] hw/mips: Inline 'bios.h' definitions,
Philippe Mathieu-Daudé <=
- [PULL 40/71] hw/ppc/spapr_cpu_core: Access QDev properties with proper API, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 41/71] hw: Simplify accesses to the CPUState::'start-powered-off' property, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 44/71] memory: Have memory_region_init_ram_flags_nomigrate() return a boolean, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 42/71] hw/ppc/xive2_regs: Remove unnecessary 'cpu.h' inclusion, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 45/71] memory: Have memory_region_init_ram_nomigrate() handler return a boolean, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 48/71] memory: Simplify memory_region_init_ram_from_fd() calls, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 46/71] memory: Have memory_region_init_rom_nomigrate() handler return a boolean, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 47/71] memory: Simplify memory_region_init_rom_nomigrate() calls, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 49/71] memory: Have memory_region_init_ram() handler return a boolean, Philippe Mathieu-Daudé, 2024/01/05
- [PULL 50/71] memory: Have memory_region_init_rom() handler return a boolean, Philippe Mathieu-Daudé, 2024/01/05