blob: edaa25ea55a9d1db0d160856b80cb37d74e5f301 [file] [log] [blame]
Andy Fleming1577ece2009-02-04 16:42:12 -08001/*
2 * Freescale PowerQUICC Ethernet Driver -- MIIM bus implementation
3 * Provides Bus interface for MIIM regs
4 *
5 * Author: Andy Fleming <afleming@freescale.com>
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +00006 * Modifier: Sandeep Gopalpet <sandeep.kumar@freescale.com>
Andy Fleming1577ece2009-02-04 16:42:12 -08007 *
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +00008 * Copyright 2002-2004, 2008-2009 Freescale Semiconductor, Inc.
Andy Fleming1577ece2009-02-04 16:42:12 -08009 *
10 * Based on gianfar_mii.c and ucc_geth_mii.c (Li Yang, Kim Phillips)
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 */
18
19#include <linux/kernel.h>
20#include <linux/string.h>
21#include <linux/errno.h>
Andy Fleming1577ece2009-02-04 16:42:12 -080022#include <linux/slab.h>
Andy Fleming1577ece2009-02-04 16:42:12 -080023#include <linux/init.h>
24#include <linux/delay.h>
Andy Fleming1577ece2009-02-04 16:42:12 -080025#include <linux/module.h>
26#include <linux/platform_device.h>
Andy Fleming1577ece2009-02-04 16:42:12 -080027#include <linux/mii.h>
Grant Likely22ae7822010-07-29 11:49:01 -060028#include <linux/of_address.h>
Grant Likely324931b2009-04-25 12:53:07 +000029#include <linux/of_mdio.h>
Andy Fleming1577ece2009-02-04 16:42:12 -080030#include <linux/of_platform.h>
31
32#include <asm/io.h>
Timur Tabi1aa06d42012-08-29 08:07:58 +000033#include <asm/ucc.h> /* for ucc_set_qe_mux_mii_mng() */
Andy Fleming1577ece2009-02-04 16:42:12 -080034
35#include "gianfar.h"
Timur Tabi19bcd6c2012-08-29 08:07:57 +000036
37#define MIIMIND_BUSY 0x00000001
38#define MIIMIND_NOTVALID 0x00000004
39#define MIIMCFG_INIT_VALUE 0x00000007
40#define MIIMCFG_RESET 0x80000000
41
42#define MII_READ_COMMAND 0x00000001
43
44struct fsl_pq_mdio {
45 u8 res1[16];
46 u32 ieventm; /* MDIO Interrupt event register (for etsec2)*/
47 u32 imaskm; /* MDIO Interrupt mask register (for etsec2)*/
48 u8 res2[4];
49 u32 emapm; /* MDIO Event mapping register (for etsec2)*/
50 u8 res3[1280];
51 u32 miimcfg; /* MII management configuration reg */
52 u32 miimcom; /* MII management command reg */
53 u32 miimadd; /* MII management address reg */
54 u32 miimcon; /* MII management control reg */
55 u32 miimstat; /* MII management status reg */
56 u32 miimind; /* MII management indication reg */
57 u8 res4[28];
58 u32 utbipar; /* TBI phy address reg (only on UCC) */
59 u8 res5[2728];
60} __packed;
Andy Fleming1577ece2009-02-04 16:42:12 -080061
Timur Tabi59399c52012-07-09 16:57:36 -050062/* Number of microseconds to wait for an MII register to respond */
63#define MII_TIMEOUT 1000
64
Anton Vorontsovb3319b12009-12-30 08:23:34 +000065struct fsl_pq_mdio_priv {
66 void __iomem *map;
67 struct fsl_pq_mdio __iomem *regs;
68};
69
Andy Fleming1577ece2009-02-04 16:42:12 -080070/*
71 * Write value to the PHY at mii_id at register regnum,
72 * on the bus attached to the local interface, which may be different from the
73 * generic mdio bus (tied to a single interface), waiting until the write is
74 * done before returning. This is helpful in programming interfaces like
75 * the TBI which control interfaces like onchip SERDES and are always tied to
76 * the local mdio pins, which may not be the same as system mdio bus, used for
77 * controlling the external PHYs, for example.
78 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +000079static int fsl_pq_local_mdio_write(struct fsl_pq_mdio __iomem *regs, int mii_id,
Andy Fleming1577ece2009-02-04 16:42:12 -080080 int regnum, u16 value)
81{
Timur Tabi59399c52012-07-09 16:57:36 -050082 u32 status;
83
Andy Fleming1577ece2009-02-04 16:42:12 -080084 /* Set the PHY address and the register address we want to write */
85 out_be32(&regs->miimadd, (mii_id << 8) | regnum);
86
87 /* Write out the value we want */
88 out_be32(&regs->miimcon, value);
89
90 /* Wait for the transaction to finish */
Timur Tabi59399c52012-07-09 16:57:36 -050091 status = spin_event_timeout(!(in_be32(&regs->miimind) & MIIMIND_BUSY),
92 MII_TIMEOUT, 0);
Andy Fleming1577ece2009-02-04 16:42:12 -080093
Timur Tabi59399c52012-07-09 16:57:36 -050094 return status ? 0 : -ETIMEDOUT;
Andy Fleming1577ece2009-02-04 16:42:12 -080095}
96
97/*
98 * Read the bus for PHY at addr mii_id, register regnum, and
99 * return the value. Clears miimcom first. All PHY operation
100 * done on the bus attached to the local interface,
101 * which may be different from the generic mdio bus
102 * This is helpful in programming interfaces like
103 * the TBI which, in turn, control interfaces like onchip SERDES
104 * and are always tied to the local mdio pins, which may not be the
105 * same as system mdio bus, used for controlling the external PHYs, for eg.
106 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000107static int fsl_pq_local_mdio_read(struct fsl_pq_mdio __iomem *regs,
Andy Fleming1577ece2009-02-04 16:42:12 -0800108 int mii_id, int regnum)
109{
110 u16 value;
Timur Tabi59399c52012-07-09 16:57:36 -0500111 u32 status;
Andy Fleming1577ece2009-02-04 16:42:12 -0800112
113 /* Set the PHY address and the register address we want to read */
114 out_be32(&regs->miimadd, (mii_id << 8) | regnum);
115
116 /* Clear miimcom, and then initiate a read */
117 out_be32(&regs->miimcom, 0);
118 out_be32(&regs->miimcom, MII_READ_COMMAND);
119
Timur Tabi59399c52012-07-09 16:57:36 -0500120 /* Wait for the transaction to finish, normally less than 100us */
121 status = spin_event_timeout(!(in_be32(&regs->miimind) &
122 (MIIMIND_NOTVALID | MIIMIND_BUSY)),
123 MII_TIMEOUT, 0);
124 if (!status)
125 return -ETIMEDOUT;
Andy Fleming1577ece2009-02-04 16:42:12 -0800126
127 /* Grab the value of the register from miimstat */
128 value = in_be32(&regs->miimstat);
129
130 return value;
131}
132
Anton Vorontsov6748f602009-11-04 12:52:57 +0000133static struct fsl_pq_mdio __iomem *fsl_pq_mdio_get_regs(struct mii_bus *bus)
134{
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000135 struct fsl_pq_mdio_priv *priv = bus->priv;
136
137 return priv->regs;
Anton Vorontsov6748f602009-11-04 12:52:57 +0000138}
139
Andy Fleming1577ece2009-02-04 16:42:12 -0800140/*
141 * Write value to the PHY at mii_id at register regnum,
142 * on the bus, waiting until the write is done before returning.
143 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000144static int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
145 u16 value)
Andy Fleming1577ece2009-02-04 16:42:12 -0800146{
Anton Vorontsov6748f602009-11-04 12:52:57 +0000147 struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
Andy Fleming1577ece2009-02-04 16:42:12 -0800148
149 /* Write to the local MII regs */
Eric Dumazet807540b2010-09-23 05:40:09 +0000150 return fsl_pq_local_mdio_write(regs, mii_id, regnum, value);
Andy Fleming1577ece2009-02-04 16:42:12 -0800151}
152
153/*
154 * Read the bus for PHY at addr mii_id, register regnum, and
155 * return the value. Clears miimcom first.
156 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000157static int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
Andy Fleming1577ece2009-02-04 16:42:12 -0800158{
Anton Vorontsov6748f602009-11-04 12:52:57 +0000159 struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
Andy Fleming1577ece2009-02-04 16:42:12 -0800160
161 /* Read the local MII regs */
Eric Dumazet807540b2010-09-23 05:40:09 +0000162 return fsl_pq_local_mdio_read(regs, mii_id, regnum);
Andy Fleming1577ece2009-02-04 16:42:12 -0800163}
164
165/* Reset the MIIM registers, and wait for the bus to free */
166static int fsl_pq_mdio_reset(struct mii_bus *bus)
167{
Anton Vorontsov6748f602009-11-04 12:52:57 +0000168 struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
Timur Tabi59399c52012-07-09 16:57:36 -0500169 u32 status;
Andy Fleming1577ece2009-02-04 16:42:12 -0800170
171 mutex_lock(&bus->mdio_lock);
172
173 /* Reset the management interface */
174 out_be32(&regs->miimcfg, MIIMCFG_RESET);
175
176 /* Setup the MII Mgmt clock speed */
177 out_be32(&regs->miimcfg, MIIMCFG_INIT_VALUE);
178
179 /* Wait until the bus is free */
Timur Tabi59399c52012-07-09 16:57:36 -0500180 status = spin_event_timeout(!(in_be32(&regs->miimind) & MIIMIND_BUSY),
181 MII_TIMEOUT, 0);
Andy Fleming1577ece2009-02-04 16:42:12 -0800182
183 mutex_unlock(&bus->mdio_lock);
184
Timur Tabi59399c52012-07-09 16:57:36 -0500185 if (!status) {
Andy Fleming1577ece2009-02-04 16:42:12 -0800186 printk(KERN_ERR "%s: The MII Bus is stuck!\n",
187 bus->name);
188 return -EBUSY;
189 }
190
191 return 0;
192}
193
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000194static void fsl_pq_mdio_bus_name(char *name, struct device_node *np)
Andy Fleming1577ece2009-02-04 16:42:12 -0800195{
Anton Vorontsov18f27382009-03-19 06:48:08 +0000196 const u32 *addr;
197 u64 taddr = OF_BAD_ADDR;
Andy Fleming1577ece2009-02-04 16:42:12 -0800198
Anton Vorontsov18f27382009-03-19 06:48:08 +0000199 addr = of_get_address(np, 0, NULL, NULL);
200 if (addr)
201 taddr = of_translate_address(np, addr);
Andy Fleming1577ece2009-02-04 16:42:12 -0800202
Anton Vorontsov18f27382009-03-19 06:48:08 +0000203 snprintf(name, MII_BUS_ID_SIZE, "%s@%llx", np->name,
204 (unsigned long long)taddr);
Andy Fleming1577ece2009-02-04 16:42:12 -0800205}
206
Andy Fleming1577ece2009-02-04 16:42:12 -0800207
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000208static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct device_node *np)
Andy Fleming1577ece2009-02-04 16:42:12 -0800209{
Andy Fleming952c5ca2011-11-11 05:10:39 +0000210#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
Andy Fleming1577ece2009-02-04 16:42:12 -0800211 struct gfar __iomem *enet_regs;
212
213 /*
214 * This is mildly evil, but so is our hardware for doing this.
215 * Also, we have to cast back to struct gfar because of
216 * definition weirdness done in gianfar.h.
217 */
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000218 if(of_device_is_compatible(np, "fsl,gianfar-mdio") ||
219 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
220 of_device_is_compatible(np, "gianfar")) {
221 enet_regs = (struct gfar __iomem *)regs;
222 return &enet_regs->tbipa;
223 } else if (of_device_is_compatible(np, "fsl,etsec2-mdio") ||
224 of_device_is_compatible(np, "fsl,etsec2-tbi")) {
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000225 return of_iomap(np, 1);
Andy Fleming952c5ca2011-11-11 05:10:39 +0000226 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800227#endif
Andy Fleming952c5ca2011-11-11 05:10:39 +0000228 return NULL;
229}
Andy Fleming1577ece2009-02-04 16:42:12 -0800230
231
Andy Fleming1577ece2009-02-04 16:42:12 -0800232static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
233{
Andy Fleming952c5ca2011-11-11 05:10:39 +0000234#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
Andy Fleming1577ece2009-02-04 16:42:12 -0800235 struct device_node *np = NULL;
236 int err = 0;
237
238 for_each_compatible_node(np, NULL, "ucc_geth") {
239 struct resource tempres;
240
241 err = of_address_to_resource(np, 0, &tempres);
242 if (err)
243 continue;
244
245 /* if our mdio regs fall within this UCC regs range */
246 if ((start >= tempres.start) && (end <= tempres.end)) {
247 /* Find the id of the UCC */
248 const u32 *id;
249
250 id = of_get_property(np, "cell-index", NULL);
251 if (!id) {
252 id = of_get_property(np, "device-id", NULL);
253 if (!id)
254 continue;
255 }
256
257 *ucc_id = *id;
258
259 return 0;
260 }
261 }
262
263 if (err)
264 return err;
265 else
266 return -EINVAL;
Andy Fleming952c5ca2011-11-11 05:10:39 +0000267#else
268 return -ENODEV;
Andy Fleming1577ece2009-02-04 16:42:12 -0800269#endif
Andy Fleming952c5ca2011-11-11 05:10:39 +0000270}
Andy Fleming1577ece2009-02-04 16:42:12 -0800271
Grant Likely74888762011-02-22 21:05:51 -0700272static int fsl_pq_mdio_probe(struct platform_device *ofdev)
Andy Fleming1577ece2009-02-04 16:42:12 -0800273{
Grant Likely61c7a082010-04-13 16:12:29 -0700274 struct device_node *np = ofdev->dev.of_node;
Andy Fleming1577ece2009-02-04 16:42:12 -0800275 struct device_node *tbi;
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000276 struct fsl_pq_mdio_priv *priv;
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000277 struct fsl_pq_mdio __iomem *regs = NULL;
Anton Vorontsov2951d642009-11-04 12:52:56 +0000278 void __iomem *map;
Andy Fleming1577ece2009-02-04 16:42:12 -0800279 u32 __iomem *tbipa;
280 struct mii_bus *new_bus;
281 int tbiaddr = -1;
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000282 const u32 *addrp;
Anton Vorontsov2951d642009-11-04 12:52:56 +0000283 u64 addr = 0, size = 0;
Anton Vorontsov08d18f32010-05-14 04:27:30 +0000284 int err;
Andy Fleming1577ece2009-02-04 16:42:12 -0800285
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000286 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
287 if (!priv)
288 return -ENOMEM;
289
Andy Fleming1577ece2009-02-04 16:42:12 -0800290 new_bus = mdiobus_alloc();
Anton Vorontsov08d18f32010-05-14 04:27:30 +0000291 if (!new_bus) {
292 err = -ENOMEM;
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000293 goto err_free_priv;
Anton Vorontsov08d18f32010-05-14 04:27:30 +0000294 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800295
296 new_bus->name = "Freescale PowerQUICC MII Bus",
297 new_bus->read = &fsl_pq_mdio_read,
298 new_bus->write = &fsl_pq_mdio_write,
299 new_bus->reset = &fsl_pq_mdio_reset,
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000300 new_bus->priv = priv;
Andy Fleming1577ece2009-02-04 16:42:12 -0800301 fsl_pq_mdio_bus_name(new_bus->id, np);
302
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000303 addrp = of_get_address(np, 0, &size, NULL);
304 if (!addrp) {
305 err = -EINVAL;
306 goto err_free_bus;
307 }
308
Andy Fleming1577ece2009-02-04 16:42:12 -0800309 /* Set the PHY base address */
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000310 addr = of_translate_address(np, addrp);
311 if (addr == OF_BAD_ADDR) {
312 err = -EINVAL;
313 goto err_free_bus;
314 }
315
Anton Vorontsov2951d642009-11-04 12:52:56 +0000316 map = ioremap(addr, size);
317 if (!map) {
Andy Fleming1577ece2009-02-04 16:42:12 -0800318 err = -ENOMEM;
319 goto err_free_bus;
320 }
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000321 priv->map = map;
Andy Fleming1577ece2009-02-04 16:42:12 -0800322
Anton Vorontsov2951d642009-11-04 12:52:56 +0000323 if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
324 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
325 of_device_is_compatible(np, "fsl,ucc-mdio") ||
326 of_device_is_compatible(np, "ucc_geth_phy"))
327 map -= offsetof(struct fsl_pq_mdio, miimcfg);
328 regs = map;
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000329 priv->regs = regs;
Andy Fleming1577ece2009-02-04 16:42:12 -0800330
Grant Likely324931b2009-04-25 12:53:07 +0000331 new_bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);
Andy Fleming1577ece2009-02-04 16:42:12 -0800332
333 if (NULL == new_bus->irq) {
334 err = -ENOMEM;
335 goto err_unmap_regs;
336 }
337
338 new_bus->parent = &ofdev->dev;
339 dev_set_drvdata(&ofdev->dev, new_bus);
340
341 if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
Anton Vorontsov30196842009-03-21 13:30:05 -0700342 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000343 of_device_is_compatible(np, "fsl,etsec2-mdio") ||
344 of_device_is_compatible(np, "fsl,etsec2-tbi") ||
Andy Fleming1577ece2009-02-04 16:42:12 -0800345 of_device_is_compatible(np, "gianfar")) {
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000346 tbipa = get_gfar_tbipa(regs, np);
347 if (!tbipa) {
348 err = -EINVAL;
349 goto err_free_irqs;
350 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800351 } else if (of_device_is_compatible(np, "fsl,ucc-mdio") ||
352 of_device_is_compatible(np, "ucc_geth_phy")) {
Andy Fleming1577ece2009-02-04 16:42:12 -0800353 u32 id;
Haiying Wangfbcc0e22009-06-02 04:04:14 +0000354 static u32 mii_mng_master;
Andy Fleming1577ece2009-02-04 16:42:12 -0800355
356 tbipa = &regs->utbipar;
357
358 if ((err = get_ucc_id_for_range(addr, addr + size, &id)))
359 goto err_free_irqs;
360
Haiying Wangfbcc0e22009-06-02 04:04:14 +0000361 if (!mii_mng_master) {
362 mii_mng_master = id;
363 ucc_set_qe_mux_mii_mng(id - 1);
364 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800365 } else {
366 err = -ENODEV;
367 goto err_free_irqs;
368 }
369
370 for_each_child_of_node(np, tbi) {
371 if (!strncmp(tbi->type, "tbi-phy", 8))
372 break;
373 }
374
375 if (tbi) {
376 const u32 *prop = of_get_property(tbi, "reg", NULL);
377
378 if (prop)
379 tbiaddr = *prop;
Baruch Siachc3e072f2011-11-14 08:21:30 +0200380
Kenth Eriksson464b57d2012-03-27 22:05:54 +0000381 if (tbiaddr == -1) {
382 err = -EBUSY;
383 goto err_free_irqs;
384 } else {
385 out_be32(tbipa, tbiaddr);
386 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800387 }
388
Grant Likely324931b2009-04-25 12:53:07 +0000389 err = of_mdiobus_register(new_bus, np);
Andy Fleming1577ece2009-02-04 16:42:12 -0800390 if (err) {
391 printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
392 new_bus->name);
393 goto err_free_irqs;
394 }
395
396 return 0;
397
398err_free_irqs:
399 kfree(new_bus->irq);
400err_unmap_regs:
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000401 iounmap(priv->map);
Andy Fleming1577ece2009-02-04 16:42:12 -0800402err_free_bus:
403 kfree(new_bus);
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000404err_free_priv:
405 kfree(priv);
Andy Fleming1577ece2009-02-04 16:42:12 -0800406 return err;
407}
408
409
Grant Likely2dc11582010-08-06 09:25:50 -0600410static int fsl_pq_mdio_remove(struct platform_device *ofdev)
Andy Fleming1577ece2009-02-04 16:42:12 -0800411{
412 struct device *device = &ofdev->dev;
413 struct mii_bus *bus = dev_get_drvdata(device);
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000414 struct fsl_pq_mdio_priv *priv = bus->priv;
Andy Fleming1577ece2009-02-04 16:42:12 -0800415
416 mdiobus_unregister(bus);
417
418 dev_set_drvdata(device, NULL);
419
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000420 iounmap(priv->map);
Andy Fleming1577ece2009-02-04 16:42:12 -0800421 bus->priv = NULL;
422 mdiobus_free(bus);
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000423 kfree(priv);
Andy Fleming1577ece2009-02-04 16:42:12 -0800424
425 return 0;
426}
427
428static struct of_device_id fsl_pq_mdio_match[] = {
429 {
430 .type = "mdio",
431 .compatible = "ucc_geth_phy",
432 },
433 {
434 .type = "mdio",
435 .compatible = "gianfar",
436 },
437 {
438 .compatible = "fsl,ucc-mdio",
439 },
440 {
441 .compatible = "fsl,gianfar-tbi",
442 },
443 {
444 .compatible = "fsl,gianfar-mdio",
445 },
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000446 {
447 .compatible = "fsl,etsec2-tbi",
448 },
449 {
450 .compatible = "fsl,etsec2-mdio",
451 },
Andy Fleming1577ece2009-02-04 16:42:12 -0800452 {},
453};
Anton Vorontsove72701a2009-10-14 14:54:52 -0700454MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
Andy Fleming1577ece2009-02-04 16:42:12 -0800455
Grant Likely74888762011-02-22 21:05:51 -0700456static struct platform_driver fsl_pq_mdio_driver = {
Grant Likely40182942010-04-13 16:13:02 -0700457 .driver = {
458 .name = "fsl-pq_mdio",
459 .owner = THIS_MODULE,
460 .of_match_table = fsl_pq_mdio_match,
461 },
Andy Fleming1577ece2009-02-04 16:42:12 -0800462 .probe = fsl_pq_mdio_probe,
463 .remove = fsl_pq_mdio_remove,
Andy Fleming1577ece2009-02-04 16:42:12 -0800464};
465
Axel Lindb62f682011-11-27 16:44:17 +0000466module_platform_driver(fsl_pq_mdio_driver);
Andy Fleming1577ece2009-02-04 16:42:12 -0800467
Sebastian Siewior26062892009-11-06 08:50:28 +0000468MODULE_LICENSE("GPL");