diff options
author | Chris Packham <judge.packham@gmail.com> | 2018-07-09 21:34:00 +1200 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-07-26 14:08:21 -0500 |
commit | fb7310769882c2fb9716352a78744327e72c2430 (patch) | |
tree | 79945c4b4254d3c6a610ce94da75a93659ba19dc /drivers/net/mvgbe.h | |
parent | e9bf75c9d3b2494c985fd4a21db8036b493fbd11 (diff) | |
download | u-boot-fb7310769882c2fb9716352a78744327e72c2430.zip u-boot-fb7310769882c2fb9716352a78744327e72c2430.tar.gz u-boot-fb7310769882c2fb9716352a78744327e72c2430.tar.bz2 |
net: mvgbe: convert to DM
Add driver model support to the mvgbe driver. As a temporary measure
both DM and non-DM uses are supported. Once all the users have been
converted the non-DM support can be dropped.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Tested-by: Michael Walle <michael@walle.cc>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/mvgbe.h')
-rw-r--r-- | drivers/net/mvgbe.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h index 1dc9bbe..44541c0 100644 --- a/drivers/net/mvgbe.h +++ b/drivers/net/mvgbe.h @@ -30,7 +30,9 @@ #define RXUQ 0 /* Used Rx queue */ #define TXUQ 0 /* Used Rx queue */ +#ifndef CONFIG_DM_ETH #define to_mvgbe(_d) container_of(_d, struct mvgbe_device, dev) +#endif #define MVGBE_REG_WR(adr, val) writel(val, &adr) #define MVGBE_REG_RD(adr) readl(&adr) #define MVGBE_REG_BITS_RESET(adr, val) writel(readl(&adr) & ~(val), &adr) @@ -479,13 +481,27 @@ struct mvgbe_txdesc { /* port device data struct */ struct mvgbe_device { +#ifndef CONFIG_DM_ETH struct eth_device dev; +#endif struct mvgbe_registers *regs; struct mvgbe_txdesc *p_txdesc; struct mvgbe_rxdesc *p_rxdesc; struct mvgbe_rxdesc *p_rxdesc_curr; u8 *p_rxbuf; u8 *p_aligned_txbuf; + +#ifdef CONFIG_DM_ETH + phy_interface_t phy_interface; + unsigned int link; + unsigned int duplex; + unsigned int speed; + + int init; + int phyaddr; + struct phy_device *phydev; + struct mii_dev *bus; +#endif }; #endif /* __MVGBE_H__ */ |