> -----Original Message----- > From: U-Boot <u-boot-boun...@lists.denx.de> On Behalf Of Madalin Bucur > Sent: Thursday, April 23, 2020 16:25 > To: u-boot@lists.denx.de > Cc: Ruchika Gupta <ruchika.gu...@nxp.com>; joe.hershber...@ni.com; > s...@chromium.org; Priyanka Jain (OSS) <priyanka.j...@oss.nxp.com>; > tr...@konsulko.com; Ioana Ciornei <ioana.cior...@nxp.com>; Madalin Bucur > (OSS) <madalin.bu...@oss.nxp.com> > Subject: [PATCH 09/12] driver: net: fm: add DM ETH support > > Probe the FMan MACs based on the device tree while > retaining the legacy code/functionality. > One notable change introduced here is that, for DM_ETH, > the name of the interfaces is corrected to the fmX-macY > format, that avoids the referral to the MAC block names > which were incorrect for FMan v3 devices (i.e. DTSEC, > TGEC) and had weird formatting (i.e. FM1@DTSEC6, FM1@TGEC1). > The legacy code is left unchanged in this respect. > > Signed-off-by: Madalin Bucur <madalin.bu...@oss.nxp.com>
<snip> > @@ -37,10 +46,18 @@ static void dtsec_configure_serdes(struct fm_eth > *priv) > #ifdef CONFIG_SYS_FMAN_V3 > u32 value; > struct mii_dev bus; > - bus.priv = priv->mac->phyregs; > bool sgmii_2500 = (priv->enet_if == > PHY_INTERFACE_MODE_SGMII_2500) ? true : false; > - int i = 0; > + int i = 0, j; > + > +#ifndef CONFIG_DM_ETH > + bus.priv = priv->mac->phyregs; > +#else > + bus.priv = priv->pcs_mdio; > +#endif > + bus.read = memac_mdio_read; > + bus.write = memac_mdio_write; > + bus.reset = memac_mdio_reset; The read/write/reset callback changes should be added for the DM_ETH case only. Camelia