[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/23] hw/mips/boston: Propagate CPU to gen_firmware()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 18/23] hw/mips/boston: Propagate CPU to gen_firmware() |
Date: |
Mon, 13 Jan 2025 01:47:43 +0100 |
In boston_mach_init(), resolves the first CPU from the CPS
container using the QOM "cpu[0]" path. Propagate it to
gen_firmware(), removing the &first_cpu use.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/mips/boston.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 09c4dfade12..f2c0e335e73 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -323,25 +323,26 @@ static void boston_register_types(void)
}
type_init(boston_register_types)
-static void gen_firmware(void *p, hwaddr kernel_entry, hwaddr fdt_addr)
+static void gen_firmware(const MIPSCPU *cpu, void *p,
+ hwaddr kernel_entry, hwaddr fdt_addr)
{
uint64_t regaddr;
/* Move CM GCRs */
regaddr = cpu_mips_phys_to_kseg1(NULL, GCR_BASE_ADDR + GCR_BASE_OFS),
- bl_gen_write_u64(MIPS_CPU(first_cpu), &p, regaddr,
+ bl_gen_write_u64(cpu, &p, regaddr,
boston_memmap[BOSTON_CM].base);
/* Move & enable GIC GCRs */
regaddr = cpu_mips_phys_to_kseg1(NULL, boston_memmap[BOSTON_CM].base
+ GCR_GIC_BASE_OFS),
- bl_gen_write_u64(MIPS_CPU(first_cpu), &p, regaddr,
+ bl_gen_write_u64(cpu, &p, regaddr,
boston_memmap[BOSTON_GIC].base | GCR_GIC_BASE_GICEN_MSK);
/* Move & enable CPC GCRs */
regaddr = cpu_mips_phys_to_kseg1(NULL, boston_memmap[BOSTON_CM].base
+ GCR_CPC_BASE_OFS),
- bl_gen_write_u64(MIPS_CPU(first_cpu), &p, regaddr,
+ bl_gen_write_u64(cpu, &p, regaddr,
boston_memmap[BOSTON_CPC].base | GCR_CPC_BASE_CPCEN_MSK);
/*
@@ -352,7 +353,7 @@ static void gen_firmware(void *p, hwaddr kernel_entry,
hwaddr fdt_addr)
* a2/$6 = 0
* a3/$7 = 0
*/
- bl_gen_jump_kernel(MIPS_CPU(first_cpu), &p,
+ bl_gen_jump_kernel(cpu, &p,
true, 0, true, (int32_t)-2,
true, fdt_addr, true, 0, true, 0,
kernel_entry);
@@ -825,7 +826,9 @@ static void boston_mach_init(MachineState *machine)
}
}
- gen_firmware(memory_region_get_ram_ptr(flash) + 0x7c00000,
+ gen_firmware(MIPS_CPU(object_resolve_path_component(OBJECT(&s->cps),
+ "cpu[0]")),
+ memory_region_get_ram_ptr(flash) + 0x7c00000,
s->kernel_entry, s->fdt_base);
} else if (!qtest_enabled()) {
error_report("Please provide either a -kernel or -bios argument");
--
2.47.1
- [PATCH 08/23] hw/mips/bootloader: Propagate CPU env to bl_gen_sw(), (continued)
- [PATCH 08/23] hw/mips/bootloader: Propagate CPU env to bl_gen_sw(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 09/23] hw/mips/bootloader: Propagate CPU env to bl_gen_sd(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 07/23] hw/mips/bootloader: Propagate CPU env to bl_gen_jalr(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 10/23] hw/mips/bootloader: Propagate CPU env to bl_gen_li(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 11/23] hw/mips/bootloader: Propagate CPU env to bl_gen_dli(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 12/23] hw/mips/bootloader: Propagate CPU env to bl_gen_load_ulong(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 13/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_to(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 14/23] hw/mips/bootloader: Propagate CPU to bl_gen_jump_kernel(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 15/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_ulong(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 16/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_u32(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 18/23] hw/mips/boston: Propagate CPU to gen_firmware(),
Philippe Mathieu-Daudé <=
- [PATCH 17/23] hw/mips/bootloader: Propagate CPU to bl_gen_write_u64(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 19/23] hw/mips/fuloong: Propagate CPU to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 20/23] hw/mips/malta: Keep reference of vCPUs in MaltaState, Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 21/23] hw/mips/malta: Propagate MaltaState to write_bootloader(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 22/23] hw/mips/malta: Propagate MaltaState to bl_setup_gt64120_jump_kernel(), Philippe Mathieu-Daudé, 2025/01/12
- [PATCH 23/23] hw/mips/malta: Remove all uses of &first_cpu global, Philippe Mathieu-Daudé, 2025/01/12
- Re: [PATCH 00/23] hw/mips: Remove all uses of &first_cpu, Philippe Mathieu-Daudé, 2025/01/13