Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic - Support 64-bit DMA addresses for the Tx and Rx ...



details:   https://anonhg.NetBSD.org/src/rev/f4b28a1e7b4d
branches:  trunk
changeset: 969770:f4b28a1e7b4d
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Mar 01 05:50:56 2020 +0000

description:
- Support 64-bit DMA addresses for the Tx and Rx ring addresses.
- g/c and unused define.

diffstat:

 sys/dev/ic/gem.c    |  15 ++++++++-------
 sys/dev/ic/gemvar.h |   4 +---
 2 files changed, 9 insertions(+), 10 deletions(-)

diffs (63 lines):

diff -r 8f79efdbaee9 -r f4b28a1e7b4d sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c  Sun Mar 01 05:39:05 2020 +0000
+++ b/sys/dev/ic/gem.c  Sun Mar 01 05:50:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gem.c,v 1.128 2020/02/07 00:56:48 thorpej Exp $ */
+/*     $NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.128 2020/02/07 00:56:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.129 2020/03/01 05:50:56 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -815,8 +815,8 @@
        GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD);
 
        /* Reprogram Descriptor Ring Base Addresses */
-       /* NOTE: we use only 32-bit DMA addresses here. */
-       bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, 0);
+       bus_space_write_4(t, h, GEM_RX_RING_PTR_HI,
+           ((uint64_t)GEM_CDRXADDR(sc, 0)) >> 32);
        bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0));
 
        /* Redo ERX Configuration */
@@ -1171,11 +1171,12 @@
        gem_setladrf(sc);
 
        /* step 6 & 7. Program Descriptor Ring Base Addresses */
-       /* NOTE: we use only 32-bit DMA addresses here. */
-       bus_space_write_4(t, h, GEM_TX_RING_PTR_HI, 0);
+       bus_space_write_4(t, h, GEM_TX_RING_PTR_HI,
+           ((uint64_t)GEM_CDTXADDR(sc, 0)) >> 32);
        bus_space_write_4(t, h, GEM_TX_RING_PTR_LO, GEM_CDTXADDR(sc, 0));
 
-       bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, 0);
+       bus_space_write_4(t, h, GEM_RX_RING_PTR_HI,
+           ((uint64_t)GEM_CDRXADDR(sc, 0)) >> 32);
        bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0));
 
        /* step 8. Global Configuration & Interrupt Mask */
diff -r 8f79efdbaee9 -r f4b28a1e7b4d sys/dev/ic/gemvar.h
--- a/sys/dev/ic/gemvar.h       Sun Mar 01 05:39:05 2020 +0000
+++ b/sys/dev/ic/gemvar.h       Sun Mar 01 05:50:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gemvar.h,v 1.26 2019/09/13 07:55:06 msaitoh Exp $ */
+/*     $NetBSD: gemvar.h,v 1.27 2020/03/01 05:50:56 thorpej Exp $ */
 
 /*
  *
@@ -246,8 +246,6 @@
 #define        GEM_CDTXADDR(sc, x)     ((sc)->sc_cddma + GEM_CDTXOFF((x)))
 #define        GEM_CDRXADDR(sc, x)     ((sc)->sc_cddma + GEM_CDRXOFF((x)))
 
-#define        GEM_CDADDR(sc)  ((sc)->sc_cddma + GEM_CDOFF)
-
 #define        GEM_CDTXSYNC(sc, x, n, ops)                                     \
 do {                                                                   \
        int __x, __n;                                                   \



Home | Main Index | Thread Index | Old Index