diff options
author | Alan Ott <alan@softiron.co.uk> | 2016-08-30 12:04:26 -0400 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-30 17:22:14 +0100 |
commit | 94eca77f492bda94f6a69a4bbf4c5c557447a48b (patch) | |
tree | 817c52c75c2ce0258e705beaa6b3df6d2061c364 /Drivers/Net/MarvellYukonDxe/if_mskreg.h | |
parent | 98af09fcda4a0bffc08237ce5ca9e7e2436878d8 (diff) |
Drivers/Net/MarvellYukon: Add 64-bit DMA support
Add support for 64-bit DMA transfers, since some 64-bit platforms don't
have the ability to generate DMA addresses which can fit in 32-bits.
This code came from the FreeBSD driver, the one from which this driver was
derived.
This patch makes this driver use 64-bit DMA in all cases, because it was
determined that there is no good way to test whether 64-bit DMA is
required.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Alan Ott <alan@softiron.co.uk>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'Drivers/Net/MarvellYukonDxe/if_mskreg.h')
-rw-r--r-- | Drivers/Net/MarvellYukonDxe/if_mskreg.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Drivers/Net/MarvellYukonDxe/if_mskreg.h b/Drivers/Net/MarvellYukonDxe/if_mskreg.h index f0dd05e..7718536 100644 --- a/Drivers/Net/MarvellYukonDxe/if_mskreg.h +++ b/Drivers/Net/MarvellYukonDxe/if_mskreg.h @@ -2239,6 +2239,12 @@ struct msk_stat_desc { #define BMU_UDP_CHECK (0x57<<16) // Descr with UDP ext (YUKON only)
#define BMU_BBC 0xffff // Bit 15.. 0: Buffer Byte Counter
+/* Use 64-bit DMA in all cases in UEFI. After much discussion on the mailing
+ * list, it was determined that there is not currently a good way to detect
+ * whether 32-bit DMA should be used (if ever) or whether there are any
+ * supported platforms on which 64-bit DMA would not work */
+#define MSK_64BIT_DMA
+
#define MSK_TX_RING_CNT 512
#define MSK_RX_RING_CNT 512
#define MSK_RX_BUF_ALIGN 8
@@ -2323,6 +2329,7 @@ struct msk_chain_data { void *msk_tx_ring_map;
void *msk_rx_ring_map;
// struct msk_rxdesc msk_jumbo_rxdesc[MSK_JUMBO_RX_RING_CNT];
+ INTN msk_tx_high_addr;
INTN msk_tx_prod;
INTN msk_tx_cons;
INTN msk_tx_cnt;
@@ -2352,6 +2359,15 @@ struct msk_ring_data { #define MSK_STAT_RING_SZ (sizeof (struct msk_stat_desc) * MSK_STAT_RING_CNT)
#define MSK_INC(x, y) ((x) = (x + 1) % y)
+#ifdef MSK_64BIT_DMA
+#define MSK_RX_INC(x, y) (x) = (x + 2) % y
+#define MSK_RX_BUF_CNT (MSK_RX_RING_CNT / 2)
+#define MSK_JUMBO_RX_BUF_CNT (MSK_JUMBO_RX_RING_CNT / 2)
+#else
+#define MSK_RX_INC(x, y) (x) = (x + 1) % y
+#define MSK_RX_BUF_CNT MSK_RX_RING_CNT
+#define MSK_JUMBO_RX_BUF_CNT MSK_JUMBO_RX_RING_CNT
+#endif
#define MSK_PCI_BUS 0
#define MSK_PCIX_BUS 1
|