ppc/Pegasos2: Firmware replacement using VOF
PATCH 2/4 target/ppc: Allow virtual hypervisor on CPU without HV
In reply to BALATON ZoltanChange the assert in ppc_store_sdr1() to allow vhyp to be set on CPUs without HV bit. This allows using the vhyp interface for firmware emulation on pegasos2.
--- target/ppc/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/cpu.c +1 -1
@@ -72,7 +72,7 @@ void ppc_store_sdr1(CPUPPCState *env, target_ulong value) {PowerPCCPU *cpu =env_archcpu (env);qemu_log_mask (CPU_LOG_MMU ,"%s: " TARGET_FMT_lx"\n" , __func__, value); -assert (!cpu->vhyp); +assert (!cpu->env.has_hv_mode || !cpu->vhyp);#if defined(TARGET_PPC64 )if (mmu_is_64bit (env->mmu_model)) {target_ulong sdr_mask =SDR_64_HTABORG |SDR_64_HTABSIZE ;
Signature · 1 line
2.21.4
PATCH 3/4 ppc/pegasos2: Use Virtual Open Firmware as firmware replacement
In reply to BALATON ZoltanThe pegasos2 board comes with an Open Firmware compliant ROM based on SmartFirmware but it has some changes that are not open source therefore the ROM binary cannot be included in QEMU. Guests running on the board however depend on services provided by the firmware. The Virtual Open Firmware recently added to QEMU implements a minimal set of these services to allow some guests to boot without the original firmware. This patch adds VOF as the default firmware for pegasos2 which allows booting Linux and MorphOS via -kernel option while a ROM image can still be used with -bios for guests that don't run with VOF.
--- hw/ppc/Kconfig | 1 + hw/ppc/pegasos2.c | 602 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 601 insertions(+), 2 deletions(-)
hw/ppc/Kconfig +1 -0
@@ -76,6 +76,7 @@ config PEGASOS2 select VT82C686 select IDE_VIA select SMBUS_EEPROM + select VOF # This should come with VT82C686 select ACPI_X86
hw/ppc/pegasos2.c +600 -2
674 lines not on this page · raw message
Signature · 1 line
2.21.4
PATCH 4/4 ppc/pegasos2: Implement some RTAS functions with VOF
In reply to BALATON ZoltanLinux uses RTAS functions to access PCI devices so we need to provide these with VOF. Implement some of the most important functions to allow booting Linux with VOF. With this the board is now usable without a binary ROM image and we can enable it by default as other boards.
--- default-configs/devices/ppc-softmmu.mak | 2 +- hw/ppc/pegasos2.c | 131 ++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-)
default-configs/devices/ppc-softmmu.mak +1 -1
@@ -14,7 +14,7 @@ CONFIG_SAM460EX=y CONFIG_MAC_OLDWORLD=y CONFIG_MAC_NEWWORLD=y -CONFIG_PEGASOS2=n +CONFIG_PEGASOS2=y # For PReP CONFIG_PREP=y
hw/ppc/pegasos2.c +131 -0
161 lines not on this page · raw message
Signature · 1 line
2.21.4
PATCH 1/4 ppc/pegasos2: Introduce Pegasos2MachineState structure
In reply to BALATON ZoltanAdd own machine state structure which will be used to store state needed for firmware emulation.
--- hw/ppc/pegasos2.c | 50 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 13 deletions(-)
hw/ppc/pegasos2.c +37 -13
@@ -1,7 +1,7 @@/* * QEMU PowerPC CHRP (Genesi/bPlan Pegasos II) hardware System Emulator * -* Copyright (c) 2018-2020 BALATON Zoltan +* Copyright (c) 2018-2021 BALATON Zoltan * * This work is licensed under the GNU GPL license version 2 or later. *
@@ -41,6 +41,15 @@#define BUS_FREQ_HZ 133333333 +#define TYPE_PEGASOS2_MACHINE MACHINE_TYPE_NAME("pegasos2") +OBJECT_DECLARE_TYPE(Pegasos2MachineState, MachineClass, PEGASOS2_MACHINE) + +struct Pegasos2MachineState { +MachineState parent_obj; +PowerPCCPU *cpu; +DeviceState *mv; +}; +static void pegasos2_cpu_reset (void *opaque) {PowerPCCPU *cpu = opaque;
@@ -51,9 +60,9 @@ static void pegasos2_cpu_reset(void *opaque)static void pegasos2_init (MachineState *machine) { -PowerPCCPU *cpu =NULL ; +Pegasos2MachineState *pm =PEGASOS2_MACHINE (machine); +CPUPPCState *env;MemoryRegion *rom =g_new (MemoryRegion,1 ); -DeviceState *mv;PCIBus *pci_bus;PCIDevice *dev;I2CBus *i2c_bus;
@@ -63,15 +72,16 @@ static void pegasos2_init(MachineState *machine)uint8_t *spd_data;/* init CPU */ - cpu =POWERPC_CPU (cpu_create (machine->cpu_type)); -if (PPC_INPUT (&cpu->env) != PPC_FLAGS_INPUT_6xx) { + pm->cpu =POWERPC_CPU (cpu_create (machine->cpu_type)); + env = &pm->cpu->env; +if (PPC_INPUT (env) != PPC_FLAGS_INPUT_6xx) {error_report ("Incompatible CPU, only 6xx bus supported" );exit (1 ); }/* Set time-base frequency */ -cpu_ppc_tb_init (&cpu->env,BUS_FREQ_HZ /4 ); -qemu_register_reset (pegasos2_cpu_reset, cpu); +cpu_ppc_tb_init (env,BUS_FREQ_HZ /4 ); +qemu_register_reset (pegasos2_cpu_reset, pm->cpu);/* RAM */ memory_region_add_subregion (get_system_memory (),0 , machine->ram);
@@ -96,16 +106,16 @@ static void pegasos2_init(MachineState *machine)g_free (filename);/* Marvell Discovery II system controller */ - mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 , - ((qemu_irq *)cpu->env.irq_inputs)[PPC6xx_INPUT_INT])); - pci_bus =mv64361_get_pci_bus (mv,1 ); + pm->mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 , + ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT])); + pci_bus =mv64361_get_pci_bus (pm->mv,1 );/* VIA VT8231 South Bridge (multifunction PCI device) */ /* VT8231 function 0: PCI-to-ISA Bridge */ dev =pci_create_simple_multifunction (pci_bus,PCI_DEVFN (12 ,0 ), true,TYPE_VT8231_ISA );qdev_connect_gpio_out (DEVICE (dev),0 , -qdev_get_gpio_in_named (mv,"gpp" ,31 )); +qdev_get_gpio_in_named (pm->mv,"gpp" ,31 ));/* VT8231 function 1: IDE Controller */ dev =pci_create_simple (pci_bus,PCI_DEVFN (12 ,1 ),"via-ide" );
@@ -129,8 +139,10 @@ static void pegasos2_init(MachineState *machine)pci_vga_init (pci_bus); } -static void pegasos2_machine (MachineClass *mc) +static void pegasos2_machine_class_init (ObjectClass *oc,void *data) { +MachineClass *mc =MACHINE_CLASS (oc); + mc->desc ="Genesi/bPlan Pegasos II" ; mc->init = pegasos2_init; mc->block_default_type =IF_IDE ;
@@ -141,4 +153,16 @@ static void pegasos2_machine(MachineClass *mc) mc->default_ram_size =512 * MiB; } -DEFINE_MACHINE ("pegasos2" , pegasos2_machine) +static const TypeInfo pegasos2_machine_info = { + .name =TYPE_PEGASOS2_MACHINE , + .parent =TYPE_MACHINE , + .class_init = pegasos2_machine_class_init, + .instance_size =sizeof (Pegasos2MachineState), +}; + +static void pegasos2_machine_register_types (void ) +{ +type_register_static (&pegasos2_machine_info); +} + +type_init (pegasos2_machine_register_types)
Signature · 1 line
2.21.4
cover ppc/Pegasos2: Firmware replacement using VOF
Based-on: <[email protected]> ^ That is v22 of Alexey's VOF patch
With this series on top of VOF v22 I can now boot Linux and MorphOS on pegasos2 without a firmware blob so I hope this is enough to get this board in 6.1 and also have it enabled so people can start using it eventually (a lot of people don't compile their QEMU but rely on binaries from distros and other sources). Provided that VOF will also be merged by then. This gives VOF another use case that may help it getting merged at last.
Further info and example command lines can be found at
https://osdn.net/projects/qmiga/wiki/SubprojectPegasos2
Regards,
BALATON Zoltan
BALATON Zoltan (4):
ppc/pegasos2: Introduce Pegasos2MachineState structure target/ppc: Allow virtual hypervisor on CPU without HV ppc/pegasos2: Use Virtual Open Firmware as firmware replacement ppc/pegasos2: Implement some RTAS functions with VOF
default-configs/devices/ppc-softmmu.mak | 2 +- hw/ppc/Kconfig | 1 + hw/ppc/pegasos2.c | 783 +++++++++++++++++++++++- target/ppc/cpu.c | 2 +- 4 files changed, 771 insertions(+), 17 deletions(-)
Signature · 1 line
2.21.4
Quoted 11 lines · BALATON Zoltan
Based-on: <[email protected]> ^ That is v22 of Alexey's VOF patch
With this series on top of VOF v22 I can now boot Linux and MorphOS on pegasos2 without a firmware blob so I hope this is enough to get this board in 6.1 and also have it enabled so people can start using it eventually (a lot of people don't compile their QEMU but rely on binaries from distros and other sources). Provided that VOF will also be merged by then. This gives VOF another use case that may help it getting merged at last.
Quoted 2 lines
Further info and example command lines can be found at
https://osdn.net/projects/qmiga/wiki/SubprojectPegasos2
Ping? Freeze is coming and this would be the second release pegasos2 misses (after it missed 6.0) if this is not in the next pull request so that's why I'm pushing.
Regards,
BALATON Zoltan
Quoted 13 lines
BALATON Zoltan (4):
ppc/pegasos2: Introduce Pegasos2MachineState structure target/ppc: Allow virtual hypervisor on CPU without HV ppc/pegasos2: Use Virtual Open Firmware as firmware replacement ppc/pegasos2: Implement some RTAS functions with VOFdefault-configs/devices/ppc-softmmu.mak | 2 +- hw/ppc/Kconfig | 1 + hw/ppc/pegasos2.c | 783 +++++++++++++++++++++++- target/ppc/cpu.c | 2 +- 4 files changed, 771 insertions(+), 17 deletions(-)
Quoted 12 lines · BALATON Zoltan
Quoted 11 lines · BALATON Zoltan
Based-on: <[email protected]> ^ That is v22 of Alexey's VOF patch
With this series on top of VOF v22 I can now boot Linux and MorphOS on pegasos2 without a firmware blob so I hope this is enough to get this board in 6.1 and also have it enabled so people can start using it eventually (a lot of people don't compile their QEMU but rely on binaries from distros and other sources). Provided that VOF will also be merged by then. This gives VOF another use case that may help it getting merged at last.
Quoted 6 lines
Quoted 2 lines
Further info and example command lines can be found at
https://osdn.net/projects/qmiga/wiki/SubprojectPegasos2Ping? Freeze is coming and this would be the second release pegasos2 misses (after it missed 6.0) if this is not in the next pull request so that's why I'm pushing.
I'm not sure who can help, I was expecting Alexey would review your series. Cc'ing Laurent and Greg in case, to help you...
Quoted 14 lines
Quoted 13 lines
BALATON Zoltan (4):
ppc/pegasos2: Introduce Pegasos2MachineState structure target/ppc: Allow virtual hypervisor on CPU without HV ppc/pegasos2: Use Virtual Open Firmware as firmware replacement ppc/pegasos2: Implement some RTAS functions with VOFdefault-configs/devices/ppc-softmmu.mak | 2 +- hw/ppc/Kconfig | 1 + hw/ppc/pegasos2.c | 783 +++++++++++++++++++++++- target/ppc/cpu.c | 2 +-
4 files changed, 771 insertions(+), 17 deletions(-)
David Gibson
AppliedRe: [PATCH 1/4] ppc/pegasos2: Introduce Pegasos2MachineState structure
In reply to BALATON ZoltanQuoted 5 lines · BALATON Zoltan
Add own machine state structure which will be used to store state needed for firmware emulation.
Signed-off-by BALATON Zoltan <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Applied to ppc-for-6.1.
Quoted 117 lines
--- hw/ppc/pegasos2.c | 50 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 13 deletions(-)hw/ppc/pegasos2.c +37
-13@@ -1,7 +1,7 @@/* * QEMU PowerPC CHRP (Genesi/bPlan Pegasos II) hardware System Emulator * -* Copyright (c) 2018-2020 BALATON Zoltan +* Copyright (c) 2018-2021 BALATON Zoltan * * This work is licensed under the GNU GPL license version 2 or later. * @@ -41,6 +41,15 @@#define BUS_FREQ_HZ 133333333 +#define TYPE_PEGASOS2_MACHINE MACHINE_TYPE_NAME("pegasos2") +OBJECT_DECLARE_TYPE(Pegasos2MachineState, MachineClass, PEGASOS2_MACHINE) + +struct Pegasos2MachineState { +MachineState parent_obj; +PowerPCCPU *cpu; +DeviceState *mv; +}; +static void pegasos2_cpu_reset (void *opaque) {PowerPCCPU *cpu = opaque;@@ -51,9 +60,9 @@ static void pegasos2_cpu_reset(void *opaque)static void pegasos2_init (MachineState *machine) { -PowerPCCPU *cpu =NULL ; +Pegasos2MachineState *pm =PEGASOS2_MACHINE (machine); +CPUPPCState *env;MemoryRegion *rom =g_new (MemoryRegion,1 ); -DeviceState *mv;PCIBus *pci_bus;PCIDevice *dev;I2CBus *i2c_bus;@@ -63,15 +72,16 @@ static void pegasos2_init(MachineState *machine)uint8_t *spd_data;/* init CPU */ - cpu =POWERPC_CPU (cpu_create (machine->cpu_type)); -if (PPC_INPUT (&cpu->env) != PPC_FLAGS_INPUT_6xx) { + pm->cpu =POWERPC_CPU (cpu_create (machine->cpu_type)); + env = &pm->cpu->env; +if (PPC_INPUT (env) != PPC_FLAGS_INPUT_6xx) {error_report ("Incompatible CPU, only 6xx bus supported" );exit (1 ); }/* Set time-base frequency */ -cpu_ppc_tb_init (&cpu->env,BUS_FREQ_HZ /4 ); -qemu_register_reset (pegasos2_cpu_reset, cpu); +cpu_ppc_tb_init (env,BUS_FREQ_HZ /4 ); +qemu_register_reset (pegasos2_cpu_reset, pm->cpu);/* RAM */ memory_region_add_subregion (get_system_memory (),0 , machine->ram);@@ -96,16 +106,16 @@ static void pegasos2_init(MachineState *machine)g_free (filename);/* Marvell Discovery II system controller */ - mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 , - ((qemu_irq *)cpu->env.irq_inputs)[PPC6xx_INPUT_INT])); - pci_bus =mv64361_get_pci_bus (mv,1 ); + pm->mv =DEVICE (sysbus_create_simple (TYPE_MV64361 ,-1 , + ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT])); + pci_bus =mv64361_get_pci_bus (pm->mv,1 );/* VIA VT8231 South Bridge (multifunction PCI device) */ /* VT8231 function 0: PCI-to-ISA Bridge */ dev =pci_create_simple_multifunction (pci_bus,PCI_DEVFN (12 ,0 ), true,TYPE_VT8231_ISA );qdev_connect_gpio_out (DEVICE (dev),0 , -qdev_get_gpio_in_named (mv,"gpp" ,31 )); +qdev_get_gpio_in_named (pm->mv,"gpp" ,31 ));/* VT8231 function 1: IDE Controller */ dev =pci_create_simple (pci_bus,PCI_DEVFN (12 ,1 ),"via-ide" );@@ -129,8 +139,10 @@ static void pegasos2_init(MachineState *machine)pci_vga_init (pci_bus); } -static void pegasos2_machine (MachineClass *mc) +static void pegasos2_machine_class_init (ObjectClass *oc,void *data) { +MachineClass *mc =MACHINE_CLASS (oc); + mc->desc ="Genesi/bPlan Pegasos II" ; mc->init = pegasos2_init; mc->block_default_type =IF_IDE ;@@ -141,4 +153,16 @@ static void pegasos2_machine(MachineClass *mc) mc->default_ram_size =512 * MiB; } -DEFINE_MACHINE ("pegasos2" , pegasos2_machine) +static const TypeInfo pegasos2_machine_info = { + .name =TYPE_PEGASOS2_MACHINE , + .parent =TYPE_MACHINE , + .class_init = pegasos2_machine_class_init, + .instance_size =sizeof (Pegasos2MachineState), +}; + +static void pegasos2_machine_register_types (void ) +{ +type_register_static (&pegasos2_machine_info); +} + +type_init (pegasos2_machine_register_types)
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH 2/4] target/ppc: Allow virtual hypervisor on CPU without HV
In reply to BALATON ZoltanQuoted 5 lines · BALATON Zoltan
Change the assert in
ppc_store_sdr1()to allow vhyp to be set on CPUs without HV bit. This allows using the vhyp interface for firmware emulation on pegasos2.Signed-off-by BALATON Zoltan <[email protected]>
Kind of a hack, but a simple one, so applied to ppc-for-6.1.
Quoted 17 lines
--- target/ppc/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/cpu.c +1
-1@@ -72,7 +72,7 @@ void ppc_store_sdr1(CPUPPCState *env, target_ulong value) {PowerPCCPU *cpu =env_archcpu (env);qemu_log_mask (CPU_LOG_MMU ,"%s: " TARGET_FMT_lx"\n" , __func__, value); -assert (!cpu->vhyp); +assert (!cpu->env.has_hv_mode || !cpu->vhyp);#if defined(TARGET_PPC64 )if (mmu_is_64bit (env->mmu_model)) {target_ulong sdr_mask =SDR_64_HTABORG |SDR_64_HTABSIZE ;
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
David Gibson
AppliedRe: [PATCH 4/4] ppc/pegasos2: Implement some RTAS functions with VOF
In reply to BALATON ZoltanQuoted 7 lines · BALATON Zoltan
Linux uses RTAS functions to access PCI devices so we need to provide these with VOF. Implement some of the most important functions to allow booting Linux with VOF. With this the board is now usable without a binary ROM image and we can enable it by default as other boards.
Signed-off-by BALATON Zoltan <[email protected]>
Applied, but...
Quoted 16 lines
hw/ppc/pegasos2.c +12
-0@@ -687,6 +795,29 @@ static void *build_fdt(MachineState *machine, int *fdt_size)qemu_fdt_setprop_string (fdt,"/failsafe" ,"device_type" ,"serial" );qemu_fdt_setprop_string (fdt,"/failsafe" ,"name" ,"failsafe" ); +qemu_fdt_add_subnode (fdt,"/rtas" ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"system-reboot" ,20 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"hibernate" ,19 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"suspend" ,18 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"power-off" ,17 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"set-indicator" ,11 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"display-character" ,10 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"write-pci-config" ,9 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"read-pci-config" ,8 ); +/* Pegasos2 firmware misspells check-exception and guests use that */ +qemu_fdt_setprop_cell (fdt,"/rtas" ,"check-execption" ,7 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"event-scan" ,6 );
hw/ppc/pegasos2.c static void *build_fdt(MachineState *machine, int *fdt_size) · line 819
Quoted 10 lines
hw/ppc/pegasos2.c +10
-0+qemu_fdt_setprop_cell (fdt,"/rtas" ,"set-time-of-day" ,4 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"get-time-of-day" ,3 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"nvram-store" ,2 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"nvram-fetch" ,1 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"restart-rtas" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-error-log-max" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-event-scan-rate" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-display-device" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-size" ,20 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-version" ,1 );
..you really want to be using your symbolic names here as well.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
David Gibson
AppliedQuoted 11 lines · BALATON Zoltan
Based-on: <[email protected]> ^ That is v22 of Alexey's VOF patch
With this series on top of VOF v22 I can now boot Linux and MorphOS on pegasos2 without a firmware blob so I hope this is enough to get this board in 6.1 and also have it enabled so people can start using it eventually (a lot of people don't compile their QEMU but rely on binaries from distros and other sources). Provided that VOF will also be merged by then. This gives VOF another use case that may help it getting merged at last.
Quoted 2 lines
Further info and example command lines can be found at
https://osdn.net/projects/qmiga/wiki/SubprojectPegasos2
Applied to ppc-for-6.1, thanks.
Quoted 16 lines
Regards,
BALATON ZoltanBALATON Zoltan (4):
ppc/pegasos2: Introduce Pegasos2MachineState structure target/ppc: Allow virtual hypervisor on CPU without HV ppc/pegasos2: Use Virtual Open Firmware as firmware replacement ppc/pegasos2: Implement some RTAS functions with VOFdefault-configs/devices/ppc-softmmu.mak | 2 +- hw/ppc/Kconfig | 1 + hw/ppc/pegasos2.c | 783 +++++++++++++++++++++++- target/ppc/cpu.c | 2 +- 4 files changed, 771 insertions(+), 17 deletions(-)
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH 4/4] ppc/pegasos2: Implement some RTAS functions with VOF
In reply to David GibsonQuoted 31 lines · David Gibson
Quoted 7 lines · BALATON Zoltan
Linux uses RTAS functions to access PCI devices so we need to provide these with VOF. Implement some of the most important functions to allow booting Linux with VOF. With this the board is now usable without a binary ROM image and we can enable it by default as other boards.
Signed-off-by BALATON Zoltan <[email protected]>Applied, but...
Quoted 20 lines
hw/ppc/pegasos2.c +16
-0@@ -687,6 +795,29 @@ static void *build_fdt(MachineState *machine, int *fdt_size)qemu_fdt_setprop_string (fdt,"/failsafe" ,"device_type" ,"serial" );qemu_fdt_setprop_string (fdt,"/failsafe" ,"name" ,"failsafe" ); +qemu_fdt_add_subnode (fdt,"/rtas" ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"system-reboot" ,20 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"hibernate" ,19 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"suspend" ,18 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"power-off" ,17 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"set-indicator" ,11 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"display-character" ,10 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"write-pci-config" ,9 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"read-pci-config" ,8 ); +/* Pegasos2 firmware misspells check-exception and guests use that */ +qemu_fdt_setprop_cell (fdt,"/rtas" ,"check-execption" ,7 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"event-scan" ,6 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"set-time-of-day" ,4 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"get-time-of-day" ,3 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"nvram-store" ,2 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"nvram-fetch" ,1 );
Quoted 8 lines
hw/ppc/pegasos2.c static void *build_fdt(MachineState *machine, int *fdt_size) · line 819
Quoted 6 lines
hw/ppc/pegasos2.c +6
-0+qemu_fdt_setprop_cell (fdt,"/rtas" ,"restart-rtas" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-error-log-max" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-event-scan-rate" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-display-device" ,0 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-size" ,20 ); +qemu_fdt_setprop_cell (fdt,"/rtas" ,"rtas-version" ,1 );..you really want to be using your symbolic names here as well.
Sent a v2 for this patch that you can replace this with.
Regards,
BALATON Zoltan