[Skiboot] [PATCH 1/5] xscom: Abstract error recovery registers

C├ędric Le Goater clg at kaod.org
Thu Mar 23 00:34:26 AEDT 2017


On 03/22/2017 03:59 AM, Michael Neuling wrote:
> Abstract error recovery registers to get ready for POWER9.
> 
> Signed-off-by: Michael Neuling <mikey at neuling.org>
> ---
>  hw/xscom.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/xscom.c b/hw/xscom.c
> index d7b8627d8b..4a5f0f2d73 100644
> --- a/hw/xscom.c
> +++ b/hw/xscom.c
> @@ -95,22 +95,28 @@ static uint64_t xscom_wait_done(void)
>  static void xscom_reset(uint32_t gcid)
>  {
>  	u64 hmer;
> +	uint32_t local, target1, target2;
> 
>  	/* Clear errors in HMER */
>  	mtspr(SPR_HMER, HMER_CLR_MASK);
> 
> +	/* Setup local and target scom addresses */
> +	local = 0x202000f;
> +	target1 = 0x2020007;
> +	target2 = 0x2020009;
> +

maybe we could use some real names for :

	0x2020007 - XSCOM Error Log Register
	0x2020009 - XSCOM Error Register
	0x202000F - XSCOM Command Received Status and Source Register

P9 is nearly the same :

	0x90012 - XSCOM Status Log Register
	0x90013 - XSCOM Error Register
	0x90018 - XSCOM Received Remote Status pMisc and Source Register

local, target[12] are a bit obscure.

It might be interesting to read and dump these registers in case
of failure also.

Cheers,

C. 

>  	/* First we need to write 0 to a register on our chip */
> -	out_be64(xscom_addr(this_cpu()->chip_id, 0x202000f), 0);
> +	out_be64(xscom_addr(this_cpu()->chip_id, local), 0);
>  	hmer = xscom_wait_done();
>  	if (hmer & SPR_HMER_XSCOM_FAIL)
>  		goto fail;
> 
>  	/* Then we need to clear those two other registers on the target */
> -	out_be64(xscom_addr(gcid, 0x2020007), 0);
> +	out_be64(xscom_addr(gcid, target1), 0);
>  	hmer = xscom_wait_done();
>  	if (hmer & SPR_HMER_XSCOM_FAIL)
>  		goto fail;
> -	out_be64(xscom_addr(gcid, 0x2020009), 0);
> +	out_be64(xscom_addr(gcid, target2), 0);
>  	hmer = xscom_wait_done();
>  	if (hmer & SPR_HMER_XSCOM_FAIL)
>  		goto fail;
> 



More information about the Skiboot mailing list