Age | Commit message (Collapse) | Author | Files | Lines |
|
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.
Signed-off-by: Jingoo Han <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Replace misleading -1 (-EPERM) by a more appropriate return code (-ENXIO)
in macb_mii_probe function.
Save macb_mii_probe return before branching to err_out_unregister to avoid
erronous 0 return.
Signed-off-by: Boris BREZILLON <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
The macb driver only handle PHY description through platform_data
(macb_platform_data).
Thus, when using dt you cannot define phy properties like phy address or
phy irq pin.
This patch makes use of the of_mdiobus_register to add support for
phy device definition using dt.
A fallback to the autoscan procedure is added in case there is no phy
devices defined in dt.
Signed-off-by: Boris BREZILLON <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
probe
Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for setting the default pins. Compile tested only.
Acked-by: Linus Walleij <[email protected]> (personally at LCE13)
Signed-off-by: Wolfram Sang <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Signed-off-by: Jongsung Kim <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
This has no dependency on any of the drivers under NET_CORE.
Signed-off-by: Ben Hutchings <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
GEM is able to adapt its DMA buffer size, so change
the RX path to take advantage of this possibility and
remove all kind of memcpy in this path.
This modification introduces function pointers for managing
differences between MACB and GEM adapter type.
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Macb Ethernet controller requires a RX buffer of 128 bytes. It is
highly sub-optimal for Gigabit-capable GEM that is able to use
a bigger DMA buffer. Change this constant and associated macros
with data stored in the private structure.
RX DMA buffer size has to be multiple of 64 bytes as indicated in
DMA Configuration Register specification.
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.
Signed-off-by: Jingoo Han <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Acked-by: Rob Herring <[email protected]>
Acked-by: Roland Stigge <[email protected]>
Acked-by: Mugunthan V N <[email protected]>
Reviewed-by: H Hartley Sweeten <[email protected]>
Tested-by: Roland Stigge <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Commit 749a2b6 (net/macb: clear tx/rx completion flags in ISR)
introduces clear-on-write on ISR register. This behavior is not always
implemented when using Cadence MACB/GEM and is breaking other platforms.
We are using the Design Configuration Register 1 information and a capability
property to actually activate this clear-on-write behavior on ISR.
Reported-by: Hein Tibosch <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
Tested-by: Hein Tibosch <[email protected]>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
If NO_DMA=y:
drivers/built-in.o: In function `macb_free_consistent':
drivers/net/ethernet/cadence/macb.c:878: undefined reference to `dma_free_coherent'
drivers/net/ethernet/cadence/macb.c:883: undefined reference to `dma_free_coherent'
drivers/net/ethernet/cadence/macb.c:888: undefined reference to `dma_free_coherent'
drivers/built-in.o: In function `macb_alloc_consistent':
drivers/net/ethernet/cadence/macb.c:905: undefined reference to `dma_alloc_coherent'
drivers/built-in.o: In function `macb_tx_interrupt':
drivers/net/ethernet/cadence/macb.c:515: undefined reference to `dma_unmap_single'
drivers/built-in.o: In function `macb_tx_error_task':
drivers/net/ethernet/cadence/macb.c:457: undefined reference to `dma_unmap_single'
drivers/built-in.o: In function `macb_start_xmit':
drivers/net/ethernet/cadence/macb.c:838: undefined reference to `dma_map_single'
Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: [email protected]
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
If NO_DMA=y:
drivers/built-in.o: In function `at91ether_start':
drivers/net/ethernet/cadence/at91_ether.c:49: undefined reference to `dma_alloc_coherent'
drivers/net/ethernet/cadence/at91_ether.c:60: undefined reference to `dma_free_coherent'
drivers/built-in.o: In function `at91ether_interrupt':
drivers/net/ethernet/cadence/at91_ether.c:250: undefined reference to `dma_unmap_single'
drivers/built-in.o: In function `at91ether_start_xmit':
drivers/net/ethernet/cadence/at91_ether.c:169: undefined reference to `dma_map_single'
drivers/built-in.o: In function `at91ether_close':
drivers/net/ethernet/cadence/at91_ether.c:145: undefined reference to `dma_free_coherent'
Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: [email protected]
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Original-idea-by: <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
With of_get_mac_address() and of_get_phy_mode() now defined as dummy
functions if OF_NET is not configured, it is no longer necessary to
provide OF dependent functions as front-end. Also, the two functions
depend on OF_NET, not on OF, so the conditional code was not correct
anyway.
Drop the front-end functions and call of_get_mac_address() and
of_get_phy_mode() directly instead.
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
With of_get_mac_address() and of_get_phy_mode() now defined as dummy
functions if OF_NET is not configured, it is no longer necessary to
provide OF dependent functions as front-end. Also, the two functions
depend on OF_NET, not on OF, so the conditional code was not correct
anyway.
Drop the front-end functions and call of_get_mac_address() and
of_get_phy_mode() directly instead.
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Use clk_prepare_enable/clk_disable_unprepare to be safe on SMP systems.
Signed-off-by: Steffen Trumtrar <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Fabio Estevam <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
The core has a bit for swapping packet data endianism.
Reset default from Cadence is off. Xilinx however, who uses this core on the
Zynq SoCs, opted for on.
Force it to off. This shouldn't change the behaviour for current users of the
macb, but enables usage on Zynq devices.
Signed-off-by: Steffen Trumtrar <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
At least in the cadence IP core on the Xilinx Zynq SoC the TCOMP/RCOMP flags
are not auto-cleaned. As these flags are evaluated, they need to be cleaned.
Signed-off-by: Steffen Trumtrar <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
I believe these error messages are already logged
on allocation failure by warn_alloc_failed and so
get a dump_stack on OOM.
Remove the unnecessary additional error logging.
Around these deletions:
o Alignment neatening.
o Remove unnecessary casts of dma_alloc_coherent.
o Hoist assigns from ifs.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Emitting netdev_alloc_skb and netdev_alloc_skb_ip_align OOM
messages is unnecessary as there is already a dump_stack
after allocation failures.
Other trivial changes around these removals:
Convert a few comparisons of pointer to 0 to !pointer.
Change flow to remove unnecessary label.
Remove now unused variable.
Hoist assignment from if.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
This patch uses module_platform_driver_probe() macro which makes
the code smaller and simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
This patch uses module_platform_driver_probe() macro which makes
the code smaller and simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 update from Martin Schwidefsky:
"The most prominent change in this patch set is the software dirty bit
patch for s390. It removes __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY and
the page_test_and_clear_dirty primitive which makes the common memory
management code a bit less obscure.
Heiko fixed most of the PCI related fallout, more often than not
missing GENERIC_HARDIRQS dependencies. Notable is one of the 3270
patches which adds an export to tty_io to be able to resize a tty.
The rest is the usual bunch of cleanups and bug fixes."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (42 commits)
s390/module: Add missing R_390_NONE relocation type
drivers/gpio: add missing GENERIC_HARDIRQ dependency
drivers/input: add couple of missing GENERIC_HARDIRQS dependencies
s390/cleanup: rename SPP to LPP
s390/mm: implement software dirty bits
s390/mm: Fix crst upgrade of mmap with MAP_FIXED
s390/linker skript: discard exit.data at runtime
drivers/media: add missing GENERIC_HARDIRQS dependency
s390/bpf,jit: add vlan tag support
drivers/net,AT91RM9200: add missing GENERIC_HARDIRQS dependency
iucv: fix kernel panic at reboot
s390/Kconfig: sort list of arch selected config options
phylib: remove !S390 dependeny from Kconfig
uio: remove !S390 dependency from Kconfig
dasd: fix sysfs cleanup in dasd_generic_remove
s390/pci: fix hotplug module init
s390/pci: cleanup clp page allocation
s390/pci: cleanup clp inline assembly
s390/perf: cpum_cf: fallback to software sampling events
s390/mm: provide PAGE_SHARED define
...
|
|
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 <[email protected]>
|
|
The AT91RM9200 driver call devm_request_irq() and therefore should
depend on GENERIC_HARDIRQS to prevent link/compile errors on plaforms
without GENERIC_HARDIRQS.
Signed-off-by: Heiko Carstens <[email protected]>
Acked-by: David S. Miller <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
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 <[email protected]>
Acked-by: Joachim Eastwood <[email protected]
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Convert all printk's to netdev_ counterparts and fix up some
printed texts.
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
No longer used after gpio phy interrupt support was
removed from at91_ether.
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
for usage in at91_ether driver.
Signed-off-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
If no pinctrl available just report a warning as some architecture may not
need to do anything.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
|
|
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
If no pinctrl available just report a warning as some architecture may not
need to do anything.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
[[email protected]: adapt the error path, remove unneeded headers]
Signed-off-by: Nicolas Ferre <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
[[email protected]: adapt to newer kernel]
Signed-off-by: Nicolas Ferre <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Ben Hutchings <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|
|
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 <[email protected]>
[[email protected]: split patch in topics, adapt to newer kernel]
Signed-off-by: Nicolas Ferre <[email protected]>
Tested-by: Joachim Eastwood <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
|