[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/29] hw/microblaze: Propagate CPU endianness to microblaze_load_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 06/29] hw/microblaze: Propagate CPU endianness to microblaze_load_kernel() |
Date: |
Tue, 31 Dec 2024 21:22:05 +0100 |
Pass vCPU endianness as argument so we can load kernels
with different endianness (different from the qemu-system-binary
builtin one).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241107012223.94337-3-philmd@linaro.org>
---
hw/microblaze/boot.h | 4 ++--
hw/microblaze/boot.c | 8 ++++----
hw/microblaze/petalogix_ml605_mmu.c | 2 +-
hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +-
hw/microblaze/xlnx-zynqmp-pmu.c | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/hw/microblaze/boot.h b/hw/microblaze/boot.h
index 5a8c2f79750..d179a551a69 100644
--- a/hw/microblaze/boot.h
+++ b/hw/microblaze/boot.h
@@ -2,8 +2,8 @@
#define MICROBLAZE_BOOT_H
-void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
- uint32_t ramsize,
+void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian,
+ hwaddr ddr_base, uint32_t ramsize,
const char *initrd_filename,
const char *dtb_filename,
void (*machine_cpu_reset)(MicroBlazeCPU *));
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 966fb2cb2a3..3854bc2291b 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -114,8 +114,8 @@ static uint64_t translate_kernel_address(void *opaque,
uint64_t addr)
return addr - 0x30000000LL;
}
-void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
- uint32_t ramsize,
+void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian,
+ hwaddr ddr_base, uint32_t ramsize,
const char *initrd_filename,
const char *dtb_filename,
void (*machine_cpu_reset)(MicroBlazeCPU *))
@@ -144,13 +144,13 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr
ddr_base,
/* Boots a kernel elf binary. */
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, NULL, &high, NULL,
- TARGET_BIG_ENDIAN, EM_MICROBLAZE, 0, 0);
+ !is_little_endian, EM_MICROBLAZE, 0, 0);
base32 = entry;
if (base32 == 0xc0000000) {
kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, NULL,
&entry, NULL, NULL, NULL,
- TARGET_BIG_ENDIAN, EM_MICROBLAZE, 0, 0);
+ !is_little_endian, EM_MICROBLAZE, 0, 0);
}
/* Always boot into physical ram. */
boot_info.bootstrap_pc = (uint32_t)entry;
diff --git a/hw/microblaze/petalogix_ml605_mmu.c
b/hw/microblaze/petalogix_ml605_mmu.c
index deab275495d..8b44be75a22 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -204,7 +204,7 @@ petalogix_ml605_init(MachineState *machine)
cpu->cfg.pvr_regs[5] = 0xc56be000;
cpu->cfg.pvr_regs[10] = 0x0e000000; /* virtex 6 */
- microblaze_load_kernel(cpu, MEMORY_BASEADDR, ram_size,
+ microblaze_load_kernel(cpu, true, MEMORY_BASEADDR, ram_size,
machine->initrd_filename,
BINARY_DEVICE_TREE_FILE,
NULL);
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c
b/hw/microblaze/petalogix_s3adsp1800_mmu.c
index 4a969af1a01..2c0d8c34cd2 100644
--- a/hw/microblaze/petalogix_s3adsp1800_mmu.c
+++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c
@@ -129,7 +129,7 @@ petalogix_s3adsp1800_init(MachineState *machine)
create_unimplemented_device("xps_gpio", GPIO_BASEADDR, 0x10000);
- microblaze_load_kernel(cpu, ddr_base, ram_size,
+ microblaze_load_kernel(cpu, !TARGET_BIG_ENDIAN, ddr_base, ram_size,
machine->initrd_filename,
BINARY_DEVICE_TREE_FILE,
NULL);
diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c
index 567aad47bfc..bdbf7328bf4 100644
--- a/hw/microblaze/xlnx-zynqmp-pmu.c
+++ b/hw/microblaze/xlnx-zynqmp-pmu.c
@@ -172,7 +172,7 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine)
qdev_realize(DEVICE(pmu), NULL, &error_fatal);
/* Load the kernel */
- microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR,
+ microblaze_load_kernel(&pmu->cpu, true, XLNX_ZYNQMP_PMU_RAM_ADDR,
machine->ram_size,
machine->initrd_filename,
machine->dtb,
--
2.47.1
- [PULL 00/29] Misc HW patches for 2024-12-31, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 01/29] hw/pci-host/gpex: Allow more than 4 legacy IRQs, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 02/29] hw/misc/ivshmem-flat: Add ivshmem-flat device, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 03/29] hw/misc/ivshmem: Rename ivshmem to ivshmem-pci, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 04/29] hw/usb/uhci: checkpatch cleanup, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 05/29] hw/usb/uhci: Introduce and use register defines, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 06/29] hw/microblaze: Propagate CPU endianness to microblaze_load_kernel(),
Philippe Mathieu-Daudé <=
- [PULL 07/29] hw/i386: Mark devices as little-endian, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 08/29] hw/tricore: Mark devices as little-endian, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 09/29] hw/openrisc: Mark devices as big-endian, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 10/29] hw/sparc: Mark devices as big-endian, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 11/29] hw/net/xilinx_ethlite: Convert some debug logs to trace events, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 12/29] hw/net/xilinx_ethlite: Remove unuseful debug logs, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 13/29] hw/net/xilinx_ethlite: Update QOM style, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 14/29] hw/net/xilinx_ethlite: Correct maximum RX buffer size, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 15/29] hw/net/xilinx_ethlite: Rename rxbuf -> port_index, Philippe Mathieu-Daudé, 2024/12/31
- [PULL 16/29] fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read(), Philippe Mathieu-Daudé, 2024/12/31