[Skiboot] [PATCH v2] Add the other 7 ATSD registers to the device tree.

Oliver oohall at gmail.com
Fri Nov 16 14:06:59 AEDT 2018


On Fri, Nov 16, 2018 at 2:04 PM Rashmica Gupta <rashmica.g at gmail.com> wrote:
>
> Suggested-by: Alexey Kardashevskiy <aik at ozlabs.ru>
> Signed-off-by: Rashmica Gupta <rashmica.g at gmail.com>
> ---
>  hw/npu2.c           | 15 ++++++++++-----
>  include/npu2-regs.h |  2 ++
>  2 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/hw/npu2.c b/hw/npu2.c
> index d7d94357..30049f5b 100644
> --- a/hw/npu2.c
> +++ b/hw/npu2.c
> @@ -1781,7 +1781,7 @@ static void npu2_add_phb_properties(struct npu2 *p)
>  {
>         struct dt_node *np = p->phb_nvlink.dt_node;
>         uint32_t icsp = get_ics_phandle();
> -       uint64_t mm_base, mm_size, mmio_atsd;
> +       uint64_t mm_base, mm_size;
>
>         /*
>          * Add various properties that HB doesn't have to
> @@ -1803,10 +1803,15 @@ static void npu2_add_phb_properties(struct npu2 *p)
>         dt_add_property_cells(np, "ibm,opal-reserved-pe",
>                               NPU2_RESERVED_PE_NUM);
>
> -       mmio_atsd = (u64) p->regs +
> -               NPU2_REG_OFFSET(NPU2_STACK_ATSD, NPU2_BLOCK_ATSD0, NPU2_XTS_MMIO_ATSD_LAUNCH);
> -       dt_add_property_cells(np, "ibm,mmio-atsd", hi32(mmio_atsd),
> -                             lo32(mmio_atsd));
> +       dt_add_property_u64s(np, "ibm,mmio-atsd",
> +                       MMIO_ATSD_ADDR(p->regs, 0),
> +                       MMIO_ATSD_ADDR(p->regs, 1),
> +                       MMIO_ATSD_ADDR(p->regs, 2),
> +                       MMIO_ATSD_ADDR(p->regs, 3),
> +                       MMIO_ATSD_ADDR(p->regs, 4),
> +                       MMIO_ATSD_ADDR(p->regs, 5),
> +                       MMIO_ATSD_ADDR(p->regs, 6),
> +                       MMIO_ATSD_ADDR(p->regs, 7));

cool

Reviewed-by: Oliver O'Halloran <oohall at gmail.com>

>
>         /*
>          * Memory window is exposed as 64-bits non-prefetchable
> diff --git a/include/npu2-regs.h b/include/npu2-regs.h
> index 8c1ba5ff..165e0b79 100644
> --- a/include/npu2-regs.h
> +++ b/include/npu2-regs.h
> @@ -579,6 +579,8 @@ void npu2_scom_write(uint64_t gcid, uint64_t scom_base,
>  #define NPU2_XTS_MMIO_ATSD_LAUNCH              0x000
>  #define NPU2_XTS_MMIO_ATSD_AVA                 0x008
>  #define NPU2_XTS_MMIO_ATSD_STATUS              0x010
> +#define MMIO_ATSD_ADDR(p, n)                   (u64) p + NPU2_REG_OFFSET(NPU2_STACK_ATSD,\
> +                                               NPU2_BLOCK_ATSD##n, NPU2_XTS_MMIO_ATSD_LAUNCH)
>
>  /* ALTD SCOM addresses */
>  #define NPU2_MISC_SCOM_IND_SCOM_ADDR           0x68e
> --
> 2.17.2
>
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot


More information about the Skiboot mailing list