[Skiboot] [PATCH v4 6/8] SLW: Allow deep states if homer address is known

Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
Fri Sep 15 18:34:13 AEST 2017


* Akshay Adiga <akshay.adiga at linux.vnet.ibm.com> [2017-09-15 13:04:34]:

> Use a common variable has_wakeup_engine instead of has_slw to tell if
> the
> a) SLW image is populated in case of power8
> b) CME image is populated in case of power9
> 
> Currently we expect CME to be loaded if homer address is known ( except
> for simulators)
> 
> Signed-off-by: Akshay Adiga <akshay.adiga at linux.vnet.ibm.com>

Reviewed-by: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>

> ---
>  hw/slw.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/slw.c b/hw/slw.c
> index 39aa4d0..1ce7608 100644
> --- a/hw/slw.c
> +++ b/hw/slw.c
> @@ -813,7 +813,7 @@ void add_cpu_idle_state_properties(void)
>  	int nr_states;
> 
>  	bool can_sleep = true;
> -	bool has_slw = true;
> +	bool has_wakeup_engine = true;
>  	bool has_stop_inst = false;
>  	u8 i;
> 
> @@ -906,9 +906,20 @@ void add_cpu_idle_state_properties(void)
>  		nr_states = ARRAY_SIZE(power7_cpu_idle_states);
>  	}
> 
> -	/* Enable deep idle states only if slw image is intact */
> -	has_slw = (chip->slw_base && chip->slw_bar_size &&
> -			chip->slw_image_size);
> +	/*
> +	 * Enable deep idle states only if :
> +	 * P8 : slw image is intact
> +	 * P9 : homer_base is set
> +	 */
> +	if (!(proc_chip_quirks & QUIRK_MAMBO_CALLOUTS)) {
> +		if (proc_gen == proc_gen_p9)
> +			has_wakeup_engine = !!(chip->homer_base);
> +		else /* (proc_gen == proc_gen_p8) */
> +			has_wakeup_engine = (chip->slw_base && chip->slw_bar_size &&
> +					chip->slw_image_size);
> +	} else {
> +		has_wakeup_engine = false;
> +	}
> 
>  	/*
>  	 * Currently we can't append strings and cells to dt properties.
> @@ -936,7 +947,7 @@ void add_cpu_idle_state_properties(void)
>  	if (has_stop_inst) {
>  		/* Power 9 / POWER ISA 3.0 */
>  		supported_states_mask = OPAL_PM_STOP_INST_FAST;
> -		if (has_slw)
> +		if (has_wakeup_engine)
>  			supported_states_mask |= OPAL_PM_STOP_INST_DEEP;
>  	} else {
>  		/* Power 7 and Power 8 */
> @@ -944,7 +955,7 @@ void add_cpu_idle_state_properties(void)
>  		if (can_sleep)
>  			supported_states_mask |= OPAL_PM_SLEEP_ENABLED |
>  						OPAL_PM_SLEEP_ENABLED_ER1;
> -		if (has_slw)
> +		if (has_wakeup_engine)
>  			supported_states_mask |= OPAL_PM_WINKLE_ENABLED;
>  	}
>  	for (i = 0; i < nr_states; i++) {
> -- 
> 2.5.5
> 



More information about the Skiboot mailing list