|
@@ -21,6 +21,7 @@
|
|
#include <linux/list.h>
|
|
#include <linux/list.h>
|
|
#include <linux/mdio.h>
|
|
#include <linux/mdio.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
|
|
+#include <linux/of_device.h>
|
|
#include <linux/of_mdio.h>
|
|
#include <linux/of_mdio.h>
|
|
#include <linux/netdevice.h>
|
|
#include <linux/netdevice.h>
|
|
#include <linux/gpio/consumer.h>
|
|
#include <linux/gpio/consumer.h>
|
|
@@ -3617,6 +3618,7 @@ static int mv88e6xxx_detect(struct mv88e6xxx_priv_state *ps)
|
|
if (!info)
|
|
if (!info)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
|
|
+ /* Update the compatible info with the probed one */
|
|
ps->info = info;
|
|
ps->info = info;
|
|
|
|
|
|
dev_info(ps->dev, "switch 0x%x detected: %s, revision %u\n",
|
|
dev_info(ps->dev, "switch 0x%x detected: %s, revision %u\n",
|
|
@@ -3669,6 +3671,9 @@ static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
|
|
if (!ps)
|
|
if (!ps)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
|
|
+ /* Legacy SMI probing will only support chips similar to 88E6085 */
|
|
|
|
+ ps->info = &mv88e6xxx_table[MV88E6085];
|
|
|
|
+
|
|
err = mv88e6xxx_smi_init(ps, bus, sw_addr);
|
|
err = mv88e6xxx_smi_init(ps, bus, sw_addr);
|
|
if (err)
|
|
if (err)
|
|
goto free;
|
|
goto free;
|
|
@@ -3754,14 +3759,21 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
|
|
{
|
|
{
|
|
struct device *dev = &mdiodev->dev;
|
|
struct device *dev = &mdiodev->dev;
|
|
struct device_node *np = dev->of_node;
|
|
struct device_node *np = dev->of_node;
|
|
|
|
+ const struct mv88e6xxx_info *compat_info;
|
|
struct mv88e6xxx_priv_state *ps;
|
|
struct mv88e6xxx_priv_state *ps;
|
|
u32 eeprom_len;
|
|
u32 eeprom_len;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
|
|
+ compat_info = of_device_get_match_data(dev);
|
|
|
|
+ if (!compat_info)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
ps = mv88e6xxx_alloc_chip(dev);
|
|
ps = mv88e6xxx_alloc_chip(dev);
|
|
if (!ps)
|
|
if (!ps)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
+ ps->info = compat_info;
|
|
|
|
+
|
|
err = mv88e6xxx_smi_init(ps, mdiodev->bus, mdiodev->addr);
|
|
err = mv88e6xxx_smi_init(ps, mdiodev->bus, mdiodev->addr);
|
|
if (err)
|
|
if (err)
|
|
return err;
|
|
return err;
|
|
@@ -3801,7 +3813,10 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)
|
|
}
|
|
}
|
|
|
|
|
|
static const struct of_device_id mv88e6xxx_of_match[] = {
|
|
static const struct of_device_id mv88e6xxx_of_match[] = {
|
|
- { .compatible = "marvell,mv88e6085" },
|
|
|
|
|
|
+ {
|
|
|
|
+ .compatible = "marvell,mv88e6085",
|
|
|
|
+ .data = &mv88e6xxx_table[MV88E6085],
|
|
|
|
+ },
|
|
{ /* sentinel */ },
|
|
{ /* sentinel */ },
|
|
};
|
|
};
|
|
|
|
|