[Skiboot] [PATCH 1/2] npu2-hw-procedures: Add platform hook to tune PHY setup

Frederic Barrat fbarrat at linux.ibm.com
Tue Mar 31 20:47:34 AEDT 2020


Add a hook to tune the PHY settings if needed. Only on the opencapi
path for now, since it seems to be only useful there.
It will be used on a later patch for Mihawk.

Signed-off-by: Frederic Barrat <fbarrat at linux.ibm.com>
Cc: skiboot-stable at lists.ozlabs.org # skiboot-op940.x
---
 hw/npu2-hw-procedures.c | 3 +++
 include/platform.h      | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c
index 6236380a..890b25a8 100644
--- a/hw/npu2-hw-procedures.c
+++ b/hw/npu2-hw-procedures.c
@@ -1020,6 +1020,9 @@ void npu2_opencapi_bump_ui_lane(struct npu2_dev *dev)
 
 void npu2_opencapi_phy_init(struct npu2_dev *dev)
 {
+	if (platform.ocapi->phy_setup)
+		platform.ocapi->phy_setup(dev);
+
 	run_procedure(dev, 5); /* procedure_phy_tx_zcal */
 	/*
 	 * This is only required for OpenCAPI - Hostboot tries to set this
diff --git a/include/platform.h b/include/platform.h
index 6aa263ae..c045883d 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -11,6 +11,7 @@ struct pci_slot;
 struct errorlog;
 struct npu2;
 struct npu3;
+struct npu2_dev;
 
 enum resource_id {
 	RESOURCE_ID_KERNEL,
@@ -64,6 +65,7 @@ struct platform_ocapi {
 	bool odl_phy_swap;		/* Swap ODL1 to use brick 2 rather than
 					 * brick 1 lanes */
 	const char *(*ocapi_slot_label)(uint32_t chip_id, uint32_t brick_index);
+	void (*phy_setup)(struct npu2_dev *dev);
 };
 
 struct dt_node;
-- 
2.25.1



More information about the Skiboot mailing list