[Skiboot] [PATCH 5/9] npu2: Add NPU2_GPU1_MEM_BAR

Reza Arbab arbab at linux.vnet.ibm.com
Tue Jul 18 07:19:36 AEST 2017


On Mon, Jul 17, 2017 at 01:35:16PM +1000, Alistair Popple wrote:
>On Fri, 14 Jul 2017 10:39:24 AM Reza Arbab wrote: 
>> @@ -628,27 +628,31 @@ static int npu2_assign_gmb(struct npu2_dev *ndev)
>>
>>  	mode += ndev->bdfn & 0x7;
>>  	val = SETFIELD(NPU2_MEM_BAR_MODE, val, mode);
>> -	if (NPU2DEV_BRICK(ndev))
>> -		val >>= 32;
>> +	gmb = NPU2_GPU0_MEM_BAR;
>> +
>> +	if (NPU2DEV_BRICK(ndev)) {
>> +		if (is_p9dd1())
>> +			/* In DD1, each brick's GPU is set via the same BAR */
>> +			val >>= 32;
>> +		else
>> +			gmb = NPU2_GPU1_MEM_BAR;
>> +	}
>> +
>>  	reg = NPU2_REG_OFFSET(NPU2_STACK_STCK_0 + NPU2DEV_STACK(ndev),
>> -			      NPU2_BLOCK_SM_0,
>> -			      NPU2_GPU0_MEM_BAR);
>> +			      NPU2_BLOCK_SM_0, gmb);
>>
>>  	old_val = npu2_read(p, reg);
>
>We should really mask old_val here before OR'ing it in in case Hostboot or other
>system boot software has assigned this to some other value.

Sure. I'll do this by changing to a read-modify-write instead of OR'ing 
our values in. It should end up being a little simpler.

>
>>  	val |= old_val;
>
>On DD2 we also need to set GPUx_BAR_POISON for the GPU BARs. I couldn't see it
>being set later in the series so we should add it here for DD2.

As mentioned off-list, we do already do this a few lines above.

	val = SETFIELD(NPU2_MEM_BAR_POISON, val, 1);

-- 
Reza Arbab



More information about the Skiboot mailing list