Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Make provision for resetting the board at start-up.



details:   https://anonhg.NetBSD.org/src/rev/949633b1a235
branches:  trunk
changeset: 509535:949633b1a235
user:      ad <ad%NetBSD.org@localhost>
date:      Sun May 06 19:53:04 2001 +0000

description:
Make provision for resetting the board at start-up.

diffstat:

 sys/dev/ic/mlx.c    |  11 ++++++++++-
 sys/dev/ic/mlxreg.h |   5 ++++-
 sys/dev/ic/mlxvar.h |   3 ++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 63b046a35dae -r 949633b1a235 sys/dev/ic/mlx.c
--- a/sys/dev/ic/mlx.c  Sun May 06 19:44:14 2001 +0000
+++ b/sys/dev/ic/mlx.c  Sun May 06 19:53:04 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mlx.c,v 1.7 2001/04/30 03:48:06 lukem Exp $    */
+/*     $NetBSD: mlx.c,v 1.8 2001/05/06 19:53:04 ad Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -343,6 +343,15 @@
        /* Disable interrupts before we start talking to the controller */
        (*mlx->mlx_intaction)(mlx, 0);
 
+       /* If we've got a reset routine, then reset the controller now. */
+       if (mlx->mlx_reset != NULL) {
+               printf("%s: resetting controller...\n", mlx->mlx_dv.dv_xname);
+               if ((*mlx->mlx_reset)(mlx) != 0) {
+                       printf("%s: reset failed\n", mlx->mlx_dv.dv_xname);
+                       return;
+               }
+       }
+
        /* 
         * Wait for the controller to come ready, handshaking with the
         * firmware if required.  This is typically only necessary on
diff -r 63b046a35dae -r 949633b1a235 sys/dev/ic/mlxreg.h
--- a/sys/dev/ic/mlxreg.h       Sun May 06 19:44:14 2001 +0000
+++ b/sys/dev/ic/mlxreg.h       Sun May 06 19:53:04 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mlxreg.h,v 1.1 2001/02/04 17:05:12 ad Exp $    */
+/*     $NetBSD: mlxreg.h,v 1.2 2001/05/06 19:53:04 ad Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -120,8 +120,10 @@
 #define        MLX_V1_IDB_INIT_BUSY    0x02    /* init in progress */
 
 #define        MLX_V1_IDB_SACK         0x02    /* acknowledge status read */
+#define        MLX_V1_IDB_RESET        0x10    /* reset controller */
 
 #define        MLX_V1_ODB_SAVAIL       0x01    /* status is available */
+#define        MLX_V1_ODB_RESET        0x02    /* reset controller */
 
 #define        MLX_V1_FWERROR_PEND     0x04    /* firmware error pending */
 
@@ -144,6 +146,7 @@
 #define        MLX_V3_IDB_INIT_BUSY    0x02    /* init in progress */
 
 #define        MLX_V3_IDB_SACK         0x02    /* acknowledge status read */
+#define        MLX_V3_IDB_RESET        0x08    /* reset controller */
 
 #define        MLX_V3_ODB_SAVAIL       0x01    /* status is available */
 
diff -r 63b046a35dae -r 949633b1a235 sys/dev/ic/mlxvar.h
--- a/sys/dev/ic/mlxvar.h       Sun May 06 19:44:14 2001 +0000
+++ b/sys/dev/ic/mlxvar.h       Sun May 06 19:53:04 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mlxvar.h,v 1.1 2001/02/04 17:05:12 ad Exp $    */
+/*     $NetBSD: mlxvar.h,v 1.2 2001/05/06 19:53:04 ad Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -146,6 +146,7 @@
        int     (*mlx_findcomplete)(struct mlx_softc *, u_int *, u_int *);
        void    (*mlx_intaction)(struct mlx_softc *, int);
        int     (*mlx_fw_handshake)(struct mlx_softc *, int *, int *, int *);
+       int     (*mlx_reset)(struct mlx_softc *);
 
        int                     mlx_max_queuecnt;
        struct mlx_enquiry2     *mlx_enq2;



Home | Main Index | Thread Index | Old Index