summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net into netDavid S. Miller2013-02-181-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | Pull in 'net' to take in the bug fixes that didn't make it into 3.8-final. Also, deal with the semantic conflict of the change made to net/ipv6/xfrm6_policy.c A missing rt6->n neighbour release was added to 'net', but in 'net-next' we no longer cache the neighbour entries in the ipv6 routes so that change is not appropriate there. Signed-off-by: David S. Miller <davem@davemloft.net>
| * net/macb: fix race with RX interrupt while doing NAPINicolas Ferre2013-02-131-0/+5
| | | | | | | | | | | | | | | | | | When interrupts are disabled, an RX condition can occur but it is not reported when enabling interrupts again. We need to check RSR and use napi_reschedule() if condition is met. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: phy: remove flags argument from phy_{attach, connect, connect_direct}Florian Fainelli2013-01-141-1/+1
|/ | | | | | | | | | | | | | | | The flags argument of the phy_{attach,connect,connect_direct} functions is then used to assign a struct phy_device dev_flags with its value. All callers but the tg3 driver pass the flag 0, which results in the underlying PHY drivers in drivers/net/phy/ not being able to actually use any of the flags they would set in dev_flags. This patch gets rid of the flags argument, and passes phydev->dev_flags to the internal PHY library call phy_attach_direct() such that drivers which actually modify a phy device dev_flags get the value preserved for use by the underlying phy driver. Acked-by: Kosta Zertsekel <konszert@marvell.com> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/cadence: remove __dev* attributesBill Pemberton2012-12-032-6/+6
| | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* net/macb: GEM DMA configuration register updateNicolas Ferre2012-11-232-2/+19
| | | | | | | | | | | Add information to the DMA Configuration Register to maximize system performance: - rx/tx packet buffer full memory size - allow possibility to use INCR16 if supported Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Joachim Eastwood <manabian@gmail.com Signed-off-by: David S. Miller <davem@davemloft.net>
* net/ethernet: remove useless is_valid_ether_addr from drivers ndo_openJoachim Eastwood2012-11-192-6/+0
| | | | | | | | | | | | | | If ndo_validate_addr is set to the generic eth_validate_addr function there is no point in calling is_valid_ether_addr from driver ndo_open if ndo_open is not used elsewhere in the driver. With this change is_valid_ether_addr will be called from the generic eth_validate_addr function. So there should be no change in the actual behavior. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: move to circ_buf macros and fix initial conditionNicolas Ferre2012-11-191-10/+7
| | | | | | | | | | | | | | | | | | | | | Move to circular buffers management macro and correct an error with circular buffer initial condition. Without this patch, the macb_tx_ring_avail() function was not reporting the proper ring availability at startup: macb macb: eth0: BUG! Tx Ring full when queue awake! macb macb: eth0: tx_head = 0, tx_tail = 0 And hanginig forever... I remove the macb_tx_ring_avail() function and use the proven macros from circ_buf.h. CIRC_CNT() is used in the "consumer" part of the driver: macb_tx_interrupt() to match advice from Documentation/circular-buffers.txt. Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: clear unused address registerJoachim Eastwood2012-11-142-0/+14
| | | | | | | | | | | | | Only the first register set is used for matching but we support getting the initial hw addr from any of the registers. To prevent stale entries and false matches clear unused register sets. This most important for the at91_ether driver where u-boot always uses the 2nd register set. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: add support for phy irq via gpio pinJoachim Eastwood2012-11-141-1/+11
| | | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/at91_ether: fix comment and style issuesJoachim Eastwood2012-11-071-60/+51
| | | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/at91_ether: clean up print outsJoachim Eastwood2012-11-071-10/+7
| | | | | | | | Convert all printk's to netdev_ counterparts and fix up some printed texts. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/at91_ether: drop board_data private struct memberJoachim Eastwood2012-11-072-8/+1
| | | | | | | | No longer used after gpio phy interrupt support was removed from at91_ether. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/at91_ether: use stat function from macbJoachim Eastwood2012-11-073-42/+11
| | | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/at91_ether: use macb functions for get/set hwaddrJoachim Eastwood2012-11-071-109/+3
| | | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: export macb_set_hwaddr and macb_get_hwaddrJoachim Eastwood2012-11-072-3/+7
| | | | | | | for usage in at91_ether driver. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: support reversed hw addrJoachim Eastwood2012-11-071-6/+18
| | | | | | | | | | | This is used on one AT91RM9200 board where a bootloader stores the Ethernet address in the wrong order. Support this on macb so address setting functions can be shared with the at91_ether driver. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: check all address registers setsJoachim Eastwood2012-11-071-15/+20
| | | | | | | | | | | | | | The macb driver in u-boot uses the first register set while the at91_ether driver in u-boot uses the second register set. By checking all register set, like at91_ether does, this code can be shared between the drivers. This only changes behavior on macb if no vaild address is found in the first register set. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: at91_ether: add pinctrl supportJean-Christophe PLAGNIOL-VILLARD2012-11-061-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>
* net: at91_ether: add dt supportJean-Christophe PLAGNIOL-VILLARD2012-11-061-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>
* macb: Keep driver's speed/duplex in sync with actual NCFGRVitalii Demianets2012-11-031-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>
* net/macb: add pinctrl consumer supportJean-Christophe PLAGNIOL-VILLARD2012-11-011-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>
* net/macb: Offset first RX buffer by two bytesHavard Skinnemoen2012-11-011-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>
* net/macb: better manage tx errorsNicolas Ferre2012-11-012-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>
* net/macb: ethtool interface: add register dump featureNicolas Ferre2012-11-012-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>
* net/macb: clean up ring buffer logicHavard Skinnemoen2012-11-013-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>
* net/macb: tx status is more than 8 bits nowNicolas Ferre2012-11-011-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>
* net/macb: remove macb_get_drvinfo()Nicolas Ferre2012-11-011-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>
* net/macb: change debugging messagesHavard Skinnemoen2012-11-011-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>
* net/macb: memory barriers cleanupHavard Skinnemoen2012-11-011-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>
* net/macb: Add support for Gigabit Ethernet modePatrice Vilchez2012-11-012-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>
* net/cadence: depend on HAS_IOMEMJoachim Eastwood2012-10-311-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>
* net/at91_ether: add pdata flag for reverse Eth addrJoachim Eastwood2012-10-232-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>
* net/at91_ether: select MACB in KconfigJoachim Eastwood2012-10-232-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>
* net/cadence: get rid of HAVE_NET_MACBJoachim Eastwood2012-10-231-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>
* net/macb: fix truncate warningsJoachim Eastwood2012-10-231-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>
* net/at91_ether: convert to devm_* functionsJoachim Eastwood2012-10-191-18/+7
| | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether: clean up rx buffer handlingJoachim Eastwood2012-10-192-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>
* net/at91_ether: use macb dma description structJoachim Eastwood2012-10-192-9/+4
| | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether: share macb_set_rx_mode with macbJoachim Eastwood2012-10-193-107/+4
| | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether: use ethtool and mdio from macbJoachim Eastwood2012-10-193-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>
* net/at91_ether: compile macb for exported functionsJoachim Eastwood2012-10-192-2/+2
| | | | | | Comile macb as well as at91_ether to access exported functions. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/macb: export some symbols for at91_etherJoachim Eastwood2012-10-192-3/+11
| | | | | | | Export some symbols to start sharing code between macb and at91_ether drivers. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether: use pclk member instead of ether_clkJoachim Eastwood2012-10-192-13/+12
| | | | | | Remove old at91_priv member and use pclk member from macb. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether/macb: absorb at91_private in to macb private structJoachim Eastwood2012-10-193-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>
* net/at91_ether: use macb defs for rx dma buffersJoachim Eastwood2012-10-192-11/+4
| | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether: use macb access functionsJoachim Eastwood2012-10-192-82/+64
| | | | | | Use macb read/write funtions and remove the old at91_ether ones. Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* net/at91_ether: use macb register definitionsJoachim Eastwood2012-10-191-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>
* net/macb: add AT91RM9200 specific registers and bits to headerJoachim Eastwood2012-10-191-0/+6
| | | | Signed-off-by: Joachim Eastwood <manabian@gmail.com>
* at91ether: return PTR_ERR if call to clk_get failsDevendra Naga2012-09-201-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>
* net/macb: manage carrier state with call to netif_carrier_{on|off}()Nicolas Ferre2012-07-091-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>
OpenPOWER on IntegriCloud