summaryrefslogtreecommitdiffstats
path: root/drivers/net/smc91111.c
Commit message (Collapse)AuthorAgeFilesLines
* drivers: net: convert drivers to spdxOleksij Rempel2018-12-061-10/+1
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move smc91111 eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc1111: fix ethernet mac settingRobert Jarzmik2015-12-071-1/+1
| | | | | | | | | | | | | | Even if the setting of the MAC address does work correctly, the function return an error. In the former barebox version, this didn't seem to be a problem. In v2015.11.0 version, the "ifup eth0" command fails because of this, and as a consequence the network interface doesn't work. The fix is straightforward. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Make set_ethaddr argument constSascha Hauer2015-06-261-1/+1
| | | | | | | The set_ethaddr callback should not modify the MAC address passed to it, so make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc1111: add a quirk for pxa pxa27x platformsRobert Jarzmik2015-04-131-0/+29
| | | | | | | | | | | | As hinted in the linux kernel driver, pxa platforms such as mainstone, stargate and idp have a broken design, where half-word writes not aligned to a word address are not working. This patch is a taking back the half-word write accessor for this specific case from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc1111: fix platform data initializationsRobert Jarzmik2015-04-131-2/+2
| | | | | | | | | | | | | The configuration and control setup introduced in commit "extend the driver for 91c94 and 91c96 support" suffers from a typo defect, which makes the commit broken. The typo happens to be in barebox tree, while it's not in the tested patches I had, and there was a mismatch in my former submission, which is fixed by this patch. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc1111: improve debug capabilityRobert Jarzmik2015-02-041-49/+69
| | | | | | | | Improve smc1111 driver debug messages by printing the register accessed, the current bank, and the values. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc1111: extend the driver for 91c94 and 91c96 supportRobert Jarzmik2015-02-041-5/+33
| | | | | | | | | | | | | | | | All the smcs family chips 91c94, 91c96, 91c100, 91c111 share almost the same behavior and register sets. The noticeable exceptions are coped with in this patch, ie : - 91c94 and 91c96 only have an internal 10 Mbps phy The registers used for phy discovery on later chips will corrupt the 91c96 state. - 91c94 and 91c96 have a control and config register quite different from their 91c1xx conterparts A platform data user defined couple of registers is introduced. If these values are 0, 91c1xx legacy behavior is assumed. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc1111: add 16 bits accessors, allow address shiftRobert Jarzmik2015-02-041-42/+92
| | | | | | | | | | | | | | Smc network IPs can be wired up in different funny ways. For example the lubbock pxa25x development platform wires all address lines shifted by 2, ie. bus A2 is smc91c96 A0, bus A3 is smc91c96 A1 etc ... In order to cope with the different possible combination, add a shift parameter for addresses. By default, the old behaviour using the 32 bit accesses is kept. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/arm'Sascha Hauer2015-01-091-0/+26
|\
| * net: smc1111: fix memory congestionsRobert Jarzmik2015-01-061-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the SMC1111 has a shared pool of 2k memory buckets for both transmission and reception, and as there are variants which have as few as 4 buckets in total, the memory pool can be hogged by unclaimed receptions, and impeed any further transmission. This happens on the zylonite pxa board, where 4 packets, most probably icmp and arp, fill the 4 buckets, preventing any further ethernet transmission, and stalling the driver. The fix is rather rough : whenever all the buckets are filled by reception packets, and if a transmission is required, the transmission code path will empty up all received packets. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: smc1111: move print_packet functionRobert Jarzmik2015-01-051-38/+37
|/ | | | | | | | Fix for a compiler complaint, because print_packet is needed by a function before it is declared. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+3
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Pass eth_device to net_receiveSascha Hauer2014-05-151-1/+1
| | | | | | | So that barebox has the information which interface a packet came from. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc91111: add fixup for qemu phy supportJean-Christophe PLAGNIOL-VILLARD2013-09-221-1/+29
| | | | | | | | | | | | | as today qemu does not support phy, it will return always 0x0 to any read on the mii bus. So the phy_id is 0 and the link is donw. To have the norwork running on versatilpb & other qenu board for the link up at 100Mbps. Only enable if qemu_fixup is set. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused debug Kconfig optionsSascha Hauer2013-06-231-4/+0
| | | | | | | | | | | ENABLE_DEVICE_NOISE is used only in two network drivers and is otherwise unused. ENABLE_FLASH_NOISE is completely unused. ENABLE_PARTITION_NOISE enables DEBUG in the partition command, but this code has no debug messages at all. Remove all this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911111: fix send and recv return valueJean-Christophe PLAGNIOL-VILLARD2013-02-261-6/+6
| | | | | | | on error send error code and 0 on success Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-8/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: introduce phylibJean-Christophe PLAGNIOL-VILLARD2012-09-251-28/+19
|/ | | | | | | | | | | | | | | | Adapt phylib from linux switch all the driver to it reimplement mii bus This will allow to have - phy drivers - to only connect the phy at then opening of the device - if the phy is not ready or not up fail on open Same behaviour as in linux and will allow to share code and simplify porting. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net drivers: remove unused type_dataSascha Hauer2012-02-251-1/+0
| | | | | | | Many net drivers set dev->type_data without ever using it, so just remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net mii: add a parent pointer to miidevs and set it to the hardware deviceSascha Hauer2011-08-151-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make the ethernet device a child of the hardware deviceSascha Hauer2011-08-151-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc91111: switch to resourcesSascha Hauer2011-07-281-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc91111: Various sparse fixes.Marek Belisko2010-11-191-20/+20
| | | | | | | | | | | Patch fix all similar warnings found by sparse: drivers/net/smc91111.c:488:9: warning: incorrect type in argument 1 (different base types) expected void const volatile [noderef] <asn:2>*<noident> got unsigned long [unsigned] offset Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: rework the mii supportJean-Christophe PLAGNIOL-VILLARD2010-08-271-17/+15
| | | | | | | this rework is done in order to add a phylib and allow to have phy driver support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* network drivers: call net_receive directly instead of NetReceiveSascha Hauer2010-06-171-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc91111: fix odering of mac address read from EEPROMMarc Kleine-Budde2010-02-011-14/+9
| | | | | | | | | | | | | | On my little endian PXA270, the ethernet address is byte swapped: correct ethernet address: 00:50:c2:80:a7:bd broken ethernet address: 50:00:80:c2:bd:a7 The correct value is what the sticker on the baoard and the linux driver says. This patch fixes the problem by reading the ethaddr byte-wise from the eeprom. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev fixes for new boardsSascha Hauer2009-07-211-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc91111: use miiphy functions for autonegotiationSascha Hauer2009-07-091-116/+15
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Adding the network driver for the SMSC91C111 ethernet device.Juergen Beisert2009-07-011-0/+1451
| | | | Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
* remove unported includes and driversSascha Hauer2007-09-211-1097/+0
|
* svn_rev_095Sascha Hauer2007-07-051-688/+234
| | | | | | | | | | | | | | | | | | | | | | Currently U-Boot uses globally defined eth_* functions. This is horribly unflexible. This patch replaces the global functions with pointers from structs. We could also use CONFIG_NET_MULTI, but this has other implications, though we should merge this some day. Also, U-Boot has no unique way to handle MAC addresses. Each and every board and network driver uses it's own mechanism to set the MAC address. There are several problems which I've for too often. For example everything goes well if we boot from network, but when we boot from flash U-Boot forgets to set the MAC address and the linux network driver has none. This patch adds [gs]et_mac_address to the eth_device struct and handles it as follows: - First try to get a valid MAC address from the EEPROM and set 'ethaddr' accordingly. - If no valid MAC address is found in the EEPROM (or no EEPROM is connected), we set the devices MAC address from 'ethaddr' This is done in eth_initialize which is called on startup for every board.
* svn_rev_057Sascha Hauer2007-07-051-0/+1551
move all ethernet drivers to drivers/net