History log of /drivers/net/ethernet/freescale/fec.c
Revision Date Author Comments
ea51ade9398f3c94f63a25f512445ee7cbbbf284 13-Feb-2012 Florian Fainelli <florian@openwrt.org> fec: fix PHY name to match fixed MDIO bus name

Commit "391420f7: fec: use an unique MDIO bus name" first modified
the MDIO bus name to include the platform name, then in commit
"a7ed07d5: net: fec: correct phy_name buffer length when init phy_name"
the PHY name formatting was fixed in the case the PHY matches a PHY
driver.

The FEC driver however, also handles the case where we want to attach
to the fixed MDIO bus name, which was previously named "0", and now
"fixed-0". Change the PHY formatting logic to account for that.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
b72061a3cb0f1c5aa3f919e2dadb4a1631773e7a 07-Feb-2012 Fabio Estevam <festevam@gmail.com> net: fec: Fix build due to wrong dev annotation

commit 21a4e469 (netdev: ethernet dev_alloc_skb to netdev_alloc_skb)
should have used "ndev" instead of "dev".

This causes the following build errors:

drivers/net/ethernet/freescale/fec.c: In function 'fec_enet_rx':
drivers/net/ethernet/freescale/fec.c:714: error: 'dev' undeclared (first use in this function)
drivers/net/ethernet/freescale/fec.c:714: error: (Each undeclared identifier is reported only once
drivers/net/ethernet/freescale/fec.c:714: error: for each function it appears in.)
drivers/net/ethernet/freescale/fec.c: In function 'fec_enet_alloc_buffers':
drivers/net/ethernet/freescale/fec.c:1213: error: 'dev' undeclared (first use in this function)

Fix it, so that fec driver can be built again.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
21a4e46995fa1a76281ac0281ff837f706231a37 05-Feb-2012 Pradeep A Dalvi <netdev@pradeepdalvi.com> netdev: ethernet dev_alloc_skb to netdev_alloc_skb

Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
- Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
a7ed07d51c8abdb407be454c6cb6cfad613759d9 29-Jan-2012 Richard Zhao <richard.zhao@linaro.org> net: fec: correct phy_name buffer length when init phy_name

Fix the bug that we got wrong phy_name on imx6q sabrelite board.
snprintf used wrong length of phy_name.
phy_name length is MII_BUS_ID_SIZE + 3 rather not MII_BUS_ID_SIZE.
I change it to sizeof(phy_name).

Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
aaca2377e9c08d1964a5cacb95330708a6f6d106 23-Jan-2012 Fabio Estevam <festevam@gmail.com> net: fec: use module_platform_driver

Using module_platform_driver can make the code smaller.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8d82f219c2d476811cd3157a39c7b5c1f045ebc3 12-Jan-2012 Eric Benard <eric@eukrea.com> net: fsl: fec: handle 10Mbps speed in RMII mode

when the link is 10 Mbps and the mode is RMII, it's necessary
to set FRCONT to 1 in MIIGSK_CFGR to divide the RMII source
clock by 10 in order to support 10 Mbps operations.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
391420f7b829e73b26a543e39c40a83f7de6467c 10-Jan-2012 Florian Fainelli <florian@openwrt.org> fec: use an unique MDIO bus name.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9b07be4b2a78166bc54c8eedf18da8a8aafacfab 04-Jan-2012 stephen hemminger <shemminger@vyatta.com> net: make ethtool_ops const

Auditing all usage of ethtool_ops found several drivers that
are not declaring the struct const when it should be.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
c3b084c24c8a372026d95497dbb0da22c6eb591c 27-Dec-2011 Rogerio Pimentel <rogerio.pimentel@freescale.com> net: fec: Adjust ENET MDIO timeouts

On extensive NFS boots on a mx6qsabrelite board it was noted that "FEC: MDIO read timeout" were occuring,
which caused failure on loading the FEC driver.

The original FEC_MII_TIMEOUT was set to 1 ms, which is too low when passed to the usecs_to_jiffies macro.

On ARM one jiffy is 10ms, so use a timeout of 30ms, which corresponds to 3 jiffies.

After running extensive NFS boots, the MDIO timeouts do not occur anymore with this change.

Signed-off-by: Rogerio Pimentel <rogerio.pimentel@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
0ebafefcaa7a383b728d977a718e23e69ce84050 15-Nov-2011 Richard Zhao <richard.zhao@linaro.org> net: fec: add clk_prepare/clk_unprepare

It's for migrating to generic clk framework API.

Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
e163cc97f9ac169f00e86df57bee365e82e9c365 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: fix the .remove code

The .remove code is broken in several ways.
- mdiobus_unregister() is called twice for the same object in case of dual FEC
- phy_disconnect() is being called when the PHY is already disconnected
- the requested IRQ(s) are not freed
- fec_stop() is being called with the inteface already stopped

All of those lead to kernel crashes if the remove function is actually used.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
42431dc24de343d62bb8fb885586de7f408919c8 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: preserve MII/RMII setting in fec_stop()

