xref: /openbmc/linux/drivers/net/pcs/pcs-xpcs-nxp.c (revision dd0721ea)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright 2021 NXP Semiconductors
3  */
4 #include <linux/pcs/pcs-xpcs.h>
5 #include "pcs-xpcs.h"
6 
7 /* In NXP SJA1105, the PCS is integrated with a PMA that has the TX lane
8  * polarity inverted by default (PLUS is MINUS, MINUS is PLUS). To obtain
9  * normal non-inverted behavior, the TX lane polarity must be inverted in the
10  * PCS, via the DIGITAL_CONTROL_2 register.
11  */
12 int nxp_sja1105_sgmii_pma_config(struct dw_xpcs *xpcs)
13 {
14 	return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL2,
15 			  DW_VR_MII_DIG_CTRL2_TX_POL_INV);
16 }
17