[Skiboot] [PATCH 1/9] npu2: Add a function to detect POWER9 DD1
Alistair Popple
alistair at popple.id.au
Mon Jul 17 13:08:00 AEST 2017
On Fri, 14 Jul 2017 10:39:20 AM Reza Arbab wrote:
> Provide a convenience we'll use quite a bit to preserve backwards
> compatibility with DD1.
>
> Cc: Alistair Popple <alistair at popple.id.au>
> Signed-off-by: Reza Arbab <arbab at linux.vnet.ibm.com>
> ---
> hw/npu2.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/hw/npu2.c b/hw/npu2.c
> index 83451c3..a986652 100644
> --- a/hw/npu2.c
> +++ b/hw/npu2.c
> @@ -58,6 +58,16 @@
>
> #define VENDOR_CAP_PCI_DEV_OFFSET 0x0d
>
> +static bool is_p9dd1(void)
We could get the proc_chip from struct npu2 rather than just assuming all chips
are the same, but that seems overly complicated as I doubt we will ever support
multiple DD levels in a single system.
Acked-by: Alistair Popple <alistair at popple.id.au>
> +{
> + struct proc_chip *chip = next_chip(NULL);
> +
> + return chip &&
> + (chip->type == PROC_CHIP_P9_NIMBUS ||
> + chip->type == PROC_CHIP_P9_CUMULUS) &&
> + (chip->ec_level & 0xf0) == 0x10;
> +}
> +
> /*
> * We use the indirect method because it uses the same addresses as
> * the MMIO offsets (NPU RING)
>
More information about the Skiboot
mailing list