[Skiboot] [PATCH v2 1/2] astbmc: Add NPU slot type and use it in Garrison
Alistair Popple
alistair at popple.id.au
Wed Jun 22 12:12:10 AEST 2016
On Tue, 21 Jun 2016 18:04:47 Russell Currey wrote:
> NPU links are grouped into pairs, signifying that they both correlate to
> the same physical GPU. These pairs are presented in the Garrison slot
> table as typical PCI devices, creating what are essentially redundant
> entries. Add a new slot type specifically for NPUs, and subsequently
> perform bdfn correlation using it.
>
> Signed-off-by: Russell Currey <ruscur at russell.cc>
> ---
> V2: New change to facilitate bdfn allocation without using pbcq
> ---
> platforms/astbmc/astbmc.h | 2 ++
> platforms/astbmc/garrison.c | 36 ++++++++----------------------------
> platforms/astbmc/slots.c | 7 +++++++
> 3 files changed, 17 insertions(+), 28 deletions(-)
<snip>
> diff --git a/platforms/astbmc/slots.c b/platforms/astbmc/slots.c
> index 36547e1..992f68b 100644
> --- a/platforms/astbmc/slots.c
> +++ b/platforms/astbmc/slots.c
> @@ -70,6 +70,13 @@ static const struct slot_table_entry
*match_slot_dev_entry(struct phb *phb,
> prerror("SLOT: Bad PHB entry type in table !\n");
> continue;
> }
> +
> + if (ent->etype == st_npu_slot) {
> + /* NPU groups are at device level, so ignore function
*/
> + if (ent->location == ((pd->bdfn & 0xff) >> 3))
Is this reliable? ent->location is a ST_LOC_NPU_GROUP code but what guarantees
that the pd->bdfn device number matches the NPU_GROUP number?
Do we need something like "if (ent->location == pd->npu_group)" instead?
- Alistair
> + return ent;
> + }
> +
> if (ent->location == (pd->bdfn & 0xff))
> return ent;
> }
>
More information about the Skiboot
mailing list