mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/16] E1000 driver AArch64 related fixes
@ 2019-02-07  1:21 Andrey Smirnov
  2019-02-07  1:21 ` [PATCH 01/16] ARM: Select HAS_DMA for AArch64 Andrey Smirnov
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Everyone:

This series contains various fixes/changes I made in order to get
E1000 driver to work on AArch64/i.MX8MQ as well as generic code
improvement patches. Hopefully each patch is self-explanatory.

Feedback is welcome!

Thanks,
Andrey Smirnov

Andrey Smirnov (16):
  ARM: Select HAS_DMA for AArch64
  include: Import io-64-nonatomic-*.h from Linux
  net/e1000: Don't use coherent memory for Rx buffer
  net/e1000: Convert e1000_transmit to use dma_map_single()
  net/e1000: Fix debug print warning
  net/e1000: Fix incorrect "Rx ready" check
  net/e1000: Get rid of pointer arithmetic in e1000_poll
  net/e1000: Improve Rx descriptor handling in e1000_poll()
  net/e1000: Remove pointer arithmetic in e1000_transmit()
  net/e1000: Improve Tx descriptor handling in e1000_transmit
  net/e1000: Make use of readl_poll_timeout() in e1000_transmit()
  net/e1000: Rename fill_rx() to e1000_fill_rx()
  net/e1000: Remove pointer arithmetic from e1000_fill_rx()
  net/e1000: Consolidate next index calculation code
  net/e1000: Improve RX buffer handling in e1000_fill_rx()
  net/e1000: Do not hardcode TDBAH and RDBAH to 0

 arch/arm/cpu/Kconfig            |   1 +
 drivers/net/e1000/e1000.h       |   1 +
 drivers/net/e1000/eeprom.c      |   3 +-
 drivers/net/e1000/main.c        | 113 ++++++++++++++++++--------------
 include/io-64-nonatomic-hi-lo.h |  32 +++++++++
 include/io-64-nonatomic-lo-hi.h |  32 +++++++++
 6 files changed, 131 insertions(+), 51 deletions(-)
 create mode 100644 include/io-64-nonatomic-hi-lo.h
 create mode 100644 include/io-64-nonatomic-lo-hi.h

-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 01/16] ARM: Select HAS_DMA for AArch64
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
@ 2019-02-07  1:21 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 02/16] include: Import io-64-nonatomic-*.h from Linux Andrey Smirnov
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

AArch64 implements all of the DMA API functions, so it should select
HAS_DMA to allow building drivers that depend on that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/cpu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index 2359c56b3..257710329 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -13,6 +13,7 @@ config CPU_64
 	bool
 	select PHYS_ADDR_T_64BIT
 	select HAVE_PBL_IMAGE
+	select HAS_DMA
 
 # Select CPU types depending on the architecture selected. This selects
 # which CPUs we support in the kernel image, and the compiler instruction
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 02/16] include: Import io-64-nonatomic-*.h from Linux
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
  2019-02-07  1:21 ` [PATCH 01/16] ARM: Select HAS_DMA for AArch64 Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 03/16] net/e1000: Don't use coherent memory for Rx buffer Andrey Smirnov
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Import io-64-nonatomic-*.h from Linux to be able to use various
non-atomic 64-bit I/O accessors.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 include/io-64-nonatomic-hi-lo.h | 32 ++++++++++++++++++++++++++++++++
 include/io-64-nonatomic-lo-hi.h | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 include/io-64-nonatomic-hi-lo.h
 create mode 100644 include/io-64-nonatomic-lo-hi.h

