From 459f2585f4f89eacfa31696ea07d60dd4361fd87 Mon Sep 17 00:00:00 2001 From: ur Date: Sun, 24 Dec 2000 09:25:24 +0000 Subject: [PATCH] Switch pica to jazzio. Split shared MD portion between algor and jazzio. --- sys/arch/arc/Makefile | 6 +- .../arc/{dev/com_lbus.c => algor/com_algor.c} | 17 +- .../arc/{dev/lpt_lbus.c => algor/lpt_algor.c} | 6 +- sys/arch/arc/arc/arc_trap.c | 6 +- sys/arch/arc/arc/clock.c | 32 +-- sys/arch/arc/arc/clock_mc.c | 6 +- sys/arch/arc/arc/machdep.c | 6 +- sys/arch/arc/arc/mainbus.c | 4 +- sys/arch/arc/conf/GENERIC | 32 +-- sys/arch/arc/conf/M403 | 30 +-- sys/arch/arc/conf/MIMORI | 28 +-- sys/arch/arc/conf/PCCONS | 26 +-- sys/arch/arc/conf/PICA | 30 +-- sys/arch/arc/conf/RAMDISK | 30 +-- sys/arch/arc/conf/files.arc | 71 ++++--- sys/arch/arc/dev/pccons.c | 15 +- sys/arch/arc/isa/isabus.c | 6 +- sys/arch/arc/{dev => jazz}/asc.c | 29 +-- sys/arch/arc/{dev => jazz}/ascreg.h | 2 +- sys/arch/arc/jazz/clock_jazzio.c | 142 +++++++++++++ sys/arch/arc/jazz/com_jazzio.c | 155 ++++++++++++++ sys/arch/arc/{dev => jazz}/dma.c | 56 ++--- sys/arch/arc/{dev => jazz}/dma.h | 8 +- sys/arch/arc/{dev => jazz}/fd.c | 19 +- sys/arch/arc/{dev => jazz}/fdreg.h | 2 +- sys/arch/arc/{dev => jazz}/if_sn.c | 18 +- sys/arch/arc/{dev => jazz}/if_snreg.h | 2 +- sys/arch/arc/jazz/jazzdmatlb.c | 3 +- .../arc/{pica/picabus.c => jazz/jazzio.c} | 118 +++++------ sys/arch/arc/jazz/jazziovar.h | 19 ++ sys/arch/arc/jazz/lpt_jazzio.c | 196 ++++++++++++++++++ sys/arch/arc/jazz/pckbc_jazzio.c | 33 ++- sys/arch/arc/{pica => jazz}/pica.h | 2 +- sys/arch/arc/{pica => jazz}/rd94.h | 2 +- sys/arch/arc/{dev => jazz}/scsi.h | 2 +- sys/arch/arc/jazz/vga_jazzio.c | 9 +- sys/arch/arc/pci/necpb.c | 4 +- 37 files changed, 804 insertions(+), 368 deletions(-) rename sys/arch/arc/{dev/com_lbus.c => algor/com_algor.c} (92%) rename sys/arch/arc/{dev/lpt_lbus.c => algor/lpt_algor.c} (97%) rename sys/arch/arc/{dev => jazz}/asc.c (99%) rename sys/arch/arc/{dev => jazz}/ascreg.h (99%) create mode 100644 sys/arch/arc/jazz/clock_jazzio.c create mode 100644 sys/arch/arc/jazz/com_jazzio.c rename sys/arch/arc/{dev => jazz}/dma.c (89%) rename sys/arch/arc/{dev => jazz}/dma.h (93%) rename sys/arch/arc/{dev => jazz}/fd.c (98%) rename sys/arch/arc/{dev => jazz}/fdreg.h (98%) rename sys/arch/arc/{dev => jazz}/if_sn.c (98%) rename sys/arch/arc/{dev => jazz}/if_snreg.h (99%) rename sys/arch/arc/{pica/picabus.c => jazz/jazzio.c} (82%) create mode 100644 sys/arch/arc/jazz/jazziovar.h create mode 100644 sys/arch/arc/jazz/lpt_jazzio.c rename sys/arch/arc/{pica => jazz}/pica.h (99%) rename sys/arch/arc/{pica => jazz}/rd94.h (98%) rename sys/arch/arc/{dev => jazz}/scsi.h (99%) diff --git a/sys/arch/arc/Makefile b/sys/arch/arc/Makefile index f35bd1d4b353..0cb440968a14 100644 --- a/sys/arch/arc/Makefile +++ b/sys/arch/arc/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2000/01/23 21:01:48 soda Exp $ +# $NetBSD: Makefile,v 1.7 2000/12/24 09:25:24 ur Exp $ # $OpenBSD: Makefile,v 1.5 1997/05/19 10:34:53 pefo Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/16/93 @@ -10,11 +10,11 @@ TARC= ../arc/tags SARC= ../arc/algor/*.[ch] ../arc/arc/*.[ch] ../arc/dev/*.[ch] \ ../arc/dti/*.[ch] ../arc/include/*.h ../arc/isa/*.[ch] \ - ../arc/pci/*.[ch] ../arc/pica/*.[ch] + ../arc/pci/*.[ch] ../arc/jazz/*.[ch] AARC= ../arc/arc/*.S # Directories in which to place tags links -DARC= algor arc dev dti include isa pci pica +DARC= algor arc dev dti include isa pci jazz .include "../../kern/Make.tags.inc" diff --git a/sys/arch/arc/dev/com_lbus.c b/sys/arch/arc/algor/com_algor.c similarity index 92% rename from sys/arch/arc/dev/com_lbus.c rename to sys/arch/arc/algor/com_algor.c index a8d78e5c38de..0c503d2a29e5 100644 --- a/sys/arch/arc/dev/com_lbus.c +++ b/sys/arch/arc/algor/com_algor.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_lbus.c,v 1.10 2000/02/22 11:26:00 soda Exp $ */ +/* $NetBSD: com_algor.c,v 1.1 2000/12/24 09:25:24 ur Exp $ */ /* $OpenBSD: com_lbus.c,v 1.7 1998/03/16 09:38:41 pefo Exp $ */ /* NetBSD: com_isa.c,v 1.12 1998/08/15 17:47:17 mycroft Exp */ @@ -91,20 +91,15 @@ extern struct arc_bus_space *arc_bus_com; /* XXX */ extern int com_freq; -int com_localbus_probe __P((struct device *, struct cfdata *, void *)); -void com_localbus_attach __P((struct device *, struct device *, void *)); - - -struct cfattach com_pica_ca = { - sizeof(struct com_softc), com_localbus_probe, com_localbus_attach -}; +int com_algor_probe __P((struct device *, struct cfdata *, void *)); +void com_algor_attach __P((struct device *, struct device *, void *)); struct cfattach com_algor_ca = { - sizeof(struct com_softc), com_localbus_probe, com_localbus_attach + sizeof(struct com_softc), com_algor_probe, com_algor_attach }; int -com_localbus_probe(parent, match, aux) +com_algor_probe(parent, match, aux) struct device *parent; struct cfdata *match; void *aux; @@ -133,7 +128,7 @@ com_localbus_probe(parent, match, aux) } void -com_localbus_attach(parent, self, aux) +com_algor_attach(parent, self, aux) struct device *parent, *self; void *aux; { diff --git a/sys/arch/arc/dev/lpt_lbus.c b/sys/arch/arc/algor/lpt_algor.c similarity index 97% rename from sys/arch/arc/dev/lpt_lbus.c rename to sys/arch/arc/algor/lpt_algor.c index 6affb9791a27..7c50b071152c 100644 --- a/sys/arch/arc/dev/lpt_lbus.c +++ b/sys/arch/arc/algor/lpt_algor.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt_lbus.c,v 1.10 2000/06/09 05:42:00 soda Exp $ */ +/* $NetBSD: lpt_algor.c,v 1.1 2000/12/24 09:25:24 ur Exp $ */ /* $OpenBSD: lpt_lbus.c,v 1.3 1997/04/10 16:29:17 pefo Exp $ */ /* @@ -70,10 +70,6 @@ extern struct arc_bus_space arc_bus_io; int lpt_localbus_probe __P((struct device *, struct cfdata *, void *)); void lpt_localbus_attach __P((struct device *, struct device *, void *)); -struct cfattach lpt_pica_ca = { - sizeof(struct lpt_softc), lpt_localbus_probe, lpt_localbus_attach -}; - struct cfattach lpt_algor_ca = { sizeof(struct lpt_softc), lpt_localbus_probe, lpt_localbus_attach }; diff --git a/sys/arch/arc/arc/arc_trap.c b/sys/arch/arc/arc/arc_trap.c index fe8f8254761f..500dc2d58e73 100644 --- a/sys/arch/arc/arc/arc_trap.c +++ b/sys/arch/arc/arc/arc_trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: arc_trap.c,v 1.16 2000/10/05 02:36:44 cgd Exp $ */ +/* $NetBSD: arc_trap.c,v 1.17 2000/12/24 09:25:24 ur Exp $ */ /* $OpenBSD: trap.c,v 1.22 1999/05/24 23:08:59 jason Exp $ */ /* @@ -55,8 +55,8 @@ #include #include -#include -#include +#include +#include #include int arc_hardware_intr __P((u_int32_t, u_int32_t, u_int32_t, u_int32_t)); diff --git a/sys/arch/arc/arc/clock.c b/sys/arch/arc/arc/clock.c index e8a6bf631a5e..ff527f61a264 100644 --- a/sys/arch/arc/arc/clock.c +++ b/sys/arch/arc/arc/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.12 2000/06/09 05:41:57 soda Exp $ */ +/* $NetBSD: clock.c,v 1.13 2000/12/24 09:25:24 ur Exp $ */ /* $OpenBSD: clock.c,v 1.6 1998/10/15 21:30:15 imp Exp $ */ /* @@ -69,10 +69,6 @@ struct cfattach aclock_isa_ca = { sizeof(struct clock_softc), clockmatch, clockattach }; -struct cfattach aclock_pica_ca = { - sizeof(struct clock_softc), clockmatch, clockattach -}; - struct cfattach aclock_algor_ca = { sizeof(struct clock_softc), clockmatch, clockattach }; @@ -93,23 +89,8 @@ clockmatch(parent, match, aux) struct cfdata *match; void *aux; { - struct confargs *ca = aux; - /* See how many clocks this system has */ switch (cputype) { - - case ACER_PICA_61: - case MAGNUM: - case NEC_R94: - case NEC_RAx94: - case NEC_RD94: - case NEC_R96: - /* make sure that we're looking for this type of device. */ - if (!BUS_MATCHNAME(ca, "dallas_rtc")) - return (0); - - break; - case DESKSTATION_RPC44: case DESKSTATION_TYNE: case ALGOR_P4032: @@ -145,22 +126,11 @@ clockattach(parent, self, aux) mcclock_attach(parent, self, aux); switch (cputype) { - - case ACER_PICA_61: case ALGOR_P4032: - case NEC_R94: - case NEC_RAx94: - case NEC_RD94: - case NEC_R96: BUS_INTR_ESTABLISH((struct confargs *)aux, (intr_handler_t)hardclock, self); break; - case MAGNUM: - BUS_INTR_ESTABLISH((struct confargs *)aux, - (intr_handler_t)clockintr, self); - break; - case DESKSTATION_RPC44: case DESKSTATION_TYNE: (void)isa_intr_establish(ia->ia_ic, diff --git a/sys/arch/arc/arc/clock_mc.c b/sys/arch/arc/arc/clock_mc.c index 25fc1cf8481c..e00646c27364 100644 --- a/sys/arch/arc/arc/clock_mc.c +++ b/sys/arch/arc/arc/clock_mc.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock_mc.c,v 1.9 2000/08/03 23:58:23 soda Exp $ */ +/* $NetBSD: clock_mc.c,v 1.10 2000/12/24 09:25:24 ur Exp $ */ /* $OpenBSD: clock_mc.c,v 1.9 1998/03/16 09:38:26 pefo Exp $ */ /* NetBSD: clock_mc.c,v 1.2 1995/06/28 04:30:30 cgd Exp */ @@ -58,8 +58,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/sys/arch/arc/arc/machdep.c b/sys/arch/arc/arc/machdep.c index fd5d0b631847..2b873b8d32d7 100644 --- a/sys/arch/arc/arc/machdep.c +++ b/sys/arch/arc/arc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.46 2000/11/27 05:57:25 soren Exp $ */ +/* $NetBSD: machdep.c,v 1.47 2000/12/24 09:25:25 ur Exp $ */ /* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */ /* @@ -97,8 +97,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/sys/arch/arc/arc/mainbus.c b/sys/arch/arc/arc/mainbus.c index 81337873d90d..8e9cbfb2f12a 100644 --- a/sys/arch/arc/arc/mainbus.c +++ b/sys/arch/arc/arc/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.12 2000/06/09 05:41:58 soda Exp $ */ +/* $NetBSD: mainbus.c,v 1.13 2000/12/24 09:25:25 ur Exp $ */ /* $OpenBSD: mainbus.c,v 1.4 1998/10/15 21:30:15 imp Exp $ */ /* NetBSD: mainbus.c,v 1.3 1995/06/28 02:45:10 cgd Exp */ @@ -109,7 +109,7 @@ mbattach(parent, self, aux) case NEC_RAx94: case NEC_RD94: case NEC_R96: - nca.ca_name = "pica"; + nca.ca_name = "jazzio"; nca.ca_slot = 0; nca.ca_offset = 0; nca.ca_bus = &sc->sc_bus; diff --git a/sys/arch/arc/conf/GENERIC b/sys/arch/arc/conf/GENERIC index 8f3ee3dfe906..ca32a62ffbc5 100644 --- a/sys/arch/arc/conf/GENERIC +++ b/sys/arch/arc/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.40 2000/12/19 10:42:03 bouyer Exp $ +# $NetBSD: GENERIC,v 1.41 2000/12/24 09:25:25 ur Exp $ # $OpenBSD: GENERIC,v 1.29 1999/08/29 12:14:03 niklas Exp $ # # GENERIC -- everything that's currently supported @@ -6,7 +6,7 @@ include "arch/arc/conf/std.arc" -#ident "GENERIC-$Revision: 1.40 $" +#ident "GENERIC-$Revision: 1.41 $" maxusers 32 # estimated number of users @@ -121,26 +121,26 @@ config netbsd root on ? type ? mainbus0 at root cpu* at mainbus0 -#### Pica bus devices +#### Jazz-Internal bus devices -pica* at mainbus0 # ACER Pica systems local bus. -aclock0 at pica? -#pc0 at pica? -#opms0 at pica? -vga0 at pica? # Jazz localbus VGA -pckbc0 at pica? # PC keyboard controller -com0 at pica? -com1 at pica? -lpt0 at pica? -sn0 at pica? +jazzio* at mainbus0 # Jazz-Internal bus. +aclock0 at jazzio? +#pc0 at jazzio? +#opms0 at jazzio? +vga0 at jazzio? # Jazz localbus VGA +pckbc0 at jazzio? # PC keyboard controller +com0 at jazzio? +com1 at jazzio? +lpt0 at jazzio? +sn0 at jazzio? -fdc0 at pica? +fdc0 at jazzio? fd* at fdc? drive ? -asc0 at pica? +asc0 at jazzio? scsibus* at asc? -#siop0 at pica? +#siop0 at jazzio? #scsibus* at siop? #### ISA bus devices diff --git a/sys/arch/arc/conf/M403 b/sys/arch/arc/conf/M403 index 31a6bcd82a7b..d37d55b2ccdb 100644 --- a/sys/arch/arc/conf/M403 +++ b/sys/arch/arc/conf/M403 @@ -1,4 +1,4 @@ -# $NetBSD: M403,v 1.10 2000/09/24 15:59:28 jdolecek Exp $ +# $NetBSD: M403,v 1.11 2000/12/24 09:25:25 ur Exp $ # # configuration file for MIPS Magnum 4000 system # @@ -116,27 +116,27 @@ config netbsd root on ? type ? mainbus0 at root cpu* at mainbus0 -#### Pica bus devices +#### Jazz-Internal bus devices -pica* at mainbus0 # ACER Pica systems local bus. -aclock0 at pica? -#pc0 at pica? -#opms0 at pica? -vga0 at pica? # Jazz localbus VGA -pckbc0 at pica? # PC keyboard controller +jazzio* at mainbus0 # Jazz-Internal bus. +aclock0 at jazzio? +#pc0 at jazzio? +#opms0 at jazzio? +vga0 at jazzio? # Jazz localbus VGA +pckbc0 at jazzio? # PC keyboard controller options COM_FREQ_MAGNUM=8192000 # 8.192 MHz - NEC M403 -com0 at pica? -com1 at pica? -lpt0 at pica? -sn0 at pica? +com0 at jazzio? +com1 at jazzio? +lpt0 at jazzio? +sn0 at jazzio? -fdc0 at pica? +fdc0 at jazzio? fd* at fdc? drive ? -asc0 at pica? +asc0 at jazzio? scsibus* at asc? -#siop0 at pica? +#siop0 at jazzio? #scsibus* at siop? #### ISA bus devices diff --git a/sys/arch/arc/conf/MIMORI b/sys/arch/arc/conf/MIMORI index 7cbb7e380788..6f2baacac250 100644 --- a/sys/arch/arc/conf/MIMORI +++ b/sys/arch/arc/conf/MIMORI @@ -1,4 +1,4 @@ -# $NetBSD: MIMORI,v 1.3 2000/09/24 15:59:28 jdolecek Exp $ +# $NetBSD: MIMORI,v 1.4 2000/12/24 09:25:25 ur Exp $ # NetBSD: GENERIC,v 1.31 2000/06/09 05:33:02 soda Exp # # MIMORI -- My NEC RISCstation 2250 (ur) @@ -118,23 +118,23 @@ config netbsd root on ? type ? mainbus0 at root cpu* at mainbus0 -#### Pica bus devices +#### Jazz-Internal bus devices -pica* at mainbus0 # ACER Pica systems local bus. -aclock0 at pica? -#pc0 at pica? -#opms0 at pica? -#vga0 at pica? # Jazz localbus VGA -pckbc0 at pica? # PC keyboard controller -com0 at pica? -com1 at pica? -lpt0 at pica? -sn0 at pica? +jazzio* at mainbus0 # Jazz-Internal bus. +aclock0 at jazzio? +#pc0 at jazzio? +#opms0 at jazzio? +#vga0 at jazzio? # Jazz localbus VGA +pckbc0 at jazzio? # PC keyboard controller +com0 at jazzio? +com1 at jazzio? +lpt0 at jazzio? +sn0 at jazzio? -fdc0 at pica? +fdc0 at jazzio? fd* at fdc? drive ? -#siop0 at pica? +#siop0 at jazzio? #scsibus* at siop? #### PCI bus devices diff --git a/sys/arch/arc/conf/PCCONS b/sys/arch/arc/conf/PCCONS index 1f53e7de0d2b..d35efd30a82a 100644 --- a/sys/arch/arc/conf/PCCONS +++ b/sys/arch/arc/conf/PCCONS @@ -1,4 +1,4 @@ -# $NetBSD: PCCONS,v 1.4 2000/09/24 15:59:28 jdolecek Exp $ +# $NetBSD: PCCONS,v 1.5 2000/12/24 09:25:25 ur Exp $ # $OpenBSD: GENERIC,v 1.29 1999/08/29 12:14:03 niklas Exp $ # # PCCONS -- generic but pccons rather than wscons @@ -119,24 +119,24 @@ config netbsd root on ? type ? mainbus0 at root cpu* at mainbus0 -#### Pica bus devices +#### Jazz-Internal bus devices -pica* at mainbus0 # ACER Pica systems local bus. -aclock0 at pica? -pc0 at pica? -opms0 at pica? -com0 at pica? -com1 at pica? -lpt0 at pica? -sn0 at pica? +jazzio* at mainbus0 # Jazz-Internal bus. +aclock0 at jazzio? +pc0 at jazzio? +opms0 at jazzio? +com0 at jazzio? +com1 at jazzio? +lpt0 at jazzio? +sn0 at jazzio? -fdc0 at pica? +fdc0 at jazzio? fd* at fdc? drive ? -asc0 at pica? +asc0 at jazzio? scsibus* at asc? -#siop0 at pica? +#siop0 at jazzio? #scsibus* at siop? #### ISA bus devices diff --git a/sys/arch/arc/conf/PICA b/sys/arch/arc/conf/PICA index f96f732a53ee..c8f3e9dbf014 100644 --- a/sys/arch/arc/conf/PICA +++ b/sys/arch/arc/conf/PICA @@ -1,4 +1,4 @@ -# $NetBSD: PICA,v 1.23 2000/09/24 15:59:28 jdolecek Exp $ +# $NetBSD: PICA,v 1.24 2000/12/24 09:25:25 ur Exp $ # # configuration file for ACER PICA system # @@ -116,26 +116,26 @@ config netbsd root on ? type ? mainbus0 at root cpu* at mainbus0 -#### Pica bus devices +#### Jazz-Internal bus devices -pica* at mainbus0 # ACER Pica systems local bus. -aclock0 at pica? -#pc0 at pica? -#opms0 at pica? -vga0 at pica? # Jazz localbus VGA -pckbc0 at pica? # PC keyboard controller -com0 at pica? -com1 at pica? -lpt0 at pica? -sn0 at pica? +jazzio* at mainbus0 # Jazz-Internal bus. +aclock0 at jazzio? +#pc0 at jazzio? +#opms0 at jazzio? +vga0 at jazzio? # Jazz localbus VGA +pckbc0 at jazzio? # PC keyboard controller +com0 at jazzio? +com1 at jazzio? +lpt0 at jazzio? +sn0 at jazzio? -fdc0 at pica? +fdc0 at jazzio? fd* at fdc? drive ? -asc0 at pica? +asc0 at jazzio? scsibus* at asc? -#siop0 at pica? +#siop0 at jazzio? #scsibus* at siop? #### ISA bus devices diff --git a/sys/arch/arc/conf/RAMDISK b/sys/arch/arc/conf/RAMDISK index 4d41d8ada9e1..c42ba7917e08 100644 --- a/sys/arch/arc/conf/RAMDISK +++ b/sys/arch/arc/conf/RAMDISK @@ -1,4 +1,4 @@ -# $NetBSD: RAMDISK,v 1.11 2000/09/24 15:59:28 jdolecek Exp $ +# $NetBSD: RAMDISK,v 1.12 2000/12/24 09:25:25 ur Exp $ # $OpenBSD: RAMDISK,v 1.9 1999/08/29 12:14:03 niklas Exp $ # # memory disk based configuration file for MIPS R4x00 ARC Systems @@ -125,26 +125,26 @@ config netbsd root on ? type ? mainbus0 at root cpu* at mainbus0 -#### Pica bus devices +#### Jazz-Internal bus devices -pica* at mainbus0 # ACER Pica systems local bus. -aclock0 at pica? -#pc0 at pica? -#opms0 at pica? -vga0 at pica? # Jazz localbus VGA -pckbc0 at pica? # PC keyboard controller -com0 at pica? -com1 at pica? -lpt0 at pica? -sn0 at pica? +jazzio* at mainbus0 # Jazz-Internal bus. +aclock0 at jazzio? +#pc0 at jazzio? +#opms0 at jazzio? +vga0 at jazzio? # Jazz localbus VGA +pckbc0 at jazzio? # PC keyboard controller +com0 at jazzio? +com1 at jazzio? +lpt0 at jazzio? +sn0 at jazzio? -fdc0 at pica? +fdc0 at jazzio? fd* at fdc? drive ? -asc0 at pica? +asc0 at jazzio? scsibus* at asc? -#siop0 at pica? +#siop0 at jazzio? #scsibus* at siop? #### ISA bus devices diff --git a/sys/arch/arc/conf/files.arc b/sys/arch/arc/conf/files.arc index a7cba618d276..f1cce00c35e7 100644 --- a/sys/arch/arc/conf/files.arc +++ b/sys/arch/arc/conf/files.arc @@ -1,4 +1,4 @@ -# $NetBSD: files.arc,v 1.24 2000/11/08 19:48:51 ad Exp $ +# $NetBSD: files.arc,v 1.25 2000/12/24 09:25:25 ur Exp $ # $OpenBSD: files.arc,v 1.21 1999/09/11 10:20:20 niklas Exp $ # # maxpartitions must be first item in files.${ARCH} @@ -12,7 +12,6 @@ maxusers 2 8 64 file arch/arc/arc/autoconf.c file arch/arc/arc/conf.c file arch/arc/arc/disksubr.c -file arch/arc/dev/dma.c file arch/arc/arc/machdep.c #file arch/arc/arc/minidebug.c file arch/arc/arc/arc_trap.c @@ -54,13 +53,14 @@ attach cpu at mainbus file arch/arc/arc/cpu.c cpu # -# Magnum and PICA bus autoconfiguration devices +# Magnum and Jazz-Internal bus autoconfiguration devices # -device pica {} -attach pica at mainbus # optional -file arch/arc/pica/picabus.c pica -file arch/arc/jazz/jazzdmatlb.c # XXX pica -file arch/arc/jazz/bus_dma_jazz.c # XXX pica +device jazzio {} +attach jazzio at mainbus # optional +file arch/arc/jazz/jazzio.c jazzio +file arch/arc/jazz/dma.c # XXX jazzio +file arch/arc/jazz/jazzdmatlb.c # XXX jazzio +file arch/arc/jazz/bus_dma_jazz.c # XXX jazzio # # ALGOR bus autoconfiguration devices @@ -91,10 +91,10 @@ device necpb: pcibus attach necpb at mainbus # optional file arch/arc/pci/necpb.c necpb -# Ethernet chip on PICA bus +# Ethernet chip on Jazz-Internal bus device sn: ifnet, ether, arp -attach sn at pica -file arch/arc/dev/if_sn.c sn +attach sn at jazzio +file arch/arc/jazz/if_sn.c sn # # Machine-independent MII/PHY drivers. @@ -111,33 +111,33 @@ include "dev/scsipi/files.scsipi" major {sd = 0} major {cd = 3} -# Symbios 53C94 SCSI interface driver on PICA bus +# Symbios 53C94 SCSI interface driver on Jazz-Internal bus device asc: scsi -attach asc at pica -file arch/arc/dev/asc.c asc +attach asc at jazzio +file arch/arc/jazz/asc.c asc -# Floppy disk controller on PICA bus +# Floppy disk controller on Jazz-internal bus device fdc {drive = -1} -attach fdc at pica +attach fdc at jazzio device fd: disk attach fd at fdc -file arch/arc/dev/fd.c fdc needs-flag +file arch/arc/jazz/fd.c fdc needs-flag major {fd = 7} # bus independent raster console glue device rasdisplay: wsemuldisplaydev, pcdisplayops file arch/arc/dev/rasdisplay.c rasdisplay -# raster console glue on PICA bus -attach rasdisplay at pica with rasdisplay_jazzio +# raster console glue on Jazz-Internal bus +attach rasdisplay at jazzio with rasdisplay_jazzio file arch/arc/jazz/rasdisplay_jazzio.c rasdisplay_jazzio needs-flag -# VGA display driver on PICA bus -attach vga at pica with vga_jazzio +# VGA display driver on Jazz-Internal bus +attach vga at jazzio with vga_jazzio file arch/arc/jazz/vga_jazzio.c vga_jazzio needs-flag -# PC keyboard controller on PICA bus -attach pckbc at pica with pckbc_jazzio +# PC keyboard controller on Jazz-Internal bus +attach pckbc at jazzio with pckbc_jazzio file arch/arc/jazz/pckbc_jazzio.c pckbc_jazzio needs-flag # @@ -152,19 +152,20 @@ file arch/arc/pci/pciide_machdep.c pciide # Real time clock, must have one.. device aclock -attach aclock at pica with aclock_pica +attach aclock at jazzio with aclock_jazzio attach aclock at isa with aclock_isa attach aclock at algor with aclock_algor -file arch/arc/arc/clock.c aclock & (aclock_isa | aclock_pica | aclock_algor) needs-flag -file arch/arc/arc/clock_mc.c aclock & (aclock_isa | aclock_pica | aclock_algor) needs-flag +file arch/arc/arc/clock.c aclock needs-flag +file arch/arc/arc/clock_mc.c aclock needs-flag +file arch/arc/jazz/clock_jazzio.c aclock & aclock_jazzio needs-flag # Console driver on PC-style graphics device pc: tty -attach pc at pica with pc_pica +attach pc at jazzio with pc_jazzio attach pc at isa with pc_isa device opms: tty -attach opms at pica -file arch/arc/dev/pccons.c pc & (pc_pica | pc_isa | opms) needs-flag +attach opms at jazzio +file arch/arc/dev/pccons.c pc & (pc_jazzio | pc_isa | opms) needs-flag # BusLogic BT-445C VLB SCSI Controller. Special on TYNE local bus. device btl: scsi @@ -172,9 +173,11 @@ attach btl at isa file arch/arc/dti/btl.c btl # NS16450/16550 Serial line driver -attach com at pica with com_pica +attach com at jazzio with com_jazzio +file arch/arc/jazz/com_jazzio.c com & com_jazzio + attach com at algor with com_algor -file arch/arc/dev/com_lbus.c com & (com_pica | com_algor) +file arch/arc/algor/com_algor.c com & com_algor # Game adapter (joystick) device joy @@ -191,9 +194,11 @@ file arch/arc/isa/joy.c joy needs-flag #file dev/isa/if_ed.c ed & (ed_isa | ed_pcmcia) needs-flag # Parallel printer port driver -attach lpt at pica with lpt_pica +attach lpt at jazzio with lpt_jazzio +file arch/arc/jazz/lpt_jazzio.c lpt & lpt_jazzio + attach lpt at algor with lpt_algor -file arch/arc/dev/lpt_lbus.c lpt & (lpt_pica | lpt_algor) +file arch/arc/algor/lpt_algor.c lpt & lpt_algor # diff --git a/sys/arch/arc/dev/pccons.c b/sys/arch/arc/dev/pccons.c index ba5efa5f2cf3..51286d9806ed 100644 --- a/sys/arch/arc/dev/pccons.c +++ b/sys/arch/arc/dev/pccons.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccons.c,v 1.22 2000/11/02 00:29:17 eeh Exp $ */ +/* $NetBSD: pccons.c,v 1.23 2000/12/24 09:25:27 ur Exp $ */ /* $OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $ */ /* NetBSD: pccons.c,v 1.89 1995/05/04 19:35:20 cgd Exp */ /* NetBSD: pms.c,v 1.21 1995/04/18 02:25:18 mycroft Exp */ @@ -79,8 +79,9 @@ #include #include #include -#include +#include #include +#include #include #include @@ -182,7 +183,7 @@ void pccnpollc __P((dev_t, int)); extern struct cfdriver pc_cd; -struct cfattach pc_pica_ca = { +struct cfattach pc_jazzio_ca = { sizeof(struct pc_softc), pcprobe, pcattach }; @@ -548,12 +549,12 @@ pcprobe(parent, match, aux) struct cfdata *match; void *aux; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; u_int i; /* Make shure we're looking for this type of device */ if(!strcmp((parent)->dv_cfdata->cf_driver->cd_name, "pica")) { - if(!BUS_MATCHNAME(ca, "pckbd")) + if (strcmp(ja->ja_name, "pckbd") != 0) return(0); switch (cputype) { /* XXX ick */ @@ -652,7 +653,7 @@ pcattach(parent, self, aux) struct device *parent, *self; void *aux; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; struct isa_attach_args *ia = aux; struct pc_softc *sc = (void *)self; @@ -662,7 +663,7 @@ pcattach(parent, self, aux) switch (cputype) { case ACER_PICA_61: case NEC_R96: - BUS_INTR_ESTABLISH(ca, pcintr, (void *)(long)sc); + jazzio_intr_establish(ja->ja_intr, pcintr, (void *)(long)sc); break; case DESKSTATION_RPC44: /* XXX ick */ case DESKSTATION_TYNE: diff --git a/sys/arch/arc/isa/isabus.c b/sys/arch/arc/isa/isabus.c index 02320b4c2b8e..d02ecff3d5e6 100644 --- a/sys/arch/arc/isa/isabus.c +++ b/sys/arch/arc/isa/isabus.c @@ -1,4 +1,4 @@ -/* $NetBSD: isabus.c,v 1.13 2000/06/29 08:34:11 mrg Exp $ */ +/* $NetBSD: isabus.c,v 1.14 2000/12/24 09:25:27 ur Exp $ */ /* $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $ */ /* NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp */ @@ -106,8 +106,8 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include -#include -#include +#include +#include #include #include diff --git a/sys/arch/arc/dev/asc.c b/sys/arch/arc/jazz/asc.c similarity index 99% rename from sys/arch/arc/dev/asc.c rename to sys/arch/arc/jazz/asc.c index 7dba293003ed..7466dae3b6d6 100644 --- a/sys/arch/arc/dev/asc.c +++ b/sys/arch/arc/jazz/asc.c @@ -1,4 +1,4 @@ -/* $NetBSD: asc.c,v 1.23 2000/06/29 08:34:11 mrg Exp $ */ +/* $NetBSD: asc.c,v 1.1 2000/12/24 09:25:27 ur Exp $ */ /* $OpenBSD: asc.c,v 1.9 1998/03/16 09:38:39 pefo Exp $ */ /* NetBSD: asc.c,v 1.10 1994/12/05 19:11:12 dean Exp */ @@ -140,12 +140,13 @@ #include #include +#include #include -#include -#include -#include +#include +#include +#include -#include +#include #include @@ -497,11 +498,11 @@ ascmatch(parent, match, aux) struct cfdata *match; void *aux; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; - if(!BUS_MATCHNAME(ca, "asc")) - return(0); - return(1); + if(strcmp(ja->ja_name, "asc") != 0) + return (0); + return (1); } void @@ -510,16 +511,16 @@ ascattach(parent, self, aux) struct device *self; void *aux; { - register struct confargs *ca = aux; - register asc_softc_t asc = (void *)self; - register asc_regmap_t *regs; + struct jazzio_attach_args *ja = aux; + asc_softc_t asc = (void *)self; + asc_regmap_t *regs; int id, s, i; int bufsiz; /* * Initialize hw descriptor, cache some pointers */ - asc->regs = (asc_regmap_t *)BUS_CVTADDR(ca); + asc->regs = (asc_regmap_t *)ja->ja_addr; /* XXX */ /* * Set up machine dependencies. @@ -617,7 +618,7 @@ ascattach(parent, self, aux) /* * Set up interrupt handler. */ - BUS_INTR_ESTABLISH(ca, asc_intr, (void *)asc); + jazzio_intr_establish(ja->ja_intr, asc_intr, (void *)asc); printf(": %s, target %d\n", asc->is24bit ? "NCR53CF9X-2" : "NCR53C94", id); diff --git a/sys/arch/arc/dev/ascreg.h b/sys/arch/arc/jazz/ascreg.h similarity index 99% rename from sys/arch/arc/dev/ascreg.h rename to sys/arch/arc/jazz/ascreg.h index 318e866ead91..6fc1c47e5f3a 100644 --- a/sys/arch/arc/dev/ascreg.h +++ b/sys/arch/arc/jazz/ascreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: ascreg.h,v 1.6 2000/01/23 21:01:53 soda Exp $ */ +/* $NetBSD: ascreg.h,v 1.1 2000/12/24 09:25:28 ur Exp $ */ /* $OpenBSD: ascreg.h,v 1.1.1.1 1996/06/24 09:07:19 pefo Exp $ */ /*- diff --git a/sys/arch/arc/jazz/clock_jazzio.c b/sys/arch/arc/jazz/clock_jazzio.c new file mode 100644 index 000000000000..6335d94b9347 --- /dev/null +++ b/sys/arch/arc/jazz/clock_jazzio.c @@ -0,0 +1,142 @@ +/* $NetBSD: clock_jazzio.c,v 1.1 2000/12/24 09:25:28 ur Exp $ */ +/* $OpenBSD: clock.c,v 1.6 1998/10/15 21:30:15 imp Exp $ */ + +/* + * Copyright (c) 1997 Per Fogelstrom. + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: Utah Hdr: clock.c 1.18 91/01/21 + * + * from: @(#)clock.c 8.1 (Berkeley) 6/10/93 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +int clock_found = 0; +extern int clock_started; + +/* Definition of the driver for autoconfig. */ +static int clock_jazzio_match(struct device *, struct cfdata *, void *); +static void clock_jazzio_attach(struct device *, struct device *, void *); + +extern struct cfdriver aclock_cd; + +struct cfattach aclock_jazzio_ca = { + sizeof(struct clock_softc), clock_jazzio_match, clock_jazzio_attach +}; + +void mcclock_attach(struct device *, struct device *, void *); +int clockintr(void *); + +static int +clock_jazzio_match(parent, match, aux) + struct device *parent; + struct cfdata *match; + void *aux; +{ + struct jazzio_attach_args *ja = aux; + + /* See how many clocks this system has */ + switch (cputype) { + case ACER_PICA_61: + case MAGNUM: + case NEC_R94: + case NEC_RAx94: + case NEC_RD94: + case NEC_R96: + /* make sure that we're looking for this type of device. */ + if (strcmp(ja->ja_name, "dallas_rtc") != 0) + return (0); + + break; + + default: + panic("unknown CPU"); + } + + if (clock_found) + return (0); + + return (1); +} + +static void +clock_jazzio_attach(parent, self, aux) + struct device *parent; + struct device *self; + void *aux; +{ + struct jazzio_attach_args *ja = aux; + + mcclock_attach(parent, self, aux); + + switch (cputype) { + + case ACER_PICA_61: + case NEC_R94: + case NEC_RAx94: + case NEC_RD94: + case NEC_R96: + jazzio_intr_establish(ja->ja_intr, + (intr_handler_t)hardclock, self); + break; + + case MAGNUM: + jazzio_intr_establish(ja->ja_intr, + (intr_handler_t)clockintr, self); + break; + + default: + panic("clockattach: it didn't get here. really."); + } + + printf("\n"); + + clock_found = 1; +} diff --git a/sys/arch/arc/jazz/com_jazzio.c b/sys/arch/arc/jazz/com_jazzio.c new file mode 100644 index 000000000000..b1f9a9c1145b --- /dev/null +++ b/sys/arch/arc/jazz/com_jazzio.c @@ -0,0 +1,155 @@ +/* $NetBSD: com_jazzio.c,v 1.1 2000/12/24 09:25:28 ur Exp $ */ +/* $OpenBSD: com_lbus.c,v 1.7 1998/03/16 09:38:41 pefo Exp $ */ +/* NetBSD: com_isa.c,v 1.12 1998/08/15 17:47:17 mycroft Exp */ + +/*- + * Copyright (c) 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Charles M. Hannum. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)com.c 7.5 (Berkeley) 5/16/91 + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include /* XXX for isa_chipset_tag_t in com_softc */ + +#include +#include +#include + +extern int com_freq; + +int com_jazzio_probe __P((struct device *, struct cfdata *, void *)); +void com_jazzio_attach __P((struct device *, struct device *, void *)); + +struct cfattach com_jazzio_ca = { + sizeof(struct com_softc), com_jazzio_probe, com_jazzio_attach +}; + +int +com_jazzio_probe(parent, match, aux) + struct device *parent; + struct cfdata *match; + void *aux; +{ + struct jazzio_attach_args *ja = aux; + bus_space_tag_t iot; + bus_space_handle_t ioh; + int iobase; + int rv = 1; + + if(strcmp(ja->ja_name, "com") != 0) + return (0); + + iot = ja->ja_bust; + iobase = ja->ja_addr; + + /* if it's in use as console, it's there. */ + if (!com_is_console(iot, iobase, 0)) { + if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) { + return 0; + } + rv = comprobe1(iot, ioh); + bus_space_unmap(iot, ioh, COM_NPORTS); + } + return (rv); +} + +void +com_jazzio_attach(parent, self, aux) + struct device *parent, *self; + void *aux; +{ + struct jazzio_attach_args *ja = aux; + struct com_softc *sc = (void *)self; + int iobase; + bus_space_tag_t iot; + + sc->sc_iobase = iobase = ja->ja_addr; + sc->sc_iot = iot = ja->ja_bust; + + if (!com_is_console(iot, iobase, &sc->sc_ioh) && + bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_ioh)) { + printf(": can't map i/o space\n"); + return; + } + + sc->sc_frequency = com_freq; + SET(sc->sc_hwflags, COM_HW_TXFIFO_DISABLE); /* XXX - NEC M403 */ + jazzio_intr_establish(ja->ja_intr, comintr, sc); + + com_attach_subr(sc); +} diff --git a/sys/arch/arc/dev/dma.c b/sys/arch/arc/jazz/dma.c similarity index 89% rename from sys/arch/arc/dev/dma.c rename to sys/arch/arc/jazz/dma.c index f2b13da991ee..8c589e4a0c8f 100644 --- a/sys/arch/arc/dev/dma.c +++ b/sys/arch/arc/jazz/dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: dma.c,v 1.17 2000/06/29 08:34:11 mrg Exp $ */ +/* $NetBSD: dma.c,v 1.1 2000/12/24 09:25:28 ur Exp $ */ /* $OpenBSD: dma.c,v 1.5 1998/03/01 16:49:57 niklas Exp $ */ /* @@ -60,12 +60,12 @@ #include #include -#include -#include +#include +#include #include #include #include -#include +#include void picaDmaReset __P((dma_softc_t *sc)); void picaDmaEnd __P((dma_softc_t *sc)); @@ -115,24 +115,6 @@ picaDmaTLBFree(dma_softc_t *dma) /*XXX Wakeup waiting */ } -/* - * Map up a viritual address space in dma space given by - * the dma control structure and invalidate dma TLB cache. - */ - -void -picaDmaTLBMap(dma_softc_t *sc) -{ - vaddr_t va; - jazz_dma_pte_t *dma_pte; - - va = sc->next_va - sc->dma_va; - dma_pte = sc->pte_base + (va / JAZZ_DMA_PAGE_SIZE); - - jazz_dmatlb_map_va(NULL, sc->req_va, sc->next_size, dma_pte); - -} - /* * Start local dma channel. */ @@ -144,6 +126,8 @@ picaDmaStart(sc, addr, size, datain) int datain; { pDmaReg regs = sc->dma_reg; + vaddr_t va; + jazz_dma_pte_t *dma_pte; /* Halt DMA */ regs->dma_enab = 0; @@ -151,17 +135,15 @@ picaDmaStart(sc, addr, size, datain) /* Remap request space va into dma space va */ - sc->req_va = (int)addr; - sc->next_va = sc->dma_va + jazz_dma_page_offs(addr); - sc->next_size = size; - /* Map up the request viritual dma space */ - picaDmaTLBMap(sc); + va = jazz_dma_page_offs(addr); + dma_pte = sc->pte_base + (va / JAZZ_DMA_PAGE_SIZE); + + jazz_dmatlb_map_va(NULL, (vaddr_t)addr, size, dma_pte); jazz_dmatlb_flush(); /* Load new transfer parameters */ - regs->dma_addr = sc->next_va; - regs->dma_count = sc->next_size; + regs->dma_addr = sc->dma_va + va; regs->dma_mode = sc->mode & R4030_DMA_MODE; sc->sc_active = 1; @@ -187,14 +169,17 @@ picaDmaMap(sc, addr, size, offset) size_t size; int offset; { + vaddr_t va; + jazz_dma_pte_t *dma_pte; + /* Remap request space va into dma space va */ - sc->req_va = (vaddr_t)addr; - sc->next_va = sc->dma_va + jazz_dma_page_offs(addr) + offset; - sc->next_size = size; - /* Map up the request viritual dma space */ - picaDmaTLBMap(sc); + + va = jazz_dma_page_offs(addr) + offset; + dma_pte = sc->pte_base + (va / JAZZ_DMA_PAGE_SIZE); + + jazz_dmatlb_map_va(NULL, (vaddr_t)addr, size, dma_pte); } /* @@ -231,9 +216,6 @@ void picaDmaEnd(dma_softc_t *sc) { pDmaReg regs = sc->dma_reg; - int res; - - res = regs->dma_count = sc->next_size; /* Halt DMA */ regs->dma_enab = 0; diff --git a/sys/arch/arc/dev/dma.h b/sys/arch/arc/jazz/dma.h similarity index 93% rename from sys/arch/arc/dev/dma.h rename to sys/arch/arc/jazz/dma.h index 8b14aa09a0da..0a5288c25462 100644 --- a/sys/arch/arc/dev/dma.h +++ b/sys/arch/arc/jazz/dma.h @@ -1,4 +1,4 @@ -/* $NetBSD: dma.h,v 1.7 2000/06/09 05:22:25 soda Exp $ */ +/* $NetBSD: dma.h,v 1.1 2000/12/24 09:25:28 ur Exp $ */ /* $OpenBSD: dma.h,v 1.3 1997/04/19 17:19:51 pefo Exp $ */ /* @@ -80,16 +80,11 @@ typedef struct dma_softc { struct device sc_dev; /* use as a device */ struct esp_softc *sc_esp; bus_addr_t dma_va; /* Viritual address for transfer */ - vaddr_t req_va; /* Original request va */ - bus_addr_t next_va; /* Value to program into dma regs */ - int next_size; /* Value to program into dma regs */ int mode; /* Mode register value and direction */ jazz_dma_pte_t *pte_base; /* Pointer to dma tlb array */ int pte_size; /* Size of pte allocated pte array */ pDmaReg dma_reg; /* Pointer to dma registers */ int sc_active; /* Active flag */ - char **sc_dmaaddr; /* Pointer to dma address in dev */ - int *sc_dmalen; /* Pointer to len counter in dev */ void (*reset)(struct dma_softc *); /* Reset routine pointer */ void (*enintr)(struct dma_softc *); /* Int enab routine pointer */ void (*map)(struct dma_softc *, char *, size_t, int); @@ -114,7 +109,6 @@ typedef struct dma_softc { void picaDmaInit __P((void)); void picaDmaTLBAlloc __P((dma_softc_t *)); void picaDmaTLBFree __P((dma_softc_t *)); -void picaDmaTLBMap __P((dma_softc_t *)); void picaDmaMap __P((struct dma_softc *, char *, size_t, int)); void picaDmaStart __P((struct dma_softc *, char *, size_t, int)); void picaDmaFlush __P((struct dma_softc *, char *, size_t, int)); diff --git a/sys/arch/arc/dev/fd.c b/sys/arch/arc/jazz/fd.c similarity index 98% rename from sys/arch/arc/dev/fd.c rename to sys/arch/arc/jazz/fd.c index 695680d5dd6c..b79b03dcdba4 100644 --- a/sys/arch/arc/dev/fd.c +++ b/sys/arch/arc/jazz/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.23 2000/06/29 08:34:11 mrg Exp $ */ +/* $NetBSD: fd.c,v 1.1 2000/12/24 09:25:28 ur Exp $ */ /* $OpenBSD: fd.c,v 1.6 1998/10/03 21:18:57 millert Exp $ */ /* NetBSD: fd.c,v 1.78 1995/07/04 07:23:09 mycroft Exp */ @@ -100,9 +100,10 @@ #include #include /* for mips3_HitFlushDCache() */ -#include +#include +#include #include -#include +#include #include "locators.h" @@ -264,10 +265,10 @@ fdcprobe(parent, match, aux) struct cfdata *match; void *aux; { - register struct confargs *ca = aux; - int iobase = (long)BUS_CVTADDR(ca); + struct jazzio_attach_args *ja = aux; + int iobase = ja->ja_addr; - if (!BUS_MATCHNAME(ca, "fdc")) + if (strcmp(ja->ja_name, "fdc") != 0) return (0); /* reset */ @@ -317,11 +318,11 @@ fdcattach(parent, self, aux) void *aux; { struct fdc_softc *fdc = (void *)self; - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; struct fdc_attach_args fa; int type; - fdc->sc_iobase = (long)BUS_CVTADDR(ca); + fdc->sc_iobase = ja->ja_addr; fdc->sc_state = DEVIDLE; TAILQ_INIT(&fdc->sc_drives); @@ -333,7 +334,7 @@ fdcattach(parent, self, aux) callout_init(&fdc->sc_timo_ch); callout_init(&fdc->sc_intr_ch); - BUS_INTR_ESTABLISH(ca, fdcintr, fdc); + jazzio_intr_establish(ja->ja_intr, fdcintr, fdc); /* * No way yet to determine default disk types. diff --git a/sys/arch/arc/dev/fdreg.h b/sys/arch/arc/jazz/fdreg.h similarity index 98% rename from sys/arch/arc/dev/fdreg.h rename to sys/arch/arc/jazz/fdreg.h index 6c2326f60f2e..4d188cff2677 100644 --- a/sys/arch/arc/dev/fdreg.h +++ b/sys/arch/arc/jazz/fdreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: fdreg.h,v 1.2 2000/01/23 21:01:54 soda Exp $ */ +/* $NetBSD: fdreg.h,v 1.1 2000/12/24 09:25:28 ur Exp $ */ /* $OpenBSD: fdreg.h,v 1.1.1.1 1996/06/24 09:07:19 pefo Exp $ */ /* NetBSD: fdreg.h,v 1.8 1995/06/28 04:30:57 cgd Exp */ diff --git a/sys/arch/arc/dev/if_sn.c b/sys/arch/arc/jazz/if_sn.c similarity index 98% rename from sys/arch/arc/dev/if_sn.c rename to sys/arch/arc/jazz/if_sn.c index 467fdde625b0..b5d339ed431d 100644 --- a/sys/arch/arc/dev/if_sn.c +++ b/sys/arch/arc/jazz/if_sn.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.22 2000/11/15 01:02:12 thorpej Exp $ */ +/* $NetBSD: if_sn.c,v 1.1 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: if_sn.c,v 1.12 1999/05/13 15:44:48 jason Exp $ */ /* @@ -66,11 +66,12 @@ #include /* for mips3_HitFlushDCache() */ +#include #include -#include +#include #define SONICDW 32 -#include +#include #define SWR(a, x) (a) = (x) #define SRD(a) ((a) & 0xffff) @@ -247,11 +248,10 @@ snmatch(parent, match, aux) struct cfdata *match; void *aux; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; - /* XXX CHECK BUS */ /* make sure that we're looking for this type of device. */ - if (!BUS_MATCHNAME(ca, "sonic")) + if (strcmp(ja->ja_name, "sonic") != 0) return (0); return (1); @@ -268,12 +268,12 @@ snattach(parent, self, aux) void *aux; { struct sn_softc *sc = (void *)self; - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; struct ifnet *ifp = &sc->sc_if; int p, pp; u_int8_t myaddr[ETHER_ADDR_LEN]; - sc->sc_csr = (struct sonic_reg *)BUS_CVTADDR(ca); + sc->sc_csr = (struct sonic_reg *)ja->ja_addr; /* XXX */ sc->dma = &sc->__dma; sn_dma_init(sc->dma, FRAGMAX * NTDA @@ -332,7 +332,7 @@ printf("sonic buffers: rra=0x%x cda=0x%x rda=0x%x tda=0x%x rba=0x%x\n", printf("mapped to offset 0x%x size 0x%x\n", SONICBUF - pp, p - SONICBUF); #endif - BUS_INTR_ESTABLISH(ca, (intr_handler_t)snintr, (void *)sc); + jazzio_intr_establish(ja->ja_intr, (intr_handler_t)snintr, (void *)sc); bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ); ifp->if_softc = sc; diff --git a/sys/arch/arc/dev/if_snreg.h b/sys/arch/arc/jazz/if_snreg.h similarity index 99% rename from sys/arch/arc/dev/if_snreg.h rename to sys/arch/arc/jazz/if_snreg.h index 5385950fb0f4..a4ab74062b15 100644 --- a/sys/arch/arc/dev/if_snreg.h +++ b/sys/arch/arc/jazz/if_snreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_snreg.h,v 1.5 2000/01/23 21:01:54 soda Exp $ */ +/* $NetBSD: if_snreg.h,v 1.1 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: if_sn.h,v 1.1.1.1 1996/06/24 09:07:19 pefo Exp $ */ /* diff --git a/sys/arch/arc/jazz/jazzdmatlb.c b/sys/arch/arc/jazz/jazzdmatlb.c index 37b2a7f05451..61a4760658fb 100644 --- a/sys/arch/arc/jazz/jazzdmatlb.c +++ b/sys/arch/arc/jazz/jazzdmatlb.c @@ -1,4 +1,4 @@ -/* $NetBSD: jazzdmatlb.c,v 1.3 2000/11/09 06:09:59 thorpej Exp $ */ +/* $NetBSD: jazzdmatlb.c,v 1.4 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: dma.c,v 1.5 1998/03/01 16:49:57 niklas Exp $ */ /*- @@ -43,7 +43,6 @@ #include #include -#include #include #include diff --git a/sys/arch/arc/pica/picabus.c b/sys/arch/arc/jazz/jazzio.c similarity index 82% rename from sys/arch/arc/pica/picabus.c rename to sys/arch/arc/jazz/jazzio.c index 42fe634e1e8c..9276f9ecfc0d 100644 --- a/sys/arch/arc/pica/picabus.c +++ b/sys/arch/arc/jazz/jazzio.c @@ -1,4 +1,4 @@ -/* $NetBSD: picabus.c,v 1.14 2000/06/29 08:34:12 mrg Exp $ */ +/* $NetBSD: jazzio.c,v 1.1 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: picabus.c,v 1.11 1999/01/11 05:11:10 millert Exp $ */ /* NetBSD: tc.c,v 1.2 1995/03/08 00:39:05 cgd Exp */ @@ -44,36 +44,36 @@ #include #include -#include -#include +#include +#include +#include #include #include -#include +#include -struct pica_softc { +struct jazzio_softc { struct device sc_dv; struct abus sc_bus; + struct arc_bus_dma_tag sc_dmat; struct pica_dev *sc_devs; }; /* Definition of the driver for autoconfig. */ -int picamatch(struct device *, struct cfdata *, void *); -void picaattach(struct device *, struct device *, void *); -int picaprint(void *, const char *); +int jazziomatch(struct device *, struct cfdata *, void *); +void jazzioattach(struct device *, struct device *, void *); +int jazzioprint(void *, const char *); -struct cfattach pica_ca = { - sizeof(struct pica_softc), picamatch, picaattach +struct cfattach jazzio_ca = { + sizeof(struct jazzio_softc), jazziomatch, jazzioattach }; -extern struct cfdriver pica_cd; +extern struct cfdriver jazzio_cd; -void pica_intr_establish __P((struct confargs *, int (*)(void *), void *)); -void pica_intr_disestablish __P((struct confargs *)); -caddr_t pica_cvtaddr __P((struct confargs *)); -int pica_matchname __P((struct confargs *, char *)); -int pica_iointr __P((unsigned int, struct clockframe *)); -int pica_clkintr __P((unsigned int, struct clockframe *)); -int rd94_iointr __P((unsigned int, struct clockframe *)); -int rd94_clkintr __P((unsigned int, struct clockframe *)); +void jazzio_intr_establish(int, int (*)(void *), void *); +void jazzio_intr_disestablish(int); +int pica_iointr(unsigned int, struct clockframe *); +int pica_clkintr(unsigned int, struct clockframe *); +int rd94_iointr(unsigned int, struct clockframe *); +int rd94_clkintr(unsigned int, struct clockframe *); intr_handler_t pica_clock_handler; @@ -171,7 +171,7 @@ struct pica_dev nec_rd94_cpu[] = { 0, pica_intrnull, (void *)NULL, }, {{ "sonic", 4, 0, }, RD94_SYS_LB_IE_SONIC, pica_intrnull, (void *)RD94_SYS_SONIC, }, - {{ NULL, 5, NULL, }, + {{ NULL, 5, 0, }, 0, pica_intrnull, (void *)NULL, }, {{ NULL, 6, NULL, }, 0, pica_intrnull, (void *)NULL, }, @@ -198,10 +198,13 @@ struct pica_dev *pica_cpu_devs[] = { }; int npica_cpu_devs = sizeof pica_cpu_devs / sizeof pica_cpu_devs[0]; +int jazzio_found = 0; int local_int_mask = 0; /* Local interrupt enable mask */ +extern struct arc_bus_space pica_bus; + int -picamatch(parent, match, aux) +jazziomatch(parent, match, aux) struct device *parent; struct cfdata *match; void *aux; @@ -209,11 +212,11 @@ picamatch(parent, match, aux) struct confargs *ca = aux; /* Make sure that we're looking for a PICA. */ - if (strcmp(ca->ca_name, pica_cd.cd_name) != 0) + if (strcmp(ca->ca_name, jazzio_cd.cd_name) != 0) return (0); /* Make sure that unit exists. */ - if (match->cf_unit != 0 || + if (jazzio_found || cputype > npica_cpu_devs || pica_cpu_devs[cputype] == NULL) return (0); @@ -221,17 +224,19 @@ picamatch(parent, match, aux) } void -picaattach(parent, self, aux) +jazzioattach(parent, self, aux) struct device *parent; struct device *self; void *aux; { - struct pica_softc *sc = (struct pica_softc *)self; - struct confargs *nca; + struct jazzio_softc *sc = (struct jazzio_softc *)self; + struct jazzio_attach_args ja; int i; printf("\n"); + jazzio_found = 1; + /* keep our CPU device description handy */ sc->sc_devs = pica_cpu_devs[cputype]; @@ -250,63 +255,53 @@ picaattach(parent, self, aux) } sc->sc_bus.ab_dv = (struct device *)sc; - sc->sc_bus.ab_type = BUS_PICA; - sc->sc_bus.ab_intr_establish = pica_intr_establish; - sc->sc_bus.ab_intr_disestablish = pica_intr_disestablish; - sc->sc_bus.ab_cvtaddr = pica_cvtaddr; - sc->sc_bus.ab_matchname = pica_matchname; /* Initialize PICA Dma */ picaDmaInit(); + /* Create bus_dma_tag */ + jazz_bus_dma_tag_init(&sc->sc_dmat); + /* Try to configure each PICA attached device */ for (i = 0; sc->sc_devs[i].ps_ca.ca_slot >= 0; i++) { if(sc->sc_devs[i].ps_ca.ca_name == NULL) continue; /* Empty slot */ - nca = &sc->sc_devs[i].ps_ca; - nca->ca_bus = &sc->sc_bus; + ja.ja_name = sc->sc_devs[i].ps_ca.ca_name; + ja.ja_bus = &sc->sc_bus; + ja.ja_bust = &pica_bus; + ja.ja_dmat = &sc->sc_dmat; + ja.ja_addr = (bus_addr_t)sc->sc_devs[i].ps_base; + ja.ja_intr = sc->sc_devs[i].ps_ca.ca_slot; + ja.ja_dma = 0; /* Tell the autoconfig machinery we've found the hardware. */ - config_found(self, nca, picaprint); + config_found(self, &ja, jazzioprint); } } int -picaprint(aux, pnp) +jazzioprint(aux, pnp) void *aux; const char *pnp; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; if (pnp) - printf("%s at %s", ca->ca_name, pnp); - printf(" slot %d offset 0x%x", ca->ca_slot, ca->ca_offset); + printf("%s at %s", ja->ja_name, pnp); + printf(" addr 0x%lx intr %d", ja->ja_addr, ja->ja_intr); return (UNCONF); } -caddr_t -pica_cvtaddr(ca) - struct confargs *ca; -{ - struct pica_softc *sc = pica_cd.cd_devs[0]; - - return(sc->sc_devs[ca->ca_slot].ps_base + ca->ca_offset); - -} - void -pica_intr_establish(ca, handler, val) - struct confargs *ca; +jazzio_intr_establish(slot, handler, val) + int slot; intr_handler_t handler; void *val; { - struct pica_softc *sc = pica_cd.cd_devs[0]; + struct jazzio_softc *sc = jazzio_cd.cd_devs[0]; - int slot; - - slot = ca->ca_slot; if(slot == 0) { /* Slot 0 is special, clock */ pica_clock_handler = handler; switch (cputype) { @@ -353,12 +348,9 @@ pica_intr_establish(ca, handler, val) } void -pica_intr_disestablish(ca) - struct confargs *ca; -{ +jazzio_intr_disestablish(slot) int slot; - - slot = ca->ca_slot; +{ if(slot != 0) { /* Slot 0 is special, clock */ local_int_mask &= ~int_table[slot].int_mask; int_table[slot].int_mask = 0; @@ -367,14 +359,6 @@ pica_intr_disestablish(ca) } } -int -pica_matchname(ca, name) - struct confargs *ca; - char *name; -{ - return (strcmp(name, ca->ca_name) == 0); -} - int pica_intrnull(val) void *val; diff --git a/sys/arch/arc/jazz/jazziovar.h b/sys/arch/arc/jazz/jazziovar.h new file mode 100644 index 000000000000..28f21b9a25c4 --- /dev/null +++ b/sys/arch/arc/jazz/jazziovar.h @@ -0,0 +1,19 @@ +#ifndef __JAZZIOVAR_H +#define __JAZZIOVAR_H + +#include + +struct jazzio_attach_args { + char *ja_name; + struct abus *ja_bus; + bus_space_tag_t ja_bust; + bus_dma_tag_t ja_dmat; + bus_addr_t ja_addr; + int ja_intr; + int ja_dma; +}; + +void jazzio_intr_establish(int, int (*)(void *), void *); +void jazzio_intr_disestablish(int); + +#endif diff --git a/sys/arch/arc/jazz/lpt_jazzio.c b/sys/arch/arc/jazz/lpt_jazzio.c new file mode 100644 index 000000000000..f7db9d540da0 --- /dev/null +++ b/sys/arch/arc/jazz/lpt_jazzio.c @@ -0,0 +1,196 @@ +/* $NetBSD: lpt_jazzio.c,v 1.1 2000/12/24 09:25:29 ur Exp $ */ +/* $OpenBSD: lpt_lbus.c,v 1.3 1997/04/10 16:29:17 pefo Exp $ */ + +/* + * Copyright (c) 1993, 1994 Charles M. Hannum. + * Copyright (c) 1990 William F. Jolitz, TeleMuse + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This software is a component of "386BSD" developed by + * William F. Jolitz, TeleMuse. + * 4. Neither the name of the developer nor the name "386BSD" + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ + * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS + * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. + * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT + * NOT MAKE USE OF THIS WORK. + * + * FOR USERS WHO WISH TO UNDERSTAND THE 386BSD SYSTEM DEVELOPED + * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN + * REFERENCES SUCH AS THE "PORTING UNIX TO THE 386" SERIES + * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING + * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND + * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE + * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS + * OF 386BSD ENTITLED "386BSD FROM THE INSIDE OUT" WILL BE AVAILABLE LATE 1992. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Device Driver for AT parallel printer port + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +int lpt_jazzio_probe __P((struct device *, struct cfdata *, void *)); +void lpt_jazzio_attach __P((struct device *, struct device *, void *)); + +struct cfattach lpt_jazzio_ca = { + sizeof(struct lpt_softc), lpt_jazzio_probe, lpt_jazzio_attach +}; + +/* + * XXX - copied from lpt_isa.c + * sys/arch/arm32/mainbus/lpt_pioc.c also copies this. + * sys/arch/amiga/dev/lpt_supio.c doesn't. + */ +static int lpt_port_test __P((bus_space_tag_t, bus_space_handle_t, bus_addr_t, + bus_size_t, u_char, u_char)); +/* + * Internal routine to lptprobe to do port tests of one byte value. + */ +static int +lpt_port_test(iot, ioh, base, off, data, mask) + bus_space_tag_t iot; + bus_space_handle_t ioh; + bus_addr_t base; + bus_size_t off; + u_char data, mask; +{ + int timeout; + u_char temp; + + data &= mask; + bus_space_write_1(iot, ioh, off, data); + timeout = 1000; + do { + delay(10); + temp = bus_space_read_1(iot, ioh, off) & mask; + } while (temp != data && --timeout); + return (temp == data); +} + +int +lpt_jazzio_probe(parent, match, aux) + struct device *parent; + struct cfdata *match; + void *aux; +{ + struct jazzio_attach_args *ja = aux; + bus_space_tag_t iot; + bus_space_handle_t ioh; + bus_addr_t base; + u_int8_t mask, data; + int i, rv; + +#ifdef DEBUG +#define ABORT \ + do { \ + printf("lpt_jazzio_probe: mask %x data %x failed\n", mask, \ + data); \ + goto out; \ + } while (0) +#else +#define ABORT goto out +#endif + + if(strcmp(ja->ja_name, "lpt") != 0) + return (0); + + iot = ja->ja_bust; + base = ja->ja_addr; + if (bus_space_map(iot, base, LPT_NPORTS, 0, &ioh)) + return 0; + + rv = 0; + mask = 0xff; + + data = 0x55; /* Alternating zeros */ + if (!lpt_port_test(iot, ioh, base, lpt_data, data, mask)) + ABORT; + + data = 0xaa; /* Alternating ones */ + if (!lpt_port_test(iot, ioh, base, lpt_data, data, mask)) + ABORT; + + for (i = 0; i < CHAR_BIT; i++) { /* Walking zero */ + data = ~(1 << i); + if (!lpt_port_test(iot, ioh, base, lpt_data, data, mask)) + ABORT; + } + + for (i = 0; i < CHAR_BIT; i++) { /* Walking one */ + data = (1 << i); + if (!lpt_port_test(iot, ioh, base, lpt_data, data, mask)) + ABORT; + } + + bus_space_write_1(iot, ioh, lpt_data, 0); + bus_space_write_1(iot, ioh, lpt_control, 0); + + rv = 1; + +out: + bus_space_unmap(iot, ioh, LPT_NPORTS); + return rv; +} + +void +lpt_jazzio_attach(parent, self, aux) + struct device *parent, *self; + void *aux; +{ + struct lpt_softc *sc = (void *)self; + struct jazzio_attach_args *ja = aux; + bus_space_tag_t iot; + bus_space_handle_t ioh; + + printf("\n"); + + sc->sc_state = 0; + iot = sc->sc_iot = ja->ja_bust; + if (bus_space_map(iot, ja->ja_addr, LPT_NPORTS, 0, &ioh)) { + printf("%s: can't map i/o space\n", self->dv_xname); + return; + } + sc->sc_ioh = ioh; + + bus_space_write_1(iot, ioh, lpt_control, LPC_NINIT); + + jazzio_intr_establish(ja->ja_intr, lptintr, sc); +} diff --git a/sys/arch/arc/jazz/pckbc_jazzio.c b/sys/arch/arc/jazz/pckbc_jazzio.c index e4e8437ea66c..6660d0f4c994 100644 --- a/sys/arch/arc/jazz/pckbc_jazzio.c +++ b/sys/arch/arc/jazz/pckbc_jazzio.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_jazzio.c,v 1.1 2000/06/17 07:17:38 soda Exp $ */ +/* $NetBSD: pckbc_jazzio.c,v 1.2 2000/12/24 09:25:29 ur Exp $ */ /* NetBSD: pckbc_isa.c,v 1.2 2000/03/23 07:01:35 thorpej Exp */ /* @@ -44,7 +44,8 @@ #include #include -#include +#include +#include #include #include @@ -59,7 +60,7 @@ void pckbc_jazzio_intr_establish __P((struct pckbc_softc *, pckbc_slot_t)); struct pckbc_jazzio_softc { struct pckbc_softc sc_pckbc; - struct confargs *sc_ca[PCKBC_NSLOTS]; + int sc_intr[PCKBC_NSLOTS]; }; struct cfattach pckbc_jazzio_ca = { @@ -67,24 +68,21 @@ struct cfattach pckbc_jazzio_ca = { pckbc_jazzio_match, pckbc_jazzio_attach, }; -extern struct arc_bus_space pica_bus; /* XXX */ - int pckbc_jazzio_match(parent, match, aux) struct device *parent; struct cfdata *match; void *aux; { - struct confargs *ca = aux; - bus_space_tag_t iot = &pica_bus; + struct jazzio_attach_args *ja = aux; + bus_space_tag_t iot = ja->ja_bust; bus_space_handle_t ioh_d, ioh_c; - bus_addr_t addr; + bus_addr_t addr = ja->ja_addr; int res, ok = 1; - if(!BUS_MATCHNAME(ca, "pckbd")) + if (strcmp(ja->ja_name, "pckbd") != 0) return(0); - addr = (bus_addr_t)BUS_CVTADDR(ca); if (pckbc_is_console(iot, addr) == 0) { if (bus_space_map(iot, addr + KBDATAP, 1, 0, &ioh_d)) return (0); @@ -119,14 +117,13 @@ pckbc_jazzio_attach(parent, self, aux) struct device *parent, *self; void *aux; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; struct pckbc_jazzio_softc *jsc = (void *)self; struct pckbc_softc *sc = &jsc->sc_pckbc; struct pckbc_internal *t; - bus_space_tag_t iot = &pica_bus; + bus_space_tag_t iot = ja->ja_bust; bus_space_handle_t ioh_d, ioh_c; - bus_addr_t addr; - static struct confargs pms_ca = { "pms", 8, NULL, }; /* XXX */ + bus_addr_t addr = ja->ja_addr; sc->intr_establish = pckbc_jazzio_intr_establish; @@ -135,11 +132,9 @@ pckbc_jazzio_attach(parent, self, aux) * * XXX handcrafting "aux" slot... */ - pms_ca.ca_bus = ca->ca_bus; - jsc->sc_ca[PCKBC_KBD_SLOT] = ca; - jsc->sc_ca[PCKBC_AUX_SLOT] = &pms_ca; + jsc->sc_intr[PCKBC_KBD_SLOT] = ja->ja_intr; + jsc->sc_intr[PCKBC_AUX_SLOT] = 8; /* XXX */ - addr = (bus_addr_t)BUS_CVTADDR(ca); if (pckbc_is_console(iot, addr)) { t = &pckbc_consdata; ioh_d = t->t_ioh_d; @@ -177,5 +172,5 @@ pckbc_jazzio_intr_establish(sc, slot) { struct pckbc_jazzio_softc *jsc = (void *) sc; - BUS_INTR_ESTABLISH(jsc->sc_ca[slot], pckbcintr, sc); + jazzio_intr_establish(jsc->sc_intr[slot], pckbcintr, sc); } diff --git a/sys/arch/arc/pica/pica.h b/sys/arch/arc/jazz/pica.h similarity index 99% rename from sys/arch/arc/pica/pica.h rename to sys/arch/arc/jazz/pica.h index 899d26928960..ff76dd19ebb1 100644 --- a/sys/arch/arc/pica/pica.h +++ b/sys/arch/arc/jazz/pica.h @@ -1,4 +1,4 @@ -/* $NetBSD: pica.h,v 1.4 2000/01/23 21:02:00 soda Exp $ */ +/* $NetBSD: pica.h,v 1.1 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: pica.h,v 1.4 1996/09/14 15:58:28 pefo Exp $ */ /* diff --git a/sys/arch/arc/pica/rd94.h b/sys/arch/arc/jazz/rd94.h similarity index 98% rename from sys/arch/arc/pica/rd94.h rename to sys/arch/arc/jazz/rd94.h index ba3c748c6672..0e47912d79ed 100644 --- a/sys/arch/arc/pica/rd94.h +++ b/sys/arch/arc/jazz/rd94.h @@ -1,4 +1,4 @@ -/* $NetBSD: rd94.h,v 1.2 2000/06/09 05:33:06 soda Exp $ */ +/* $NetBSD: rd94.h,v 1.1 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: pica.h,v 1.4 1996/09/14 15:58:28 pefo Exp $ */ /* diff --git a/sys/arch/arc/dev/scsi.h b/sys/arch/arc/jazz/scsi.h similarity index 99% rename from sys/arch/arc/dev/scsi.h rename to sys/arch/arc/jazz/scsi.h index 6849ccc97bd9..4883468de377 100644 --- a/sys/arch/arc/dev/scsi.h +++ b/sys/arch/arc/jazz/scsi.h @@ -1,4 +1,4 @@ -/* $NetBSD: scsi.h,v 1.4 2000/01/23 21:01:54 soda Exp $ */ +/* $NetBSD: scsi.h,v 1.1 2000/12/24 09:25:29 ur Exp $ */ /* $OpenBSD: scsi.h,v 1.2 1997/04/19 17:19:54 pefo Exp $ */ /* diff --git a/sys/arch/arc/jazz/vga_jazzio.c b/sys/arch/arc/jazz/vga_jazzio.c index 277770134a89..605b39484006 100644 --- a/sys/arch/arc/jazz/vga_jazzio.c +++ b/sys/arch/arc/jazz/vga_jazzio.c @@ -1,4 +1,4 @@ -/* $NetBSD: vga_jazzio.c,v 1.3 2000/08/14 20:14:50 thorpej Exp $ */ +/* $NetBSD: vga_jazzio.c,v 1.4 2000/12/24 09:25:30 ur Exp $ */ /* NetBSD: vga_isa.c,v 1.3 1998/06/12 18:45:48 drochner Exp */ /* @@ -41,7 +41,8 @@ #include #include #include -#include +#include +#include #include #include @@ -106,10 +107,10 @@ vga_jazzio_match(parent, match, aux) struct cfdata *match; void *aux; { - struct confargs *ca = aux; + struct jazzio_attach_args *ja = aux; bus_space_tag_t iot, memt; - if(!BUS_MATCHNAME(ca, "vga")) + if(strcmp(ja->ja_name, "vga") != 0) return(0); vga_jazzio_init_tag(&iot, &memt); diff --git a/sys/arch/arc/pci/necpb.c b/sys/arch/arc/pci/necpb.c index 900673120b7a..9af17d050ad6 100644 --- a/sys/arch/arc/pci/necpb.c +++ b/sys/arch/arc/pci/necpb.c @@ -1,4 +1,4 @@ -/* $NetBSD: necpb.c,v 1.5 2000/11/09 06:15:27 thorpej Exp $ */ +/* $NetBSD: necpb.c,v 1.6 2000/12/24 09:25:30 ur Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -89,7 +89,7 @@ #include #include -#include +#include #include int necpbmatch __P((struct device *, struct cfdata *, void *));