Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arc As per discussion with soda, all EISA based Jaz...



details:   https://anonhg.NetBSD.org/src/rev/3f2c82d4e22e
branches:  trunk
changeset: 540304:3f2c82d4e22e
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon Dec 09 13:36:26 2002 +0000

description:
As per discussion with soda, all EISA based Jazz machines seem to require
the same method to access TOD clock, so move chipset-dependent mcclock
routines to appropriate files.

This should also fix Express RISCserver and RISCserver2200 (aka R96) support
which has been broken since "struct platform" was introduced.

diffstat:

 sys/arch/arc/arc/c_jazz_eisa.c |  45 +++++++++++++++++++++++++++++++++-
 sys/arch/arc/arc/c_magnum.c    |  44 +---------------------------------
 sys/arch/arc/arc/c_nec_jazz.c  |  43 +--------------------------------
 sys/arch/arc/arc/c_nec_pci.c   |  47 +++++++++++++++++++++++++++++++++++-
 sys/arch/arc/arc/p_nec_j96a.c  |  54 +----------------------------------------
 sys/arch/arc/jazz/pica.h       |   4 +-
 sys/arch/arc/jazz/rd94.h       |   4 +--
 7 files changed, 96 insertions(+), 145 deletions(-)

diffs (truncated from 431 to 300 lines):

diff -r 6744e78276b1 -r 3f2c82d4e22e sys/arch/arc/arc/c_jazz_eisa.c
--- a/sys/arch/arc/arc/c_jazz_eisa.c    Mon Dec 09 13:22:48 2002 +0000
+++ b/sys/arch/arc/arc/c_jazz_eisa.c    Mon Dec 09 13:36:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_jazz_eisa.c,v 1.1 2001/06/13 15:21:00 soda Exp $     */
+/*     $NetBSD: c_jazz_eisa.c,v 1.2 2002/12/09 13:36:26 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1998
@@ -38,11 +38,14 @@
 
 #include <machine/autoconf.h>
 #include <machine/bus.h>
+#include <machine/pio.h>
 #include <machine/platform.h>
 
 #include <arc/arc/arcbios.h>
 #include <arc/jazz/pica.h>
 #include <arc/jazz/jazziovar.h>
+#include <arc/dev/mcclockvar.h>
+#include <arc/jazz/mcclock_jazziovar.h>
 
 #include "pc.h"
 #if NPC_JAZZIO > 0
@@ -79,12 +82,50 @@
 };
 
 /*
+ * chipset-dependent mcclock routines.
+ */
+u_int mc_jazz_eisa_read __P((struct mcclock_softc *, u_int));
+void mc_jazz_eisa_write __P((struct mcclock_softc *, u_int, u_int));
+ 
+struct mcclock_jazzio_config mcclock_jazz_eisa_conf = {
+       0x80004000, 1,
+       { mc_jazz_eisa_read, mc_jazz_eisa_write }
+};
+
+u_int   
+mc_jazz_eisa_read(sc, reg)
+       struct mcclock_softc *sc;
+       u_int reg;
+{       
+       int i, as;
+
+       as = in32(arc_bus_io.bs_vbase + C_JAZZ_EISA_TODCLOCK_AS) & 0x80;
+       out32(arc_bus_io.bs_vbase + C_JAZZ_EISA_TODCLOCK_AS, as | reg);
+       i = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 0);
+       return i;
+}
+
+void
+mc_jazz_eisa_write(sc, reg, datum)
+       struct mcclock_softc *sc;
+       u_int reg, datum;
+{
+       int as;
+
+       as = in32(arc_bus_io.bs_vbase + C_JAZZ_EISA_TODCLOCK_AS) & 0x80;
+       out32(arc_bus_io.bs_vbase + C_JAZZ_EISA_TODCLOCK_AS, as | reg);
+       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 0, datum);
+}
+
+/*
  * common configuration for Magnum derived and NEC EISA generation machines.
  */
 void
 c_jazz_eisa_init()
 {
-       /* nothing to do */
+
+       /* chipset-dependent mcclock configuration */
+        mcclock_jazzio_conf = &mcclock_jazz_eisa_conf;
 }
 
 /*
diff -r 6744e78276b1 -r 3f2c82d4e22e sys/arch/arc/arc/c_magnum.c
--- a/sys/arch/arc/arc/c_magnum.c       Mon Dec 09 13:22:48 2002 +0000
+++ b/sys/arch/arc/arc/c_magnum.c       Mon Dec 09 13:36:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_magnum.c,v 1.1 2001/06/13 15:19:28 soda Exp $        */
+/*     $NetBSD: c_magnum.c,v 1.2 2002/12/09 13:36:27 tsutsui Exp $     */
 /*     $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $   */
 
 /*
@@ -60,53 +60,14 @@
 #include <dev/isa/isavar.h>
 
 #include <arc/arc/wired_map.h>
-#include <arc/dev/mcclockvar.h>
 #include <arc/jazz/pica.h>
 #include <arc/jazz/jazziovar.h>
-#include <arc/jazz/mcclock_jazziovar.h>
 #include <arc/jazz/timer_jazziovar.h>
 #include <arc/isa/isabrvar.h>
 
 extern int cpu_int_mask;
 
 /*
- * chipset-dependent mcclock routines.
- */
-
-u_int mc_magnum_read __P((struct mcclock_softc *, u_int));
-void mc_magnum_write __P((struct mcclock_softc *, u_int, u_int));
-
-struct mcclock_jazzio_config mcclock_magnum_conf = {
-       0x80004000, 1,
-       { mc_magnum_read, mc_magnum_write }
-};
-
-u_int
-mc_magnum_read(sc, reg)
-       struct mcclock_softc *sc;
-       u_int reg;
-{
-       int i, as;
-
-       as = in32(PICA_SYS_ISA_AS) & 0x80;
-       out32(PICA_SYS_ISA_AS, as | reg);
-       i = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 0);
-       return (i);
-}
-
-void
-mc_magnum_write(sc, reg, datum)
-       struct mcclock_softc *sc;
-       u_int reg, datum;
-{
-       int as;
-
-       as = in32(PICA_SYS_ISA_AS) & 0x80;
-       out32(PICA_SYS_ISA_AS, as | reg);
-       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 0, datum);
-}
-
-/*
  * chipset-dependent timer routine.
  */
 
