summaryrefslogtreecommitdiffstats
path: root/drivers/net/davinci_emac.c
Commit message (Collapse)AuthorAgeFilesLines
* net: davinci-emac: switch to device tree supportHeinrich Toews2018-12-141-69/+85
| | | | | | | | | | | | | | | This adds device tree support to the davinci-emac driver. This needs some changes to the driver as the device has four different resources. Three of them are merged into a single resource in the dts files with the node providing offsets for the different resources to base address. The mdio node is found separately in the dts, so we have to split this out to a different driver. Since this driver has been unused previously, we do not bother maintaining two different probe methods and remove platform probe support at the same time. Signed-off-by: Heinrich Toews <heinrich.toews@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: davinci-emac: Add timeout to polling loopSascha Hauer2018-12-141-9/+38
| | | | | | Do not poll forever when the hardware does not behave like we want to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: davinci-emac: fix buggy channel tear downHeinrich Toews2018-12-131-0/+11
| | | | | | | | | | | | | | | | | Druing a barebox_shutdown() already probed platform devices are being halted. While trying to halt the davinci emac a channel tear down operation is triggered which leads due to a missing DMA pointer configuration to a memory corruption whithin the decompressed kernel memory. In this case the devices failed to boot and are completely freezed. In the davinci driver DMA initialisation is only done during the opening of the device which is done only when the device is setup for communication. The problem was solved by adding DMA init code to emacs_init() which is called shortly after the probing of the device. In this case the tearing down of the channels completes successfully. Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
* drivers: net: convert drivers to spdxOleksij Rempel2018-12-061-18/+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 davinci emac 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-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: 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: davinci_emac: convert to streaming DMA opsLucas Stach2015-03-061-4/+5
| | | | | | | | | Move to the common streaming DMA ops in order to get rid of the direct usage of the ARM MMU functions for the cache maintenance. Signed-off-by: Lucas Stach <dev@lynxeye.de> 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>
* 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>
* davinci_emac: fix comment for the _send functionAntony Pavlov2012-10-051-2/+2
| | | | | | | | | | | | | | | | The _send function should not return the length of the transmitted packet. See also commit 76c4c9e48ffbe35490e1f7d3abcedc04934ac302 Author: Jan Luebbe <jlu@pengutronix.de> Date: Fri Sep 28 18:17:44 2012 +0200 davinci_emac: return 0 on successful transmit Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> 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>
* davinci_emac: get rid of mdio wrapper functionsJan Luebbe2012-09-291-32/+19
| | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* davinci_emac: adjust to new phylib frameworkJan Luebbe2012-09-291-33/+46
| | | | | | | | Also pass flags using platform_data and remove useless casts from void*. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* davinci_emac: return 0 on successful transmitJan Luebbe2012-09-291-2/+2
| | | | | | | | The _send function should not return the length of the transmitted packet. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/net: add driver for the EMAC device found in some TI SoCsJan Luebbe2012-09-171-0/+618
Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>