Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/dnard Make it possible to build a kernel that actua...



details:   https://anonhg.NetBSD.org/src/rev/4224c934fc7a
branches:  trunk
changeset: 519115:4224c934fc7a
user:      briggs <briggs%NetBSD.org@localhost>
date:      Tue Dec 11 06:00:16 2001 +0000

description:
Make it possible to build a kernel that actually compiles and runs on a shark.

diffstat:

 sys/arch/dnard/conf/GENERIC              |    8 +-
 sys/arch/dnard/conf/files.dnard          |    8 +-
 sys/arch/dnard/dnard/autoconf.c          |  113 ++++--------------------------
 sys/arch/dnard/dnard/conf.c              |   29 +++++++-
 sys/arch/dnard/dnard/scr.c               |   44 +++++++++++-
 sys/arch/dnard/ofw/consinit.c            |   60 ++++++++++++++++
 sys/arch/dnard/ofw/if_cs_ofisa_machdep.c |    6 +-
 sys/arch/dnard/ofw/vga_ofbus.c           |    6 +-
 8 files changed, 166 insertions(+), 108 deletions(-)

diffs (truncated from 403 to 300 lines):

diff -r 4e877598ca4c -r 4224c934fc7a sys/arch/dnard/conf/GENERIC
--- a/sys/arch/dnard/conf/GENERIC       Tue Dec 11 05:54:56 2001 +0000
+++ b/sys/arch/dnard/conf/GENERIC       Tue Dec 11 06:00:16 2001 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: GENERIC,v 1.5 2001/11/20 12:56:24 lukem Exp $
+#      $NetBSD: GENERIC,v 1.6 2001/12/11 06:00:16 briggs Exp $
 
 include        "arch/dnard/conf/std.dnard"
 
-#ident         "GENERIC-$Revision: 1.5 $"
+#ident         "GENERIC-$Revision: 1.6 $"
 
 # estimated number of users
 maxusers       32
@@ -168,8 +168,8 @@
 sd*            at atapibus? drive?
 
 # WSCONS @ OFW
-ofb*           at ofbus?
-wsdisplay*     at ofb?
+vga*           at ofbus?
+wsdisplay*     at vga?
 
 pckbc*         at ofisa?
 pckbd*         at pckbc?
diff -r 4e877598ca4c -r 4224c934fc7a sys/arch/dnard/conf/files.dnard
--- a/sys/arch/dnard/conf/files.dnard   Tue Dec 11 05:54:56 2001 +0000
+++ b/sys/arch/dnard/conf/files.dnard   Tue Dec 11 06:00:16 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.dnard,v 1.17 2001/11/28 10:21:13 lukem Exp $
+#      $NetBSD: files.dnard,v 1.18 2001/12/11 06:00:16 briggs Exp $
 #
 # First try for arm-specific configuration info
 #
@@ -41,6 +41,10 @@
 file   arch/dnard/ofw/openfirm.c
 file   arch/dnard/ofw/oftodclock.c
 
+# OFW console initialization
+file   arch/arm32/ofw/consinit.c               ofw
+file   dev/cninit.c                            ofw
+
 attach cpu at ofbus with cpu_ofbus
 file   arch/dnard/ofw/cpu_ofbus.c              cpu_ofbus
 
@@ -55,6 +59,7 @@
 include "dev/ofisa/files.ofisa"
 file   arch/dnard/ofw/ofisa_machdep.c          ofisa
 file   arch/dnard/ofw/com_ofisa_machdep.c      com_ofisa
+file   arch/arm32/ofw/com_ofisa_consolehack.c  com_ofisa       # XXX
 file   arch/dnard/ofw/if_cs_ofisa_machdep.c    cs_ofisa
 file   arch/dnard/ofw/lpt_ofisa_machdep.c      lpt_ofisa
 file   arch/dnard/ofw/wdc_ofisa_machdep.c      wdc_ofisa
@@ -136,5 +141,6 @@
 
 # Include WSCONS stuff
 include "dev/wscons/files.wscons"
+include        "dev/wsfont/files.wsfont"
 include "dev/rasops/files.rasops"
 include "dev/pckbc/files.pckbc"
diff -r 4e877598ca4c -r 4224c934fc7a sys/arch/dnard/dnard/autoconf.c
--- a/sys/arch/dnard/dnard/autoconf.c   Tue Dec 11 05:54:56 2001 +0000
+++ b/sys/arch/dnard/dnard/autoconf.c   Tue Dec 11 06:00:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.3 2001/12/02 22:54:26 bouyer Exp $      */
+/*     $NetBSD: autoconf.c,v 1.4 2001/12/11 06:00:16 briggs Exp $      */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -150,6 +150,20 @@
        (void)spl0();
 }
 
+#include "wd.h"
+#include "cd.h"
+#include "sd.h"
+
+#if NWD > 0 || NSD > 0 || NCD > 0
+#include <dev/ata/atavar.h>
+#include <dev/ata/wdvar.h>
+#endif
+#if NSD > 0 || NCD > 0
+#include <dev/scsipi/scsi_all.h>
+#include <dev/scsipi/scsipi_all.h>
+#include <dev/scsipi/scsipiconf.h>
+#endif
+
 void
 device_register(struct device *dev, void *aux)
 {
@@ -219,9 +233,9 @@
                struct scsipibus_attach_args *sa = aux;
                char *cp = strchr(boot_component, '@');
                if (cp != NULL
-                   && sa->sa_sc_link->type == BUS_ATAPI
-                   && sa->sa_sc_link->scsipi_atapi.channel == 0
-                   && sa->sa_sc_link->scsipi_atapi.drive == strtoul(cp+1, NULL, 16)) {
+                   && sa->sa_periph->periph_channel->chan_bustype->bustype_type == SCSIPI_BUSTYPE_ATAPI
+                   && sa->sa_periph->periph_channel->chan_channel == 0
+                   && sa->sa_periph->periph_target == strtoul(cp+1, NULL, 16)) {
                        booted_device = dev;
                }
                return;
@@ -242,94 +256,3 @@
                }
        }
 }
-
-#include "ofb.h"
-#include "vga_ofbus.h"
-#include "com.h"
-
-#if (NCOM > 0)
-#ifndef CONSPEED
-#define        CONSPEED        9600
-#endif
-#ifndef CONMODE
-#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
-#endif
-
-int comcnmode = CONMODE;
-#endif /* (NCOM > 0) */
-
-void
-cninit(void)
-{
-       int chosen, stdin, stdout, node;
-       char type[16], name[16];
-
-       chosen = OF_finddevice("/chosen");
-       if (chosen == 0)
-               goto nocons;
-       
-       if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout))
-           != sizeof(stdout))
-               goto nocons;
-
-       node = OF_instance_to_package(stdout);
-       memset(type, 0, sizeof(type));
-       if (OF_getprop(node, "device_type", type, sizeof(type)) == -1)
-               goto nocons;
-
-       if (strcmp(type, "display") == 0) {
-#if NOFB > 0
-               if (!ofb_cnattach())
-                       goto dokbd;
-#endif
-#if NVGA_OFBUS > 0
-               if (!vga_ofbus_cnattach(node, &isa_io_bs_tag, &isa_mem_bs_tag))
-                       goto dokbd;
-#endif
-               return;
-       dokbd:
-
-               /*
-                * We must determine which keyboard type we have.
-                */
-               if (OF_getprop(chosen, "stdin", &stdin, sizeof(stdin))
-                   != sizeof(stdin)) {
-                       printf("WARNING: no `stdin' property in /chosen\n");
-                       return;
-               }
-
-               node = OF_instance_to_package(stdin);
-               memset(name, 0, sizeof(name));
-               OF_getprop(node, "name", name, sizeof(name));
-               if (strcmp(name, "keyboard") != 0) {
-                       printf("WARNING: stdin is not a keyboard: %s\n", name);
-                       return;
-               }
-
-#if (NPCKBC > 0)
-               pckbc_cnattach(&isa_io_bs_tag, IO_KBD, KBCMDP, PCKBC_KBD_SLOT);
-#endif
-               return;
-       }
-
-#if NCOM > 0
-       if (strcmp(type, "serial") == 0) {
-               int regs[3];
-               int freq;
-               if (OF_getprop(node, "reg", regs, sizeof(regs)) != sizeof(regs))
-                       goto nocom;
-               if (OF_getprop(node, "clock-frequency", &freq, sizeof(freq)) 
-                   != sizeof(freq))
-                       goto nocom;
-               if (!comcnattach(&isa_io_bs_tag, regs[1], CONSPEED, freq,
-                   comcnmode))
-                       return;
-         nocom:
-               panic("can't init serial console (hanlde=%#x)", node);
-               return;
-       }
-#endif
-
-nocons:
-       return;
-}
diff -r 4e877598ca4c -r 4224c934fc7a sys/arch/dnard/dnard/conf.c
--- a/sys/arch/dnard/dnard/conf.c       Tue Dec 11 05:54:56 2001 +0000
+++ b/sys/arch/dnard/dnard/conf.c       Tue Dec 11 06:00:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.2 2001/07/29 00:34:44 matt Exp $    */
+/*     $NetBSD: conf.c,v 1.3 2001/12/11 06:00:17 briggs Exp $  */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -414,3 +414,30 @@
                return (NODEV);
        return (makedev(blkmaj, minor(dev)));
 }
