[Skiboot] [PATCH v2 05/10] npu2: Use read-modify-write in npu2_assign_gmb()

Reza Arbab arbab at linux.vnet.ibm.com
Tue Aug 1 10:14:58 AEST 2017


On Mon, Jul 31, 2017 at 02:29:56PM +1000, Alistair Popple wrote:
>Personally I think it would be clearer if we just calculated the BAR 
>setup in val with no shift and then use SETFIELD to assign it to the 
>upper or lower half of the SCOM register. Eg:
>
>val = npu2_read(p, reg)
>gmb = SETFIELD(NPU2_MEM_BAR_SEL_MEM, *0*, 4)
>...
>if (NPU2DEV_BIRCK(ndev))
>   val = SETFIELD(PPC_BITMASK(0, 31), val, gmb);
>else
>   val = SETFIELD(PPC_BITMASK(32, 63), val, gmb);
>npu2_write(p, reg, val);
>
>Of course this would be a little different on DD2 where you only have 
>to change the register.

No problem, I can rearrange it as you've described.

-- 
Reza Arbab



More information about the Skiboot mailing list