[Skiboot] [RFC PATCH 3/3] occ: Add support for Version 0x90 OCC_OPAL shared memory region

Cédric Le Goater clg at kaod.org
Wed Sep 14 03:56:28 AEST 2016


On 09/13/2016 04:50 PM, Shilpasri G Bhat wrote:
> This patch enables pstate table parsing support for P9. It
> introduces below device tree changes.
> - Add a new node per chip in /ibm,opal/power-mgt called occ.
> 	occ at 3ffd9f8000 {
> 		reg = <0x3f 0xfd9f8000>;
> 		ibm,chip-id = <0x0>;
> 		ibm,pstate-vdds = <0x4e4e4f4f 0x4f505152 0x53545556
> 		0x5758595a 0x5b5c5d5e 0x5f606162 0x63646565 0x66676868
> 		0x696a6a6b 0x6c6d6d6e 0x6f6f7071 0x72727374 0x74757677
> 		0x7778797a 0x7a7b7c7c>;
> 		ibm,pstate-vcss = <0x4446484a 0x4c4e4f50 0x50515253
> 		0x54555556 0x5758595a 0x5a5b5c5d 0x5d5e5e5e 0x5e5f5f5f
> 		0x5f606060 0x61616161 0x62626263 0x63636364 0x64646465
> 		0x65656666 0x66666767>;
> 		ibm,pstate-core-max = <0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0>;
> 		phandle = <0x10000326>;
> 	};
> - Move VID (ibm,pstate-vdds, ibm,pstate-vcss) and max pstate for
>   #n active cores array (ibm,pstate-core-max) in to the new per-chip
>   /ibm,opal/power-mgt/occ node as these properties are unique to
>   chip.
> - WOF is supported from version 0x02. Till now we have been adding
>   max ultra-turbo pstate(ibm,pstate-ultra-turbo), max turbo pstate
>   (ibm,pstate-turbo) and max pstate-per-n-core (ibm,pstate-core-max)
>   only when WOF is enabled. This patch will add these properties
>   even when WOF is disabled. When WOF is disabled max ultra turbo is
>   equal to max turbo pstate and max pstate-per-n-core array has all
>   entries equal to max turbo pstate. So the above three properties
>   are added whenever WOF is supported to ease the reporting of these
>   data in host.
> 
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
> ---
>  hw/occ.c | 535 +++++++++++++++++++++++++++++++++++++++++----------------------
>  1 file changed, 349 insertions(+), 186 deletions(-)
> 
> diff --git a/hw/occ.c b/hw/occ.c
> index 1ca338b..cdfe142 100644
> --- a/hw/occ.c
> +++ b/hw/occ.c
> @@ -31,41 +31,105 @@
>  /* OCC Communication Area for PStates */
>  
>  #define P8_HOMER_SAPPHIRE_DATA_OFFSET	0x1F8000
> -
> -#define MAX_PSTATES 256
> +#define P9_HOMER_SAPPHIRE_DATA_OFFSET	0x0E2000
> +#define MAX_PSTATES			256
> +#define MAX_P8_CORES			16

This is 12 only. 

> +#define MAX_P9_CORES			24
> +#define MAX_OPAL_CMD_DATA_LENGTH	4090
> +#define MAX_OCC_RSP_DATA_LENGTH		8698

[ ... ] 

> +	/* Dump first 16 bytes of PState table */
>  	prlog(PR_DEBUG, "OCC: Data (%16llx) = %16llx %16llx\n",
> -	      occ_data_area,
> -	      *(uint64_t *)occ_data_area,
> -	      *(uint64_t *)(occ_data_area+8));
> -	
> -	occ_data = (struct occ_pstate_table *)occ_data_area;
> +	      (uint64_t)occ_data, *(uint64_t *)occ_data,
> +	      *(((uint64_t *)occ_data) + 1));

May be introduce a temporary variable ? 


C.


More information about the Skiboot mailing list