aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-11-06net: at91_ether: add pinctrl supportJean-Christophe PLAGNIOL-VILLARD1-0/+11
If no pinctrl available just report a warning as some architecture may not need to do anything. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-06net: at91_ether: add dt supportJean-Christophe PLAGNIOL-VILLARD1-7/+66
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-03macb: Keep driver's speed/duplex in sync with actual NCFGRVitalii Demianets1-0/+2
When underlying phy driver restores its state very fast after being brought down and up so that macb driver function macb_handle_link_change() was never called with link state "down", driver's internal representation of phy speed and duplex (bp->speed and bp->duplex) didn't change. So, macb driver sees no reason to perform actual write to the NCFGR register, although the speed and duplex settings in that register were reset when interface was brought down and up. In that case actual phy speed and duplex differ from NCFGR settings. The patch fixes that by keeping internal driver representation of speed and duplex in sync with actual content of NCFGR. Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: add pinctrl consumer supportJean-Christophe PLAGNIOL-VILLARD1-0/+11
If no pinctrl available just report a warning as some architecture may not need to do anything. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> [nicolas.ferre@atmel.com: adapt the error path, remove unneeded headers] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: Offset first RX buffer by two bytesHavard Skinnemoen1-7/+16
Make the ethernet frame payload word-aligned, possibly making the memcpy into the skb a bit faster. This will be even more important after we eliminate the copy altogether. Also eliminate the redundant RX_OFFSET constant -- it has the same definition and purpose as NET_IP_ALIGN. Signed-off-by: Havard Skinnemoen <havard@skinnemoen.net> [nicolas.ferre@atmel.com: adapt to newer kernel] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: better manage tx errorsNicolas Ferre2-54/+113
Handle all TX errors, not only underruns. TX error management is deferred to a dedicated workqueue. Reinitialize the TX ring after treating all remaining frames, and restart the controller when everything has been cleaned up properly. Napi is not stopped during this task as the driver only handles napi for RX for now. With this sequence, we do not need a special check during the xmit method as the packets will be caught by TX disable during workqueue execution. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: ethtool interface: add register dump featureNicolas Ferre2-0/+43
Add macb_get_regs() ethtool function and its helper function: macb_get_regs_len(). The version field is deduced from the IP revision which gives the "MACB or GEM" information. An additional version field is reserved. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: clean up ring buffer logicHavard Skinnemoen3-73/+127
Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize the chances of messing this up. This makes the code slightly smaller, and hopefully faster as well. Also, doing the ring buffer management this way will simplify things a lot when making the ring sizes configurable in the future. Available number of descriptors in ring buffer function by David Laight. Signed-off-by: Havard Skinnemoen <havard@skinnemoen.net> [nicolas.ferre@atmel.com: split patch in topics, adapt to newer kernel] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: tx status is more than 8 bits nowNicolas Ferre1-1/+1
On some revision of GEM, TSR status register has more information. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: remove macb_get_drvinfo()Nicolas Ferre1-11/+0
This function has little meaning so remove it altogether and let ethtool core fill in the fields automatically. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: change debugging messagesHavard Skinnemoen1-10/+12
Convert some noisy netdev_dbg() statements to netdev_vdbg(). Defining DEBUG will no longer fill up the logs; VERBOSE_DEBUG still does. Add one more verbose debug for ISR status. Signed-off-by: Havard Skinnemoen <havard@skinnemoen.net> [nicolas.ferre@atmel.com: split patch in topics, add ISR status] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: memory barriers cleanupHavard Skinnemoen1-4/+14
Remove a couple of unneeded barriers and document the remaining ones. Signed-off-by: Havard Skinnemoen <havard@skinnemoen.net> [nicolas.ferre@atmel.com: split patch in topics] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-01net/macb: Add support for Gigabit Ethernet modePatrice Vilchez2-3/+16
Add Gigabit Ethernet mode to GEM cadence IP and enable RGMII connection. Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-31net/cadence: depend on HAS_IOMEMJoachim Eastwood1-0/+1
Fixes the following build failure on S390: In file included from drivers/net/ethernet/cadence/at91_ether.c:35:0: drivers/net/ethernet/cadence/macb.h: In function 'macb_is_gem': drivers/net/ethernet/cadence/macb.h:563:2: error: implicit declaration of function '__raw_readl' [-Werror=implicit-function-declaration] drivers/net/ethernet/cadence/at91_ether.c: In function 'update_mac_address': drivers/net/ethernet/cadence/at91_ether.c:119:2: error: implicit declaration of function '__raw_writel' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Joachim Eastwood <manabian@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/at91_ether: add pdata flag for reverse Eth addrJoachim Eastwood2-4/+2
This will allow us to remove the last mach include from at91_ether and also make it easier to share address setup with macb. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/at91_ether: select MACB in KconfigJoachim Eastwood2-2/+2
Now that HAVE_NET_MACB is gone let's just select MACB to satisfy the dependecies in at91_ether. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/cadence: get rid of HAVE_NET_MACBJoachim Eastwood1-5/+0
macb is a platform driver and there is nothing that prevents this driver from being built on non-ARM/AVR32 platforms. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23net/macb: fix truncate warningsJoachim Eastwood1-4/+4
When building macb on x86_64 the following warnings show up: drivers/net/ethernet/cadence/macb.c: In function macb_interrupt: drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c: In function macb_reset_hw: drivers/net/ethernet/cadence/macb.c:792:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c:793:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] drivers/net/ethernet/cadence/macb.c:796:2: warning: large integer implicitly truncated to unsigned type [-Woverflow] Use -1 insted of ~0UL, as done in other places in the driver, to silence these warnings. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-19net/at91_ether: convert to devm_* functionsJoachim Eastwood1-18/+7
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: clean up rx buffer handlingJoachim Eastwood2-51/+68
This patch does two things: * Use macb struct members and remove at91_ether ones * Alloc DMA buffers on netdev start and dealloc on stop Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use macb dma description structJoachim Eastwood2-9/+4
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: share macb_set_rx_mode with macbJoachim Eastwood3-107/+4
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use ethtool and mdio from macbJoachim Eastwood3-673/+31
This rips out the at91_ether phy handling and ethtool stuff and replace it with equivalent stuff from macb. The only thing lost is the phy irq support from at91_ether, but this can be added to macb and then benefit all users. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: compile macb for exported functionsJoachim Eastwood2-2/+2
Comile macb as well as at91_ether to access exported functions. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/macb: export some symbols for at91_etherJoachim Eastwood2-3/+11
Export some symbols to start sharing code between macb and at91_ether drivers. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use pclk member instead of ether_clkJoachim Eastwood2-13/+12
Remove old at91_priv member and use pclk member from macb. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether/macb: absorb at91_private in to macb private structJoachim Eastwood3-79/+71
This will make it easier to share code between the drivers and eventually merge them into one driver. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use macb defs for rx dma buffersJoachim Eastwood2-11/+4
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use macb access functionsJoachim Eastwood2-82/+64
Use macb read/write funtions and remove the old at91_ether ones. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/at91_ether: use macb register definitionsJoachim Eastwood1-80/+84
Use register and bits definitions from the macb header. This makes it possible to have one header file for this hardware. Process was scripted and the resulting object file has the same checksum. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-10-19net/macb: add AT91RM9200 specific registers and bits to headerJoachim Eastwood1-0/+6
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
2012-09-20at91ether: return PTR_ERR if call to clk_get failsDevendra Naga1-1/+1
we are currently returning ENODEV, as the clk_get may give a exact error code in its returned pointer, assign it to the ret by using the PTR_ERR function, so that the subsequent goto label will jump to the error path and clean the driver and return the error correctly. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-09net/macb: manage carrier state with call to netif_carrier_{on|off}()Nicolas Ferre1-2/+11
OFF carrier state is setup in probe() open() and suspend() functions. The carrier ON state is managed in macb_handle_link_change(). Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-28net/at91_ether: use gpio_to_irq for phy IRQ lineNicolas Ferre1-4/+4
Use the gpio_to_irq() function to retrieve the phy IRQ line from the GPIO pin specification. This fix is needed now that we have moved to irqdomains on AT91. Reported-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Andrew Victor <avictor.za@gmail.com> Cc: David S. Miller <davem@davemloft.net> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-28AT91: Remove fixed mapping for AT91RM9200 ethernetAndrew Victor2-243/+285
The AT91RM9200 Ethernet controller still has a fixed IO mapping. So: * Remove the fixed IO mapping and AT91_VA_BASE_EMAC definition. * Pass the physical base-address via platform-resources to the driver. * Convert at91_ether.c driver to perform an ioremap(). * Ethernet PHY detection needs to be performed during the driver initialization process, it can no longer be done first. Signed-off-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04macb: Support the get_ts_info ethtool method.Richard Cochran1-0/+1
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15net: replace random_ether_addr() with eth_hw_addr_random()Danny Kukawka1-1/+1
Replace usage of random_ether_addr() with eth_hw_addr_random() to set addr_assign_type correctly to NET_ADDR_RANDOM. Change the trivial cases. v2: adapt to renamed eth_hw_addr_random() Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06netdev: ethernet dev_alloc_skb to netdev_alloc_skbPradeep A Dalvi1-1/+1
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>
2012-02-06netdev: ethernet dev_alloc_skb to netdev_alloc_skbPradeep A Dalvi1-1/+1
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>
2012-01-31drivers/net: Remove alloc_etherdev error messagesJoe Perches1-3/+1
alloc_etherdev has a generic OOM/unable to alloc message. Remove the duplicative messages after alloc_etherdev calls. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-10macb: use an unique MDIO bus name.Florian Fainelli1-1/+2
Signed-off-by: Florian Fainelli <florian@openwrt.org> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-21net: macb: fix build break with !CONFIG_OFOlof Johansson1-0/+1
This fixes the build of the macb driver that was broken by the DT changes: drivers/net/ethernet/cadence/macb.c:1503: error: implicit declaration of function 'of_match_ptr' drivers/net/ethernet/cadence/macb.c:1503: error: 'macb_dt_ids' undeclared here (not in a function) drivers/net/ethernet/cadence/macb.c:1503: error: initializer element is not constant drivers/net/ethernet/cadence/macb.c:1503: error: (near initialization for 'macb_driver.driver.of_match_table') Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2011-12-16Merge branch 'at91/macb' into next/driversArnd Bergmann3-18/+80
2011-12-16net/at91_ether: use gpio_is_valid for phy IRQ lineNicolas Ferre1-10/+13
Use the generic gpiolib gpio_is_valid() function to test if the phy IRQ line GPIO is actually provided. For non-connected or non-existing phy IRQ lines, -EINVAL value is used for phy_irq_pin field of struct at91_eth_data. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: David S. Miller <davem@davemloft.net>
2011-12-16net/macb: add DT support for Cadence macb/gem driverJean-Christophe PLAGNIOL-VILLARD2-8/+67
Allow the device tree to provide the mac address and the phy mode. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> [nicolas.ferre@atmel.com: change "compatible" node property, doc and DT hwaddr] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> [jamie@jamieiles.com: add "gem" compatibility strings and doc] Acked-by: Jamie Iles<jamie@jamieiles.com> Acked-by: David S. Miller <davem@davemloft.net>
2011-12-06Merge branch 'mxs/saif' into next/driversArnd Bergmann1-0/+1
Conflicts: drivers/net/ethernet/cadence/Kconfig
2011-11-22macb: allow GEM to have configurable receive buffer sizeJamie Iles2-0/+22
GEM has configurable receive buffer sizes so requires this to be programmed up. Any size < 2048 and a multiple of 64 bytes is permitted. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-11-22macb: support DMA bus widths > 32 bitsJamie Iles2-0/+42
Some GEM implementations may support DMA bus widths up to 128 bits. We can get the maximum supported DMA bus width from the design configuration register so use that to program the device up. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-11-22macb: support statistics for GEM devicesJamie Iles2-4/+107
GEM devices have a different number of statistics registers and they are at a different offset to MACB devices. Make the statistics collection method dependent on device type. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-11-22macb: support higher rate GEM MDIO clock divisorsJamie Iles2-11/+55
GEM devices support larger clock divisors and have a different range of divisors. Program the MDIO clock divisors based on the device type. Signed-off-by: Jamie Iles <jamie@jamieiles.com> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>