summaryrefslogtreecommitdiffstats
path: root/drivers/net/smc911x.c
Commit message (Collapse)AuthorAgeFilesLines
* consolidate mdelay by providing a common function for all usersAnatolij Gustschin2011-10-221-2/+0
| | | | | | | | | There are several mdelay() definitions in the driver and board code. Remove them all and provide a common mdelay() in lib/time.c. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* smc911x: Fix build warningsWolfgang Denk2011-09-091-2/+2
| | | | | | | | | | | | Commit 6af1d41 "smc911x MII made available" was missing a few "const" qualifiers. Fix the resulting in build warnings: smc911x.c: In function 'smc911x_initialize': smc911x.c:297: warning: passing argument 2 of 'miiphy_register' from incompatible pointer type smc911x.c:297: warning: passing argument 3 of 'miiphy_register' from incompatible pointer type Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Helmut Raiger <helmut.raiger@hale.at>
* smc911x MII made availableHelmut Raiger2011-09-071-6/+30
| | | | | | | The driver already had the MII functions, but they have not been registered using miiphy_register(). Signed-off-by: Helmut Raiger <helmut.raiger@hale.at>
* miiphy: convert to linux/mii.hMike Frysinger2011-01-091-6/+6
| | | | | | | | The include/miiphy.h header duplicates a lot of things from linux/mii.h. So punt all the things that overlap to keep the API simple and to make merging between U-Boot and Linux simpler. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* lan91c96, smc911x: remove useless free(ptr) calls on NULL ptrSerge Ziryukin2010-05-171-1/+0
| | | | Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
* smc911x driver frame alignment patchValentin Yakovenkov2010-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SMSC911x chips have alignment function to allow frame payload data (which comes after 14-bytes ethernet header) to be aligned at some boundary when reading it from fifo (usually - 4 bytes boundary). This is done by inserting fake zeros bytes BEFORE actual frame data when reading from SMSC's fifo. This function controlled by RX_CFG register. There are bits that represents amount of fake bytes to be inserted. Linux uses alignment of 4 bytes. Ethernet frame header is 14 bytes long, so we need to add 2 fake bytes to get payload data aligned at 4-bytes boundary. Linux driver does this by adding IP_ALIGNMENT constant (defined at skb.h) when calculating fifo data length. All network subsystem of Linux uses this constant too when calculating different offsets. But u-boot does not use any packet data alignment, so we don't need to add anything when calculating fifo data length. Moreover, driver zeros the RX_CFG register just one line up, so chip does not insert any fake data at the beginig. So calculated data length is always bigger by 1 word. It seems that at almost every packet read we get an underflow condition at fifo and possible corruption of data. Especially at continuous transfers, such as tftp. Just after removing this magic addition, I've got tftp transfer speed as it aught to be at 100Mbps. It was really slow before. It seems that fifo underflow occurs only when using byte packing on 32-bit blackfin bus (may be because of very small delay between reads). Signed-off-by: Valentin Yakovenkov <yakovenkov@niistt.ru> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* NET: Fix MAC addr handling for smc911xSeunghyeon Rhee2010-01-311-6/+9
| | | | | | | | | | | | | | | | | | | This patch turns off MAC address mismatch warning when optional eeprom programmed with MAC address is not available. In that case, smc911x's MAC address register has its default value ff:ff:ff:ff:ff:ff and it's not a valid address. This makes eth_initialize() show the warning which has no meaningful information while environment variable ethaddr overrides the address read from the register. If there's no eeprom and the value of MAC address register is not valid after initialization, dev->enetaddr had better not be updated and maintain its initial value 00:00:00:00:00:00, which I think is what eth_initialize() expects. This is not a bug fix. Even without this patch, the driver works fine. It's just for enhancing the way of displaying messages. Signed-off-by: Seunghyeon Rhee <seunghyeon@lpmtec.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* smc911x: fix typo in smc911x_handle_mac_address nameMike Rapoport2009-12-071-2/+2
| | | | Signed-off-by: Mike Rapoport <mike@compulab.co.il>
* smc911x: make smc911x_initialize return correct valueMike Rapoport2009-11-121-2/+2
| | | | | | | | | Make smc911x_initialize return -1 on error and number of interfaces detected otherwise. Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Coding Style cleanup; update CHANGELOG, prepare -rc1Wolfgang Denk2009-10-281-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* ARM: OMAP3: Refactors the SM911x driverSteve Sakoman2009-10-241-6/+6
| | | | | | | Move the test up in the function to not hang on systems without ethernet. Signed-off-by: Steve Sakoman <sakoman@gmail.com> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* SMC911X: Add chip auto detectionOlof Johansson2009-10-131-6/+8
| | | | | | | | | | Refactor the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's. Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Dirk Behme <dirk.behme@googlemail.com> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* Convert SMC911X Ethernet driver to CONFIG_NET_MULTI APIBen Warren2009-07-221-80/+97
| | | | | | | | | | | | All in-tree boards that use this controller have CONFIG_NET_MULTI added Also: - changed CONFIG_DRIVER_SMC911X* to CONFIG_SMC911X* - cleaned up line lengths - modified all boards that override weak function in this driver - added Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Tested-by: Mike Frysinger <vapier@gentoo.org>
* Revert "SMC911x driver fixed for NFS boot"Wolfgang Denk2009-06-141-22/+1
| | | | | | | | | | | | This reverts commit ca9c8a1e10fac01e6a1129f82a7ce18bd818fa43, which causes compile warnings ("large integer implicitly truncated to unsigned type") on all systems that use this driver. The warning results from passing long constants (TX_CFG, RX_CFG) into smc911x_set_mac_csr() which is declared to accept "unsigned character" arguments only. Being close to a release, with nobody available to actually test the code or the suggested fixes, it seems better to revert the patch.
* SMC911x driver fixed for NFS bootManikandan Pillai2009-06-081-1/+22
| | | | | | | | | | | | | | eth_halt() function in the smc911x drivers used to call the smc911x_reset() function. eth_halt() used to be called after tftp transfers. This used to put the ethernet chip in reset while the linux boots up resulting in the ethernet driver not coming up. NFS boot used to fail as a result. This patch calls smc911x_shutdown() instead of smc911x_reset(). Some comments received has also been fixed. Signed-off-by: Manikandan Pillai <mani.pillai@ti.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* smc911x: write back the manually set MAC addressDaniel Mack2009-06-071-2/+7
| | | | | | | | | If the MAX address is given by the environment, write it back to the hardware. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* lan91c96/smc91111/smc911x: get mac address from environmentMike Frysinger2009-03-201-9/+5
| | | | | | | | | | | | | | | | | The environment is the canonical storage location of the mac address, so we're killing off the global data location and moving everything to querying the env directly. Also, do not bother checking the EEPROM if the env is setup. This simplifies the code greatly. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Wolfgang Dnek <wd@denx.de> CC: Ben Warren <biggerbadderben@gmail.com> CC: Rolf Offermanns <rof@sysgo.de> CC: Erik Stahlman <erik@vt.edu> CC: Daris A Nevil <dnevil@snmc.com> CC: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: split out useful defines/functions into local headerMike Frysinger2009-02-251-455/+2
| | | | | | | | | | | | | | The smc911x driver has a lot of useful defines/functions which can be used by pieces of code (such as example eeprom programmers). Rather than forcing each place to duplicate these defines/functions, split them out of the smdc911x driver into a local header. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Ben Warren <biggerbadderben@gmail.com> CC: Sascha Hauer <s.hauer@pengutronix.de> CC: Guennadi Liakhovetski <lg@denx.de> CC: Magnus Lilja <lilja.magnus@gmail.com> CC: Ben Warren <biggerbadderben@gmail.com>
* net: smc911x.c: Add LAN9211 to chip_ids[] arrayStefan Roese2009-01-281-0/+2
| | | | | Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: smc911x: Make register read/write functions weakStefan Roese2009-01-241-37/+40
| | | | | | | | | | | This patch changes the reg_read/_write to smc911x_reg_read/_write and defines then as weak so that they can be overridden by board specific version. This will be used by the upcoming VCTH board support. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* net: smc911x: Add pkt_data_pull and pkt_data_push functionNobuhiro Iwamatsu2008-09-021-2/+7
| | | | | | | | | | | | The RSK7203 board has the SMSC9118 wired up 'incorrectly'. Byte-swapping is necessary, and so poor performance is inevitable. This problem cannot evade by the swap function of CHIP, this can evade by software Byte-swapping. And this has problem by FIFO access only. pkt_data_pull/pkt_data_push functions necessary to solve this problem. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Fix some more printf() format issues.Jean-Christophe PLAGNIOL-VILLARD2008-07-131-2/+2
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: smc911x: Fix typoNobuhiro Iwamatsu2008-07-071-1/+1
| | | | Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
* net: fix compile problem in smc911x driver.Nobuhiro Iwamatsu2008-07-071-2/+2
| | | | | Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* net: Conditional COBJS inclusion of network driversShinya Kuribayashi2008-06-091-5/+0
| | | | | | | Replace COBJS-y with appropriate driver config names. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* smc911x: add 16 bit supportJens Gehrlein2008-05-221-2/+19
| | | | | Signed-off-by: Jens Gehrlein <sew_s@tqs.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Big white-space cleanup.Wolfgang Denk2008-05-211-4/+4
| | | | | | | | | | | This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Fix @ -> <at> substitutionStelian Pop2008-05-101-1/+1
| | | | | | | | | | | | When applying the AT91CAP9 patches upstream, something transformed the '@' character into the ' <at> ' sequence. The patch below restores the original form in all the places where it has been modified (the AT91CAP9 files, the AT91SAM9260 files which were copied from AT91CAP9, and a couple of other files where the ' <at> ' sequence was present). Signed-off-by: Stelian Pop <stelian@popies.net>
* Clean up smsc911x driverGuennadi Liakhovetski2008-04-151-349/+368
| | | | | | | | | Replace direct register address derefencing with accessor functions. Restrict explicitly 32-bit bus-width, extend affected configurations respectively. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* This patch adds a driver for the following smsc network controllers:Sascha Hauer2008-04-151-0/+667
| | | | | | | | | | | | | LAN9115 LAN9116 LAN9117 LAN9215 LAN9216 LAN9217 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Guennadi Liakhovetski<lg@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Revert merge of git://www.denx.de/git/u-boot-arm, commit 62479b18:Wolfgang Denk2008-04-111-680/+0
| | | | | | | | | | | | | | | | | | | | | | Reverting became necessary after it turned out that the patches in the u-boot-arm repo were modified, and in some cases corrupted. This reverts the following commits: 066bebd6353e33af3adefc3404560871699e9961 7a837b7310166ae8fc8b8d66d7ef01b60a80f9d6 c88ae20580b2b01487b4cdcc8b2a113f551aee36 a147e56f03871bba4f05058d5e04ce7deb010b04 d6674e0e2a6a1f033945f78838566210d3f28c95 8c8463cce44d849e37744749b32d38e1dfb12e50 c98b47ad24b2d91f41c09a3d62d7f70ad84f4b7d 8bf69d81782619187933a605f1a95ee1d069478d 8c16cb0d3b971f46fbe77c072664c0f2dcd4471d a574a73852a527779234e73e17e7597fd8128882 1377b5583a48021d983e1fd565f7d40c89e84d63 1704dc20917b4f71e373e2c888497ee666d40380 Signed-off-by: Wolfgang Denk <wd@denx.de>
* add SMSC LAN9x1x Network driverSascha Hauer2008-03-301-0/+680
This patch adds a driver for the following smsc network controllers: LAN9115 LAN9116 LAN9117 LAN9215 LAN9216 LAN9217 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
OpenPOWER on IntegriCloud