[ipxe-devel] [PATCH] [tg3] Remove tg3_calc_dma_bndry().

Thomas Miletich thomas.miletich at gmail.com
Fri Feb 10 13:17:45 UTC 2012


This function never did much in this driver anyway, and after commit b5ed30b2 it became apparent that its remaining functionality could be easily moved to tg3_test_dma().

Signed-off-by: Thomas Miletich <thomas.miletich at gmail.com>
---
 src/drivers/net/tg3/tg3.c    |   12 ++++++------
 src/drivers/net/tg3/tg3.h    |    1 -
 src/drivers/net/tg3/tg3_hw.c |   22 ----------------------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/src/drivers/net/tg3/tg3.c b/src/drivers/net/tg3/tg3.c
index 79dd34d..0bdec4b 100644
--- a/src/drivers/net/tg3/tg3.c
+++ b/src/drivers/net/tg3/tg3.c
@@ -543,14 +543,14 @@ static int tg3_test_dma(struct tg3 *tp)
 	}
 	buf_dma = virt_to_bus(buf);
 	DBGC2(tp->dev, "dma test buffer, virt: %p phys: %#08x\n", buf, buf_dma);
+	
+	if (tg3_flag(tp, 57765_PLUS)) {
+		tp->dma_rwctrl = DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
+		goto out;
+	}
 
 	tp->dma_rwctrl = ((0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
-			  (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT));
-
-	tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
-
-	if (tg3_flag(tp, 57765_PLUS))
-		goto out;
+	                 (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT));
 
 	if (tg3_flag(tp, PCI_EXPRESS)) {
 		/* DMA read watermark not used on PCIE */
diff --git a/src/drivers/net/tg3/tg3.h b/src/drivers/net/tg3/tg3.h
index ac24387..a56d784 100644
--- a/src/drivers/net/tg3/tg3.h
+++ b/src/drivers/net/tg3/tg3.h
@@ -3380,7 +3380,6 @@ void tg3_set_txd(struct tg3 *tp, int entry, dma_addr_t mapping, int len, u32 fla
 void tg3_set_power_state_0(struct tg3 *tp);
 int tg3_alloc_consistent(struct tg3 *tp);
 int tg3_init_hw(struct tg3 *tp, int reset_phy);
-u32 tg3_calc_dma_bndry(struct tg3 *tp, u32 val);
 void tg3_poll_link(struct tg3 *tp);
 void tg3_wait_for_event_ack(struct tg3 *tp);
 void __tg3_set_mac_addr(struct tg3 *tp, int skip_mac_1);
diff --git a/src/drivers/net/tg3/tg3_hw.c b/src/drivers/net/tg3/tg3_hw.c
index 18bbc4f..13d5962 100644
--- a/src/drivers/net/tg3/tg3_hw.c
+++ b/src/drivers/net/tg3/tg3_hw.c
@@ -2564,28 +2564,6 @@ void tg3_set_txd(struct tg3 *tp, int entry,
 	txd->vlan_tag = 0;
 }
 
-u32 tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
-{	DBGP("%s\n", __func__);
-
-	u8 byte;
-
-	pci_read_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE, &byte);
-
-	/* On 5703 and later chips, the boundary bits have no
-	 * effect.
-	 */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
-	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701 &&
-	    !tg3_flag(tp, PCI_EXPRESS))
-		goto out;
-
-	if (tg3_flag(tp, 57765_PLUS))
-		val = DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
-
-out:
-	return val;
-}
-
 int tg3_do_test_dma(struct tg3 *tp, u32 __unused *buf, dma_addr_t buf_dma, int size, int to_device)
 {	DBGP("%s\n", __func__);
 
-- 
1.7.1




More information about the ipxe-devel mailing list