xref: /openbmc/linux/drivers/net/phy/icplus.c (revision f2f1a847e74f61fb151e0f6f689a8485345ed1fc)
10cefeebaSMichael Barkowski /*
20cefeebaSMichael Barkowski  * Driver for ICPlus PHYs
30cefeebaSMichael Barkowski  *
40cefeebaSMichael Barkowski  * Copyright (c) 2007 Freescale Semiconductor, Inc.
50cefeebaSMichael Barkowski  *
60cefeebaSMichael Barkowski  * This program is free software; you can redistribute  it and/or modify it
70cefeebaSMichael Barkowski  * under  the terms of  the GNU General  Public License as published by the
80cefeebaSMichael Barkowski  * Free Software Foundation;  either version 2 of the  License, or (at your
90cefeebaSMichael Barkowski  * option) any later version.
100cefeebaSMichael Barkowski  *
110cefeebaSMichael Barkowski  */
120cefeebaSMichael Barkowski #include <linux/kernel.h>
130cefeebaSMichael Barkowski #include <linux/string.h>
140cefeebaSMichael Barkowski #include <linux/errno.h>
150cefeebaSMichael Barkowski #include <linux/unistd.h>
160cefeebaSMichael Barkowski #include <linux/interrupt.h>
170cefeebaSMichael Barkowski #include <linux/init.h>
180cefeebaSMichael Barkowski #include <linux/delay.h>
190cefeebaSMichael Barkowski #include <linux/netdevice.h>
200cefeebaSMichael Barkowski #include <linux/etherdevice.h>
210cefeebaSMichael Barkowski #include <linux/skbuff.h>
220cefeebaSMichael Barkowski #include <linux/spinlock.h>
230cefeebaSMichael Barkowski #include <linux/mm.h>
240cefeebaSMichael Barkowski #include <linux/module.h>
250cefeebaSMichael Barkowski #include <linux/mii.h>
260cefeebaSMichael Barkowski #include <linux/ethtool.h>
270cefeebaSMichael Barkowski #include <linux/phy.h>
28*f2f1a847SMartin Blumenstingl #include <linux/property.h>
290cefeebaSMichael Barkowski 
300cefeebaSMichael Barkowski #include <asm/io.h>
310cefeebaSMichael Barkowski #include <asm/irq.h>
327c0f6ba6SLinus Torvalds #include <linux/uaccess.h>
330cefeebaSMichael Barkowski 
34e3e09f26SGiuseppe CAVALLARO MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers");
350cefeebaSMichael Barkowski MODULE_AUTHOR("Michael Barkowski");
360cefeebaSMichael Barkowski MODULE_LICENSE("GPL");
370cefeebaSMichael Barkowski 
38e3e09f26SGiuseppe CAVALLARO /* IP101A/G - IP1001 */
399c9b1f24SGiuseppe CAVALLARO #define IP10XX_SPEC_CTRL_STATUS		16	/* Spec. Control Register */
40ee336140SMartin Blumenstingl #define IP1001_RXPHASE_SEL		BIT(0)	/* Add delay on RX_CLK */
41ee336140SMartin Blumenstingl #define IP1001_TXPHASE_SEL		BIT(1)	/* Add delay on TX_CLK */
429c9b1f24SGiuseppe CAVALLARO #define IP1001_SPEC_CTRL_STATUS_2	20	/* IP1001 Spec. Control Reg 2 */
439c9b1f24SGiuseppe CAVALLARO #define IP1001_APS_ON			11	/* IP1001 APS Mode  bit */
44ee336140SMartin Blumenstingl #define IP101A_G_APS_ON			BIT(1)	/* IP101A/G APS Mode bit */
45996f7393SGiuseppe CAVALLARO #define IP101A_G_IRQ_CONF_STATUS	0x11	/* Conf Info IRQ & Status Reg */
46ba2f55b0SHeiner Kallweit #define	IP101A_G_IRQ_PIN_USED		BIT(15) /* INTR pin used */
47a872c388SMartin Blumenstingl #define IP101A_G_IRQ_ALL_MASK		BIT(11) /* IRQ's inactive */
48f7e290fbSMartin Blumenstingl #define IP101A_G_IRQ_SPEED_CHANGE	BIT(2)
49f7e290fbSMartin Blumenstingl #define IP101A_G_IRQ_DUPLEX_CHANGE	BIT(1)
50f7e290fbSMartin Blumenstingl #define IP101A_G_IRQ_LINK_CHANGE	BIT(0)
519c9b1f24SGiuseppe CAVALLARO 
52*f2f1a847SMartin Blumenstingl #define IP101G_DIGITAL_IO_SPEC_CTRL			0x1d
53*f2f1a847SMartin Blumenstingl #define IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32		BIT(2)
54*f2f1a847SMartin Blumenstingl 
55*f2f1a847SMartin Blumenstingl /* The 32-pin IP101GR package can re-configure the mode of the RXER/INTR_32 pin
56*f2f1a847SMartin Blumenstingl  * (pin number 21). The hardware default is RXER (receive error) mode. But it
57*f2f1a847SMartin Blumenstingl  * can be configured to interrupt mode manually.
58*f2f1a847SMartin Blumenstingl  */
59*f2f1a847SMartin Blumenstingl enum ip101gr_sel_intr32 {
60*f2f1a847SMartin Blumenstingl 	IP101GR_SEL_INTR32_KEEP,
61*f2f1a847SMartin Blumenstingl 	IP101GR_SEL_INTR32_INTR,
62*f2f1a847SMartin Blumenstingl 	IP101GR_SEL_INTR32_RXER,
63*f2f1a847SMartin Blumenstingl };
64*f2f1a847SMartin Blumenstingl 
65*f2f1a847SMartin Blumenstingl struct ip101a_g_phy_priv {
66*f2f1a847SMartin Blumenstingl 	enum ip101gr_sel_intr32 sel_intr32;
67*f2f1a847SMartin Blumenstingl };
68*f2f1a847SMartin Blumenstingl 
690cefeebaSMichael Barkowski static int ip175c_config_init(struct phy_device *phydev)
700cefeebaSMichael Barkowski {
710cefeebaSMichael Barkowski 	int err, i;
729ed66cb5SFlorian Fainelli 	static int full_reset_performed;
730cefeebaSMichael Barkowski 
740cefeebaSMichael Barkowski 	if (full_reset_performed == 0) {
750cefeebaSMichael Barkowski 
760cefeebaSMichael Barkowski 		/* master reset */
77e5a03bfdSAndrew Lunn 		err = mdiobus_write(phydev->mdio.bus, 30, 0, 0x175c);
780cefeebaSMichael Barkowski 		if (err < 0)
790cefeebaSMichael Barkowski 			return err;
800cefeebaSMichael Barkowski 
810cefeebaSMichael Barkowski 		/* ensure no bus delays overlap reset period */
82e5a03bfdSAndrew Lunn 		err = mdiobus_read(phydev->mdio.bus, 30, 0);
830cefeebaSMichael Barkowski 
840cefeebaSMichael Barkowski 		/* data sheet specifies reset period is 2 msec */
850cefeebaSMichael Barkowski 		mdelay(2);
860cefeebaSMichael Barkowski 
870cefeebaSMichael Barkowski 		/* enable IP175C mode */
88e5a03bfdSAndrew Lunn 		err = mdiobus_write(phydev->mdio.bus, 29, 31, 0x175c);
890cefeebaSMichael Barkowski 		if (err < 0)
900cefeebaSMichael Barkowski 			return err;
910cefeebaSMichael Barkowski 
920cefeebaSMichael Barkowski 		/* Set MII0 speed and duplex (in PHY mode) */
93e5a03bfdSAndrew Lunn 		err = mdiobus_write(phydev->mdio.bus, 29, 22, 0x420);
940cefeebaSMichael Barkowski 		if (err < 0)
950cefeebaSMichael Barkowski 			return err;
960cefeebaSMichael Barkowski 
970cefeebaSMichael Barkowski 		/* reset switch ports */
980cefeebaSMichael Barkowski 		for (i = 0; i < 5; i++) {
99e5a03bfdSAndrew Lunn 			err = mdiobus_write(phydev->mdio.bus, i,
1000cefeebaSMichael Barkowski 					    MII_BMCR, BMCR_RESET);
1010cefeebaSMichael Barkowski 			if (err < 0)
1020cefeebaSMichael Barkowski 				return err;
1030cefeebaSMichael Barkowski 		}
1040cefeebaSMichael Barkowski 
1050cefeebaSMichael Barkowski 		for (i = 0; i < 5; i++)
106e5a03bfdSAndrew Lunn 			err = mdiobus_read(phydev->mdio.bus, i, MII_BMCR);
1070cefeebaSMichael Barkowski 
1080cefeebaSMichael Barkowski 		mdelay(2);
1090cefeebaSMichael Barkowski 
1100cefeebaSMichael Barkowski 		full_reset_performed = 1;
1110cefeebaSMichael Barkowski 	}
1120cefeebaSMichael Barkowski 
113e5a03bfdSAndrew Lunn 	if (phydev->mdio.addr != 4) {
1140cefeebaSMichael Barkowski 		phydev->state = PHY_RUNNING;
1150cefeebaSMichael Barkowski 		phydev->speed = SPEED_100;
1160cefeebaSMichael Barkowski 		phydev->duplex = DUPLEX_FULL;
1170cefeebaSMichael Barkowski 		phydev->link = 1;
1180cefeebaSMichael Barkowski 		netif_carrier_on(phydev->attached_dev);
1190cefeebaSMichael Barkowski 	}
1200cefeebaSMichael Barkowski 
1210cefeebaSMichael Barkowski 	return 0;
1220cefeebaSMichael Barkowski }
1230cefeebaSMichael Barkowski 
1249c9b1f24SGiuseppe CAVALLARO static int ip1xx_reset(struct phy_device *phydev)
125377ecca9SGiuseppe CAVALLARO {
126b8e3995aSDavid McKay 	int bmcr;
127377ecca9SGiuseppe CAVALLARO 
128377ecca9SGiuseppe CAVALLARO 	/* Software Reset PHY */
1299c9b1f24SGiuseppe CAVALLARO 	bmcr = phy_read(phydev, MII_BMCR);
130b8e3995aSDavid McKay 	if (bmcr < 0)
131b8e3995aSDavid McKay 		return bmcr;
1329c9b1f24SGiuseppe CAVALLARO 	bmcr |= BMCR_RESET;
133b8e3995aSDavid McKay 	bmcr = phy_write(phydev, MII_BMCR, bmcr);
134b8e3995aSDavid McKay 	if (bmcr < 0)
135b8e3995aSDavid McKay 		return bmcr;
136377ecca9SGiuseppe CAVALLARO 
137377ecca9SGiuseppe CAVALLARO 	do {
1389c9b1f24SGiuseppe CAVALLARO 		bmcr = phy_read(phydev, MII_BMCR);
139b8e3995aSDavid McKay 		if (bmcr < 0)
140b8e3995aSDavid McKay 			return bmcr;
1419c9b1f24SGiuseppe CAVALLARO 	} while (bmcr & BMCR_RESET);
1429c9b1f24SGiuseppe CAVALLARO 
143b8e3995aSDavid McKay 	return 0;
1449c9b1f24SGiuseppe CAVALLARO }
1459c9b1f24SGiuseppe CAVALLARO 
1469c9b1f24SGiuseppe CAVALLARO static int ip1001_config_init(struct phy_device *phydev)
1479c9b1f24SGiuseppe CAVALLARO {
1489c9b1f24SGiuseppe CAVALLARO 	int c;
1499c9b1f24SGiuseppe CAVALLARO 
1509c9b1f24SGiuseppe CAVALLARO 	c = ip1xx_reset(phydev);
1519c9b1f24SGiuseppe CAVALLARO 	if (c < 0)
1529c9b1f24SGiuseppe CAVALLARO 		return c;
1539c9b1f24SGiuseppe CAVALLARO 
1549c9b1f24SGiuseppe CAVALLARO 	/* Enable Auto Power Saving mode */
1559c9b1f24SGiuseppe CAVALLARO 	c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);
156b8e3995aSDavid McKay 	if (c < 0)
157b8e3995aSDavid McKay 		return c;
1589c9b1f24SGiuseppe CAVALLARO 	c |= IP1001_APS_ON;
159b8e3995aSDavid McKay 	c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c);
1609c9b1f24SGiuseppe CAVALLARO 	if (c < 0)
1619c9b1f24SGiuseppe CAVALLARO 		return c;
162377ecca9SGiuseppe CAVALLARO 
16332a64161SFlorian Fainelli 	if (phy_interface_is_rgmii(phydev)) {
164b4a49631SStuart Menefy 
1659c9b1f24SGiuseppe CAVALLARO 		c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
166b8e3995aSDavid McKay 		if (c < 0)
167b8e3995aSDavid McKay 			return c;
168b8e3995aSDavid McKay 
169b4a49631SStuart Menefy 		c &= ~(IP1001_RXPHASE_SEL | IP1001_TXPHASE_SEL);
170b4a49631SStuart Menefy 
171b4a49631SStuart Menefy 		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
172b4a49631SStuart Menefy 			c |= (IP1001_RXPHASE_SEL | IP1001_TXPHASE_SEL);
173b4a49631SStuart Menefy 		else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
174b4a49631SStuart Menefy 			c |= IP1001_RXPHASE_SEL;
175b4a49631SStuart Menefy 		else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
176b4a49631SStuart Menefy 			c |= IP1001_TXPHASE_SEL;
177b4a49631SStuart Menefy 
178a4886d52SGiuseppe CAVALLARO 		c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
179b8e3995aSDavid McKay 		if (c < 0)
180b8e3995aSDavid McKay 			return c;
181a4886d52SGiuseppe CAVALLARO 	}
182377ecca9SGiuseppe CAVALLARO 
183b8e3995aSDavid McKay 	return 0;
1849c9b1f24SGiuseppe CAVALLARO }
1859c9b1f24SGiuseppe CAVALLARO 
1860cefeebaSMichael Barkowski static int ip175c_read_status(struct phy_device *phydev)
1870cefeebaSMichael Barkowski {
188e5a03bfdSAndrew Lunn 	if (phydev->mdio.addr == 4) /* WAN port */
1890cefeebaSMichael Barkowski 		genphy_read_status(phydev);
1900cefeebaSMichael Barkowski 	else
1910cefeebaSMichael Barkowski 		/* Don't need to read status for switch ports */
1920cefeebaSMichael Barkowski 		phydev->irq = PHY_IGNORE_INTERRUPT;
1930cefeebaSMichael Barkowski 
1940cefeebaSMichael Barkowski 	return 0;
1950cefeebaSMichael Barkowski }
1960cefeebaSMichael Barkowski 
1970cefeebaSMichael Barkowski static int ip175c_config_aneg(struct phy_device *phydev)
1980cefeebaSMichael Barkowski {
199e5a03bfdSAndrew Lunn 	if (phydev->mdio.addr == 4) /* WAN port */
2000cefeebaSMichael Barkowski 		genphy_config_aneg(phydev);
2010cefeebaSMichael Barkowski 
2020cefeebaSMichael Barkowski 	return 0;
2030cefeebaSMichael Barkowski }
2040cefeebaSMichael Barkowski 
205*f2f1a847SMartin Blumenstingl static int ip101a_g_probe(struct phy_device *phydev)
206*f2f1a847SMartin Blumenstingl {
207*f2f1a847SMartin Blumenstingl 	struct device *dev = &phydev->mdio.dev;
208*f2f1a847SMartin Blumenstingl 	struct ip101a_g_phy_priv *priv;
209*f2f1a847SMartin Blumenstingl 
210*f2f1a847SMartin Blumenstingl 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
211*f2f1a847SMartin Blumenstingl 	if (!priv)
212*f2f1a847SMartin Blumenstingl 		return -ENOMEM;
213*f2f1a847SMartin Blumenstingl 
214*f2f1a847SMartin Blumenstingl 	/* Both functions (RX error and interrupt status) are sharing the same
215*f2f1a847SMartin Blumenstingl 	 * pin on the 32-pin IP101GR, so this is an exclusive choice.
216*f2f1a847SMartin Blumenstingl 	 */
217*f2f1a847SMartin Blumenstingl 	if (device_property_read_bool(dev, "icplus,select-rx-error") &&
218*f2f1a847SMartin Blumenstingl 	    device_property_read_bool(dev, "icplus,select-interrupt")) {
219*f2f1a847SMartin Blumenstingl 		dev_err(dev,
220*f2f1a847SMartin Blumenstingl 			"RXER and INTR mode cannot be selected together\n");
221*f2f1a847SMartin Blumenstingl 		return -EINVAL;
222*f2f1a847SMartin Blumenstingl 	}
223*f2f1a847SMartin Blumenstingl 
224*f2f1a847SMartin Blumenstingl 	if (device_property_read_bool(dev, "icplus,select-rx-error"))
225*f2f1a847SMartin Blumenstingl 		priv->sel_intr32 = IP101GR_SEL_INTR32_RXER;
226*f2f1a847SMartin Blumenstingl 	else if (device_property_read_bool(dev, "icplus,select-interrupt"))
227*f2f1a847SMartin Blumenstingl 		priv->sel_intr32 = IP101GR_SEL_INTR32_INTR;
228*f2f1a847SMartin Blumenstingl 	else
229*f2f1a847SMartin Blumenstingl 		priv->sel_intr32 = IP101GR_SEL_INTR32_KEEP;
230*f2f1a847SMartin Blumenstingl 
231*f2f1a847SMartin Blumenstingl 	phydev->priv = priv;
232*f2f1a847SMartin Blumenstingl 
233*f2f1a847SMartin Blumenstingl 	return 0;
234*f2f1a847SMartin Blumenstingl }
235*f2f1a847SMartin Blumenstingl 
236034289b2SMartin Blumenstingl static int ip101a_g_config_init(struct phy_device *phydev)
237034289b2SMartin Blumenstingl {
238*f2f1a847SMartin Blumenstingl 	struct ip101a_g_phy_priv *priv = phydev->priv;
239*f2f1a847SMartin Blumenstingl 	int err, c;
240034289b2SMartin Blumenstingl 
241034289b2SMartin Blumenstingl 	c = ip1xx_reset(phydev);
242034289b2SMartin Blumenstingl 	if (c < 0)
243034289b2SMartin Blumenstingl 		return c;
244034289b2SMartin Blumenstingl 
245*f2f1a847SMartin Blumenstingl 	/* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */
246*f2f1a847SMartin Blumenstingl 	switch (priv->sel_intr32) {
247*f2f1a847SMartin Blumenstingl 	case IP101GR_SEL_INTR32_RXER:
248*f2f1a847SMartin Blumenstingl 		err = phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
249*f2f1a847SMartin Blumenstingl 				 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32, 0);
250*f2f1a847SMartin Blumenstingl 		if (err < 0)
251*f2f1a847SMartin Blumenstingl 			return err;
252*f2f1a847SMartin Blumenstingl 		break;
253*f2f1a847SMartin Blumenstingl 
254*f2f1a847SMartin Blumenstingl 	case IP101GR_SEL_INTR32_INTR:
255*f2f1a847SMartin Blumenstingl 		err = phy_modify(phydev, IP101G_DIGITAL_IO_SPEC_CTRL,
256*f2f1a847SMartin Blumenstingl 				 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32,
257*f2f1a847SMartin Blumenstingl 				 IP101G_DIGITAL_IO_SPEC_CTRL_SEL_INTR32);
258*f2f1a847SMartin Blumenstingl 		if (err < 0)
259*f2f1a847SMartin Blumenstingl 			return err;
260*f2f1a847SMartin Blumenstingl 		break;
261*f2f1a847SMartin Blumenstingl 
262*f2f1a847SMartin Blumenstingl 	default:
263*f2f1a847SMartin Blumenstingl 		/* Don't touch IP101G_DIGITAL_IO_SPEC_CTRL because it's not
264*f2f1a847SMartin Blumenstingl 		 * documented on IP101A and it's not clear whether this would
265*f2f1a847SMartin Blumenstingl 		 * cause problems.
266*f2f1a847SMartin Blumenstingl 		 * For the 32-pin IP101GR we simply keep the SEL_INTR32
267*f2f1a847SMartin Blumenstingl 		 * configuration as set by the bootloader when not configured
268*f2f1a847SMartin Blumenstingl 		 * to one of the special functions.
269*f2f1a847SMartin Blumenstingl 		 */
270*f2f1a847SMartin Blumenstingl 		break;
271*f2f1a847SMartin Blumenstingl 	}
272*f2f1a847SMartin Blumenstingl 
273034289b2SMartin Blumenstingl 	/* Enable Auto Power Saving mode */
274034289b2SMartin Blumenstingl 	c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
275034289b2SMartin Blumenstingl 	c |= IP101A_G_APS_ON;
276034289b2SMartin Blumenstingl 
277034289b2SMartin Blumenstingl 	return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
278034289b2SMartin Blumenstingl }
279034289b2SMartin Blumenstingl 
280ba2f55b0SHeiner Kallweit static int ip101a_g_config_intr(struct phy_device *phydev)
281ba2f55b0SHeiner Kallweit {
282ba2f55b0SHeiner Kallweit 	u16 val;
283ba2f55b0SHeiner Kallweit 
284ba2f55b0SHeiner Kallweit 	if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
285ba2f55b0SHeiner Kallweit 		/* INTR pin used: Speed/link/duplex will cause an interrupt */
286ba2f55b0SHeiner Kallweit 		val = IP101A_G_IRQ_PIN_USED;
287ba2f55b0SHeiner Kallweit 	else
288a872c388SMartin Blumenstingl 		val = IP101A_G_IRQ_ALL_MASK;
289ba2f55b0SHeiner Kallweit 
290ba2f55b0SHeiner Kallweit 	return phy_write(phydev, IP101A_G_IRQ_CONF_STATUS, val);
291ba2f55b0SHeiner Kallweit }
292ba2f55b0SHeiner Kallweit 
293f7e290fbSMartin Blumenstingl static int ip101a_g_did_interrupt(struct phy_device *phydev)
294f7e290fbSMartin Blumenstingl {
295f7e290fbSMartin Blumenstingl 	int val = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS);
296f7e290fbSMartin Blumenstingl 
297f7e290fbSMartin Blumenstingl 	if (val < 0)
298f7e290fbSMartin Blumenstingl 		return 0;
299f7e290fbSMartin Blumenstingl 
300f7e290fbSMartin Blumenstingl 	return val & (IP101A_G_IRQ_SPEED_CHANGE |
301f7e290fbSMartin Blumenstingl 		      IP101A_G_IRQ_DUPLEX_CHANGE |
302f7e290fbSMartin Blumenstingl 		      IP101A_G_IRQ_LINK_CHANGE);
303f7e290fbSMartin Blumenstingl }
304f7e290fbSMartin Blumenstingl 
305996f7393SGiuseppe CAVALLARO static int ip101a_g_ack_interrupt(struct phy_device *phydev)
306996f7393SGiuseppe CAVALLARO {
307996f7393SGiuseppe CAVALLARO 	int err = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS);
308996f7393SGiuseppe CAVALLARO 	if (err < 0)
309996f7393SGiuseppe CAVALLARO 		return err;
310996f7393SGiuseppe CAVALLARO 
311996f7393SGiuseppe CAVALLARO 	return 0;
312996f7393SGiuseppe CAVALLARO }
313996f7393SGiuseppe CAVALLARO 
314d5bf9071SChristian Hohnstaedt static struct phy_driver icplus_driver[] = {
315d5bf9071SChristian Hohnstaedt {
3160cefeebaSMichael Barkowski 	.phy_id		= 0x02430d80,
3170cefeebaSMichael Barkowski 	.name		= "ICPlus IP175C",
3180cefeebaSMichael Barkowski 	.phy_id_mask	= 0x0ffffff0,
3190cefeebaSMichael Barkowski 	.features	= PHY_BASIC_FEATURES,
3200cefeebaSMichael Barkowski 	.config_init	= &ip175c_config_init,
3210cefeebaSMichael Barkowski 	.config_aneg	= &ip175c_config_aneg,
3220cefeebaSMichael Barkowski 	.read_status	= &ip175c_read_status,
323dab10863SGiuseppe Cavallaro 	.suspend	= genphy_suspend,
324dab10863SGiuseppe Cavallaro 	.resume		= genphy_resume,
325d5bf9071SChristian Hohnstaedt }, {
326377ecca9SGiuseppe CAVALLARO 	.phy_id		= 0x02430d90,
327377ecca9SGiuseppe CAVALLARO 	.name		= "ICPlus IP1001",
328377ecca9SGiuseppe CAVALLARO 	.phy_id_mask	= 0x0ffffff0,
329529ed127STimur Tabi 	.features	= PHY_GBIT_FEATURES,
330377ecca9SGiuseppe CAVALLARO 	.config_init	= &ip1001_config_init,
331377ecca9SGiuseppe CAVALLARO 	.suspend	= genphy_suspend,
332377ecca9SGiuseppe CAVALLARO 	.resume		= genphy_resume,
333d5bf9071SChristian Hohnstaedt }, {
3349c9b1f24SGiuseppe CAVALLARO 	.phy_id		= 0x02430c54,
335e3e09f26SGiuseppe CAVALLARO 	.name		= "ICPlus IP101A/G",
3369c9b1f24SGiuseppe CAVALLARO 	.phy_id_mask	= 0x0ffffff0,
337529ed127STimur Tabi 	.features	= PHY_BASIC_FEATURES,
338*f2f1a847SMartin Blumenstingl 	.probe		= ip101a_g_probe,
339ba2f55b0SHeiner Kallweit 	.config_intr	= ip101a_g_config_intr,
340f7e290fbSMartin Blumenstingl 	.did_interrupt	= ip101a_g_did_interrupt,
341996f7393SGiuseppe CAVALLARO 	.ack_interrupt	= ip101a_g_ack_interrupt,
342e3e09f26SGiuseppe CAVALLARO 	.config_init	= &ip101a_g_config_init,
3439c9b1f24SGiuseppe CAVALLARO 	.suspend	= genphy_suspend,
3449c9b1f24SGiuseppe CAVALLARO 	.resume		= genphy_resume,
345d5bf9071SChristian Hohnstaedt } };
3469c9b1f24SGiuseppe CAVALLARO 
34750fd7150SJohan Hovold module_phy_driver(icplus_driver);
3484e4f10f6SDavid Woodhouse 
349cf93c945SUwe Kleine-König static struct mdio_device_id __maybe_unused icplus_tbl[] = {
3504e4f10f6SDavid Woodhouse 	{ 0x02430d80, 0x0ffffff0 },
351377ecca9SGiuseppe CAVALLARO 	{ 0x02430d90, 0x0ffffff0 },
352e3e09f26SGiuseppe CAVALLARO 	{ 0x02430c54, 0x0ffffff0 },
3534e4f10f6SDavid Woodhouse 	{ }
3544e4f10f6SDavid Woodhouse };
3554e4f10f6SDavid Woodhouse 
3564e4f10f6SDavid Woodhouse MODULE_DEVICE_TABLE(mdio, icplus_tbl);
357