1. 15 2月, 2011 10 次提交
  2. 10 1月, 2011 5 次提交
    • S
      net/fec: add dual fec support for mx28 · b5680e0b
      Shawn Guo 提交于
      This patch is to add mx28 dual fec support. Here are some key notes
      for mx28 fec controller.
      
       - The mx28 fec controller naming ENET-MAC is a different IP from FEC
         used on other i.mx variants.  But they are basically compatible
         on software interface, so it's possible to share the same driver.
       - ENET-MAC design on mx28 made an improper assumption that it runs
         on a big-endian system. As the result, driver has to swap every
         frame going to and coming from the controller.
       - The external phys can only be configured by fec0, which means fec1
         can not work independently and both phys need to be configured by
         mii_bus attached on fec0.
       - ENET-MAC reset will get mac address registers reset too.
       - ENET-MAC MII/RMII mode and 10M/100M speed are configured
         differently FEC.
       - ETHER_EN bit must be set to get ENET-MAC interrupt work.
      Signed-off-by: NShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5680e0b
    • S
      net/fec: improve pm for better suspend/resume · bcc67771
      Shawn Guo 提交于
      The following commit made a fix to use fec_enet_open/fec_enet_close
      over fec_enet_init/fec_stop for suspend/resume, because fec_enet_init
      does not allow to have a working network interface at resume.
      
        e3fe8558
        net/fec: fix pm to survive to suspend/resume
      
      This fix works for i.mx/mxc fec controller, but fails on mx28 fec
      which gets a different interrupt logic design. On i.mx fec, interrupt
      can be triggered even bit ETHER_EN of ECR register is not set. But
      on mx28 fec, ETHER_EN must be set to get interrupt work. Meanwhile,
      MII interrupt is mandatory to resume the driver, because MDIO
      read/write changed to interrupt mode by commit below.
      
        97b72e43
        fec: use interrupt for MDIO completion indication
      
      fec_restart/fec_stop comes out as the solution working for both
      cases.
      Signed-off-by: NShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bcc67771
    • S
      net/fec: add mac field into platform data and consolidate fec_get_mac · 49da97dc
      Shawn Guo 提交于
      Add mac field into fec_platform_data and consolidate function
      fec_get_mac to get mac address in following order.
      
       1) module parameter via kernel command line fec.macaddr=0x00,0x04,...
       2) from flash in case of CONFIG_M5272 or fec_platform_data mac
          field for others, which typically have mac stored in fuse
       3) fec mac address registers set by bootloader
      Signed-off-by: NShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49da97dc
    • S
      net/fec: remove the use of "index" which is legacy · 8649a230
      Shawn Guo 提交于
      The "index" becomes legacy since fep->pdev->id starts working
      to identify the instance.
      
      Moreover, the call of fec_enet_init(ndev, 0) always passes 0
      to fep->index. This makes the following code in fec_get_mac buggy.
      
      	/* Adjust MAC if using default MAC address */
      	if (iap == fec_mac_default)
      		dev->dev_addr[ETH_ALEN-1] = fec_mac_default[ETH_ALEN-1] + fep->index;
      
      It may be the time to remove "index" and use fep->pdev->id instead.
      Signed-off-by: NShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8649a230
    • S
      net/fec: fix MMFR_OP type in fec_enet_mdio_write · 862f0982
      Shawn Guo 提交于
      FEC_MMFR_OP_WRITE should be used than FEC_MMFR_OP_READ in
      a mdio write operation.
      
      It's probably a typo introduced by commit:
      
      e6b043d5
      netdev/fec.c: add phylib supporting to enable carrier detection (v2)
      Signed-off-by: NShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      862f0982
  3. 14 10月, 2010 1 次提交
    • G
      net: allow FEC driver to use fixed PHY support · 6fcc040f
      Greg Ungerer 提交于
      At least one board using the FEC driver does not have a conventional
      PHY attached to it, it is directly connected to a somewhat simple
      ethernet switch (the board is the SnapGear/LITE, and the attached
      4-port ethernet switch is a RealTek RTL8305). This switch does not
      present the usual register interface of a PHY, it presents nothing.
      So a PHY scan will find nothing - it finds ID's of 0 for each PHY
      on the attached MII bus.
      
      After the FEC driver was changed to use phylib for supporting PHYs
      it no longer works on this particular board/switch setup.
      
      Add code support to use a fixed phy if no PHY is found on the MII bus.
      This is based on the way the cpmac.c driver solved this same problem.
      Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6fcc040f
  4. 11 10月, 2010 1 次提交
  5. 23 7月, 2010 1 次提交
  6. 19 7月, 2010 1 次提交
  7. 13 7月, 2010 1 次提交
  8. 26 6月, 2010 1 次提交
    • E
      net/fec: clean suspend/resume · 87cad5c3
      Eric Benard 提交于
      Commit 59d4289b converted fec to dev_pm_ops but
      didn't update the suspend/resume functions thus leading to the following warning :
      "initialization from incompatible pointer type" when CONFIG_PM is set.
      
      This patch also fixe a few indentation and style around CONFIG_PM area.
      Signed-off-by: NEric Bénard <eric@eukrea.com>
      Cc: netdev@vger.kernel.org
      Cc: davem@davemloft.net
      Cc: amit.kucheria@canonical.com
      Cc: s.hauer@pengutronix.de
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87cad5c3
  9. 05 6月, 2010 1 次提交
  10. 03 6月, 2010 2 次提交
  11. 02 6月, 2010 1 次提交
    • E
      net/fec: fix pm to survive to suspend/resume · e3fe8558
      Eric Bénard 提交于
      * in the actual driver, calling fec_stop and fec_enet_init doesn't
      allow to have a working network interface at resume (where a
      ifconfig down and up is required to recover the interface)
      * by using fec_enet_close and fec_enet_open, this patch solves this
      problem and handle the case where the link changed between suspend
      and resume
      * this patch also disable clock at suspend and reenable it at resume
      Signed-off-by: NEric Bénard <eric@eukrea.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3fe8558
  12. 28 5月, 2010 1 次提交
  13. 24 5月, 2010 1 次提交
  14. 10 5月, 2010 1 次提交
  15. 05 5月, 2010 1 次提交
  16. 04 4月, 2010 1 次提交
    • J
      net: convert multicast list to list_head · 22bedad3
      Jiri Pirko 提交于
      Converts the list and the core manipulating with it to be the same as uc_list.
      
      +uses two functions for adding/removing mc address (normal and "global"
       variant) instead of a function parameter.
      +removes dev_mcast.c completely.
      +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
       manipulation with lists on a sandbox (used in bonding and 80211 drivers)
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22bedad3
  17. 02 4月, 2010 1 次提交
  18. 23 2月, 2010 1 次提交
  19. 13 2月, 2010 1 次提交
  20. 11 2月, 2010 2 次提交
  21. 21 10月, 2009 1 次提交
  22. 16 9月, 2009 1 次提交
  23. 03 9月, 2009 2 次提交
    • U
      fec: don't enable irqs in hard irq context · 81538e74
      Uwe Kleine-König 提交于
      fec_enet_mii, fec_enet_rx and fec_enet_tx are both only called by
      fec_enet_interrupt in interrupt context.  So they must not use
      spin_lock_irq/spin_unlock_irq.
      
      This fixes:
      	WARNING: at kernel/lockdep.c:2140 trace_hardirqs_on_caller+0x130/0x194()
      	...
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Matt Waddel <Matt.Waddel@freescale.com>
      Cc: netdev@vger.kernel.org
      Cc: Tim Sander <tim01@vlsi.informatik.tu-darmstadt.de>
      Acked-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81538e74
    • U
      fec: fix recursive locking of mii_lock · 84177a20
      Uwe Kleine-König 提交于
      mii_discover_phy is only called by fec_enet_mii (via mip->mii_func).  So
      &fep->mii_lock is already held and mii_discover_phy must not call
      mii_queue which locks &fep->mii_lock, too.
      
      This was noticed by lockdep:
      
      	=============================================
      	[ INFO: possible recursive locking detected ]
      	2.6.31-rc8-00038-g37d0892c #109
      	---------------------------------------------
      	swapper/1 is trying to acquire lock:
      	 (&fep->mii_lock){-.....}, at: [<c01569f8>] mii_queue+0x2c/0xcc
      
      	but task is already holding lock:
      	 (&fep->mii_lock){-.....}, at: [<c0156328>] fec_enet_interrupt+0x78/0x460
      
      	other info that might help us debug this:
      	2 locks held by swapper/1:
      	 #0:  (rtnl_mutex){+.+.+.}, at: [<c0183534>] rtnl_lock+0x18/0x20
      	 #1:  (&fep->mii_lock){-.....}, at: [<c0156328>] fec_enet_interrupt+0x78/0x460
      
      	stack backtrace:
      	Backtrace:
      	[<c00226fc>] (dump_backtrace+0x0/0x108) from [<c01eac14>] (dump_stack+0x18/0x1c)
      	 r6:c781d118 r5:c03e41d8 r4:00000001
      	[<c01eabfc>] (dump_stack+0x0/0x1c) from [<c005bae4>] (__lock_acquire+0x1a20/0x1a88)
      	[<c005a0c4>] (__lock_acquire+0x0/0x1a88) from [<c005bbac>] (lock_acquire+0x60/0x74)
      	[<c005bb4c>] (lock_acquire+0x0/0x74) from [<c01edda8>] (_spin_lock_irqsave+0x54/0x68)
      	 r7:60000093 r6:c01569f8 r5:c785e468 r4:00000000
      	[<c01edd54>] (_spin_lock_irqsave+0x0/0x68) from [<c01569f8>] (mii_queue+0x2c/0xcc)
      	 r7:c785e468 r6:c0156b24 r5:600a0000 r4:c785e000
      	[<c01569cc>] (mii_queue+0x0/0xcc) from [<c0156b78>] (mii_discover_phy+0x54/0xa8)
      	 r8:00000002 r7:00000032 r6:c785e000 r5:c785e360 r4:c785e000
      	[<c0156b24>] (mii_discover_phy+0x0/0xa8) from [<c0156354>] (fec_enet_interrupt+0xa4/0x460)
      	 r5:c785e360 r4:c077a170
      	[<c01562b0>] (fec_enet_interrupt+0x0/0x460) from [<c0066674>] (handle_IRQ_event+0x48/0x120)
      	[<c006662c>] (handle_IRQ_event+0x0/0x120) from [<c0068438>] (handle_level_irq+0x94/0x11c)
      	...
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Matt Waddel <Matt.Waddel@freescale.com>
      Cc: netdev@vger.kernel.org
      Cc: Tim Sander <tim01@vlsi.informatik.tu-darmstadt.de>
      Acked-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84177a20
  24. 10 8月, 2009 1 次提交
    • G
      fec: fix FEC driver packet transmission breakage · 9555b31e
      Greg Ungerer 提交于
      Commit f0b3fbea ("FEC Buffer rework")
      breaks transmission of packets where the skb data buffer is not memory
      aligned according to FEC_ALIGNMENT. It incorrectly passes to
      dma_sync_single() the buffer address directly from the skb, instead of
      the address calculated for use (which may be the skb address or one of
      the bounce buffers).
      
      It seems there is no use converting the cpu address of the buffer to
      a physical either, since dma_map_single() expects the cpu address and
      will return the dma address to use in the descriptor. So remove the use
      of __pa() on the buffer address as well.
      
      This patch is against 2.6.30-rc5. This breakage is a regression over
      2.6.30, which does not have this problem.
      Signed-off-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9555b31e