@@ -245,9 +206,6 @@
        /* common configuration for Magnum derived and NEC EISA machines */
        c_jazz_eisa_init();
 
-       /* chipset-dependent mcclock configuration */
-       mcclock_jazzio_conf = &mcclock_magnum_conf;
-
        /* chipset-dependent timer configuration */
        timer_jazzio_conf = &timer_magnum_conf;
 
diff -r 6744e78276b1 -r 3f2c82d4e22e sys/arch/arc/arc/c_nec_jazz.c
--- a/sys/arch/arc/arc/c_nec_jazz.c     Mon Dec 09 13:22:48 2002 +0000
+++ b/sys/arch/arc/arc/c_nec_jazz.c     Mon Dec 09 13:36:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_nec_jazz.c,v 1.1 2001/06/13 15:21:52 soda Exp $      */
+/*     $NetBSD: c_nec_jazz.c,v 1.2 2002/12/09 13:36:27 tsutsui Exp $   */
 
 /*-
  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
@@ -42,50 +42,11 @@
 
 #include <arc/jazz/rd94.h>
 #include <arc/jazz/jazziovar.h>
-#include <arc/dev/mcclockvar.h>
-#include <arc/jazz/mcclock_jazziovar.h>
 #include <arc/jazz/timer_jazziovar.h>
 
 extern int cpu_int_mask;
 
 /*
- * chipset-dependent mcclock routines.
- */
-
-u_int  mc_nec_jazz_read __P((struct mcclock_softc *, u_int));
-void   mc_nec_jazz_write __P((struct mcclock_softc *, u_int, u_int));
-
-struct mcclock_jazzio_config mcclock_nec_jazz_conf = {
-       0x80004000, 2,
-       { mc_nec_jazz_read, mc_nec_jazz_write }
-};
-
-u_int
-mc_nec_jazz_read(sc, reg)
-       struct mcclock_softc *sc;
-       u_int reg;
-{
-       int i, as;
-
-       as = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 1) & 0x80;
-       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 1, as | reg);
-       i = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 0);
-       return (i);
-}
-
-void
-mc_nec_jazz_write(sc, reg, datum)
-       struct mcclock_softc *sc;
-       u_int reg, datum;
-{
-       int as;
-
-       as = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 1) & 0x80;
-       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 1, as | reg);
-       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 0, datum);
-}
-
-/*
  * chipset-dependent timer routine.
  */
 
