From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 3/3] net: e1000: Add missing address translations
Date: Mon, 16 Nov 2020 18:02:30 +0100 [thread overview]
Message-ID: <20201116170230.1148457-3-sr@denx.de> (raw)
In-Reply-To: <20201116170230.1148457-1-sr@denx.de>
Add some missing address translations from virtual address in local DRAM
to physical address, which is needed for the DMA transactions to work
correctly.
This issue was detected while testing the e1000 driver on the MIPS
Octeon III platform, which needs address translation.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
---
drivers/net/e1000.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index bf6cd7d602..cf57ff067b 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5143,7 +5143,7 @@ fill_rx(struct e1000_hw *hw)
rd = rx_base + rx_tail;
rx_tail = (rx_tail + 1) % 8;
memset(rd, 0, 16);
- rd->buffer_addr = cpu_to_le64((unsigned long)packet);
+ rd->buffer_addr = cpu_to_le64(virt_to_phys(packet));
/*
* Make sure there are no stale data in WB over this area, which
@@ -5174,8 +5174,8 @@ e1000_configure_tx(struct e1000_hw *hw)
unsigned long tipg, tarc;
uint32_t ipgr1, ipgr2;
- E1000_WRITE_REG(hw, TDBAL, lower_32_bits((unsigned long)tx_base));
- E1000_WRITE_REG(hw, TDBAH, upper_32_bits((unsigned long)tx_base));
+ E1000_WRITE_REG(hw, TDBAL, lower_32_bits(virt_to_phys(tx_base)));
+ E1000_WRITE_REG(hw, TDBAH, upper_32_bits(virt_to_phys(tx_base)));
E1000_WRITE_REG(hw, TDLEN, 128);
@@ -5319,8 +5319,8 @@ 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, RDBAL, lower_32_bits((unsigned long)rx_base));
- E1000_WRITE_REG(hw, RDBAH, upper_32_bits((unsigned long)rx_base));
+ E1000_WRITE_REG(hw, RDBAL, lower_32_bits(virt_to_phys(rx_base)));
+ E1000_WRITE_REG(hw, RDBAH, upper_32_bits(virt_to_phys(rx_base)));
E1000_WRITE_REG(hw, RDLEN, 128);
--
2.29.2
next prev parent reply other threads:[~2020-11-16 17:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 17:02 [PATCH 1/3] net: e1000: Remove unused bus_to_phys() macro Stefan Roese
2020-11-16 17:02 ` [PATCH 2/3] net: e1000: Use virt_to_phys() instead of pci_virt_to_mem() Stefan Roese
2021-01-27 19:21 ` Tom Rini
2020-11-16 17:02 ` Stefan Roese [this message]
2021-01-27 19:21 ` [PATCH 3/3] net: e1000: Add missing address translations Tom Rini
2021-01-27 19:21 ` [PATCH 1/3] net: e1000: Remove unused bus_to_phys() macro Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201116170230.1148457-3-sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox