Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/tc Print warning for problematic switch configuration.



details:   https://anonhg.NetBSD.org/src/rev/e42678dd26cc
branches:  trunk
changeset: 349280:e42678dd26cc
user:      flxd <flxd%NetBSD.org@localhost>
date:      Sat Dec 03 18:12:50 2016 +0000

description:
Print warning for problematic switch configuration.

diffstat:

 sys/dev/tc/tcu.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 2f4aaeede658 -r e42678dd26cc sys/dev/tc/tcu.c
--- a/sys/dev/tc/tcu.c  Sat Dec 03 17:38:02 2016 +0000
+++ b/sys/dev/tc/tcu.c  Sat Dec 03 18:12:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcu.c,v 1.2 2016/09/13 16:54:26 christos Exp $ */
+/* $NetBSD: tcu.c,v 1.3 2016/12/03 18:12:50 flxd Exp $ */
 
 /*-
  * Copyright (c) 2016, Felix Deichmann
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcu.c,v 1.2 2016/09/13 16:54:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcu.c,v 1.3 2016/12/03 18:12:50 flxd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,6 +54,10 @@
 
 #define TCU_CFG                0x0
 #define   TCU_CFG_RUN  __BIT(7)        /* write-only */
+#define   TCU_CFG_S1_1 __BIT(3)        /* read-only */
+#define   TCU_CFG_S1_2 __BIT(2)        /* read-only */
+#define   TCU_CFG_S1_3 __BIT(1)        /* read-only */
+#define   TCU_CFG_S1_4 __BIT(0)        /* read-only */
 #define TCU_GPIO_DIR   0x4
 #define TCU_GPIO_IN    0x8
 #define TCU_GPIO_OUT   0xc
@@ -137,6 +141,10 @@
            "\0", cfg);
        aprint_normal_dev(self, "config %s\n", buf);
 
+       if ((cfg & TCU_CFG_S1_1) != 0 && ta->ta_busspeed != TC_SPEED_12_5_MHZ)
+               aprint_error_dev(self, "warning: switch S1-1 asserted with "
+                   "clock != 12.5 MHz");
+
 #if NSLHCI_TCU > 0
        /* Attach slhci. */
        (void)config_found_ia(self, "tcu", aux, tcu_print);



Home | Main Index | Thread Index | Old Index