ppc: remove bios_name

Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20201026143028.3034018-11-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-10-26 10:30:23 -04:00
parent b029702bac
commit cd7b94989a
7 changed files with 9 additions and 22 deletions

View File

@ -1035,7 +1035,7 @@ void ppce500_init(MachineState *machine)
* -kernel to users but allows them to run through u-boot as well. * -kernel to users but allows them to run through u-boot as well.
*/ */
kernel_as_payload = false; kernel_as_payload = false;
if (bios_name == NULL) { if (machine->firmware == NULL) {
if (machine->kernel_filename) { if (machine->kernel_filename) {
payload_name = machine->kernel_filename; payload_name = machine->kernel_filename;
kernel_as_payload = true; kernel_as_payload = true;
@ -1043,7 +1043,7 @@ void ppce500_init(MachineState *machine)
payload_name = "u-boot.e500"; payload_name = "u-boot.e500";
} }
} else { } else {
payload_name = bios_name; payload_name = machine->firmware;
} }
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, payload_name); filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, payload_name);

View File

@ -109,6 +109,7 @@ static void ppc_core99_reset(void *opaque)
static void ppc_core99_init(MachineState *machine) static void ppc_core99_init(MachineState *machine)
{ {
ram_addr_t ram_size = machine->ram_size; ram_addr_t ram_size = machine->ram_size;
const char *bios_name = machine->firmware ?: PROM_FILENAME;
const char *kernel_filename = machine->kernel_filename; const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline; const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename; const char *initrd_filename = machine->initrd_filename;
@ -161,9 +162,6 @@ static void ppc_core99_init(MachineState *machine)
&error_fatal); &error_fatal);
memory_region_add_subregion(get_system_memory(), PROM_BASE, bios); memory_region_add_subregion(get_system_memory(), PROM_BASE, bios);
if (!bios_name) {
bios_name = PROM_FILENAME;
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename) { if (filename) {
/* Load OpenBIOS (ELF) */ /* Load OpenBIOS (ELF) */

View File

@ -83,6 +83,7 @@ static void ppc_heathrow_reset(void *opaque)
static void ppc_heathrow_init(MachineState *machine) static void ppc_heathrow_init(MachineState *machine)
{ {
ram_addr_t ram_size = machine->ram_size; ram_addr_t ram_size = machine->ram_size;
const char *bios_name = machine->firmware ?: PROM_FILENAME;
const char *boot_device = machine->boot_order; const char *boot_device = machine->boot_order;
PowerPCCPU *cpu = NULL; PowerPCCPU *cpu = NULL;
CPUPPCState *env = NULL; CPUPPCState *env = NULL;
@ -130,9 +131,6 @@ static void ppc_heathrow_init(MachineState *machine)
&error_fatal); &error_fatal);
memory_region_add_subregion(get_system_memory(), PROM_BASE, bios); memory_region_add_subregion(get_system_memory(), PROM_BASE, bios);
if (!bios_name) {
bios_name = PROM_FILENAME;
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename) { if (filename) {
/* Load OpenBIOS (ELF) */ /* Load OpenBIOS (ELF) */

View File

@ -713,6 +713,7 @@ static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon)
static void pnv_init(MachineState *machine) static void pnv_init(MachineState *machine)
{ {
const char *bios_name = machine->firmware ?: FW_FILE_NAME;
PnvMachineState *pnv = PNV_MACHINE(machine); PnvMachineState *pnv = PNV_MACHINE(machine);
MachineClass *mc = MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_GET_CLASS(machine);
char *fw_filename; char *fw_filename;
@ -739,10 +740,6 @@ static void pnv_init(MachineState *machine)
pnv->pnor = PNV_PNOR(dev); pnv->pnor = PNV_PNOR(dev);
/* load skiboot firmware */ /* load skiboot firmware */
if (bios_name == NULL) {
bios_name = FW_FILE_NAME;
}
fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (!fw_filename) { if (!fw_filename) {
error_report("Could not find OPAL firmware '%s'", bios_name); error_report("Could not find OPAL firmware '%s'", bios_name);

View File

@ -141,6 +141,7 @@ static void ref405ep_fpga_init(MemoryRegion *sysmem, uint32_t base)
static void ref405ep_init(MachineState *machine) static void ref405ep_init(MachineState *machine)
{ {
MachineClass *mc = MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_GET_CLASS(machine);
const char *bios_name = machine->firmware ?: BIOS_FILENAME;
const char *kernel_filename = machine->kernel_filename; const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline; const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename; const char *initrd_filename = machine->initrd_filename;
@ -206,8 +207,6 @@ static void ref405ep_init(MachineState *machine)
memory_region_init_rom(bios, NULL, "ef405ep.bios", BIOS_SIZE, memory_region_init_rom(bios, NULL, "ef405ep.bios", BIOS_SIZE,
&error_fatal); &error_fatal);
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename) { if (filename) {
bios_size = load_image_size(filename, bios_size = load_image_size(filename,
@ -425,6 +424,7 @@ static void taihu_cpld_init(MemoryRegion *sysmem, uint32_t base)
static void taihu_405ep_init(MachineState *machine) static void taihu_405ep_init(MachineState *machine)
{ {
MachineClass *mc = MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_GET_CLASS(machine);
const char *bios_name = machine->firmware ?: BIOS_FILENAME;
const char *kernel_filename = machine->kernel_filename; const char *kernel_filename = machine->kernel_filename;
const char *initrd_filename = machine->initrd_filename; const char *initrd_filename = machine->initrd_filename;
char *filename; char *filename;
@ -475,8 +475,6 @@ static void taihu_405ep_init(MachineState *machine)
} else } else
#endif #endif
{ {
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
bios = g_new(MemoryRegion, 1); bios = g_new(MemoryRegion, 1);
memory_region_init_rom(bios, NULL, "taihu_405ep.bios", BIOS_SIZE, memory_region_init_rom(bios, NULL, "taihu_405ep.bios", BIOS_SIZE,
&error_fatal); &error_fatal);

View File

@ -237,6 +237,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, void *opaque)
static void ibm_40p_init(MachineState *machine) static void ibm_40p_init(MachineState *machine)
{ {
const char *bios_name = machine->firmware ?: "openbios-ppc";
CPUPPCState *env = NULL; CPUPPCState *env = NULL;
uint16_t cmos_checksum; uint16_t cmos_checksum;
PowerPCCPU *cpu; PowerPCCPU *cpu;
@ -271,9 +272,6 @@ static void ibm_40p_init(MachineState *machine)
/* PCI host */ /* PCI host */
dev = qdev_new("raven-pcihost"); dev = qdev_new("raven-pcihost");
if (!bios_name) {
bios_name = "openbios-ppc";
}
qdev_prop_set_string(dev, "bios-name", bios_name); qdev_prop_set_string(dev, "bios-name", bios_name);
qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE); qdev_prop_set_uint32(dev, "elf-machine", PPC_ELF_MACHINE);
pcihost = SYS_BUS_DEVICE(dev); pcihost = SYS_BUS_DEVICE(dev);

View File

@ -2657,6 +2657,7 @@ static void spapr_machine_init(MachineState *machine)
SpaprMachineState *spapr = SPAPR_MACHINE(machine); SpaprMachineState *spapr = SPAPR_MACHINE(machine);
SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine); SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine);
MachineClass *mc = MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_GET_CLASS(machine);
const char *bios_name = machine->firmware ?: FW_FILE_NAME;
const char *kernel_filename = machine->kernel_filename; const char *kernel_filename = machine->kernel_filename;
const char *initrd_filename = machine->initrd_filename; const char *initrd_filename = machine->initrd_filename;
PCIHostState *phb; PCIHostState *phb;
@ -2980,9 +2981,6 @@ static void spapr_machine_init(MachineState *machine)
} }
} }
if (bios_name == NULL) {
bios_name = FW_FILE_NAME;
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (!filename) { if (!filename) {
error_report("Could not find LPAR firmware '%s'", bios_name); error_report("Could not find LPAR firmware '%s'", bios_name);