Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/allwinner add awin_dma_dump_regs func if DDB is...



details:   https://anonhg.NetBSD.org/src/rev/56e323a4aeff
branches:  trunk
changeset: 802222:56e323a4aeff
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Sep 06 12:39:27 2014 +0000

description:
add awin_dma_dump_regs func if DDB is defined, and print the irq # at attach time

diffstat:

 sys/arch/arm/allwinner/awin_dma.c |  45 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 2 deletions(-)

diffs (78 lines):

diff -r d32408954ae9 -r 56e323a4aeff sys/arch/arm/allwinner/awin_dma.c
--- a/sys/arch/arm/allwinner/awin_dma.c Sat Sep 06 12:18:49 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_dma.c Sat Sep 06 12:39:27 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_dma.c,v 1.1 2014/09/06 00:15:34 jmcneill Exp $ */
+/* $NetBSD: awin_dma.c,v 1.2 2014/09/06 12:39:27 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,8 +26,10 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_ddb.h"
+
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_dma.c,v 1.1 2014/09/06 00:15:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_dma.c,v 1.2 2014/09/06 12:39:27 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -76,6 +78,10 @@
 
 static int     awin_dma_intr(void *);
 
+#if defined(DDB)
+void           awin_dma_dump_regs(void);
+#endif
+
 CFATTACH_DECL_NEW(awin_dma, sizeof(struct awin_dma_softc),
        awin_dma_match, awin_dma_attach, NULL, NULL);
 
@@ -136,6 +142,7 @@
                    loc->loc_intr);
                return;
        }
+       aprint_normal_dev(self, "interrupting on irq %d\n", loc->loc_intr);
 }
 
 static int
@@ -274,3 +281,37 @@
 
        return 0;
 }
+
+#if defined(DDB)
+void
+awin_dma_dump_regs(void)
+{
+       int i;
+
+       printf("IRQ_EN:          %08X\n", DMA_READ(AWIN_DMA_IRQ_EN_REG));
+       printf("PEND_STA:        %08X\n",
+           DMA_READ(AWIN_DMA_IRQ_PEND_STA_REG));
+       for (i = 0; i < NDMA_CHANNELS; i++) {
+               printf("NDMA%d CTL:       %08X\n", i,
+                   DMA_READ(AWIN_NDMA_REG(i) + AWIN_NDMA_CTL_REG));
+               printf("NDMA%d SRC_ADDR:  %08X\n", i,
+                   DMA_READ(AWIN_NDMA_REG(i) + AWIN_NDMA_SRC_ADDR_REG));
+               printf("NDMA%d DEST_ADDR: %08X\n", i,
+                   DMA_READ(AWIN_NDMA_REG(i) + AWIN_NDMA_DEST_ADDR_REG));
+               printf("NDMA%d BC:        %08X\n", i,
+                   DMA_READ(AWIN_NDMA_REG(i) + AWIN_NDMA_BC_REG));
+       }
+       for (i = 0; i < DDMA_CHANNELS; i++) {
+               printf("DDMA%d CTL:       %08X\n", i,
+                   DMA_READ(AWIN_DDMA_REG(i) + AWIN_DDMA_CTL_REG));
+               printf("DDMA%d SRC_ADDR:  %08X\n", i,
+                   DMA_READ(AWIN_DDMA_REG(i) + AWIN_DDMA_SRC_START_ADDR_REG));
+               printf("DDMA%d DEST_ADDR: %08X\n", i,
+                   DMA_READ(AWIN_DDMA_REG(i) + AWIN_DDMA_DEST_START_ADDR_REG));
+               printf("DDMA%d BC:        %08X\n", i,
+                   DMA_READ(AWIN_DDMA_REG(i) + AWIN_DDMA_BC_REG));
+               printf("DDMA%d PARA:      %08X\n", i,
+                   DMA_READ(AWIN_DDMA_REG(i) + AWIN_DDMA_PARA_REG));
+       }
+}
+#endif



Home | Main Index | Thread Index | Old Index