diff options
author | Reza Arbab <arbab@linux.ibm.com> | 2019-07-17 15:44:25 -0500 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-07-26 15:30:21 +1000 |
commit | aa3fc69fef205fc4e8d2ad2d65a5d1e3fa8b1ec7 (patch) | |
tree | d210ab3cde38ba164879b5e4f679fd8d9efae906 /hw/npu-opal.c | |
parent | d9b06b855e8b858976491c19ab9bd792e3a4c3e5 (diff) | |
download | skiboot-aa3fc69fef205fc4e8d2ad2d65a5d1e3fa8b1ec7.zip skiboot-aa3fc69fef205fc4e8d2ad2d65a5d1e3fa8b1ec7.tar.gz skiboot-aa3fc69fef205fc4e8d2ad2d65a5d1e3fa8b1ec7.tar.bz2 |
hw: Introduce npu3
POWER9P systems have been upgraded with NVLink 3.0 interconnects. The
underlying hardware is fundamentally different--each POWER9 chip has
(1 NPU) * (3 stacks) * (2 bricks) = (6 links)
Where in each POWER9P chip, there are
(3 NPUs) * (4 bricks) = (12 links)
This flatter hierarchy simplifies the firmware implementation a bit, but
also prevents sharing much common code with npu2.
As in previous versions, initialize the hardware and expose each link to
the OS as a virtual PCIe device. This initial support covers NVLink
devices only, with OpenCAPI to follow.
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw/npu-opal.c')
-rw-r--r-- | hw/npu-opal.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/hw/npu-opal.c b/hw/npu-opal.c index f106c73..208ec51 100644 --- a/hw/npu-opal.c +++ b/hw/npu-opal.c @@ -18,16 +18,23 @@ #include <pci.h> #include <phb4.h> #include <npu2.h> +#include <npu3.h> static int64_t opal_npu_init_context(uint64_t phb_id, int pid __unused, uint64_t msr, uint64_t bdf) { struct phb *phb = pci_get_phb(phb_id); - if (!phb || phb->phb_type != phb_type_npu_v2) + if (!phb) return OPAL_PARAMETER; - return npu2_init_context(phb, msr, bdf); + if (phb->phb_type == phb_type_npu_v2) + return npu2_init_context(phb, msr, bdf); + + if (phb->phb_type == phb_type_npu_v3) + return npu3_init_context(phb, msr, bdf); + + return OPAL_PARAMETER; } opal_call(OPAL_NPU_INIT_CONTEXT, opal_npu_init_context, 4); @@ -36,10 +43,16 @@ static int64_t opal_npu_destroy_context(uint64_t phb_id, uint64_t pid __unused, { struct phb *phb = pci_get_phb(phb_id); - if (!phb || phb->phb_type != phb_type_npu_v2) + if (!phb) return OPAL_PARAMETER; - return npu2_destroy_context(phb, bdf); + if (phb->phb_type == phb_type_npu_v2) + return npu2_destroy_context(phb, bdf); + + if (phb->phb_type == phb_type_npu_v3) + return npu3_destroy_context(phb, bdf); + + return OPAL_PARAMETER; } opal_call(OPAL_NPU_DESTROY_CONTEXT, opal_npu_destroy_context, 3); @@ -48,10 +61,16 @@ static int64_t opal_npu_map_lpar(uint64_t phb_id, uint64_t bdf, uint64_t lparid, { struct phb *phb = pci_get_phb(phb_id); - if (!phb || phb->phb_type != phb_type_npu_v2) + if (!phb) return OPAL_PARAMETER; - return npu2_map_lpar(phb, bdf, lparid, lpcr); + if (phb->phb_type == phb_type_npu_v2) + return npu2_map_lpar(phb, bdf, lparid, lpcr); + + if (phb->phb_type == phb_type_npu_v3) + return npu3_map_lpar(phb, bdf, lparid, lpcr); + + return OPAL_PARAMETER; } opal_call(OPAL_NPU_MAP_LPAR, opal_npu_map_lpar, 4); @@ -81,10 +100,13 @@ static int64_t npu_set_relaxed_order(uint32_t gcid, int pec, bool enable) int64_t rc; for_each_phb(phb) { - if (phb->phb_type != phb_type_npu_v2) + if (phb->phb_type == phb_type_npu_v2) + rc = npu2_set_relaxed_order(phb, gcid, pec, enable); + else if (phb->phb_type == phb_type_npu_v3) + rc = npu3_set_relaxed_order(phb, gcid, pec, enable); + else continue; - rc = npu2_set_relaxed_order(phb, gcid, pec, enable); if (rc) return rc; } |