@@ -166,8 +127,6 @@
 void
 c_nec_jazz_init()
 {
-       /* chipset-dependent mcclock configuration */
-       mcclock_jazzio_conf = &mcclock_nec_jazz_conf;
 
        /* chipset-dependent timer configuration */
        timer_jazzio_conf = &timer_nec_jazz_conf;
diff -r 6744e78276b1 -r 3f2c82d4e22e sys/arch/arc/arc/c_nec_pci.c
--- a/sys/arch/arc/arc/c_nec_pci.c      Mon Dec 09 13:22:48 2002 +0000
+++ b/sys/arch/arc/arc/c_nec_pci.c      Mon Dec 09 13:36:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_nec_pci.c,v 1.1 2001/06/13 15:23:22 soda Exp $       */
+/*     $NetBSD: c_nec_pci.c,v 1.2 2002/12/09 13:36:27 tsutsui Exp $    */
 
 /*-
  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
@@ -48,6 +48,8 @@
 #include <arc/jazz/pica.h>
 #include <arc/jazz/rd94.h>
 #include <arc/jazz/jazziovar.h>
+#include <arc/dev/mcclockvar.h>
+#include <arc/jazz/mcclock_jazziovar.h>
 #include <arc/pci/necpbvar.h>
 
 #include "tga.h"
@@ -84,6 +86,43 @@
        NULL,
 };
 
+/*      
+ * chipset-dependent mcclock routines.
+ */
+
+u_int  mc_nec_pci_read __P((struct mcclock_softc *, u_int));
+void   mc_nec_pci_write __P((struct mcclock_softc *, u_int, u_int));
+        
+struct mcclock_jazzio_config mcclock_nec_pci_conf = {
+       0x80004000, 2,
+       { mc_nec_pci_read, mc_nec_pci_write }
+};      
+ 
+u_int
+mc_nec_pci_read(sc, reg)
+       struct mcclock_softc *sc;
+       u_int reg;
+{
+       int i, as;
+
+       as = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 1) & 0x80;
+       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 1, as | reg);
+       i = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 0);
+       return (i);
+}
+
+void
+mc_nec_pci_write(sc, reg, datum)
+       struct mcclock_softc *sc;
+       u_int reg, datum;
+{
+       int as;
+
+       as = bus_space_read_1(sc->sc_iot, sc->sc_ioh, 1) & 0x80;
+       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 1, as | reg);
+       bus_space_write_1(sc->sc_iot, sc->sc_ioh, 0, datum);
+}
+
 /*
  * chipset-dependent jazzio bus configuration
  */
@@ -101,6 +140,7 @@
 jazzio_nec_pci_set_iointr_mask(mask)
        int mask;
 {
+
        /* XXX: I don't know why, but firmware does. */
        if (in32(RD94_V_LOCAL_IO_BASE + 0x560) != 0)
                out16(RD94_SYS_LB_IE2, mask);
@@ -114,6 +154,7 @@
 void
 c_nec_pci_init()
 {
+
        /*
         * Initialize I/O address offset
         */
@@ -173,6 +214,9 @@
         */
        c_nec_jazz_init();
 



Home | Main Index | Thread Index | Old Index