@@ -28,7 +28,8 @@ device that exists on this bus, a PHY node should be created.
Required properties:
- compatible : Should define the compatible device type for the
- mdio. Currently supported string/device is "fsl,etsec2-mdio".
+ mdio. Currently supported string/device is "fsl,etsec2-mdio" and
+ "fsl,gianfar-mdio".
- reg : Offset and length of the register set for the device
Example:
@@ -138,10 +138,12 @@ static int dm_fsl_pq_mdio_write(struct udevice *dev, int addr, int devad,
static int fsl_pq_mdio_probe(struct udevice *dev)
{
struct fsl_pq_mdio_info *info = dev_get_priv(dev);
+ struct fsl_pq_mdio_data *data;
fdt_addr_t reg;
+ data = (struct fsl_pq_mdio_data *)dev_get_driver_data(dev);
reg = devfdt_get_addr(dev);
- info->regs = map_physmem(reg + TSEC_MDIO_REGS_OFFSET, 0, MAP_NOCACHE);
+ info->regs = map_physmem(reg + data->mdio_regs_off, 0, MAP_NOCACHE);
return fsl_pq_mdio_reset(info->regs);
}
@@ -151,8 +153,17 @@ static const struct mdio_ops fsl_pq_mdio_ops = {
.write = dm_fsl_pq_mdio_write,
};
+static struct fsl_pq_mdio_data etsec2_data = {
+ .mdio_regs_off = TSEC_MDIO_REGS_OFFSET,
+};
+
+static struct fsl_pq_mdio_data gianfar_data = {
+ .mdio_regs_off = 0x0,
+};
+
static const struct udevice_id fsl_pq_mdio_ids[] = {
- { .compatible = "fsl,etsec2-mdio" },
+ { .compatible = "fsl,etsec2-mdio", .data = (ulong)&etsec2_data },
+ { .compatible = "fsl,gianfar-mdio", .data = (ulong)&gianfar_data },
{ }
};
@@ -53,6 +53,10 @@ int memac_mdio_read(struct mii_dev *bus, int port_addr, int dev_addr,
int regnum);
int memac_mdio_reset(struct mii_dev *bus);
+struct fsl_pq_mdio_data {
+ u32 mdio_regs_off;
+};
+
struct fsl_pq_mdio_info {
struct tsec_mii_mng __iomem *regs;
char *name;