static int aquantia_dts_config(struct phy_device *phydev)
{
-#ifdef CONFIG_DM_ETH
ofnode node = phydev->node;
u32 prop;
u16 reg;
(u16)(prop << 1));
}
-#endif
return 0;
}
static int ar803x_of_init(struct phy_device *phydev)
{
-#if defined(CONFIG_DM_ETH)
struct ar803x_priv *priv;
ofnode node, vddio_reg_node;
u32 strength, freq, min_uV, max_uV;
debug("%s: flags=%x clk_25m_reg=%04x clk_25m_mask=%04x\n", __func__,
priv->flags, priv->clk_25m_reg, priv->clk_25m_mask);
-#endif
return 0;
}
return 0;
}
-#if defined(CONFIG_DM_ETH)
/**
* dp83867_data_init - Convenience function for setting PHY specific data
*
return 0;
}
-#else
-static int dp83867_of_init(struct phy_device *phydev)
-{
- struct dp83867_private *dp83867 = phydev->priv;
-
- dp83867->rx_id_delay = DP83867_RGMIIDCTL_2_25_NS;
- dp83867->tx_id_delay = DP83867_RGMIIDCTL_2_75_NS;
- dp83867->fifo_depth = DEFAULT_FIFO_DEPTH;
- dp83867->io_impedance = -EINVAL;
-
- return 0;
-}
-#endif
static int dp83867_config(struct phy_device *phydev)
{
return 0;
}
-#ifdef CONFIG_DM_ETH
static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
1750, 2000, 2250, 2500, 2750, 3000,
3250, 3500, 3750, 4000};
return 0;
}
-#else
-static int dp83869_of_init(struct phy_device *phydev)
-{
- struct dp83869_private *dp83869 = phydev->priv;
-
- dp83869->rx_int_delay = DP83869_RGMIIDCTL_2_25_NS;
- dp83869->tx_int_delay = DP83869_RGMIIDCTL_2_75_NS;
- dp83869->fifo_depth = DEFAULT_FIFO_DEPTH;
- dp83869->io_impedance = -EINVAL;
-
- return 0;
-}
-#endif /* CONFIG_OF_MDIO */
static int dp83869_configure_rgmii(struct phy_device *phydev,
struct dp83869_private *dp83869)
#define MIIM_88E151x_MODE_SGMII 1
#define MIIM_88E151x_RESET_OFFS 15
-#if IS_ENABLED(CONFIG_DM_ETH)
static int marvell_read_page(struct phy_device *phydev)
{
return phy_read(phydev, MDIO_DEVAD_NONE, MII_MARVELL_PHY_PAGE);
err:
return marvell_write_page(phydev, saved_page);
}
-#else
-static int marvell_of_reg_init(struct phy_device *phydev)
-{
- return 0;
-}
-#endif /* CONFIG_DM_ETH */
static int m88e1xxx_phy_extread(struct phy_device *phydev, int addr,
int devaddr, int regnum)
}
/* Common OF config bits for KSZ9021 and KSZ9031 */
-#ifdef CONFIG_DM_ETH
struct ksz90x1_reg_field {
const char *name;
const u8 size; /* Size of the bitfield, in bits */
return ret;
}
-#else /* !CONFIG_DM_ETH */
-static int ksz9021_of_config(struct phy_device *phydev)
-{
- return 0;
-}
-
-static int ksz9031_of_config(struct phy_device *phydev)
-{
- return 0;
-}
-
-static int ksz9031_center_flp_timing(struct phy_device *phydev)
-{
- return 0;
-}
-#endif
-
/*
* KSZ9021
*/
dev->link = 0;
dev->interface = PHY_INTERFACE_MODE_NA;
-#ifdef CONFIG_DM_ETH
dev->node = ofnode_null();
-#endif
dev->autoneg = AUTONEG_ENABLE;
return get_phy_device_by_mask(bus, phy_mask);
}
-#ifdef CONFIG_DM_ETH
void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
phy_interface_t interface)
-#else
-void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev,
- phy_interface_t interface)
-#endif
{
/* Soft Reset the PHY */
phy_reset(phydev);
}
#endif
-#ifdef CONFIG_DM_ETH
struct phy_device *phy_connect(struct mii_dev *bus, int addr,
struct udevice *dev,
phy_interface_t interface)
-#else
-struct phy_device *phy_connect(struct mii_dev *bus, int addr,
- struct eth_device *dev,
- phy_interface_t interface)
-#endif
{
struct phy_device *phydev = NULL;
uint mask = (addr >= 0) ? (1 << addr) : 0xffffffff;
struct phy_driver *drv;
void *priv;
-#ifdef CONFIG_DM_ETH
struct udevice *dev;
ofnode node;
-#else
- struct eth_device *dev;
-#endif
/* forced speed & duplex (no autoneg)
* partner speed & duplex & pause (autoneg)
#endif
-#ifdef CONFIG_DM_ETH
-
/**
* phy_connect_dev() - Associates the given pair of PHY and Ethernet devices
* @phydev: PHY device
else
return dev_ofnode(phydev->dev);
}
-#else
-
-/**
- * phy_connect_dev() - Associates the given pair of PHY and Ethernet devices
- * @phydev: PHY device
- * @dev: Ethernet device
- * @interface: type of MAC-PHY interface
- */
-void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev,
- phy_interface_t interface);
-
-/**
- * phy_connect() - Creates a PHY device for the Ethernet interface
- * Creates a PHY device for the PHY at the given address, if one doesn't exist
- * already, and associates it with the Ethernet device.
- * The function may be called with addr <= 0, in this case addr value is ignored
- * and the bus is scanned to detect a PHY. Scanning should only be used if only
- * one PHY is expected to be present on the MDIO bus, otherwise it is undefined
- * which PHY is returned.
- *
- * @bus: MII/MDIO bus that hosts the PHY
- * @addr: PHY address on MDIO bus
- * @dev: Ethernet device to associate to the PHY
- * @interface: type of MAC-PHY interface
- * @return: pointer to phy_device if a PHY is found, or NULL otherwise
- */
-struct phy_device *phy_connect(struct mii_dev *bus, int addr,
- struct eth_device *dev,
- phy_interface_t interface);
-
-static inline ofnode phy_get_ofnode(struct phy_device *phydev)
-{
- return ofnode_null();
-}
-#endif
int phy_read(struct phy_device *phydev, int devad, int regnum);
int phy_write(struct phy_device *phydev, int devad, int regnum, u16 val);