summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-06-11 11:33:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-06-11 11:33:34 +0200
commit06b8bc4d708b8ff4eba1dd9b48ec110a8019d2c8 (patch)
tree3c7c238c81aa91405159959906f31f6195aa6217 /drivers/net
parentb697fba4a5c5395a9db271efa286870191418040 (diff)
parentb917f7864115a35fbb9e69af2c1d553a110a37fc (diff)
downloadbarebox-06b8bc4d708b8ff4eba1dd9b48ec110a8019d2c8.tar.gz
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig4
-rw-r--r--drivers/net/macb.c27
-rw-r--r--drivers/net/phy/Kconfig26
3 files changed, 35 insertions, 22 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 3e3de5a..beeb4b8 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -108,13 +108,13 @@ config DRIVER_NET_ENC28J60
bool "ENC28J60 support"
depends on SPI
select PHYLIB
- ---help---
+ help
Support for the Microchip EN28J60 ethernet chip.
config DRIVER_NET_ENC28J60_WRITEVERIFY
bool "Enable write verify"
depends on DRIVER_NET_ENC28J60
- ---help---
+ help
Enable the verify after the buffer write useful for debugging purpose.
If unsure, say N.
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 0c0d17e..a0411d6 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -209,9 +209,11 @@ static int macb_recv(struct eth_device *edev)
dev_dbg(macb->dev, "%s\n", __func__);
for (;;) {
+ barrier();
if (!(macb->rx_ring[rx_tail].addr & MACB_BIT(RX_USED)))
return -1;
+ barrier();
status = macb->rx_ring[rx_tail].ctrl;
if (status & MACB_BIT(RX_SOF)) {
if (rx_tail != macb->rx_tail)
@@ -228,14 +230,26 @@ static int macb_recv(struct eth_device *edev)
headlen = macb->rx_buffer_size * (macb->rx_ring_size
- macb->rx_tail);
taillen = length - headlen;
- memcpy((void *)NetRxPackets[0],
- buffer, headlen);
+ dma_sync_single_for_cpu((unsigned long)buffer,
+ headlen, DMA_FROM_DEVICE);
+ memcpy((void *)NetRxPackets[0], buffer, headlen);
+ dma_sync_single_for_cpu((unsigned long)macb->rx_buffer,
+ taillen, DMA_FROM_DEVICE);
memcpy((void *)NetRxPackets[0] + headlen,
- macb->rx_buffer, taillen);
- buffer = (void *)NetRxPackets[0];
+ macb->rx_buffer, taillen);
+ dma_sync_single_for_device((unsigned long)buffer,
+ headlen, DMA_FROM_DEVICE);
+ dma_sync_single_for_device((unsigned long)macb->rx_buffer,
+ taillen, DMA_FROM_DEVICE);
+ net_receive(edev, NetRxPackets[0], length);
+ } else {
+ dma_sync_single_for_cpu((unsigned long)buffer, length,
+ DMA_FROM_DEVICE);
+ net_receive(edev, buffer, length);
+ dma_sync_single_for_device((unsigned long)buffer, length,
+ DMA_FROM_DEVICE);
}
-
- net_receive(edev, buffer, length);
+ barrier();
if (++rx_tail >= macb->rx_ring_size)
rx_tail = 0;
reclaim_rx_buffers(macb, rx_tail);
@@ -245,7 +259,6 @@ static int macb_recv(struct eth_device *edev)
rx_tail = 0;
}
}
- barrier();
}
return 0;
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index c08b825..2806af3 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -10,52 +10,52 @@ comment "MII PHY device drivers"
config AR8327N_PHY
bool "Driver for QCA AR8327N PHYs"
- ---help---
+ help
Currently supports the AR8327N PHY.
config AT803X_PHY
bool "Driver for Atheros AT803X PHYs"
- ---help---
+ help
Currently supports the AT8030, AT8031 and AT8035 PHYs.
config DAVICOM_PHY
bool "Driver for Davicom PHYs"
- ---help---
+ help
Currently supports dm9161e and dm9131
config DP83867_PHY
tristate "Texas Instruments DP83867 Gigabit PHY"
- ---help---
+ help
Currently supports the DP83867 PHY.
config LXT_PHY
bool "Driver for the Intel LXT PHYs"
- ---help---
+ help
Currently supports the lxt971 PHY.
config MARVELL_PHY
tristate "Drivers for Marvell PHYs"
- ---help---
+ help
Add support for various Marvell PHYs (e.g. 88E1121R).
config MICREL_PHY
bool "Driver for Micrel PHYs"
- ---help---
+ help
Supports the KSZ9021, VSC8201, KS8001 PHYs.
config NATIONAL_PHY
bool "Driver for National Semiconductor PHYs"
- ---help---
+ help
Currently supports the DP83865 PHY.
config REALTEK_PHY
bool "Driver for Realtek PHYs"
- ---help---
+ help
Supports the Realtek 821x PHY.
config SMSC_PHY
bool "Drivers for SMSC PHYs"
- ---help---
+ help
Currently supports the LAN83C185, LAN8187 and LAN8700 PHYs
config NET_DSA_MV88E6XXX
@@ -69,12 +69,12 @@ comment "MII bus device drivers"
config MDIO_MVEBU
bool "Driver for MVEBU SoC MDIO bus"
depends on ARCH_MVEBU
- ---help---
+ help
Driver for the MDIO bus found on Marvell EBU SoCs.
config MDIO_BITBANG
bool "Support for bitbanged MDIO buses"
- ---help---
+ help
This module implements the MDIO bus protocol in software,
for use by low level drivers that export the ability to
drive the relevant pins.
@@ -84,7 +84,7 @@ config MDIO_BITBANG
config MDIO_GPIO
bool "Support for GPIO lib-based bitbanged MDIO buses"
depends on MDIO_BITBANG && GPIOLIB
- ---help---
+ help
Supports GPIO lib-based MDIO busses.
config MDIO_BUS_MUX