Permalink
Browse files

Import sys/arch/arm32/{shark,ofw} bits of the Digital Network Appliance

Reference Design NetBSD source code, obtained from the pages under
http://www.research.digital.com/SRC/iag .  Some of this code (badly)
needs to be cleaned up, and as-is it doesn't compile.  However, getting
it in the tree is a start.
  • Loading branch information...
1 parent a2bca40 commit 3dca576b78ce326325e9b936cd743e812f8c11f5 cgd committed May 1, 1998
Showing with 25,023 additions and 0 deletions.
  1. +78 −0 sys/arch/arm32/ofw/com_ofisa_consolehack.c
  2. +87 −0 sys/arch/arm32/ofw/com_ofisa_machdep.c
  3. +88 −0 sys/arch/arm32/ofw/lpt_ofisa_machdep.c
  4. +94 −0 sys/arch/arm32/ofw/ofisa_machdep.c
  5. +62 −0 sys/arch/arm32/ofw/ofisa_machdep.h
  6. +131 −0 sys/arch/arm32/ofw/ofisacs.c
  7. +127 −0 sys/arch/arm32/ofw/ofisaess.c
  8. +123 −0 sys/arch/arm32/ofw/ofisapc.c
  9. +131 −0 sys/arch/arm32/ofw/ofisascr.c
  10. +219 −0 sys/arch/arm32/ofw/ofrom.c
  11. +284 −0 sys/arch/arm32/ofw/oftodclock.c
  12. +2,047 −0 sys/arch/arm32/ofw/ofw.c
  13. +671 −0 sys/arch/arm32/ofw/ofw_irq.S
  14. +549 −0 sys/arch/arm32/ofw/ofw_irqhandler.c
  15. +402 −0 sys/arch/arm32/ofw/ofwgencfg_clock.c
  16. +388 −0 sys/arch/arm32/ofw/ofwgencfg_machdep.c
  17. +694 −0 sys/arch/arm32/ofw/openfirm.c
  18. +86 −0 sys/arch/arm32/ofw/wdc_ofisa_machdep.c
  19. +47 −0 sys/arch/arm32/shark/display.h
  20. +148 −0 sys/arch/arm32/shark/fiq.S
  21. +50 −0 sys/arch/arm32/shark/fiq.h
  22. +195 −0 sys/arch/arm32/shark/hat.c
  23. +89 −0 sys/arch/arm32/shark/hat.h
  24. +408 −0 sys/arch/arm32/shark/i8042.c
  25. +295 −0 sys/arch/arm32/shark/i8042reg.h
  26. +31 −0 sys/arch/arm32/shark/kbdreg.h
  27. +591 −0 sys/arch/arm32/shark/lpt.c
  28. +358 −0 sys/arch/arm32/shark/ns87307.c
  29. +424 −0 sys/arch/arm32/shark/ns87307reg.h
  30. +3,792 −0 sys/arch/arm32/shark/pccons.c
  31. +983 −0 sys/arch/arm32/shark/pms.c
  32. +717 −0 sys/arch/arm32/shark/profile.c
  33. +4,230 −0 sys/arch/arm32/shark/scr.c
  34. +1 −0 sys/arch/arm32/shark/scr.h
  35. +772 −0 sys/arch/arm32/shark/sequoia.c
  36. +5,129 −0 sys/arch/arm32/shark/sequoia.h
  37. +502 −0 sys/arch/arm32/shark/shark_machdep.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and conditions.
