drivers: net: apply serdes configuration for ENETC Ethernet interfaces

Ethernet interfaces using serial protocols go through the serdes block
integrated in the SoC.  This is accessed over dedicated internal MDIOs
which are part of the Ethernet PCI functions.  Set up serdes at _start,
along with other protocol specific port/MAC configuration.
MDIO code is shared with enetc_mdio, read/write functions are exported
from fsl_enetc_mdio for this reason.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Alex Marginean 2019-07-03 12:11:42 +03:00 committed by Joe Hershberger
parent 1d99534bef
commit e4aafd5c20
3 changed files with 189 additions and 5 deletions

View file

@ -21,8 +21,8 @@ static void enetc_mdio_wait_bsy(struct enetc_mdio_priv *priv)
cpu_relax();
}
static int enetc_mdio_read_priv(struct enetc_mdio_priv *priv, int addr,
int devad, int reg)
int enetc_mdio_read_priv(struct enetc_mdio_priv *priv, int addr, int devad,
int reg)
{
if (devad == MDIO_DEVAD_NONE)
enetc_write(priv, ENETC_MDIO_CFG, ENETC_EMDIO_CFG_C22);
@ -51,8 +51,8 @@ static int enetc_mdio_read_priv(struct enetc_mdio_priv *priv, int addr,
return enetc_read(priv, ENETC_MDIO_DATA);
}
static int enetc_mdio_write_priv(struct enetc_mdio_priv *priv, int addr,
int devad, int reg, u16 val)
int enetc_mdio_write_priv(struct enetc_mdio_priv *priv, int addr, int devad,
int reg, u16 val)
{
if (devad == MDIO_DEVAD_NONE)
enetc_write(priv, ENETC_MDIO_CFG, ENETC_EMDIO_CFG_C22);