Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh3/dev fix the sci[f]cninit() bugs to work both SC...



details:   https://anonhg.NetBSD.org/src/rev/624fd50ccd50
branches:  trunk
changeset: 484188:624fd50ccd50
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Mar 27 16:24:08 2000 +0000

description:
fix the sci[f]cninit() bugs to work both SCI and SCIF at the same time.

diffstat:

 sys/arch/sh3/dev/sci.c  |  23 ++++++++++++++---------
 sys/arch/sh3/dev/scif.c |  19 +++++++++++++------
 2 files changed, 27 insertions(+), 15 deletions(-)

diffs (124 lines):

diff -r dba9147ddbf8 -r 624fd50ccd50 sys/arch/sh3/dev/sci.c
--- a/sys/arch/sh3/dev/sci.c    Mon Mar 27 15:53:04 2000 +0000
+++ b/sys/arch/sh3/dev/sci.c    Mon Mar 27 16:24:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sci.c,v 1.7 2000/03/23 06:43:52 thorpej Exp $ */
+/* $NetBSD: sci.c,v 1.8 2000/03/27 16:24:08 msaitoh Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -238,6 +238,7 @@
 
 #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
 int sciconscflag = CONMODE;
+int sciisconsole = 0;
 
 #ifdef SCICN_SPEED
 int scicn_speed = SCICN_SPEED;
@@ -466,14 +467,13 @@
        struct cfdata *cfp;
        void *aux;
 {
-#if 0
-       struct shb_attach_args *ia = aux;
-#endif
+       struct shb_attach_args *sa = aux;
 
        if (strcmp(cfp->cf_driver->cd_name, "sci")
            || cfp->cf_unit >= SCI_MAX_UNITS)
                return 0;
 
+       sa->ia_iosize = 0x10;
        return 1;
 }
 
@@ -493,8 +493,14 @@
 
        irq = ia->ia_irq;
 
-       SET(sc->sc_hwflags, SCI_HW_DEV_OK);
-       SET(sc->sc_hwflags, SCI_HW_CONSOLE);
+       if (sciisconsole) {
+               SET(sc->sc_hwflags, SCI_HW_CONSOLE);
+               SET(sc->sc_swflags, TIOCFLAG_SOFTCAR);
+               printf("\n%s: console\n", sc->sc_dev.dv_xname);
+       } else {
+               InitializeSci(9600);
+               printf("\n");
+       }
 
        callout_init(&sc->sc_diag_ch);
 
@@ -510,9 +516,7 @@
        }
 #endif
 
-       printf("\n");
-
-       printf("%s: console\n", sc->sc_dev.dv_xname);
+       SET(sc->sc_hwflags, SCI_HW_DEV_OK);
 
        tp = ttymalloc();
        tp->t_oproc = scistart;
@@ -1515,6 +1519,7 @@
 {
 
        InitializeSci(scicn_speed);
+       sciisconsole = 1;
 }
 
 #define sci_getc GetcSci
diff -r dba9147ddbf8 -r 624fd50ccd50 sys/arch/sh3/dev/scif.c
--- a/sys/arch/sh3/dev/scif.c   Mon Mar 27 15:53:04 2000 +0000
+++ b/sys/arch/sh3/dev/scif.c   Mon Mar 27 16:24:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scif.c,v 1.8 2000/03/23 06:43:52 thorpej Exp $ */
+/* $NetBSD: scif.c,v 1.9 2000/03/27 16:24:08 msaitoh Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -240,6 +240,7 @@
 
 #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
 int scifconscflag = CONMODE;
+int scifisconsole = 0;
 
 #ifdef SCIFCN_SPEED
 unsigned int scifcn_speed = SCIFCN_SPEED;
@@ -516,8 +517,15 @@
 
        irq = ia->ia_irq;
 
-       SET(sc->sc_hwflags, SCIF_HW_DEV_OK);
-       SET(sc->sc_hwflags, SCIF_HW_CONSOLE);
+       if (scifisconsole) {
+               /* InitializeScif(scifcn_speed); */
+               SET(sc->sc_hwflags, SCIF_HW_CONSOLE);
+               SET(sc->sc_swflags, TIOCFLAG_SOFTCAR);
+               printf("\n%s: console\n", sc->sc_dev.dv_xname);
+       } else {
+               InitializeScif(9600);
+               printf("\n");
+       }
 
        callout_init(&sc->sc_diag_ch);
 
@@ -533,9 +541,7 @@
        }
 #endif
 
-       printf("\n");
-
-       printf("%s: console\n", sc->sc_dev.dv_xname);
+       SET(sc->sc_hwflags, SCIF_HW_DEV_OK);
 
        tp = ttymalloc();
        tp->t_oproc = scifstart;
@@ -1578,6 +1584,7 @@
 {
 
        InitializeScif(scifcn_speed);
+       scifisconsole = 1;
 }
 
 #define scif_getc GetcScif



Home | Main Index | Thread Index | Old Index