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 awinac_dump_regs if DDB is defined



details:   https://anonhg.NetBSD.org/src/rev/4e2f7a85e4a3
branches:  trunk
changeset: 332083:4e2f7a85e4a3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Sep 06 13:00:33 2014 +0000

description:
add awinac_dump_regs if DDB is defined

diffstat:

 sys/arch/arm/allwinner/awin_ac.c |  38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)

diffs (65 lines):

diff -r dd667d12d5c1 -r 4e2f7a85e4a3 sys/arch/arm/allwinner/awin_ac.c
--- a/sys/arch/arm/allwinner/awin_ac.c  Sat Sep 06 12:49:31 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_ac.c  Sat Sep 06 13:00:33 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_ac.c,v 1.4 2014/09/06 12:49:31 jmcneill Exp $ */
+/* $NetBSD: awin_ac.c,v 1.5 2014/09/06 13:00:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,9 +27,10 @@
  */
 
 #include "locators.h"
+#include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.4 2014/09/06 12:49:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.5 2014/09/06 13:00:33 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -160,6 +161,10 @@
 static void    awinac_pint(void *);
 static int     awinac_play(struct awinac_softc *);
 
+#if defined(DDB)
+void           awinac_dump_regs(void);
+#endif
+
 static int     awinac_open(void *, int);
 static void    awinac_close(void *);
 static int     awinac_drain(void *);
@@ -696,3 +701,32 @@
        *intr = &sc->sc_intr_lock;
        *thread = &sc->sc_lock;
 }
+
+#if defined(DDB)
+void
+awinac_dump_regs(void)
+{
+       struct awinac_softc *sc;
+       device_t dev;
+
+       dev = device_find_by_driver_unit("awinac", 0);
+       if (dev == NULL)
+               return;
+       sc = device_private(dev);
+
+       printf("DAC_DPC:       %08X\n", AC_READ(sc, AC_DAC_DPC));
+       printf("DAC_FIFOC:     %08X\n", AC_READ(sc, AC_DAC_FIFOC));
+       printf("DAC_FIFOS:     %08X\n", AC_READ(sc, AC_DAC_FIFOS));
+       printf("DAC_TXDATA:    ...\n");
+       printf("DAC_ACTL:      %08X\n", AC_READ(sc, AC_DAC_ACTL));
+       printf("DAC_TUNE:      %08X\n", AC_READ(sc, AC_DAC_TUNE));
+       printf("ADC_FIFOC:     %08X\n", AC_READ(sc, AC_ADC_FIFOC));
+       printf("ADC_FIFOS:     %08X\n", AC_READ(sc, AC_ADC_FIFOS));
+       printf("ADC_RXDATA:    ...\n");
+       printf("ADC_ACTL:      %08X\n", AC_READ(sc, AC_ADC_ACTL));
+       printf("DAC_CNT:       %08X\n", AC_READ(sc, AC_DAC_CNT));
+       printf("ADC_CNT:       %08X\n", AC_READ(sc, AC_ADC_CNT));
+       printf("DAC_CAL:       %08X\n", AC_READ(sc, AC_DAC_CAL));
+       printf("MIC_PHONE_CAL: %08X\n", AC_READ(sc, AC_MIC_PHONE_CAL));
+}
+#endif



Home | Main Index | Thread Index | Old Index