Port-sgimips archive

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

Re: port-sgimips/53539: irisboot (I named) Yet another sgimips bootloader



Dear Tsutsui-san,

Happy New Year!

Sorry for replying so late.

I fixed the points you pointed out. Please check it again.

--------------------------------------------------------------
diff -Naru NetBSD_irisboot.orig/common/iris_disk.c
NetBSD_irisboot/common/iris_disk.c
--- NetBSD_irisboot.orig/common/iris_disk.c 2018-12-31 15:20:01.908811938 +0000
+++ NetBSD_irisboot/common/iris_disk.c 2018-12-31 15:59:19.893235937 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: sd.c,v 1.11 2011/07/17 20:54:40 joerg Exp $ */
+
 /*
  * Copyright (c) 2018 Naruaki Etomi
  * All rights reserved.
@@ -24,6 +26,44 @@
  */

 /*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Van Jacobson of Lawrence Berkeley Laboratory and the Systems
+ * Programming Group of the University of Utah Computer Science Department.
+ *
+ * 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.
+ *
+ * from: Utah $Hdr: sd.c 1.9 92/12/21$
+ *
+ * @(#)sd.c 8.1 (Berkeley) 6/10/93
+ */
+
+/*
  * Silicon Graphics "IRIS" series MIPS processors machine bootloader.
  * Disk I/O API routine.
  * Most of the following was adapted from /sys/arch/hp300/stand/common/sd.c.
@@ -77,7 +117,7 @@
  sc->sc_retry = 0;

  retry:
- stat = scsi_readx28(buf, reqcnt, blk, nblk);
+ stat = scsi_read(buf, reqcnt, blk, nblk);

  if (stat) {
  DELAY(1000000);
@@ -104,12 +144,10 @@

  if (stat != 0) {
  /* drive may be doing RTZ - wait a bit */
- if (stat == STS_CHECKCOND) {
- DELAY(1000000);
- stat = scsi_test_unit_rdy();
- }
+ DELAY(1000000);
+ stat = scsi_test_unit_rdy();

- if (stat) {
+ if (stat != 0) {
  printf("diskinit abort!\n");
  printf("Boot failed!  Halting...\n");
 #ifdef INDIGO_R3K_MODE
@@ -126,7 +164,7 @@
  capbuf[0] = 0;
  capbuf[1] = 0;

- stat = scsi_readx25((uint8_t *)capbuf, sizeof(capbuf));
+ stat = scsi_read_capacity((uint8_t *)capbuf, sizeof(capbuf));

  if (stat == 0) {
  if (capbuf[1] > DEV_BSIZE)
diff -Naru NetBSD_irisboot.orig/common/iris_machdep.h
NetBSD_irisboot/common/iris_machdep.h
--- NetBSD_irisboot.orig/common/iris_machdep.h 2018-12-31
15:20:01.918116939 +0000
+++ NetBSD_irisboot/common/iris_machdep.h 2018-12-31 15:19:58.433007939 +0000
@@ -55,9 +55,9 @@

 /* iris_scsictl.c */
 int scsi_test_unit_rdy(void);
-int scsi_readx25(uint8_t *, size_t);
-int scsi_readx28(uint8_t *, size_t, daddr_t, size_t);
-int scsi_writex2A(uint8_t *, size_t, daddr_t, size_t);
+int scsi_read_capacity(uint8_t *, size_t);
+int scsi_read(uint8_t *, size_t, daddr_t, size_t);
+int scsi_write(uint8_t *, size_t, daddr_t, size_t);

 #define INDIGO_R3K_MODE

diff -Naru NetBSD_irisboot.orig/common/iris_scsictl.c
NetBSD_irisboot/common/iris_scsictl.c
--- NetBSD_irisboot.orig/common/iris_scsictl.c 2018-12-31
15:20:01.953052939 +0000
+++ NetBSD_irisboot/common/iris_scsictl.c 2018-12-31 15:19:58.471961939 +0000
@@ -44,7 +44,7 @@
 }

 int
-scsi_readx25(uint8_t *buf, size_t olen)
+scsi_read_capacity(uint8_t *buf, size_t olen)
 {
  size_t len = olen;
  size_t *lenp;
@@ -56,7 +56,7 @@
 }

 int
-scsi_readx28(uint8_t *buf, size_t olen, daddr_t blk, u_int nblk)
+scsi_read(uint8_t *buf, size_t olen, daddr_t blk, u_int nblk)
 {
  size_t len = olen;
  size_t *lenp;
@@ -81,7 +81,7 @@
 }

 int
-scsi_writex2A(uint8_t *buf, size_t olen, daddr_t blk, u_int nblk)
+scsi_write(uint8_t *buf, size_t olen, daddr_t blk, u_int nblk)
 {
  size_t len = olen;
  size_t *lenp;
diff -Naru NetBSD_irisboot.orig/common/iris_scsireg.h
NetBSD_irisboot/common/iris_scsireg.h
--- NetBSD_irisboot.orig/common/iris_scsireg.h 2018-12-31
15:20:01.966549939 +0000
+++ NetBSD_irisboot/common/iris_scsireg.h 2018-12-31 15:19:58.482679939 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: wd33c93reg.h,v 1.4 2009/02/12 06:24:45 rumble Exp $ */
+
 /*
  * Copyright (c) 2018 Naruaki Etomi
  * All rights reserved.
@@ -24,6 +26,77 @@
  */

 /*
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Van Jacobson of Lawrence Berkeley Laboratory.
+ *
+ * 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.
+ *
+ *  @(#)scsireg.h   7.3 (Berkeley) 2/5/91
+ */
+
+/*
+ * Copyright (c) 2001 Wayne Knowles
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Van Jacobson of Lawrence Berkeley Laboratory.
+ *
+ * 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.
+ *
+ *  @(#)scsireg.h   7.3 (Berkeley) 2/5/91
+ */
+
+/*
  * Silicon Graphics "IRIS" series MIPS processors machine bootloader.
  * WD33C93 SCSI interface hardware description.
  * Most of the following was adapted from sys/dev/ic/wd33c93reg.h.
diff -Naru NetBSD_irisboot.orig/common/iris_zs.c
NetBSD_irisboot/common/iris_zs.c
--- NetBSD_irisboot.orig/common/iris_zs.c 2018-12-31 15:20:01.980695939 +0000
+++ NetBSD_irisboot/common/iris_zs.c 2018-12-31 15:19:58.477928939 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: zs.c,v 1.39 2015/02/18 16:47:58 macallan Exp $ */
+
 /*
  * Copyright (c) 2018 Naruaki Etomi
  * All rights reserved.
@@ -23,6 +25,35 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

+/*-
+ * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Gordon W. Ross and Wayne Knowles
+ *
+ * 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.
+ *
+ * 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.
+ */
+
 /*
  * Silicon Graphics "IRIS" series MIPS processors machine bootloader.
  * Zilog Z8530 Dual UART driver.
--------------------------------------------------------------

Cheers to 2019!

-- 
Naruaki Etomi
nullnilaki%gmail.com@localhost


Home | Main Index | Thread Index | Old Index