The XPCS in these NXP switches returns 0 when reading the ID registers, and is integrated with a custom PMA. The current way to support it is with hijacked PHYID register reads in sja1105_pcs_mdio_read_c45(), to fake that it returns NXP_SJA1105_XPCS_ID. The new way to support it is with a specific compatible string. This makes the platform XPCS driver use a specific struct dw_xpcs_info which it assigns to mdiodev->dev.platform_data, and from there, xpcs_init_id() picks it up and uses it. Later, xpcs_identify() doesn't overwrite the xpcs->info.pcs and xpcs->info.pma unless they are set to DW_XPCS_ID_NATIVE and DW_XPCS_PMA_ID_NATIVE, aka zeroes. Since what is custom is the PMA and not the PCS, a later patch will probably have to move the NXP constants around. But that should be done only after this becomes strictly XPCS internal business. Cc: Serge Semin Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: devicetree@vger.kernel.org Signed-off-by: Vladimir Oltean --- v1->v2: none drivers/net/pcs/pcs-xpcs-plat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/pcs/pcs-xpcs-plat.c b/drivers/net/pcs/pcs-xpcs-plat.c index 2bc0afe2bbb4..a256ae40c757 100644 --- a/drivers/net/pcs/pcs-xpcs-plat.c +++ b/drivers/net/pcs/pcs-xpcs-plat.c @@ -476,6 +476,8 @@ DW_XPCS_INFO_DECLARE(xpcs_pma_gen4_3g, DW_XPCS_ID_NATIVE, DW_XPCS_PMA_GEN4_3G_ID DW_XPCS_INFO_DECLARE(xpcs_pma_gen4_6g, DW_XPCS_ID_NATIVE, DW_XPCS_PMA_GEN4_6G_ID); DW_XPCS_INFO_DECLARE(xpcs_pma_gen5_10g, DW_XPCS_ID_NATIVE, DW_XPCS_PMA_GEN5_10G_ID); DW_XPCS_INFO_DECLARE(xpcs_pma_gen5_12g, DW_XPCS_ID_NATIVE, DW_XPCS_PMA_GEN5_12G_ID); +DW_XPCS_INFO_DECLARE(xpcs_sja1105, NXP_SJA1105_XPCS_ID, DW_XPCS_PMA_ID_NATIVE); +DW_XPCS_INFO_DECLARE(xpcs_sja1110, NXP_SJA1110_XPCS_ID, DW_XPCS_PMA_ID_NATIVE); static const struct of_device_id xpcs_of_ids[] = { { .compatible = "snps,dw-xpcs", .data = &xpcs_generic }, @@ -486,6 +488,8 @@ static const struct of_device_id xpcs_of_ids[] = { { .compatible = "snps,dw-xpcs-gen4-6g", .data = &xpcs_pma_gen4_6g }, { .compatible = "snps,dw-xpcs-gen5-10g", .data = &xpcs_pma_gen5_10g }, { .compatible = "snps,dw-xpcs-gen5-12g", .data = &xpcs_pma_gen5_12g }, + { .compatible = "nxp,sja1105-pcs", .data = &xpcs_sja1105 }, + { .compatible = "nxp,sja1110-pcs", .data = &xpcs_sja1110 }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, xpcs_of_ids); -- 2.34.1