[Skiboot] [PATCH v2 1/3] plat/qemu: add a POWER8 and POWER9 platform

Andrew Jeffery andrew at aj.id.au
Fri Apr 12 12:51:28 AEST 2019



On Fri, 12 Apr 2019, at 00:16, Cédric Le Goater wrote:
> These new QEMU platforms have characteristics closer to real OpenPOWER
> systems that we use today and define a different BMC depending on the
> CPU type. New platform properties are introduced for each,
> "qemu,powernv8", "qemu,powernv9" and these should be compatible with
> existing QEMUs which only expose the "qemu,powernv" property
> 
> Signed-off-by: Cédric Le Goater <clg at kaod.org>

Reviewed-by: Andrew Jeffery <andrew at aj.id.au>

> ---
>  platforms/qemu/qemu.c | 55 ++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 52 insertions(+), 3 deletions(-)
> 
> diff --git a/platforms/qemu/qemu.c b/platforms/qemu/qemu.c
> index 04bf3fb3f0ea..b528a826301a 100644
> --- a/platforms/qemu/qemu.c
> +++ b/platforms/qemu/qemu.c
> @@ -23,11 +23,11 @@
>  
>  static bool bt_device_present;
>  
> -static bool qemu_probe(void)
> +static bool qemu_probe_common(const char *compat)
>  {
>  	struct dt_node *n;
>  
> -	if (!dt_node_is_compatible(dt_root, "qemu,powernv"))
> +	if (!dt_node_is_compatible(dt_root, compat))
>  		return false;
>  
>          astbmc_early_init();
> @@ -40,6 +40,21 @@ static bool qemu_probe(void)
>  	return true;
>  }
>  
> +static bool qemu_probe(void)
> +{
> +	return qemu_probe_common("qemu,powernv");
> +}
> +
> +static bool qemu_probe_powernv8(void)
> +{
> +	return qemu_probe_common("qemu,powernv8");
> +}
> +
> +static bool qemu_probe_powernv9(void)
> +{
> +	return qemu_probe_common("qemu,powernv9");
> +}
> +
>  static void qemu_init(void)
>  {
>  	if (!bt_device_present) {
> @@ -50,7 +65,7 @@ static void qemu_init(void)
>  }
>  
>  DECLARE_PLATFORM(qemu) = {
> -	.name		= "Qemu",
> +	.name		= "QEMU",
>  	.probe		= qemu_probe,
>  	.init		= qemu_init,
>  	.external_irq   = astbmc_ext_irq_serirq_cpld,
> @@ -60,3 +75,37 @@ DECLARE_PLATFORM(qemu) = {
>  	.resource_loaded	= flash_resource_loaded,
>  	.terminate	= ipmi_terminate,
>  };
> +
> +/*
> + * For a QEMU PowerNV machine using POWER8 CPUs (Palmetto)
> + */
> +DECLARE_PLATFORM(qemu_powernv8) = {
> +	.name		= "QEMU POWER8",
> +	.probe		= qemu_probe_powernv8,
> +	.bmc		= &bmc_plat_ast2400_ami,
> +	.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,
> +};
> +
> +/*
> + * For a QEMU PowerNV machine using POWER9 CPUs (Witherspoon)
> + */
> +DECLARE_PLATFORM(qemu_powernv9) = {
> +	.name		= "QEMU POWER9",
> +	.probe		= qemu_probe_powernv9,
> +	.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.20.1
> 
>


More information about the Skiboot mailing list