[Skiboot] [RFC PATCH skiboot] hmi/npu2: Print register names in HMI dump

Alistair Popple alistair at popple.id.au
Tue Dec 11 11:12:19 AEDT 2018

> The NPU2_REG_OFFSET() macro is really meant to compute the indirect NPU
> ring address, in which case it starts making sense to programmatically
> adjust the stack and block number. The possible stack and block numbers
> are already defined at the top of npu2-regs.h
> Current code and this patch is using direct scom addresses, and I don't
> believe there's any logical way of building those addresses. In which
> case, we shouldn't be using NPU2_REG_OFFSET() but can keep using direct
> addresses (0x5011000 + scom offset)

I agree. As Fred pointed out the registers in this patch are all direct scom 
addressable so should just be defined directly without using NPU2_REG_OFFSET, 
etc. as there is no way to translate from block/stack/offset to direct scom 
address. Alternatively you could define these using the indirect NPU_RING 
addresses defined in the workbook, although I'm not sure what you would gain 
from that.

> > 
> > -		prlog(PR_ERR, "%s: [Loc: %s] P:%d 0x%08x=0x%016llx\n",
> > -		      unit, loc, flat_chip_id, *scoms, value);
> > +		if (value)
> > +			prlog(PR_ERR, "%s: [Loc: %s] P:%d %s=0x%016llx\n",
> > +			      unit, loc, flat_chip_id, scoms->name, value);

I think it would be helpful to print both the name and the scom address. Other 
than that I think this is a great idea - having names in the print out would 
be very useful.

- Alistair

> >   		scoms++;
> >   	
> >   	}
> >   
> >   }

More information about the Skiboot mailing list