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

Cédric Le Goater clg at kaod.org
Tue Nov 5 23:47:34 AEDT 2019


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.

C. 
 
> 
>>                 proc_chip_quirks |= QUIRK_QEMU | QUIRK_NO_CHIPTOD
>>                         | QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
>>                 prlog(PR_NOTICE, "CHIP: Detected QEMU simulator\n");
>> diff --git a/platforms/qemu/qemu.c b/platforms/qemu/qemu.c
>> index 757c086d4a22..4a0e6a489b97 100644
>> --- a/platforms/qemu/qemu.c
>> +++ b/platforms/qemu/qemu.c
>> @@ -42,6 +42,11 @@ static bool qemu_probe_powernv9(void)
>>         return qemu_probe_common("qemu,powernv9");
>>  }
>>
>> +static bool qemu_probe_powernv10(void)
>> +{
>> +       return qemu_probe_common("qemu,powernv10");
>> +}
>> +
>>  static void qemu_init(void)
>>  {
>>         if (!bt_device_present) {
>> @@ -96,3 +101,20 @@ DECLARE_PLATFORM(qemu_powernv9) = {
>>         .exit                   = astbmc_exit,
>>         .terminate      = ipmi_terminate,
>>  };
>> +
>> +/*
>> + * For a QEMU PowerNV machine using POWER10 CPUs (Rainier)
>> + */
>> +DECLARE_PLATFORM(qemu_powernv10) = {
>> +       .name           = "QEMU POWER10",
>> +       .probe          = qemu_probe_powernv10,
>> +       .bmc            = &bmc_plat_ast2500_openbmc,
>> +       .init           = qemu_init,
>> +       .external_irq   = astbmc_ext_irq_serirq_cpld,
>> +       .cec_power_down = astbmc_ipmi_power_down,
>> +       .cec_reboot     = astbmc_ipmi_reboot,
>> +       .start_preload_resource = flash_start_preload_resource,
>> +       .resource_loaded        = flash_resource_loaded,
>> +       .exit                   = astbmc_exit,
>> +       .terminate      = ipmi_terminate,
>> +};
>> --
>> 2.21.0
>>



More information about the Skiboot mailing list