Additionally to setting the ETHER_EN bit in FEC_ECNTRL the MII/RMII
setting in FEC_R_CNTRL needs to be preserved to keep the MII interface
functional.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
589efdc7f7327bc8ddf597bdaf9de38fcea31744 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: don't munge MAC address from platform data

When the MAC address is supplied via platform_data it should be OK as
it is and should not be modified in case of a dual FEC setup.
Also copying the MAC from platform_data to the single 'macaddr'
variable will overwrite the MAC for the first interface in case of a
dual FEC setup.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
86f9f2c81c44223b1be129d0b15cf6edac2a5278 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: don't request invalid IRQ

prevent calling request_irq() with a known invalid IRQ number and
preserve the return value of the platform_get_irq() function

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6ea0722fb8cdeacc774733c259d33bf45529e91b 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: prevent dobule restart of interface on FDX/HDX change

Upon detection of a FDX/HDX change the interface is restarted twice.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5b1436c1f94e591e240845edee835658ce98985e 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: set con_id in clk_get() call to NULL

The con_id is actually not needed for clk_get().

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
a7dd3219b915577e12612ac5d269e1bd22c6fb65 07-Dec-2011 Lothar Waßmann <LW@KARO-electronics.de> net/fec: misc cleanups

- remove some bogus whitespace
- remove line wraps from printk messages

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
43af940c54d712ab5e6d6798a82498b25c2af299 05-Dec-2011 Shawn Guo <shawn.guo@linaro.org> net/fec: fix the use of pdev->id

The pdev->id is used in several places for different purpose. All
these uses assume it's always the id of fec device which is >= 0.
However this is only true for non-DT case. When DT plays, pdev->id
is always -1, which will break these pdev->id users.

Instead of fixing all these users one by one, this patch introduces
a new member 'dev_id' to 'struct fec_enet_private' for holding the
correct fec device id, and replaces all the existing uses of pdev->id
with this dev_id.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7f5c6addcdc039c1a7c435857e6284ecac5d97c8 29-Sep-2011 Xiao Jiang <jgq516@gmail.com> net/fec: add poll controller function for fec nic

Add poll controller function for fec nic.

Signed-off-by: Xiao Jiang <jgq516@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
c7c83d1c95b84cf0e71e947613a5d409cf0ebca1 29-Sep-2011 Xiao Jiang <jgq516@gmail.com> net/fec: replace hardcoded irq num with macro

Don't use hardcoded irq num and replace it with
FEC_IRQ_NUM macro.

Signed-off-by: Xiao Jiang <jgq516@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
230dec61313dc5f5720311d0b492f69f5466b0a4 23-Sep-2011 Shawn Guo <shawn.guo@linaro.org> net/fec: add imx6q enet support

The imx6q enet is a derivative of imx28 enet controller. It fixed
the frame endian issue found on imx28, and added 1 Gbps support.

It also fixes a typo on vendor name in Kconfig.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
c828827f8426f2cd8e37315c59ae406534a16d48 23-Sep-2011 Shawn Guo <shawn.guo@linaro.org> net/fec: fix fec1 check in fec_enet_mii_init()

In function fec_enet_mii_init(), it uses non-zero pdev->id as part
of the condition to check the second fec instance (fec1). This works
before the driver supports device tree probe. But in case of device
tree probe, pdev->id is -1 which is also non-zero, so the logic becomes
broken when device tree probe gets supported.

The patch change the logic to check "pdev->id > 0" as the part of the
condition for identifying fec1.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
a9b2c8ef1585e1f14cec03777b1238e0d5ec4ea1 23-Sep-2011 Shawn Guo <shawn.guo@linaro.org> net/fec: fec_reset_phy() does not need to always succeed

FEC can work without a phy reset on some platforms, which means not
very platform necessarily have a phy-reset gpio encoded in device tree.
Even on the platforms that have the gpio, FEC can work without
resetting phy for some cases, e.g. boot loader has done that.

So it makes more sense to have the phy-reset-gpio request failure as
a debug message rather than a warning, and get fec_reset_phy() return
void since the caller does not check the return anyway.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
afc4b13df143122f99a0eb10bfefb216c2806de0 16-Aug-2011 Jiri Pirko <jpirko@redhat.com> net: remove use of ndo_set_multicast_list in drivers

replace it by ndo_set_rx_mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
ec21e2ec367697b4803e82662bdff6c8567745fc 11-Jun-2011 Jeff Kirsher <jeffrey.t.kirsher@intel.com> freescale: Move the Freescale drivers

Move the Freescale drivers into drivers/net/ethernet/freescale/ and
make the necessary Kconfig and Makefile changes.

CC: Sandeep Gopalpet <sandeep.kumar@freescale.com>
CC: Andy Fleming <afleming@freescale.com>
CC: Shlomi Gridish <gridish@freescale.com>
CC: Li Yang <leoli@freescale.com>
CC: Pantelis Antoniou <pantelis.antoniou@gmail.com>
CC: Vitaly Bordug <vbordug@ru.mvista.com>
CC: Dan Malek <dmalek@jlc.net>
CC: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>