+ * Subject to these conditions, you may download, copy, install,
+ * use, modify and distribute this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Digital Equipment Corporation. Neither the "Digital Equipment
+ * Corporation" name nor any trademark or logo of Digital Equipment
+ * Corporation may be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied
+ * warranties, including but not limited to, any implied warranties
+ * of merchantability, fitness for a particular purpose, or
+ * non-infringement are disclaimed. In no event shall DIGITAL be
+ * liable for any damages whatsoever, and in particular, DIGITAL
+ * shall not be liable for special, indirect, consequential, or
+ * incidental damages or damages for lost profits, loss of
+ * revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise,
+ * even if advised of the possibility of such damage.
+ */
+
+/*
+ * OFW Attachment for 'com' serial driver
+ */
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/socket.h>
+#include <sys/tty.h>
+
+#include <machine/intr.h>
+#include <machine/bus.h>
+
+#include <dev/ofw/openfirm.h>
+
+#include <dev/ic/comreg.h>
+#include <dev/ic/comvar.h>
+
+#include <arm32/isa/isa_machdep.h> /* XXX for space tags */
+
+#include <dev/cons.h>
+
+void
+comcnprobe(cp)
+ struct consdev *cp;
+{
+
+#ifdef COMCONSOLE
+ cp->cn_pri = CN_REMOTE; /* Force a serial port console */
+#else
+ cp->cn_pri = CN_NORMAL;
+#endif
+}
+
+void
+comcninit(cp)
+ struct consdev *cp;
+{
+
+#ifndef CONMODE
+#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
+#endif
+
+ if (comcnattach(&isa_io_bs_tag, 0x3f8, 9600, COM_FREQ, CONMODE))
+ panic("can't init serial console @%x", 0x3f8);
+}
@@ -0,0 +1,87 @@
+/* $NetBSD: com_ofisa_machdep.c,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
+
+/*
+ * Copyright 1998
+ * Digital Equipment Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and conditions.
+ * Subject to these conditions, you may download, copy, install,
+ * use, modify and distribute this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Digital Equipment Corporation. Neither the "Digital Equipment
+ * Corporation" name nor any trademark or logo of Digital Equipment
+ * Corporation may be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied
+ * warranties, including but not limited to, any implied warranties
+ * of merchantability, fitness for a particular purpose, or
+ * non-infringement are disclaimed. In no event shall DIGITAL be
+ * liable for any damages whatsoever, and in particular, DIGITAL
+ * shall not be liable for special, indirect, consequential, or
+ * incidental damages or damages for lost profits, loss of
+ * revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise,
+ * even if advised of the possibility of such damage.
+ */
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <machine/intr.h>
+
+#include <dev/ofw/openfirm.h>
+#include <dev/isa/isavar.h>
+#include <dev/ofisa/ofisavar.h>
+
+#ifdef COMPAT_OLD_OFW
+
+int
+com_ofisa_md_match(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ struct ofisa_attach_args *aa = aux;
+ char type[8];
+ char name[8];
+ int rv;
+
+ rv = 0;
+ if (1) { /* XXX old firmware compat enabled */
+ /* match type and name properties */
+ /* At a minimum, must match type and name properties. */
+ if (OF_getprop(aa->ofp.phandle, "device_type",
+ type, sizeof(type)) > 0 &&
+ strcmp(type, "serial") == 0 &&
+ OF_getprop(aa->ofp.phandle, "name", name,
+ sizeof(name)) > 0 &&
+ strcmp(name, "serial") == 0)
+ rv = 4;
+ }
+ return (rv);
+}
+
+int
+com_ofisa_md_intr_fixup(parent, self, aux, descp, ndescs, ndescsfilled)
+ struct device *parent, *self;
+ void *aux;
+ struct ofisa_intr_desc *descp;
+ int ndescs, ndescsfilled;
+{
+
+ if (1) /* XXX old firmware compat enabled */
+ if (ndescs > 0 && ndescsfilled > 0)
+ descp[0].share = IST_LEVEL;
+ return (ndescsfilled);
+}
+
+#endif /* COMPAT_OLD_OFW */
@@ -0,0 +1,88 @@
+/* $NetBSD: lpt_ofisa_machdep.c,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
+
+/*
+ * Copyright 1998
+ * Digital Equipment Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and conditions.
+ * Subject to these conditions, you may download, copy, install,
+ * use, modify and distribute this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Digital Equipment Corporation. Neither the "Digital Equipment
+ * Corporation" name nor any trademark or logo of Digital Equipment
+ * Corporation may be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied
+ * warranties, including but not limited to, any implied warranties
+ * of merchantability, fitness for a particular purpose, or
+ * non-infringement are disclaimed. In no event shall DIGITAL be
+ * liable for any damages whatsoever, and in particular, DIGITAL
+ * shall not be liable for special, indirect, consequential, or
+ * incidental damages or damages for lost profits, loss of
+ * revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise,
+ * even if advised of the possibility of such damage.
+ */
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <machine/intr.h>
+
+#include <dev/ofw/openfirm.h>
+#include <dev/isa/isavar.h>
+#include <dev/ofisa/ofisavar.h>
+
+#ifdef COMPAT_OLD_OFW
+
+int
+lpt_ofisa_md_match(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ struct ofisa_attach_args *aa = aux;
+ char type[8];
+ char name[8];
+ int rv;
+
+ rv = 0;
+ if (1) { /* XXX old firmware compat enabled */
+ /* match type and name properties */
+ if (OF_getprop(aa->ofp.phandle, "device_type",
+ type, sizeof(type)) > 0 &&
+ strcmp(type, "parallel") == 0 &&
+ OF_getprop(aa->ofp.phandle, "name", name,
+ sizeof(name)) > 0 &&
+ strcmp(name, "parallel") == 0)
+ rv = 4;
+ }
+ return (rv);
+}
+
+int
+lpt_ofisa_md_intr_fixup(parent, self, aux, descp, ndescs, ndescsfilled)
+ struct device *parent, *self;
+ void *aux;
+ struct ofisa_intr_desc *descp;
+ int ndescs, ndescsfilled;
+{
+
+ if (1) /* XXX old firmware compat enabled */
+ if (ndescs > 0 && ndescsfilled > 0) {
+ i87307PrinterConfig(&isa_io_bs_tag, descp[0].irq);
+ descp[0].share = IST_LEVEL;
+ }
+ return (ndescsfilled);
+}
+
+#endif /* COMPAT_OLD_OFW */
@@ -0,0 +1,94 @@
+/* $NetBSD: ofisa_machdep.c,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
+
+/*
+ * Copyright 1998
+ * Digital Equipment Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and conditions.
+ * Subject to these conditions, you may download, copy, install,
+ * use, modify and distribute this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions as
+ * they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ * Digital Equipment Corporation. Neither the "Digital Equipment
+ * Corporation" name nor any trademark or logo of Digital Equipment
+ * Corporation may be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied
+ * warranties, including but not limited to, any implied warranties
+ * of merchantability, fitness for a particular purpose, or
+ * non-infringement are disclaimed. In no event shall DIGITAL be
+ * liable for any damages whatsoever, and in particular, DIGITAL
+ * shall not be liable for special, indirect, consequential, or
+ * incidental damages or damages for lost profits, loss of
+ * revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise,
+ * even if advised of the possibility of such damage.
+ */
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <machine/intr.h>
+
+#include <dev/ofw/openfirm.h>
+#include <dev/isa/isavar.h>
+#include <dev/ofisa/ofisavar.h>
+
+int
+ofisa_get_isabus_data(phandle, iba)
+ int phandle;
+ struct isabus_attach_args *iba;
+{
+
+ iba->iba_iot = &isa_io_bs_tag;
+ iba->iba_memt = &isa_io_bs_tag;
+ iba->iba_dmat = NULL;
+ iba->iba_ic = NULL;
+
+ return (0);
+}
+
+int
+ofisa_ignore_child(pphandle, cphandle)
+ int pphandle, cphandle;
+{
+
+ return (0);
+}
+
+#ifdef COMPAT_OLD_OFW
+
+int
+ofisa_md_match(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ struct ofprobe *ofp = aux;
+ char type[8];
+ char name[8];
+ int rv;
+
+ rv = 0;
+ if (1) { /* XXX old firmware compat enabled */
+ /* match type and name properties */
+ if (OF_getprop(ofp->phandle, "device_type", type,
+ sizeof(type)) > 0 &&
+ strcmp(type, "isa") == 0 &&
+ OF_getprop(ofp->phandle, "name", name,
+ sizeof(name)) > 0 &&
+ strcmp(name, "isa") == 0)
+ rv = 4;
+ }
+ return (rv);
+}
+
+#endif /* COMPAT_OLD_OFW */
Oops, something went wrong.

0 comments on commit 3dca576

Please sign in to comment.