diff --git a/include/io-64-nonatomic-hi-lo.h b/include/io-64-nonatomic-hi-lo.h
new file mode 100644
index 000000000..3393e6317
--- /dev/null
+++ b/include/io-64-nonatomic-hi-lo.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_IO_64_NONATOMIC_HI_LO_H_
+#define _LINUX_IO_64_NONATOMIC_HI_LO_H_
+
+#include <io.h>
+
+static inline __u64 hi_lo_readq(const volatile void __iomem *addr)
+{
+	const volatile u32 __iomem *p = addr;
+	u32 low, high;
+
+	high = readl(p + 1);
+	low = readl(p);
+
+	return low + ((u64)high << 32);
+}
+
+static inline void hi_lo_writeq(__u64 val, volatile void __iomem *addr)
+{
+	writel(val >> 32, addr + 4);
+	writel(val, addr);
+}
+
+#ifndef readq
+#define readq hi_lo_readq
+#endif
+
+#ifndef writeq
+#define writeq hi_lo_writeq
+#endif
+
+#endif	/* _LINUX_IO_64_NONATOMIC_HI_LO_H_ */
diff --git a/include/io-64-nonatomic-lo-hi.h b/include/io-64-nonatomic-lo-hi.h
new file mode 100644
index 000000000..62b402279
--- /dev/null
+++ b/include/io-64-nonatomic-lo-hi.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_IO_64_NONATOMIC_LO_HI_H_
+#define _LINUX_IO_64_NONATOMIC_LO_HI_H_
+
+#include <io.h>
+
+static inline __u64 lo_hi_readq(const volatile void __iomem *addr)
+{
+	const volatile u32 __iomem *p = addr;
+	u32 low, high;
+
+	low = readl(p);
+	high = readl(p + 1);
+
+	return low + ((u64)high << 32);
+}
+
+static inline void lo_hi_writeq(__u64 val, volatile void __iomem *addr)
+{
+	writel(val, addr);
+	writel(val >> 32, addr + 4);
+}
+
+#ifndef readq
+#define readq lo_hi_readq
+#endif
+
+#ifndef writeq
+#define writeq lo_hi_writeq
+#endif
+
+#endif	/* _LINUX_IO_64_NONATOMIC_LO_HI_H_ */
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 03/16] net/e1000: Don't use coherent memory for Rx buffer
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
  2019-02-07  1:21 ` [PATCH 01/16] ARM: Select HAS_DMA for AArch64 Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 02/16] include: Import io-64-nonatomic-*.h from Linux Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 04/16] net/e1000: Convert e1000_transmit to use dma_map_single() Andrey Smirnov
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

In order to avoid issues on AArch64, convert the driver to use regular
memory and add appropriate DMA sync calls. Drop needless (uchar *)
cast while at it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/e1000.h |  1 +
 drivers/net/e1000/main.c  | 18 ++++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 0a9e107c0..52ad3d4cd 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -2182,6 +2182,7 @@ struct e1000_hw {
 	struct e1000_tx_desc *tx_base;
 	struct e1000_rx_desc *rx_base;
 	unsigned char *packet;
+	dma_addr_t packet_dma;
 
 	int tx_tail;
 	int rx_tail, rx_last;
diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 0ef8fd623..7358763f9 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3215,7 +3215,7 @@ static void fill_rx(struct e1000_hw *hw)
 	for (i = 0; i < 4; i++)
 		*bla++ = 0;
 
-	rd->buffer_addr = cpu_to_le64((unsigned long)hw->packet);
+	rd->buffer_addr = cpu_to_le64(hw->packet_dma);
 
 	e1000_write_reg(hw, E1000_RDT, hw->rx_tail);
 }
@@ -3406,9 +3406,11 @@ static int e1000_poll(struct eth_device *edev)
 
 	len = le32_to_cpu(rd->length);
 
-	dma_sync_single_for_cpu((unsigned long)hw->packet, len, DMA_FROM_DEVICE);
+	dma_sync_single_for_cpu(hw->packet_dma, len, DMA_FROM_DEVICE);
 
-	net_receive(edev, (uchar *)hw->packet, len);
+	net_receive(edev, hw->packet, len);
+
+	dma_sync_single_for_device(hw->packet_dma, len, DMA_FROM_DEVICE);
 	fill_rx(hw);
 	return 1;
 }
@@ -3561,7 +3563,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	hw->tx_base = dma_alloc_coherent(16 * sizeof(*hw->tx_base), DMA_ADDRESS_BROKEN);
 	hw->rx_base = dma_alloc_coherent(16 * sizeof(*hw->rx_base), DMA_ADDRESS_BROKEN);
-	hw->packet = dma_alloc_coherent(4096, DMA_ADDRESS_BROKEN);
 
 	edev = &hw->edev;
 
@@ -3570,6 +3571,15 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	pdev->dev.priv = hw;
 	edev->priv = hw;
 
+	hw->packet = dma_alloc(PAGE_SIZE);
+	if (!hw->packet)
+		return -ENOMEM;
+
+	hw->packet_dma = dma_map_single(hw->dev, hw->packet, PAGE_SIZE,
+					DMA_FROM_DEVICE);
+	if (dma_mapping_error(hw->dev, hw->packet_dma))
+		return -EFAULT;
+
 	hw->hw_addr = pci_iomap(pdev, 0);
 
 	/* MAC and Phy settings */
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 04/16] net/e1000: Convert e1000_transmit to use dma_map_single()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (2 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 03/16] net/e1000: Don't use coherent memory for Rx buffer Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 05/16] net/e1000: Fix debug print warning Andrey Smirnov
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Convert e1000_transmit to use dma_map_single()/dma_unmap_single(),
which is more apporpirate in this case, since it will account for
phys/virtual address difference as well as allow us to check for DMA
mapping failure.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 7358763f9..5ab4eb3fd 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -36,11 +36,6 @@ tested on both gig copper and gig fiber boards
 #include <dma.h>
 #include "e1000.h"
 
-static u32 inline virt_to_bus(struct pci_dev *pdev, void *adr)
-{
-	return (u32)adr;
-}
-
 #define PCI_VENDOR_ID_INTEL	0x8086
 
 
@@ -3420,15 +3415,20 @@ static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 	struct e1000_hw *hw = edev->priv;
 	volatile struct e1000_tx_desc *txp;
 	uint64_t to;
+	dma_addr_t dma;
+	int ret = 0;
 
 	txp = hw->tx_base + hw->tx_tail;
 	hw->tx_tail = (hw->tx_tail + 1) % 8;
 
-	txp->buffer_addr = cpu_to_le64(virt_to_bus(hw->pdev, txpacket));
 	txp->lower.data = cpu_to_le32(hw->txd_cmd | length);
 	txp->upper.data = 0;
 
-	dma_sync_single_for_device((unsigned long)txpacket, length, DMA_TO_DEVICE);
+	dma = dma_map_single(hw->dev, txpacket, length, DMA_TO_DEVICE);
+	if (dma_mapping_error(hw->dev, dma))
+		return -EFAULT;
+
+	txp->buffer_addr = cpu_to_le64(dma);
 
 	e1000_write_reg(hw, E1000_TDT, hw->tx_tail);
 
@@ -3440,11 +3440,14 @@ static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 			break;
 		if (is_timeout(to, MSECOND)) {
 			dev_dbg(hw->dev, "e1000: tx timeout\n");
-			return -ETIMEDOUT;
+			ret = -ETIMEDOUT;
+			break;
 		}
 	}
 
-	return 0;
+	dma_unmap_single(hw->dev, dma, length, DMA_TO_DEVICE);
+
+	return ret;
 }
 
 static void e1000_disable(struct eth_device *edev)
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 05/16] net/e1000: Fix debug print warning
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (3 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 04/16] net/e1000: Convert e1000_transmit to use dma_map_single() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 06/16] net/e1000: Fix incorrect "Rx ready" check Andrey Smirnov
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Cast eeprom->word_size to int, so it would match its printf specifier
to avoid getting errors when building on AArch64.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/eeprom.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index 01f6addbc..5b34e9b8d 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -1000,7 +1000,8 @@ int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t offset,
 		(words > eeprom->word_size - offset) ||
 		(words == 0)) {
 		dev_dbg(hw->dev, "\"words\" parameter out of bounds."
-			"Words = %d, size = %d\n", offset, eeprom->word_size);
+			"Words = %d, size = %d\n", offset,
+			(int)eeprom->word_size);
 		return -E1000_ERR_EEPROM;
 	}
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 06/16] net/e1000: Fix incorrect "Rx ready" check
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (4 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 05/16] net/e1000: Fix debug print warning Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 07/16] net/e1000: Get rid of pointer arithmetic in e1000_poll Andrey Smirnov
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Due to wrong placement of parenthesis in

	if (!(le32_to_cpu(rd->status)) & E1000_RXD_STAT_DD)
		return 0;

instead of checking that E1000_RXD_STAT_DD is not set, the condition
ends up checking that "status" is 0.

Change the code to invert the condition tested and get rid of !
entirely.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 5ab4eb3fd..e793785e6 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3396,18 +3396,21 @@ static int e1000_poll(struct eth_device *edev)
 
 	rd = hw->rx_base + hw->rx_last;
 
-	if (!(le32_to_cpu(rd->status)) & E1000_RXD_STAT_DD)
-		return 0;
+	if (le32_to_cpu(rd->status) & E1000_RXD_STAT_DD) {
+		len = le32_to_cpu(rd->length);
 
-	len = le32_to_cpu(rd->length);
+		dma_sync_single_for_cpu(hw->packet_dma, len,
+					DMA_FROM_DEVICE);
 
-	dma_sync_single_for_cpu(hw->packet_dma, len, DMA_FROM_DEVICE);
+		net_receive(edev, hw->packet, len);
 
-	net_receive(edev, hw->packet, len);
+		dma_sync_single_for_device(hw->packet_dma, len,
+					   DMA_FROM_DEVICE);
+		fill_rx(hw);
+		return 1;
+	}
 
-	dma_sync_single_for_device(hw->packet_dma, len, DMA_FROM_DEVICE);
-	fill_rx(hw);
-	return 1;
+	return 0;
 }
 
 static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 07/16] net/e1000: Get rid of pointer arithmetic in e1000_poll
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (5 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 06/16] net/e1000: Fix incorrect "Rx ready" check Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 08/16] net/e1000: Improve Rx descriptor handling in e1000_poll() Andrey Smirnov
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Instead of relying on reles of pointer arithmetic (implicit
multiplication by the size of pointer type), change the code to
retreive address of an array elemet to clarify the intent.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index e793785e6..f13b48e0c 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3391,11 +3391,9 @@ static void e1000_configure_rx(struct e1000_hw *hw)
 static int e1000_poll(struct eth_device *edev)
 {
 	struct e1000_hw *hw = edev->priv;
-	volatile struct e1000_rx_desc *rd;
+	volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_last];
 	uint32_t len;
 
-	rd = hw->rx_base + hw->rx_last;
-
 	if (le32_to_cpu(rd->status) & E1000_RXD_STAT_DD) {
 		len = le32_to_cpu(rd->length);
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 08/16] net/e1000: Improve Rx descriptor handling in e1000_poll()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (6 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 07/16] net/e1000: Get rid of pointer arithmetic in e1000_poll Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 09/16] net/e1000: Remove pointer arithmetic in e1000_transmit() Andrey Smirnov
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Drop explicit volatile specifier as well as endianness conversion by
changing the code to use appropriate read*() IO accessors.

While at it if fix incorrect width used for "status" (8 vs 32) and
"len" (16 vs 32).

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index f13b48e0c..b8222c7ae 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3391,11 +3391,10 @@ static void e1000_configure_rx(struct e1000_hw *hw)
 static int e1000_poll(struct eth_device *edev)
 {
 	struct e1000_hw *hw = edev->priv;
-	volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_last];
-	uint32_t len;
+	struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_last];
 
-	if (le32_to_cpu(rd->status) & E1000_RXD_STAT_DD) {
-		len = le32_to_cpu(rd->length);
+	if (readb(&rd->status) & E1000_RXD_STAT_DD) {
+		const uint16_t len = readw(&rd->length);
 
 		dma_sync_single_for_cpu(hw->packet_dma, len,
 					DMA_FROM_DEVICE);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 09/16] net/e1000: Remove pointer arithmetic in e1000_transmit()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (7 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 08/16] net/e1000: Improve Rx descriptor handling in e1000_poll() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 10/16] net/e1000: Improve Tx descriptor handling in e1000_transmit Andrey Smirnov
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Instead of relying on reles of pointer arithmetic (implicit
multiplication by the size of pointer type), change the code to
retreive address of an array elemet to clarify the intent.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index b8222c7ae..f7e26a0e5 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3413,12 +3413,11 @@ static int e1000_poll(struct eth_device *edev)
 static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 {
 	struct e1000_hw *hw = edev->priv;
-	volatile struct e1000_tx_desc *txp;
+	volatile struct e1000_tx_desc *txp = &hw->tx_base[hw->tx_tail];
 	uint64_t to;
 	dma_addr_t dma;
 	int ret = 0;
 
-	txp = hw->tx_base + hw->tx_tail;
 	hw->tx_tail = (hw->tx_tail + 1) % 8;
 
 	txp->lower.data = cpu_to_le32(hw->txd_cmd | length);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 10/16] net/e1000: Improve Tx descriptor handling in e1000_transmit
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (8 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 09/16] net/e1000: Remove pointer arithmetic in e1000_transmit() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 11/16] net/e1000: Make use of readl_poll_timeout() in e1000_transmit() Andrey Smirnov
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Drop explicit "volatile" specifier for struct e1000_tx_desc as well as
explicit endiannes fix, by using little endian IO accessors (readl,
writel, etc.)

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index f7e26a0e5..866d8def3 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -35,6 +35,7 @@ tested on both gig copper and gig fiber boards
 #include <linux/pci.h>
 #include <dma.h>
 #include "e1000.h"
+#include <io-64-nonatomic-lo-hi.h>
 
 #define PCI_VENDOR_ID_INTEL	0x8086
 
@@ -3413,29 +3414,28 @@ static int e1000_poll(struct eth_device *edev)
 static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 {
 	struct e1000_hw *hw = edev->priv;
-	volatile struct e1000_tx_desc *txp = &hw->tx_base[hw->tx_tail];
+	struct e1000_tx_desc *txp = &hw->tx_base[hw->tx_tail];
 	uint64_t to;
 	dma_addr_t dma;
 	int ret = 0;
 
 	hw->tx_tail = (hw->tx_tail + 1) % 8;
 
-	txp->lower.data = cpu_to_le32(hw->txd_cmd | length);
-	txp->upper.data = 0;
+	writel(hw->txd_cmd | length, &txp->lower.data);
+	writel(0, &txp->upper.data);
 
 	dma = dma_map_single(hw->dev, txpacket, length, DMA_TO_DEVICE);
 	if (dma_mapping_error(hw->dev, dma))
 		return -EFAULT;
 
-	txp->buffer_addr = cpu_to_le64(dma);
-
+	writeq(dma, &txp->buffer_addr);
 	e1000_write_reg(hw, E1000_TDT, hw->tx_tail);
 
 	e1000_write_flush(hw);
 
 	to = get_time_ns();
 	while (1) {
-		if (le32_to_cpu(txp->upper.data) & E1000_TXD_STAT_DD)
+		if (readl(&txp->upper.data) & E1000_TXD_STAT_DD)
 			break;
 		if (is_timeout(to, MSECOND)) {
 			dev_dbg(hw->dev, "e1000: tx timeout\n");
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 11/16] net/e1000: Make use of readl_poll_timeout() in e1000_transmit()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (9 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 10/16] net/e1000: Improve Tx descriptor handling in e1000_transmit Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 12/16] net/e1000: Rename fill_rx() to e1000_fill_rx() Andrey Smirnov
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Simplify code of e1000_transmit() with readl_poll_timeout().

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 866d8def3..425d478ed 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -33,6 +33,7 @@ tested on both gig copper and gig fiber boards
 #include <init.h>
 #include <malloc.h>
 #include <linux/pci.h>
+#include <linux/iopoll.h>
 #include <dma.h>
 #include "e1000.h"
 #include <io-64-nonatomic-lo-hi.h>
@@ -3415,9 +3416,9 @@ static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 {
 	struct e1000_hw *hw = edev->priv;
 	struct e1000_tx_desc *txp = &hw->tx_base[hw->tx_tail];
-	uint64_t to;
 	dma_addr_t dma;
-	int ret = 0;
+	uint32_t stat;
+	int ret;
 
 	hw->tx_tail = (hw->tx_tail + 1) % 8;
 
@@ -3433,16 +3434,11 @@ static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 
 	e1000_write_flush(hw);
 
-	to = get_time_ns();
-	while (1) {
-		if (readl(&txp->upper.data) & E1000_TXD_STAT_DD)
-			break;
-		if (is_timeout(to, MSECOND)) {
-			dev_dbg(hw->dev, "e1000: tx timeout\n");
-			ret = -ETIMEDOUT;
-			break;
-		}
-	}
+	ret = readl_poll_timeout(&txp->upper.data,
+				 stat, stat & E1000_TXD_STAT_DD,
+				 MSECOND / USECOND);
+	if (ret)
+		dev_dbg(hw->dev, "e1000: tx timeout\n");
 
 	dma_unmap_single(hw->dev, dma, length, DMA_TO_DEVICE);
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 12/16] net/e1000: Rename fill_rx() to e1000_fill_rx()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (10 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 11/16] net/e1000: Make use of readl_poll_timeout() in e1000_transmit() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 13/16] net/e1000: Remove pointer arithmetic from e1000_fill_rx() Andrey Smirnov
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Rename fill_rx() to e1000_fill_rx() to match the naming convention of
other functions in the file.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 425d478ed..b728add7f 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3198,7 +3198,7 @@ static int e1000_sw_init(struct eth_device *edev)
 	return E1000_SUCCESS;
 }
 
-static void fill_rx(struct e1000_hw *hw)
+static void e1000_fill_rx(struct e1000_hw *hw)
 {
 	volatile struct e1000_rx_desc *rd;
 	volatile u32 *bla;
@@ -3387,7 +3387,7 @@ static void e1000_configure_rx(struct e1000_hw *hw)
 
 	e1000_write_reg(hw, E1000_RCTL, rctl);
 
-	fill_rx(hw);
+	e1000_fill_rx(hw);
 }
 
 static int e1000_poll(struct eth_device *edev)
@@ -3405,7 +3405,7 @@ static int e1000_poll(struct eth_device *edev)
 
 		dma_sync_single_for_device(hw->packet_dma, len,
 					   DMA_FROM_DEVICE);
-		fill_rx(hw);
+		e1000_fill_rx(hw);
 		return 1;
 	}
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 13/16] net/e1000: Remove pointer arithmetic from e1000_fill_rx()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (11 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 12/16] net/e1000: Rename fill_rx() to e1000_fill_rx() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 14/16] net/e1000: Consolidate next index calculation code Andrey Smirnov
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Instead of relying on reles of pointer arithmetic (implicit
multiplication by the size of pointer type), change the code to
retreive address of an array elemet to clarify the intent.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index b728add7f..90b6d6e43 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3200,12 +3200,11 @@ static int e1000_sw_init(struct eth_device *edev)
 
 static void e1000_fill_rx(struct e1000_hw *hw)
 {
-	volatile struct e1000_rx_desc *rd;
+	volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_tail];
 	volatile u32 *bla;
 	int i;
 
 	hw->rx_last = hw->rx_tail;
-	rd = hw->rx_base + hw->rx_tail;
 	hw->rx_tail = (hw->rx_tail + 1) % 8;
 
 	bla = (void *)rd;
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 14/16] net/e1000: Consolidate next index calculation code
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (12 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 13/16] net/e1000: Remove pointer arithmetic from e1000_fill_rx() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 15/16] net/e1000: Improve RX buffer handling in e1000_fill_rx() Andrey Smirnov
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Consolidate next index calculation code into a helper function and
convert the code to make use of it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 90b6d6e43..01330f5a5 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3198,6 +3198,11 @@ static int e1000_sw_init(struct eth_device *edev)
 	return E1000_SUCCESS;
 }
 
+static int e1000_bd_next_index(int index)
+{
+	return (index + 1) % 8;
+}
+
 static void e1000_fill_rx(struct e1000_hw *hw)
 {
 	volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_tail];
@@ -3205,7 +3210,7 @@ static void e1000_fill_rx(struct e1000_hw *hw)
 	int i;
 
 	hw->rx_last = hw->rx_tail;
-	hw->rx_tail = (hw->rx_tail + 1) % 8;
+	hw->rx_tail = e1000_bd_next_index(hw->rx_tail);
 
 	bla = (void *)rd;
 	for (i = 0; i < 4; i++)
@@ -3419,7 +3424,7 @@ static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
 	uint32_t stat;
 	int ret;
 
-	hw->tx_tail = (hw->tx_tail + 1) % 8;
+	hw->tx_tail = e1000_bd_next_index(hw->tx_tail);
 
 	writel(hw->txd_cmd | length, &txp->lower.data);
 	writel(0, &txp->upper.data);
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 15/16] net/e1000: Improve RX buffer handling in e1000_fill_rx()
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (13 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 14/16] net/e1000: Consolidate next index calculation code Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-07  1:22 ` [PATCH 16/16] net/e1000: Do not hardcode TDBAH and RDBAH to 0 Andrey Smirnov
  2019-02-11  7:48 ` [PATCH 00/16] E1000 driver AArch64 related fixes Sascha Hauer
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Drop explicit "volatile" specifier for struct e1000_rx_desc, "bla"
variable as well as explicit endiannes fix, by using little endian IO
accessors (readl, writel, etc.)

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index 01330f5a5..c6b6906ce 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3205,18 +3205,17 @@ static int e1000_bd_next_index(int index)
 
 static void e1000_fill_rx(struct e1000_hw *hw)
 {
-	volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_tail];
-	volatile u32 *bla;
-	int i;
+	struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_tail];
 
 	hw->rx_last = hw->rx_tail;
 	hw->rx_tail = e1000_bd_next_index(hw->rx_tail);
 
-	bla = (void *)rd;
-	for (i = 0; i < 4; i++)
-		*bla++ = 0;
-
-	rd->buffer_addr = cpu_to_le64(hw->packet_dma);
+	writeq(hw->packet_dma, &rd->buffer_addr);
+	writew(0, &rd->length);
+	writew(0, &rd->csum);
+	writeb(0, &rd->status);
+	writeb(0, &rd->errors);
+	writew(0, &rd->special);
 
 	e1000_write_reg(hw, E1000_RDT, hw->rx_tail);
 }
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 16/16] net/e1000: Do not hardcode TDBAH and RDBAH to 0
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (14 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 15/16] net/e1000: Improve RX buffer handling in e1000_fill_rx() Andrey Smirnov
@ 2019-02-07  1:22 ` Andrey Smirnov
  2019-02-11  7:48 ` [PATCH 00/16] E1000 driver AArch64 related fixes Sascha Hauer
  16 siblings, 0 replies; 18+ messages in thread
From: Andrey Smirnov @ 2019-02-07  1:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

While there currently no user of e1000 driver that places those rings
beyond 4GiB boundary, there's also no real reason not to initialize
those registers properly.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/net/e1000/main.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index c6b6906ce..774e3d030 100644
--- a/drivers/net/e1000/main.c
+++ b/drivers/net/e1000/main.c
@@ -3232,9 +3232,10 @@ static void e1000_configure_tx(struct e1000_hw *hw)
 	unsigned long tctl;
 	unsigned long tipg, tarc;
 	uint32_t ipgr1, ipgr2;
+	const unsigned long tx_base = (unsigned long)hw->tx_base;
 
-	e1000_write_reg(hw, E1000_TDBAL, (unsigned long)hw->tx_base);
-	e1000_write_reg(hw, E1000_TDBAH, 0);
+	e1000_write_reg(hw, E1000_TDBAL, lower_32_bits(tx_base));
+	e1000_write_reg(hw, E1000_TDBAH, upper_32_bits(tx_base));
 
 	e1000_write_reg(hw, E1000_TDLEN, 128);
 
@@ -3350,6 +3351,7 @@ static void e1000_setup_rctl(struct e1000_hw *hw)
 static void e1000_configure_rx(struct e1000_hw *hw)
 {
 	unsigned long rctl, ctrl_ext;
+	const unsigned long rx_base = (unsigned long)hw->rx_base;
 
 	hw->rx_tail = 0;
 	/* make sure receives are disabled while setting up the descriptors */
@@ -3371,8 +3373,8 @@ static void e1000_configure_rx(struct e1000_hw *hw)
 		e1000_write_flush(hw);
 	}
 	/* Setup the Base and Length of the Rx Descriptor Ring */
-	e1000_write_reg(hw, E1000_RDBAL, (unsigned long)hw->rx_base);
-	e1000_write_reg(hw, E1000_RDBAH, 0);
+	e1000_write_reg(hw, E1000_RDBAL, lower_32_bits(rx_base));
+	e1000_write_reg(hw, E1000_RDBAH, upper_32_bits(rx_base));
 
 	e1000_write_reg(hw, E1000_RDLEN, 128);
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/16] E1000 driver AArch64 related fixes
  2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
                   ` (15 preceding siblings ...)
  2019-02-07  1:22 ` [PATCH 16/16] net/e1000: Do not hardcode TDBAH and RDBAH to 0 Andrey Smirnov
@ 2019-02-11  7:48 ` Sascha Hauer
  16 siblings, 0 replies; 18+ messages in thread
