diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-03-27 15:21:18 +0100 |
---|---|---|
committer | Stefan Agner <stefan@agner.ch> | 2014-05-15 13:48:47 +0200 |
commit | b7abbee6ae02442498a6f4ab37f696e1fa057953 (patch) | |
tree | 8ee990478486b354b77fc3a9908202ee89554e7c /drivers | |
parent | b2ea6f57645e26f8b099ea87aeeef6149dbb2e96 (diff) |
colibri_vf: add support for second Ethernet
Add alternative pinmux and platform data for second Ethernet. Also
make sure MAC address is calculated from first Ethernet MAC address,
which is derived from part serial number. Note that FEC1 is the
default Ethernet controller (and hence eth0), while FEC0 is the
additional Ethernet controller (eth1).
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/Kconfig | 7 | ||||
-rwxr-xr-x | drivers/net/fec.c | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index de2905a67e76..31da73894a70 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -1951,6 +1951,13 @@ config FEC Say Y here if you want to use the built-in 10/100 Fast ethernet controller on some Motorola ColdFire and Freescale i.MX processors. +config FEC0 + bool "First FEC ethernet controller (of Vybrid and ColdFire)" + depends on FEC && (ARCH_MVF || M54455 || M5441X) + help + Say Y here if you want to use the first built-in 10/100 Fast + ethernet controller on Vybrid and some ColdFire processors. + config FEC1 bool "Second FEC ethernet controller (of Vybrid and ColdFire)" depends on FEC && (ARCH_MVF || M54455 || M5441X) diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 8a2c60f29898..bcd02e5cfaf0 100755 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -691,8 +691,12 @@ static void __inline__ fec_get_mac(struct net_device *ndev) memcpy(ndev->dev_addr, iap, ETH_ALEN); -#if !defined(CONFIG_COLIBRI_VF) /* Adjust MAC if using macaddr */ +#if CONFIG_COLIBRI_VF + /* Add 0x100000 to the first MAC address to get the second */ + if (iap == macaddr) + ndev->dev_addr[3] = macaddr[3] + (fep->pdev->id * 0x10); +#else if (iap == macaddr) ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->pdev->id; #endif /* !CONFIG_COLIBRI_VF */ |