Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/next68k/stand/boot Pull up following revision(s)...



details:   https://anonhg.NetBSD.org/src/rev/a3db738e002d
branches:  netbsd-9
changeset: 373614:a3db738e002d
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 22 12:09:16 2023 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1600):

        sys/arch/next68k/stand/boot/en.c: revision 1.20
        sys/arch/next68k/stand/boot/scsi.c: revision 1.13
        sys/arch/next68k/stand/boot/scsi.c: revision 1.14
        sys/arch/next68k/stand/boot/conf.c: revision 1.8
        sys/arch/next68k/stand/boot/sd.c: revision 1.17
        sys/arch/next68k/stand/boot/samachdep.h: revision 1.1
        sys/arch/next68k/stand/boot/samachdep.h: revision 1.2
        sys/arch/next68k/stand/boot/rtc.c: revision 1.8
        sys/arch/next68k/stand/boot/machdep.c: revision 1.9
        sys/arch/next68k/stand/boot/boot.c: revision 1.14
        sys/arch/next68k/stand/boot/boot.c: revision 1.15
        sys/arch/next68k/stand/boot/scsivar.h: revision 1.2
        sys/arch/next68k/stand/boot/devopen.c: revision 1.8
        sys/arch/next68k/stand/boot/version: revision 1.7

Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

Replace DELAY() with one in hp300 bootloader and adjust cpuspeed counts.

Fix boot failure on my ancient Seagate ST52160N drive.
It looks some of such old drives can't respond to SCSI
test-unit-ready command without proper wait after SCSI bus reset.

Bump version again to denote a fix.

XXX we should re-evaluate cpuspeed counts for DELAY() in bootloaders
    (where cache is disabled) on other m68k ports, hp300 and luna68k etc.

Actually bump version (missed in the previous commit).

diffstat:

 sys/arch/next68k/stand/boot/boot.c      |  23 ++++-----
 sys/arch/next68k/stand/boot/conf.c      |  12 +---
 sys/arch/next68k/stand/boot/devopen.c   |   8 +-
 sys/arch/next68k/stand/boot/en.c        |   6 +-
 sys/arch/next68k/stand/boot/machdep.c   |   7 +-
 sys/arch/next68k/stand/boot/rtc.c       |   9 +--
 sys/arch/next68k/stand/boot/samachdep.h |  77 +++++++++++++++++++++++++++++++++
 sys/arch/next68k/stand/boot/scsi.c      |  20 ++------
 sys/arch/next68k/stand/boot/scsivar.h   |   5 +-
 sys/arch/next68k/stand/boot/sd.c        |  24 ++++++---
 sys/arch/next68k/stand/boot/version     |   3 +-
 11 files changed, 127 insertions(+), 67 deletions(-)

diffs (truncated from 475 to 300 lines):

diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/boot.c
--- a/sys/arch/next68k/stand/boot/boot.c        Fri Feb 17 17:42:21 2023 +0000
+++ b/sys/arch/next68k/stand/boot/boot.c        Wed Feb 22 12:09:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.12.22.1 2023/02/15 19:28:29 martin Exp $    */
+/*     $NetBSD: boot.c,v 1.12.22.2 2023/02/22 12:09:16 martin Exp $    */
 /*
  * Copyright (c) 1994 Rolf Grossmann
  * All rights reserved.
@@ -34,17 +34,17 @@
 
 #include <lib/libsa/stand.h>
 #include <lib/libsa/loadfile.h>
+#include <lib/libsa/dev_net.h>
 #include <lib/libkern/libkern.h>
 
 #include <machine/cpu.h>        /* for NEXT_RAMBASE */
 
 #include <next68k/next68k/nextrom.h>
 
+#include "samachdep.h"
+
 #define KERN_LOADADDR NEXT_RAMBASE
 
-extern int errno;
-
-extern char *mg;
 #define        MON(type, off) (*(type *)((u_int) (mg) + off))
 
 int devparse(const char *, int *, char *, char *, char *, char **);
@@ -56,18 +56,12 @@
  * Boot device is derived from PROM provided information.
  */
 
-extern char bootprog_rev[];
-extern char bootprog_name[];
-extern int build;
 #define KNAMEN 100
 char kernel[KNAMEN];
 int entry_point;               /* return value filled in by machdep_start */
+int cpuspeed = MHZ_33;         /* assume fastest 33 MHz for sanity */
 int turbo;
 
-extern void rtc_init(void);
-
-extern int try_bootp;
-
 volatile int qq;
 
 int
@@ -86,10 +80,13 @@
        machine = MON(char, MG_machine_type);
        if (machine == NeXT_TURBO_MONO ||
            machine == NeXT_TURBO_COLOR ||
-           machine == NeXT_CUBE_TURBO)
+           machine == NeXT_CUBE_TURBO) {
                turbo = 1;
-       else
+               cpuspeed = MHZ_33;
+       } else {
                turbo = 0;
+               cpuspeed = MHZ_25;
+       }
 
        memset(marks, 0, sizeof(marks));
        printf(">> %s BOOT [%s #%d]\n", bootprog_name, bootprog_rev, build);
diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/conf.c
--- a/sys/arch/next68k/stand/boot/conf.c        Fri Feb 17 17:42:21 2023 +0000
+++ b/sys/arch/next68k/stand/boot/conf.c        Wed Feb 22 12:09:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.7 2005/12/11 12:18:29 christos Exp $        */
+/*     $NetBSD: conf.c,v 1.7.170.1 2023/02/22 12:09:16 martin Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -45,21 +45,15 @@
 #include <netif.h>
 #include <dev_net.h>
 
+#include "samachdep.h"
+
 /*
  * Device configuration
  */
 
-extern int     sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
-extern int     sdopen(struct open_file *, ...);
-extern int     sdclose(struct open_file *);
 #define        sdioctl noioctl
 
-/* ### now from libsa
-extern int     enstrategy(void *, int, daddr_t, size_t, void *, size_t *);
-extern int     enopen(struct open_file *, ...);
-extern int     enclose(struct open_file *);
 #define        enioctl noioctl
-*/
 
 struct devsw devsw[] = {
        { "sd", sdstrategy,     sdopen, sdclose,        sdioctl },
diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/devopen.c
--- a/sys/arch/next68k/stand/boot/devopen.c     Fri Feb 17 17:42:21 2023 +0000
+++ b/sys/arch/next68k/stand/boot/devopen.c     Wed Feb 22 12:09:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.6.32.1 2023/02/12 12:22:44 martin Exp $  */
+/*     $NetBSD: devopen.c,v 1.6.32.2 2023/02/22 12:09:16 martin Exp $  */
 /*
  * Copyright (c) 1994 Rolf Grossmann
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include <lib/libkern/libkern.h>
 
 int devlookup(const char *, int);
-int devparse(const char *, int *, char *, char *, char *, char **);
+int devparse(const char *, int *, int *, int *, int *, char **);
 
 int
 devlookup(const char *d, int len)
@@ -64,7 +64,7 @@
  */
 int
 devparse(const char *fname, int *dev,
-        char *count, char *lun, char *part, char **file)
+        int *count, int *lun, int *part, char **file)
 {
     int i;
     const char *s, *args[3];
@@ -120,7 +120,7 @@
 {
     int error;
     int dev;
-    char count, lun, part;
+    int count, lun, part;
     struct devsw *dp;
 
     dev   = 0; /* default device is first in table (usually scsi disk) */
diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/en.c
--- a/sys/arch/next68k/stand/boot/en.c  Fri Feb 17 17:42:21 2023 +0000
+++ b/sys/arch/next68k/stand/boot/en.c  Wed Feb 22 12:09:16 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: en.c,v 1.19 2018/03/08 03:12:02 mrg Exp $        */
+/*      $NetBSD: en.c,v 1.19.6.1 2023/02/22 12:09:16 martin Exp $        */
 /*
  * Copyright (c) 1996 Rolf Grossmann
  * All rights reserved.
@@ -37,6 +37,7 @@
 #include <next68k/next68k/nextrom.h>
 #include "enreg.h"
 #include "dmareg.h"
+#include "samachdep.h"
 
 #include <stand.h>
 #include <netif.h>
@@ -45,7 +46,6 @@
 
 #include <lib/libkern/libkern.h>
 
-extern char *mg;
 #define        MON(type, off) (*(type *)((u_int) (mg) + off))
 
 #define PRINTF(x) printf x;
@@ -80,8 +80,6 @@
        en_ifs, sizeof(en_ifs) / sizeof(en_ifs[0])
 };
 
-extern int turbo;
-
 /* ### int netdev_sock;
 static int open_count; */
 
diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/machdep.c
--- a/sys/arch/next68k/stand/boot/machdep.c     Fri Feb 17 17:42:21 2023 +0000
+++ b/sys/arch/next68k/stand/boot/machdep.c     Wed Feb 22 12:09:16 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.7.102.1 2023/02/12 12:22:44 martin Exp $ */
+/*     $NetBSD: machdep.c,v 1.7.102.2 2023/02/22 12:09:16 martin Exp $ */
 /*
  * Copyright (c) 1998 Darrin Jewell
  * Copyright (c) 1994 Rolf Grossmann
@@ -35,12 +35,12 @@
 #include <stand.h>
 #include <next68k/next68k/nextrom.h>
 
+#include "samachdep.h"
+
 char *mg;
 
 #define        MON(type, off) (*(type *)((u_int) (mg) + off))
 
-extern int entry_point;
-
 #ifdef DEBUG
 int debug = 1;
 #else
@@ -86,7 +86,6 @@
 __dead void
 _rtt(void)
 {
-       extern __dead void _halt(void);
 
        printf("Press any key to halt.\n");
        getchar();
diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/rtc.c
--- a/sys/arch/next68k/stand/boot/rtc.c Fri Feb 17 17:42:21 2023 +0000
+++ b/sys/arch/next68k/stand/boot/rtc.c Wed Feb 22 12:09:16 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rtc.c,v 1.6.70.1 2023/02/12 12:22:44 martin Exp $        */
+/*      $NetBSD: rtc.c,v 1.6.70.2 2023/02/22 12:09:16 martin Exp $        */
 /*
  * Copyright (c) 1997 Rolf Grossmann
  * All rights reserved.
@@ -35,12 +35,9 @@
 #include <lib/libsa/stand.h>
 #include <lib/libsa/net.h>
 
-u_char rtc_read(u_char);
-void rtc_init(void);
+#include "samachdep.h"
 
-
-/* ### where shall I put this definition? */
-#define        DELAY(n)        { register int N = (n); while (--N > 0); }
+u_char rtc_read(u_char);
 
 static volatile u_int *scr2 = (u_int *)NEXT_P_SCR2_CON;
 static u_char new_clock;
diff -r 3d000f7740b0 -r a3db738e002d sys/arch/next68k/stand/boot/samachdep.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/next68k/stand/boot/samachdep.h   Wed Feb 22 12:09:16 2023 +0000
@@ -0,0 +1,77 @@
+/*     $NetBSD: samachdep.h,v 1.2.4.2 2023/02/22 12:09:16 martin Exp $ */
+
+/*
+ * Copyright (c) 1982, 1990, 1993
+ *     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. 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.
+ *
+ *     @(#)samachdep.h 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/param.h>
+#include <lib/libsa/stand.h>
+
+/* boot.c */
+extern int entry_point;
+extern int cpuspeed;
+extern int turbo;
+
+/* en.c */
+int enstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+int enopen(struct open_file *, ...);
+int enclose(struct open_file *);
+
+/* machdep.c */
+extern char *mg;
+
+/* rtc.c */
+void rtc_init(void);
+
+/* sd.c */
+int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+int sdopen(struct open_file *, ...);
+int sdclose(struct open_file *);
+
+/* srt0.S */
+__dead void _halt(void);
+
+/* vers.c (generated by sys/conf/newvers_stand.sh) */
+extern char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
+
+/* build.c (generated by ${.CURDIR}/newvers.sh) */
+extern int build;
+
+/* delay constants; note all CPU cache is turned off here */
+#define MHZ_25         3
+#define MHZ_33         4
+
+#define DELAY(n)                                                       \



Home | Main Index | Thread Index | Old Index