From: Sascha Hauer @ 2019-02-11  7:48 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Wed, Feb 06, 2019 at 05:21:58PM -0800, Andrey Smirnov wrote:
> Everyone:
> 
> This series contains various fixes/changes I made in order to get
> E1000 driver to work on AArch64/i.MX8MQ as well as generic code
> improvement patches. Hopefully each patch is self-explanatory.
> 
> Feedback is welcome!
> 
> Thanks,
> Andrey Smirnov

Applied, thanks

Sascha

> 
> Andrey Smirnov (16):
>   ARM: Select HAS_DMA for AArch64
>   include: Import io-64-nonatomic-*.h from Linux
>   net/e1000: Don't use coherent memory for Rx buffer
>   net/e1000: Convert e1000_transmit to use dma_map_single()
>   net/e1000: Fix debug print warning
>   net/e1000: Fix incorrect "Rx ready" check
>   net/e1000: Get rid of pointer arithmetic in e1000_poll
>   net/e1000: Improve Rx descriptor handling in e1000_poll()
>   net/e1000: Remove pointer arithmetic in e1000_transmit()
>   net/e1000: Improve Tx descriptor handling in e1000_transmit
>   net/e1000: Make use of readl_poll_timeout() in e1000_transmit()
>   net/e1000: Rename fill_rx() to e1000_fill_rx()
>   net/e1000: Remove pointer arithmetic from e1000_fill_rx()
>   net/e1000: Consolidate next index calculation code
>   net/e1000: Improve RX buffer handling in e1000_fill_rx()
>   net/e1000: Do not hardcode TDBAH and RDBAH to 0
> 
>  arch/arm/cpu/Kconfig            |   1 +
>  drivers/net/e1000/e1000.h       |   1 +
>  drivers/net/e1000/eeprom.c      |   3 +-
>  drivers/net/e1000/main.c        | 113 ++++++++++++++++++--------------
>  include/io-64-nonatomic-hi-lo.h |  32 +++++++++
>  include/io-64-nonatomic-lo-hi.h |  32 +++++++++
>  6 files changed, 131 insertions(+), 51 deletions(-)
>  create mode 100644 include/io-64-nonatomic-hi-lo.h
>  create mode 100644 include/io-64-nonatomic-lo-hi.h
> 
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-02-11  7:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07  1:21 [PATCH 00/16] E1000 driver AArch64 related fixes Andrey Smirnov
2019-02-07  1:21 ` [PATCH 01/16] ARM: Select HAS_DMA for AArch64 Andrey Smirnov
2019-02-07  1:22 ` [PATCH 02/16] include: Import io-64-nonatomic-*.h from Linux Andrey Smirnov
2019-02-07  1:22 ` [PATCH 03/16] net/e1000: Don't use coherent memory for Rx buffer Andrey Smirnov
2019-02-07  1:22 ` [PATCH 04/16] net/e1000: Convert e1000_transmit to use dma_map_single() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 05/16] net/e1000: Fix debug print warning Andrey Smirnov
2019-02-07  1:22 ` [PATCH 06/16] net/e1000: Fix incorrect "Rx ready" check Andrey Smirnov
2019-02-07  1:22 ` [PATCH 07/16] net/e1000: Get rid of pointer arithmetic in e1000_poll Andrey Smirnov
2019-02-07  1:22 ` [PATCH 08/16] net/e1000: Improve Rx descriptor handling in e1000_poll() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 09/16] net/e1000: Remove pointer arithmetic in e1000_transmit() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 10/16] net/e1000: Improve Tx descriptor handling in e1000_transmit Andrey Smirnov
2019-02-07  1:22 ` [PATCH 11/16] net/e1000: Make use of readl_poll_timeout() in e1000_transmit() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 12/16] net/e1000: Rename fill_rx() to e1000_fill_rx() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 13/16] net/e1000: Remove pointer arithmetic from e1000_fill_rx() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 14/16] net/e1000: Consolidate next index calculation code Andrey Smirnov
2019-02-07  1:22 ` [PATCH 15/16] net/e1000: Improve RX buffer handling in e1000_fill_rx() Andrey Smirnov
2019-02-07  1:22 ` [PATCH 16/16] net/e1000: Do not hardcode TDBAH and RDBAH to 0 Andrey Smirnov
2019-02-11  7:48 ` [PATCH 00/16] E1000 driver AArch64 related fixes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox