Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/dnard/ofw Populate ofw subtree.



details:   https://anonhg.NetBSD.org/src/rev/bc6d085f1aac
branches:  trunk
changeset: 509638:bc6d085f1aac
user:      matt <matt%NetBSD.org@localhost>
date:      Wed May 09 16:08:43 2001 +0000

description:
Populate ofw subtree.

diffstat:

 sys/arch/dnard/ofw/com_ofisa_consolehack.c |    80 +
 sys/arch/dnard/ofw/com_ofisa_machdep.c     |    87 +
 sys/arch/dnard/ofw/if_cs_ofisa_machdep.c   |   186 ++
 sys/arch/dnard/ofw/lpt_ofisa_machdep.c     |    90 +
 sys/arch/dnard/ofw/ofisa_machdep.c         |    94 +
 sys/arch/dnard/ofw/ofisascr.c              |   106 +
 sys/arch/dnard/ofw/ofrom.c                 |   222 +++
 sys/arch/dnard/ofw/oftodclock.c            |   284 ++++
 sys/arch/dnard/ofw/ofw.c                   |  1957 ++++++++++++++++++++++++++++
 sys/arch/dnard/ofw/ofw_irq.S               |   684 +++++++++
 sys/arch/dnard/ofw/ofw_irqhandler.c        |   521 +++++++
 sys/arch/dnard/ofw/ofwgencfg_clock.c       |   204 ++
 sys/arch/dnard/ofw/ofwgencfg_machdep.c     |   280 ++++
 sys/arch/dnard/ofw/openfirm.c              |   723 ++++++++++
 sys/arch/dnard/ofw/vga_ofbus.c             |   104 +
 sys/arch/dnard/ofw/wdc_ofisa_machdep.c     |    86 +
 16 files changed, 5708 insertions(+), 0 deletions(-)

diffs (truncated from 5772 to 300 lines):

diff -r 08f27ceed1bd -r bc6d085f1aac sys/arch/dnard/ofw/com_ofisa_consolehack.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/dnard/ofw/com_ofisa_consolehack.c        Wed May 09 16:08:43 2001 +0000
@@ -0,0 +1,80 @@
+/*     $NetBSD: com_ofisa_consolehack.c,v 1.1 2001/05/09 16:08:43 matt Exp $   */
+
+/*
+ * 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/systm.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 <machine/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);
+}
diff -r 08f27ceed1bd -r bc6d085f1aac sys/arch/dnard/ofw/com_ofisa_machdep.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/dnard/ofw/com_ofisa_machdep.c    Wed May 09 16:08:43 2001 +0000
@@ -0,0 +1,87 @@
+/*     $NetBSD: com_ofisa_machdep.c,v 1.1 2001/05/09 16:08:43 matt 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->oba.oba_phandle, "device_type",
+                     type, sizeof(type)) > 0 &&
+                   strcmp(type, "serial") == 0 &&
+                   OF_getprop(aa->oba.oba_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 */
diff -r 08f27ceed1bd -r bc6d085f1aac sys/arch/dnard/ofw/if_cs_ofisa_machdep.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/dnard/ofw/if_cs_ofisa_machdep.c  Wed May 09 16:08:43 2001 +0000
@@ -0,0 +1,186 @@
+/*     $NetBSD: if_cs_ofisa_machdep.c,v 1.1 2001/05/09 16:08:43 matt 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.
+ */
+
+/*
+ * WARNING: THIS FILE IS VERY SHARK-SPECIFIC!
+ */
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
+#include <net/if_media.h>
+
+#include <machine/bus.h>
+#include <machine/intr.h>
+
+#include <dev/ofw/openfirm.h>
+#include <dev/isa/isavar.h>
+#include <dev/ofisa/ofisavar.h>
+
+#include <dev/isa/cs89x0reg.h>
+#include <dev/isa/cs89x0var.h>
+
+#ifdef COMPAT_OLD_OFW
+
+int
+cs_ofisa_md_match(parent, cf, aux)
+       struct device *parent;
+       struct cfdata *cf;
+       void *aux;
+{
+       struct ofisa_attach_args *aa = aux;
+       char type[64];
+       char name[64];
+       char model[64];
+       char compatible[64];
+       int rv;
+
+       rv = 0;
+       if (1) {                /* XXX old firmware compat enabled */
+               /* At a minimum, must match type and name properties. */
+               if (OF_getprop(aa->oba.oba_phandle, "device_type", type,
+                   sizeof(type)) < 0 || strcmp(type, "network") != 0 ||
+                   OF_getprop(aa->oba.oba_phandle, "name", name,
+                   sizeof(name)) < 0 || strcmp(name, "ethernet") != 0)
+                       return (0);
+
+               /* Full match on model. */
+               if (OF_getprop(aa->oba.oba_phandle, "model", model,
+                   sizeof(model)) > 0 && strcmp(model, "CS8900") == 0)
+                       rv = 3;
+
+               /* Check for compatible match. */
+               if (OF_getprop(aa->oba.oba_phandle, "compatible", compatible,
+                   sizeof(compatible)) > 0 && pmatch(compatible, "*CS8900*",
+                   NULL) > 0)
+                       rv = 2;
+       }
+       return (rv);
+}
+
+int
+cs_ofisa_md_reg_fixup(parent, self, aux, descp, ndescs, ndescsfilled)
+       struct device *parent, *self;
+       void *aux;
+       struct ofisa_reg_desc *descp;
+       int ndescs, ndescsfilled;
+{
+
+       if (1) {                /* XXX old firmware compat enabled */
+               /* We can't provide it. */
+               if (ndescs != 2)
+                       return (ndescsfilled);
+
+               /* Firmware provided it. */
+               if (ndescsfilled == 2)
+                       return (ndescsfilled);
+
+               descp[0].type = OFISA_REG_TYPE_IO;
+               descp[0].addr = 0x300;
+               descp[0].len  = CS8900_IOSIZE;
+
+               descp[1].type = OFISA_REG_TYPE_MEM;
+               descp[1].addr = 0xd0000;
+               descp[1].len  = 4096;



Home | Main Index | Thread Index | Old Index