[Skiboot] [PATCH V5 3/5] capi: Enable capi mode for PHB4

Frederic Barrat fbarrat at linux.vnet.ibm.com
Mon Jun 12 20:07:17 AEST 2017


Hi Christophe,

A few minor comments:
- in phb4.c, there are a few
// XXX FIXME learn CAPI :-(
in the code, which can now be removed, as they were about setting up 
registers which are now handled.

- similarly, there are a few:
/* XXX CAPI has diff. value */
which can be removed as phb4_init_capp_errors() takes care of it.


Le 07/06/2017 à 11:21, Christophe Lombard a écrit :

> diff --git a/hw/phb4.c b/hw/phb4.c
> index b53dadf..687096d 100644
> --- a/hw/phb4.c
> +++ b/hw/phb4.c


> +	/* PEC Phase 3 (PBCQ) registers Init */
> +	/* poll cqstat
> +	 * CAPP0 attached to PHB0(PEC0)
> +	 * CAPP1 attached to PHB3(PEC2)
> +	 */
> +	offset = 0x40;
> +	if (p->index > 0 && p->index < 3)
> +		offset = 0x80;
> +	else if (p->index > 2)
> +		offset = 0xC0;


That code works, but the 'if' conditions seem convoluted to me. What about:

	if (p->index == 0) {
		/* PEC 0 */
		offset = 0x40;
	} else if (p->index == 1 || p->index == 2) {
		/* PEC 1 */
		offset = 0x80;
	} else {
		/* PEC 2 */
		offset = 0xC0;
	}


   Fred



More information about the Skiboot mailing list