summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2022-04-16 23:20:47 +0000
committerjmcneill <jmcneill@NetBSD.org>2022-04-16 23:20:47 +0000
commitd1323ef499f4876eb351ab92b94546da67ccf8e6 (patch)
tree6bab2cbde14c6fbc69054f80065debab25d35e1e /sys/dev
parent94c05b10960dec534c7c151187dc8a479d2858cd (diff)
eqos: Freeze counters to prevent unhandled interrupts
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/dwc_eqos.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/ic/dwc_eqos.c b/sys/dev/ic/dwc_eqos.c
index b8b343dbd96..c28a7a826d7 100644
--- a/sys/dev/ic/dwc_eqos.c
+++ b/sys/dev/ic/dwc_eqos.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos.c,v 1.5 2022/02/13 18:29:15 riastradh Exp $ */
+/* $NetBSD: dwc_eqos.c,v 1.6 2022/04/16 23:20:47 jmcneill Exp $ */
/*-
* Copyright (c) 2022 Jared McNeill <jmcneill@invisible.ca>
@@ -33,7 +33,7 @@
#include "opt_net_mpsafe.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.5 2022/02/13 18:29:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.6 2022/04/16 23:20:47 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -565,6 +565,12 @@ eqos_init_locked(struct eqos_softc *sc)
val |= GMAC_DMA_CHAN0_RX_CONTROL_START;
WR4(sc, GMAC_DMA_CHAN0_RX_CONTROL, val);
+ /* Disable counters */
+ WR4(sc, GMAC_MMC_CONTROL,
+ GMAC_MMC_CONTROL_CNTFREEZ |
+ GMAC_MMC_CONTROL_CNTPRST |
+ GMAC_MMC_CONTROL_CNTPRSTLVL);
+
/* Configure operation modes */
WR4(sc, GMAC_MTL_TXQ0_OPERATION_MODE,
GMAC_MTL_TXQ0_OPERATION_MODE_TSF |