blob: bc19fe09a1d20f8539eb1c6705ca6edfa9edb139 [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>
22#include <linux/unistd.h>
23#include <linux/slab.h>
24#include <linux/interrupt.h>
25#include <linux/init.h>
26#include <linux/delay.h>
27#include <linux/netdevice.h>
28#include <linux/etherdevice.h>
29#include <linux/skbuff.h>
30#include <linux/spinlock.h>
31#include <linux/mm.h>
32#include <linux/module.h>
33#include <linux/platform_device.h>
34#include <linux/crc32.h>
35#include <linux/mii.h>
36#include <linux/phy.h>
37#include <linux/of.h>
Grant Likely22ae7822010-07-29 11:49:01 -060038#include <linux/of_address.h>
Grant Likely324931b2009-04-25 12:53:07 +000039#include <linux/of_mdio.h>
Andy Fleming1577ece2009-02-04 16:42:12 -080040#include <linux/of_platform.h>
41
42#include <asm/io.h>
43#include <asm/irq.h>
44#include <asm/uaccess.h>
45#include <asm/ucc.h>
46
47#include "gianfar.h"
Timur Tabi19bcd6c2012-08-29 08:07:57 +000048
49#define MIIMIND_BUSY 0x00000001
50#define MIIMIND_NOTVALID 0x00000004
51#define MIIMCFG_INIT_VALUE 0x00000007
52#define MIIMCFG_RESET 0x80000000
53
54#define MII_READ_COMMAND 0x00000001
55
56struct fsl_pq_mdio {
57 u8 res1[16];
58 u32 ieventm; /* MDIO Interrupt event register (for etsec2)*/
59 u32 imaskm; /* MDIO Interrupt mask register (for etsec2)*/
60 u8 res2[4];
61 u32 emapm; /* MDIO Event mapping register (for etsec2)*/
62 u8 res3[1280];
63 u32 miimcfg; /* MII management configuration reg */
64 u32 miimcom; /* MII management command reg */
65 u32 miimadd; /* MII management address reg */
66 u32 miimcon; /* MII management control reg */
67 u32 miimstat; /* MII management status reg */
68 u32 miimind; /* MII management indication reg */
69 u8 res4[28];
70 u32 utbipar; /* TBI phy address reg (only on UCC) */
71 u8 res5[2728];
72} __packed;
Andy Fleming1577ece2009-02-04 16:42:12 -080073
Timur Tabi59399c52012-07-09 16:57:36 -050074/* Number of microseconds to wait for an MII register to respond */
75#define MII_TIMEOUT 1000
76
Anton Vorontsovb3319b12009-12-30 08:23:34 +000077struct fsl_pq_mdio_priv {
78 void __iomem *map;
79 struct fsl_pq_mdio __iomem *regs;
80};
81
Andy Fleming1577ece2009-02-04 16:42:12 -080082/*
83 * Write value to the PHY at mii_id at register regnum,
84 * on the bus attached to the local interface, which may be different from the
85 * generic mdio bus (tied to a single interface), waiting until the write is
86 * done before returning. This is helpful in programming interfaces like
87 * the TBI which control interfaces like onchip SERDES and are always tied to
88 * the local mdio pins, which may not be the same as system mdio bus, used for
89 * controlling the external PHYs, for example.
90 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +000091static int fsl_pq_local_mdio_write(struct fsl_pq_mdio __iomem *regs, int mii_id,
Andy Fleming1577ece2009-02-04 16:42:12 -080092 int regnum, u16 value)
93{
Timur Tabi59399c52012-07-09 16:57:36 -050094 u32 status;
95
Andy Fleming1577ece2009-02-04 16:42:12 -080096 /* Set the PHY address and the register address we want to write */
97 out_be32(&regs->miimadd, (mii_id << 8) | regnum);
98
99 /* Write out the value we want */
100 out_be32(&regs->miimcon, value);
101
102 /* Wait for the transaction to finish */
Timur Tabi59399c52012-07-09 16:57:36 -0500103 status = spin_event_timeout(!(in_be32(&regs->miimind) & MIIMIND_BUSY),
104 MII_TIMEOUT, 0);
Andy Fleming1577ece2009-02-04 16:42:12 -0800105
Timur Tabi59399c52012-07-09 16:57:36 -0500106 return status ? 0 : -ETIMEDOUT;
Andy Fleming1577ece2009-02-04 16:42:12 -0800107}
108
109/*
110 * Read the bus for PHY at addr mii_id, register regnum, and
111 * return the value. Clears miimcom first. All PHY operation
112 * done on the bus attached to the local interface,
113 * which may be different from the generic mdio bus
114 * This is helpful in programming interfaces like
115 * the TBI which, in turn, control interfaces like onchip SERDES
116 * and are always tied to the local mdio pins, which may not be the
117 * same as system mdio bus, used for controlling the external PHYs, for eg.
118 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000119static int fsl_pq_local_mdio_read(struct fsl_pq_mdio __iomem *regs,
Andy Fleming1577ece2009-02-04 16:42:12 -0800120 int mii_id, int regnum)
121{
122 u16 value;
Timur Tabi59399c52012-07-09 16:57:36 -0500123 u32 status;
Andy Fleming1577ece2009-02-04 16:42:12 -0800124
125 /* Set the PHY address and the register address we want to read */
126 out_be32(&regs->miimadd, (mii_id << 8) | regnum);
127
128 /* Clear miimcom, and then initiate a read */
129 out_be32(&regs->miimcom, 0);
130 out_be32(&regs->miimcom, MII_READ_COMMAND);
131
Timur Tabi59399c52012-07-09 16:57:36 -0500132 /* Wait for the transaction to finish, normally less than 100us */
133 status = spin_event_timeout(!(in_be32(&regs->miimind) &
134 (MIIMIND_NOTVALID | MIIMIND_BUSY)),
135 MII_TIMEOUT, 0);
136 if (!status)
137 return -ETIMEDOUT;
Andy Fleming1577ece2009-02-04 16:42:12 -0800138
139 /* Grab the value of the register from miimstat */
140 value = in_be32(&regs->miimstat);
141
142 return value;
143}
144
Anton Vorontsov6748f602009-11-04 12:52:57 +0000145static struct fsl_pq_mdio __iomem *fsl_pq_mdio_get_regs(struct mii_bus *bus)
146{
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000147 struct fsl_pq_mdio_priv *priv = bus->priv;
148
149 return priv->regs;
Anton Vorontsov6748f602009-11-04 12:52:57 +0000150}
151
Andy Fleming1577ece2009-02-04 16:42:12 -0800152/*
153 * Write value to the PHY at mii_id at register regnum,
154 * on the bus, waiting until the write is done before returning.
155 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000156static int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
157 u16 value)
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 /* Write to the local MII regs */
Eric Dumazet807540b2010-09-23 05:40:09 +0000162 return fsl_pq_local_mdio_write(regs, mii_id, regnum, value);
Andy Fleming1577ece2009-02-04 16:42:12 -0800163}
164
165/*
166 * Read the bus for PHY at addr mii_id, register regnum, and
167 * return the value. Clears miimcom first.
168 */
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000169static int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
Andy Fleming1577ece2009-02-04 16:42:12 -0800170{
Anton Vorontsov6748f602009-11-04 12:52:57 +0000171 struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
Andy Fleming1577ece2009-02-04 16:42:12 -0800172
173 /* Read the local MII regs */
Eric Dumazet807540b2010-09-23 05:40:09 +0000174 return fsl_pq_local_mdio_read(regs, mii_id, regnum);
Andy Fleming1577ece2009-02-04 16:42:12 -0800175}
176
177/* Reset the MIIM registers, and wait for the bus to free */
178static int fsl_pq_mdio_reset(struct mii_bus *bus)
179{
Anton Vorontsov6748f602009-11-04 12:52:57 +0000180 struct fsl_pq_mdio __iomem *regs = fsl_pq_mdio_get_regs(bus);
Timur Tabi59399c52012-07-09 16:57:36 -0500181 u32 status;
Andy Fleming1577ece2009-02-04 16:42:12 -0800182
183 mutex_lock(&bus->mdio_lock);
184
185 /* Reset the management interface */
186 out_be32(&regs->miimcfg, MIIMCFG_RESET);
187
188 /* Setup the MII Mgmt clock speed */
189 out_be32(&regs->miimcfg, MIIMCFG_INIT_VALUE);
190
191 /* Wait until the bus is free */
Timur Tabi59399c52012-07-09 16:57:36 -0500192 status = spin_event_timeout(!(in_be32(&regs->miimind) & MIIMIND_BUSY),
193 MII_TIMEOUT, 0);
Andy Fleming1577ece2009-02-04 16:42:12 -0800194
195 mutex_unlock(&bus->mdio_lock);
196
Timur Tabi59399c52012-07-09 16:57:36 -0500197 if (!status) {
Andy Fleming1577ece2009-02-04 16:42:12 -0800198 printk(KERN_ERR "%s: The MII Bus is stuck!\n",
199 bus->name);
200 return -EBUSY;
201 }
202
203 return 0;
204}
205
Timur Tabi19bcd6c2012-08-29 08:07:57 +0000206static void fsl_pq_mdio_bus_name(char *name, struct device_node *np)
Andy Fleming1577ece2009-02-04 16:42:12 -0800207{
Anton Vorontsov18f27382009-03-19 06:48:08 +0000208 const u32 *addr;
209 u64 taddr = OF_BAD_ADDR;
Andy Fleming1577ece2009-02-04 16:42:12 -0800210
Anton Vorontsov18f27382009-03-19 06:48:08 +0000211 addr = of_get_address(np, 0, NULL, NULL);
212 if (addr)
213 taddr = of_translate_address(np, addr);
Andy Fleming1577ece2009-02-04 16:42:12 -0800214
Anton Vorontsov18f27382009-03-19 06:48:08 +0000215 snprintf(name, MII_BUS_ID_SIZE, "%s@%llx", np->name,
216 (unsigned long long)taddr);
Andy Fleming1577ece2009-02-04 16:42:12 -0800217}
218
Andy Fleming1577ece2009-02-04 16:42:12 -0800219
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000220static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct device_node *np)
Andy Fleming1577ece2009-02-04 16:42:12 -0800221{
Andy Fleming952c5ca2011-11-11 05:10:39 +0000222#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
Andy Fleming1577ece2009-02-04 16:42:12 -0800223 struct gfar __iomem *enet_regs;
224
225 /*
226 * This is mildly evil, but so is our hardware for doing this.
227 * Also, we have to cast back to struct gfar because of
228 * definition weirdness done in gianfar.h.
229 */
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000230 if(of_device_is_compatible(np, "fsl,gianfar-mdio") ||
231 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
232 of_device_is_compatible(np, "gianfar")) {
233 enet_regs = (struct gfar __iomem *)regs;
234 return &enet_regs->tbipa;
235 } else if (of_device_is_compatible(np, "fsl,etsec2-mdio") ||
236 of_device_is_compatible(np, "fsl,etsec2-tbi")) {
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000237 return of_iomap(np, 1);
Andy Fleming952c5ca2011-11-11 05:10:39 +0000238 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800239#endif
Andy Fleming952c5ca2011-11-11 05:10:39 +0000240 return NULL;
241}
Andy Fleming1577ece2009-02-04 16:42:12 -0800242
243
Andy Fleming1577ece2009-02-04 16:42:12 -0800244static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
245{
Andy Fleming952c5ca2011-11-11 05:10:39 +0000246#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
Andy Fleming1577ece2009-02-04 16:42:12 -0800247 struct device_node *np = NULL;
248 int err = 0;
249
250 for_each_compatible_node(np, NULL, "ucc_geth") {
251 struct resource tempres;
252
253 err = of_address_to_resource(np, 0, &tempres);
254 if (err)
255 continue;
256
257 /* if our mdio regs fall within this UCC regs range */
258 if ((start >= tempres.start) && (end <= tempres.end)) {
259 /* Find the id of the UCC */
260 const u32 *id;
261
262 id = of_get_property(np, "cell-index", NULL);
263 if (!id) {
264 id = of_get_property(np, "device-id", NULL);
265 if (!id)
266 continue;
267 }
268
269 *ucc_id = *id;
270
271 return 0;
272 }
273 }
274
275 if (err)
276 return err;
277 else
278 return -EINVAL;
Andy Fleming952c5ca2011-11-11 05:10:39 +0000279#else
280 return -ENODEV;
Andy Fleming1577ece2009-02-04 16:42:12 -0800281#endif
Andy Fleming952c5ca2011-11-11 05:10:39 +0000282}
Andy Fleming1577ece2009-02-04 16:42:12 -0800283
Grant Likely74888762011-02-22 21:05:51 -0700284static int fsl_pq_mdio_probe(struct platform_device *ofdev)
Andy Fleming1577ece2009-02-04 16:42:12 -0800285{
Grant Likely61c7a082010-04-13 16:12:29 -0700286 struct device_node *np = ofdev->dev.of_node;
Andy Fleming1577ece2009-02-04 16:42:12 -0800287 struct device_node *tbi;
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000288 struct fsl_pq_mdio_priv *priv;
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000289 struct fsl_pq_mdio __iomem *regs = NULL;
Anton Vorontsov2951d642009-11-04 12:52:56 +0000290 void __iomem *map;
Andy Fleming1577ece2009-02-04 16:42:12 -0800291 u32 __iomem *tbipa;
292 struct mii_bus *new_bus;
293 int tbiaddr = -1;
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000294 const u32 *addrp;
Anton Vorontsov2951d642009-11-04 12:52:56 +0000295 u64 addr = 0, size = 0;
Anton Vorontsov08d18f32010-05-14 04:27:30 +0000296 int err;
Andy Fleming1577ece2009-02-04 16:42:12 -0800297
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000298 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
299 if (!priv)
300 return -ENOMEM;
301
Andy Fleming1577ece2009-02-04 16:42:12 -0800302 new_bus = mdiobus_alloc();
Anton Vorontsov08d18f32010-05-14 04:27:30 +0000303 if (!new_bus) {
304 err = -ENOMEM;
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000305 goto err_free_priv;
Anton Vorontsov08d18f32010-05-14 04:27:30 +0000306 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800307
308 new_bus->name = "Freescale PowerQUICC MII Bus",
309 new_bus->read = &fsl_pq_mdio_read,
310 new_bus->write = &fsl_pq_mdio_write,
311 new_bus->reset = &fsl_pq_mdio_reset,
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000312 new_bus->priv = priv;
Andy Fleming1577ece2009-02-04 16:42:12 -0800313 fsl_pq_mdio_bus_name(new_bus->id, np);
314
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000315 addrp = of_get_address(np, 0, &size, NULL);
316 if (!addrp) {
317 err = -EINVAL;
318 goto err_free_bus;
319 }
320
Andy Fleming1577ece2009-02-04 16:42:12 -0800321 /* Set the PHY base address */
Anton Vorontsov3b1fd3e2010-04-23 07:12:35 +0000322 addr = of_translate_address(np, addrp);
323 if (addr == OF_BAD_ADDR) {
324 err = -EINVAL;
325 goto err_free_bus;
326 }
327
Anton Vorontsov2951d642009-11-04 12:52:56 +0000328 map = ioremap(addr, size);
329 if (!map) {
Andy Fleming1577ece2009-02-04 16:42:12 -0800330 err = -ENOMEM;
331 goto err_free_bus;
332 }
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000333 priv->map = map;
Andy Fleming1577ece2009-02-04 16:42:12 -0800334
Anton Vorontsov2951d642009-11-04 12:52:56 +0000335 if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
336 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
337 of_device_is_compatible(np, "fsl,ucc-mdio") ||
338 of_device_is_compatible(np, "ucc_geth_phy"))
339 map -= offsetof(struct fsl_pq_mdio, miimcfg);
340 regs = map;
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000341 priv->regs = regs;
Andy Fleming1577ece2009-02-04 16:42:12 -0800342
Grant Likely324931b2009-04-25 12:53:07 +0000343 new_bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);
Andy Fleming1577ece2009-02-04 16:42:12 -0800344
345 if (NULL == new_bus->irq) {
346 err = -ENOMEM;
347 goto err_unmap_regs;
348 }
349
350 new_bus->parent = &ofdev->dev;
351 dev_set_drvdata(&ofdev->dev, new_bus);
352
353 if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
Anton Vorontsov30196842009-03-21 13:30:05 -0700354 of_device_is_compatible(np, "fsl,gianfar-tbi") ||
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000355 of_device_is_compatible(np, "fsl,etsec2-mdio") ||
356 of_device_is_compatible(np, "fsl,etsec2-tbi") ||
Andy Fleming1577ece2009-02-04 16:42:12 -0800357 of_device_is_compatible(np, "gianfar")) {
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000358 tbipa = get_gfar_tbipa(regs, np);
359 if (!tbipa) {
360 err = -EINVAL;
361 goto err_free_irqs;
362 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800363 } else if (of_device_is_compatible(np, "fsl,ucc-mdio") ||
364 of_device_is_compatible(np, "ucc_geth_phy")) {
Andy Fleming1577ece2009-02-04 16:42:12 -0800365 u32 id;
Haiying Wangfbcc0e22009-06-02 04:04:14 +0000366 static u32 mii_mng_master;
Andy Fleming1577ece2009-02-04 16:42:12 -0800367
368 tbipa = &regs->utbipar;
369
370 if ((err = get_ucc_id_for_range(addr, addr + size, &id)))
371 goto err_free_irqs;
372
Haiying Wangfbcc0e22009-06-02 04:04:14 +0000373 if (!mii_mng_master) {
374 mii_mng_master = id;
375 ucc_set_qe_mux_mii_mng(id - 1);
376 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800377 } else {
378 err = -ENODEV;
379 goto err_free_irqs;
380 }
381
382 for_each_child_of_node(np, tbi) {
383 if (!strncmp(tbi->type, "tbi-phy", 8))
384 break;
385 }
386
387 if (tbi) {
388 const u32 *prop = of_get_property(tbi, "reg", NULL);
389
390 if (prop)
391 tbiaddr = *prop;
Baruch Siachc3e072f2011-11-14 08:21:30 +0200392
Kenth Eriksson464b57d2012-03-27 22:05:54 +0000393 if (tbiaddr == -1) {
394 err = -EBUSY;
395 goto err_free_irqs;
396 } else {
397 out_be32(tbipa, tbiaddr);
398 }
Andy Fleming1577ece2009-02-04 16:42:12 -0800399 }
400
Grant Likely324931b2009-04-25 12:53:07 +0000401 err = of_mdiobus_register(new_bus, np);
Andy Fleming1577ece2009-02-04 16:42:12 -0800402 if (err) {
403 printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
404 new_bus->name);
405 goto err_free_irqs;
406 }
407
408 return 0;
409
410err_free_irqs:
411 kfree(new_bus->irq);
412err_unmap_regs:
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000413 iounmap(priv->map);
Andy Fleming1577ece2009-02-04 16:42:12 -0800414err_free_bus:
415 kfree(new_bus);
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000416err_free_priv:
417 kfree(priv);
Andy Fleming1577ece2009-02-04 16:42:12 -0800418 return err;
419}
420
421
Grant Likely2dc11582010-08-06 09:25:50 -0600422static int fsl_pq_mdio_remove(struct platform_device *ofdev)
Andy Fleming1577ece2009-02-04 16:42:12 -0800423{
424 struct device *device = &ofdev->dev;
425 struct mii_bus *bus = dev_get_drvdata(device);
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000426 struct fsl_pq_mdio_priv *priv = bus->priv;
Andy Fleming1577ece2009-02-04 16:42:12 -0800427
428 mdiobus_unregister(bus);
429
430 dev_set_drvdata(device, NULL);
431
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000432 iounmap(priv->map);
Andy Fleming1577ece2009-02-04 16:42:12 -0800433 bus->priv = NULL;
434 mdiobus_free(bus);
Anton Vorontsovb3319b12009-12-30 08:23:34 +0000435 kfree(priv);
Andy Fleming1577ece2009-02-04 16:42:12 -0800436
437 return 0;
438}
439
440static struct of_device_id fsl_pq_mdio_match[] = {
441 {
442 .type = "mdio",
443 .compatible = "ucc_geth_phy",
444 },
445 {
446 .type = "mdio",
447 .compatible = "gianfar",
448 },
449 {
450 .compatible = "fsl,ucc-mdio",
451 },
452 {
453 .compatible = "fsl,gianfar-tbi",
454 },
455 {
456 .compatible = "fsl,gianfar-mdio",
457 },
Sandeep Gopalpet1d2397d2009-11-02 07:03:22 +0000458 {
459 .compatible = "fsl,etsec2-tbi",
460 },
461 {
462 .compatible = "fsl,etsec2-mdio",
463 },
Andy Fleming1577ece2009-02-04 16:42:12 -0800464 {},
465};
Anton Vorontsove72701a2009-10-14 14:54:52 -0700466MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
Andy Fleming1577ece2009-02-04 16:42:12 -0800467
Grant Likely74888762011-02-22 21:05:51 -0700468static struct platform_driver fsl_pq_mdio_driver = {
Grant Likely40182942010-04-13 16:13:02 -0700469 .driver = {
470 .name = "fsl-pq_mdio",
471 .owner = THIS_MODULE,
472 .of_match_table = fsl_pq_mdio_match,
473 },
Andy Fleming1577ece2009-02-04 16:42:12 -0800474 .probe = fsl_pq_mdio_probe,
475 .remove = fsl_pq_mdio_remove,
Andy Fleming1577ece2009-02-04 16:42:12 -0800476};
477
Axel Lindb62f682011-11-27 16:44:17 +0000478module_platform_driver(fsl_pq_mdio_driver);
Andy Fleming1577ece2009-02-04 16:42:12 -0800479
Sebastian Siewior26062892009-11-06 08:50:28 +0000480MODULE_LICENSE("GPL");