Commit Graph

72 Commits

Author SHA1 Message Date
Lucas Stach
1dff9d0f54 net: asix: add AX88772B support
Add AX88772B ID together with two fixes needed to make this work.

1. The packet length check has to be adjusted, as all ASIX chips
only use 11 bits to indicate the length. AX88772B uses the other
bits to indicate unrelated things, which cause the check to fail.
This fix is based on a fix for the Linux kernel by Marek Vasut.
Linux upstream commit: bca0beb9363f8487ac902931a50eb00180a2d14a

2. AX88772B provides several bulk endpoints. Only the first
IN/OUT endpoints work in the default configuration. So stop
enumeration after we found them to avoid overwriting the
endpoint config with a non-working one.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-26 12:36:31 -05:00
Lucas Stach
02c8d8cc6e net: asix: add read_mac function
Initial device MAC should be read while getting info about the
device, so it's wrong to only read it in asix_init().

Add a dedicated function to read the initial MAC, which is also
able to handle devices that have their initial MAC stored in
EEPROM. Call this function inasix_eth_get_info().

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-26 12:36:31 -05:00
Lucas Stach
58f8fab8a4 net: asix: add write_hwaddr function
All ASIX chipsets aside from AX88172 are able to set the MAC
address on the hardware level. Add a function to expose this
ability.

To differentiate between chip types we now carry flags as driver
private data. Also while touching the asix_dongles array
constify this.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-26 12:36:30 -05:00
Lucas Stach
5fae53d0f1 net: asix: split out basic reset function
The basic device reset ensures that the device is ready to
service commands and does not need to get redone before each
network operation.

Split out the basic reset from asix_init() and instead call it
from asix_eth_get_info(), so that it only gets called once.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-26 12:36:30 -05:00
Lucas Stach
e1dbdf9109 net: introduce transparent driver private in ueth_data
Avoid clutter in ueth_data. Individual drivers should not mess
with structures belonging to the core like this.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-26 12:36:29 -05:00
Wolfgang Denk
b98b611502 Merge branch 'next' of git://git.denx.de/u-boot
* 'next' of git://git.denx.de/u-boot:
  MPC8xx: Fixup warning in arch/powerpc/cpu/mpc8xx/cpu.c
  doc: cleanup - move board READMEs into respective board directories
  net: sh_eth: add support for SH7757's GETHER
  net: sh_eth: modify the definitions of regsiter
  net: sh_eth: add SH_ETH_TYPE_ condition
  net: sh_eth: clean up for the SH7757's code
  net: fec_mxc: Fix MDC for xMII
  net: fec_mxc: Fix setting of RCR for xMII
  net: nfs: make NFS_TIMEOUT configurable
  net: Inline the new eth_setenv_enetaddr_by_index function
  net: allow setting env enetaddr from net device setting
  net/designware: Consecutive writes to the same register to be avoided
  CACHE: net: asix: Fix asix driver to work with data cache on
  net: phy: micrel: make ksz9021 phy accessible
  net: abort network initialization if the PHY driver fails
  phylib: phy_startup() should return an error code on failure
  net: tftp: fix type of block arg to store_block

Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-07-30 20:39:52 +02:00
Ilya Yanok
e3b31c8d75 smsc95xx: align buffers to cache line size
Align buffers passed to the USB code to cache line size so
they can be DMAed safely.

Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
2012-07-18 14:43:42 +02:00
Marek Vasut
c59ab0921f CACHE: net: asix: Fix asix driver to work with data cache on
The asix driver did not align buffers, therefore it didn't work
with data cache enabled. Fix this.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@gmail.com>
2012-07-11 13:15:31 -05:00
Anatolij Gustschin
e14826bc8d drivers/usb/eth/asix.c: Fix build warning
Fix:
asix.c: In function 'asix_eth_get_info':
asix.c:629:12: warning: assignment from incompatible pointer type

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2012-05-22 10:18:14 -05:00
Anatolij Gustschin
92ec210d31 drivers/usb/eth/smsc95xx.c: Fix GCC 4.6 warning
Fix:
smsc95xx.c: In function 'smsc95xx_eth_get_info':
smsc95xx.c:869:12: warning: assignment from incompatible pointer type
[enabled by default]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2012-05-22 10:18:13 -05:00
Vincent Palatin
e7e982d69c eth: remove usb-ethernet devices before re-enumerating them
Fix the crash when running several times usb_init() with a USB ethernet
device plugged.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Wolfgang Grandegger <wg@denx.de>
2012-03-03 16:56:04 +01:00
Peter Meerwald
d1f862f97e usb_ether: fix typo
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-14 11:02:46 -07:00
Wolfgang Grandegger
0d9679e65a smsc95xx: Debug message cleanup
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Simon Glass <sjg@chromium.org>
2011-11-22 08:39:24 +01:00
Wolfgang Grandegger
50d89f5757 smsc95xx: Fix MAC address programming
Commit 79ad544009 broke MAC address
programming in the SMSC95xx register set.

Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Simon Glass <sjg@chromium.org>
2011-11-22 08:39:24 +01:00
Marek Vasut
79ad544009 GCC4.6: Squash warnings in smsc95xx.c
smsc95xx.c: In function 'smsc95xx_write_hwaddr':
smsc95xx.c:380:2: warning: dereferencing type-punned pointer will break
strict-aliasing rules

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
2011-10-27 23:54:07 +02:00
Marek Vasut
0ed1eb6f55 ASIX: Fix buffer access in asix_get_phy_addr()
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-09-24 19:28:50 +02:00
Simon Glass
7616e78508 Add Ethernet hardware MAC address framework to usbnet
Built-in Ethernet adapters support setting the mac address by means of a
ethaddr environment variable for each interface (ethaddr, eth1addr, eth2addr).

This adds similar support to the USB network side, using the names
usbethaddr, usbeth1addr, etc. They are kept separate since we don't want
a USB device taking the MAC address of a built-in device or vice versa.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Eric Bénard <eric@eukrea.com>
2011-08-08 21:05:23 +02:00
Simon Glass
291391bed5 Add support for SMSC95XX USB 2.0 10/100MBit Ethernet Adapter
The SMSC95XX is a USB hub with a built-in Ethernet adapter. This adds support
for this, using the USB host network framework.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Eric Bénard <eric@eukrea.com>
2011-08-08 21:05:23 +02:00
Mike Frysinger
181f565c2d usb: convert to partial linking
Looks like this was missed during the conversion to partial linking.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-25 09:53:10 +02:00
Wolfgang Denk
14666418e9 Coding Style cleanup: remove trailing empty lines
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-03-27 21:48:08 +02:00
Simon Glass
9b70e00773 Add support for ASIX AX88772 USB 2.0 10/100Mbit Ethernet Adaptor
Driver originally written by NVIDIA Corporation, modified to
handle odd-length packets.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-02-19 20:32:36 +01:00
Simon Glass
89d48367ed Add USB host ethernet adapter support
This adds support for using USB Ethernet dongles in host mode. This is just
the framework - drivers will come later. A new config option called
CONFIG_USB_HOST_ETHER can be defined in board config files to switch this
on.

The was originally written by NVIDIA and was cleaned up for release by the
Chromium authors.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-02-19 20:32:36 +01:00