[Skiboot] [PATCH] plat/qemu: add a POWER10 platform

Cédric Le Goater clg at kaod.org
Wed Nov 6 18:11:50 AEDT 2019


On 06/11/2019 07:41, Oliver O'Halloran wrote:
> On Tue, Nov 5, 2019 at 11:47 PM Cédric Le Goater <clg at kaod.org> wrote:
>>
>> On 05/11/2019 13:14, Oliver O'Halloran wrote:
>>> On Tue, Nov 5, 2019 at 9:42 PM Cédric Le Goater <clg at kaod.org> wrote:
>>>>
>>>> Prepare ground for the QEMU simulator which will export "qemu,powernv10"
>>>> machines when available. BMC is still defined as ast2500 but it should
>>>> change to ast2600 in the future.
>>>>
>>>> Signed-off-by: Cédric Le Goater <clg at kaod.org>
>>>> ---
>>>>  core/chip.c           |  3 ++-
>>>>  platforms/qemu/qemu.c | 22 ++++++++++++++++++++++
>>>>  2 files changed, 24 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/core/chip.c b/core/chip.c
>>>> index 45733573b6e1..7ec68d8a50f4 100644
>>>> --- a/core/chip.c
>>>> +++ b/core/chip.c
>>>> @@ -132,7 +132,8 @@ void init_chips(void)
>>>>         /* Detect Qemu */
>>>>         if (dt_node_is_compatible(dt_root, "qemu,powernv") ||
>>>>             dt_node_is_compatible(dt_root, "qemu,powernv8") ||
>>>> -           dt_node_is_compatible(dt_root, "qemu,powernv9")) {
>>>> +           dt_node_is_compatible(dt_root, "qemu,powernv9") ||
>>>> +           dt_node_is_compatible(dt_root, "qemu,powernv10")) {
>>>
>>> Can we fix QEMU to always provide the generic "qemu,powernv"
>>> compatible in addition to the generation specific one? This is getting
>>> a bit absurd.
>>
>> But it will break probing in platforms/qemu/qemu.c. all machines would
>> be considered as P8.
> 
> Well that's annoying. I'd still like to have a way to work out when
> the QEMU quirks apply that's independent of the current machine model.

I think we can fix that by removing the default generic QEMU platform :

DECLARE_PLATFORM(qemu) = {
	.name		= "QEMU",
	.probe		= qemu_probe,
	.init		= qemu_init,
	.external_irq   = astbmc_ext_irq_serirq_cpld,
	.cec_power_down = astbmc_ipmi_power_down,
	.cec_reboot     = astbmc_ipmi_reboot,
	.pci_get_slot_info = slot_table_get_slot_info,
	.start_preload_resource	= flash_start_preload_resource,
	.resource_loaded	= flash_resource_loaded,
	.terminate	= ipmi_terminate,
};

It would break old QEMUs using a recent skiboot but I think that is 
fine because a compatible skiboot is shipped in QEMU anyhow. 

> We have a /mambo, /simics, and /awan for the various simulation
> environments so why not have a /qemu too?

yes. We can add that also. I will rework the patches.

Thanks,

C.

> What I'm really after is a way to emulate the "real" platforms we
> support under QEMU and we can't do without hacks if the compatible is
> fixed at something qemu specific.
> 
> Oliver
> 



More information about the Skiboot mailing list