+
+/*
+ * This entire table could be autoconfig()ed but that would mean that
+ * the kernel's idea of the console would be out of sync with that of
+ * the standalone boot.  I think it best that they both use the same
+ * known algorithm unless we see a pressing need otherwise.
+ */
+
+#include <dev/cons.h>
+
+cons_decl(com);   
+cons_decl(ofcons_);
+cons_decl(pc);
+
+struct consdev constab[] = {
+#if (NCOM > 0)
+       cons_init(com),
+#endif
+#if (NPC > 0)
+       cons_init(pc),
+#elif (NOFCONS > 0)                    /* XXX should work together */
+       cons_init(ofcons_),
+#endif
+       { 0 },
+};
+                           
+/* End of conf.c */
diff -r 4e877598ca4c -r 4224c934fc7a sys/arch/dnard/dnard/scr.c
--- a/sys/arch/dnard/dnard/scr.c        Tue Dec 11 05:54:56 2001 +0000
+++ b/sys/arch/dnard/dnard/scr.c        Tue Dec 11 06:00:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scr.c,v 1.3 2001/11/23 19:36:49 thorpej Exp $  */
+/*     $NetBSD: scr.c,v 1.4 2001/12/11 06:00:17 briggs Exp $   */
 
 /*
  * Copyright 1997
@@ -1089,6 +1089,48 @@
 **++
 **  FUNCTIONAL DESCRIPTION:
 **
+**      scrpoll
+**
+**      not supported
+**
+**  FORMAL PARAMETERS:
+**      
+**      dev  - input : Device identifier consisting of major and minor numbers.
+**      events -input: Events to poll for
+**      p    - input : Process requesting the poll.
+**
+**  IMPLICIT INPUTS:
+**
+**
+**  IMPLICIT OUTPUTS:
+**
+**      none
+**
+**  FUNCTION VALUE:
+**
+**      Returns ENODEV
+**
+**  SIDE EFFECTS:
+**
+**      none
+**--
+*/
+int
+scrpoll(dev, events, p)
+dev_t       dev;
+int         events;
+struct proc *p;
+{
+    return ENODEV;
+} 
+
+
+
+
+/*
+**++
+**  FUNCTIONAL DESCRIPTION:
+**
 **     scrstop
 **
 **     should not be called
diff -r 4e877598ca4c -r 4224c934fc7a sys/arch/dnard/ofw/consinit.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/dnard/ofw/consinit.c     Tue Dec 11 06:00:16 2001 +0000
@@ -0,0 +1,60 @@



Home | Main Index | Thread Index | Old Index