mirror of
https://github.com/torvalds/linux.git
synced 2024-12-06 02:52:22 +00:00
net/fsl: xgmac_mdio: Support preamble suppression
Support the standard "suppress-preamble" attribute to disable preamble generation. Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1d14eb15dc
commit
909bea7348
@ -39,6 +39,7 @@ struct tgec_mdio_controller {
|
||||
#define MDIO_STAT_CLKDIV(x) (((x>>1) & 0xff) << 8)
|
||||
#define MDIO_STAT_BSY BIT(0)
|
||||
#define MDIO_STAT_RD_ER BIT(1)
|
||||
#define MDIO_STAT_PRE_DIS BIT(5)
|
||||
#define MDIO_CTL_DEV_ADDR(x) (x & 0x1f)
|
||||
#define MDIO_CTL_PORT_ADDR(x) ((x & 0x1f) << 5)
|
||||
#define MDIO_CTL_PRE_DIS BIT(10)
|
||||
@ -254,6 +255,21 @@ irq_restore:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void xgmac_mdio_set_suppress_preamble(struct mii_bus *bus)
|
||||
{
|
||||
struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv;
|
||||
struct tgec_mdio_controller __iomem *regs = priv->mdio_base;
|
||||
struct device *dev = bus->parent;
|
||||
u32 mdio_stat;
|
||||
|
||||
if (!device_property_read_bool(dev, "suppress-preamble"))
|
||||
return;
|
||||
|
||||
mdio_stat = xgmac_read32(®s->mdio_stat, priv->is_little_endian);
|
||||
mdio_stat |= MDIO_STAT_PRE_DIS;
|
||||
xgmac_write32(mdio_stat, ®s->mdio_stat, priv->is_little_endian);
|
||||
}
|
||||
|
||||
static int xgmac_mdio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct fwnode_handle *fwnode;
|
||||
@ -301,6 +317,8 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
|
||||
priv->has_a011043 = device_property_read_bool(&pdev->dev,
|
||||
"fsl,erratum-a011043");
|
||||
|
||||
xgmac_mdio_set_suppress_preamble(bus);
|
||||
|
||||
fwnode = pdev->dev.fwnode;
|
||||
if (is_of_node(fwnode))
|
||||
ret = of_mdiobus_register(bus, to_of_node(fwnode));
|
||||
|
Loading…
Reference in New Issue
Block a user