Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/luna68k/stand/boot Fix drivers to make secondary SP...
details: https://anonhg.NetBSD.org/src/rev/7733dd6bfe0e
branches: trunk
changeset: 783979:7733dd6bfe0e
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Mon Jan 14 01:37:57 2013 +0000
description:
Fix drivers to make secondary SPC SCSI on LUNA-II work properly.
Also bump version.
Now we can load a NetBSD kernel from external SCSI disks on LUNA-II.
(and netboot on LUNA-II also works)
diffstat:
sys/arch/luna68k/stand/boot/autoconf.c | 7 ++++++-
sys/arch/luna68k/stand/boot/ioconf.c | 5 ++++-
sys/arch/luna68k/stand/boot/samachdep.h | 4 ++--
sys/arch/luna68k/stand/boot/sc.c | 13 ++++++++++---
sys/arch/luna68k/stand/boot/sd.c | 4 ++--
sys/arch/luna68k/stand/boot/ufs_disksubr.c | 6 +++---
sys/arch/luna68k/stand/boot/version | 3 ++-
7 files changed, 29 insertions(+), 13 deletions(-)
diffs (165 lines):
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/autoconf.c
--- a/sys/arch/luna68k/stand/boot/autoconf.c Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/autoconf.c Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.2 2013/01/12 13:39:47 tsutsui Exp $ */
+/* $NetBSD: autoconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -80,6 +80,7 @@
#include <sys/param.h>
#include <sys/dkstat.h>
+#include <machine/cpu.h>
#include <lib/libkern/libkern.h>
#include <luna68k/stand/boot/samachdep.h>
#include <luna68k/stand/boot/device.h>
@@ -499,6 +500,10 @@
setup_hw(hw, (char *) 0xe1000000, 0xe, SCSI, 0xe, "MB89352 (SPC)");
hw++;
+ if (machtype == LUNA_II && !badaddr((void *) 0xe1000040)) {
+ setup_hw(hw, (char *) 0xe1000040, 0xe, SCSI, 0xe, "MB89352 (SPC)");
+ hw++;
+ }
if (!badaddr((void *) 0xf1000000)) {
setup_hw(hw, (char *) 0xf1000000, 0xf, NET, 0xf, "Am7990 (LANCE)");
hw++;
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/ioconf.c
--- a/sys/arch/luna68k/stand/boot/ioconf.c Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/ioconf.c Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ioconf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */
+/* $NetBSD: ioconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -86,6 +86,7 @@
struct hp_ctlr hp_cinit[] = {
/* driver, unit, alive, addr, flags */
{ &scdriver, 0, 0, C 0x0, 0x0 },
+ { &scdriver, 1, 0, C 0x0, 0x0 },
{0},
};
@@ -93,6 +94,8 @@
/*driver, cdriver, unit, ctlr, slave, addr, dk, flags*/
{ &sddriver, &scdriver, 0, 0, 6, C 0x0, 1, 0x0 },
{ &sddriver, &scdriver, 1, 0, 5, C 0x0, 1, 0x0 },
+{ &sddriver, &scdriver, 2, 1, 6, C 0x0, 1, 0x0 },
+{ &sddriver, &scdriver, 3, 1, 5, C 0x0, 1, 0x0 },
{ &ledriver, NULL, 0, 0, 0, C 0x0, 0, 0x0 },
#ifdef notyet
{ &stdriver, &scdriver, 0, 0, 4, C 0x0, 0, 0x0 },
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/samachdep.h
--- a/sys/arch/luna68k/stand/boot/samachdep.h Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/samachdep.h Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: samachdep.h,v 1.3 2013/01/13 14:10:55 tsutsui Exp $ */
+/* $NetBSD: samachdep.h,v 1.4 2013/01/14 01:37:57 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -208,7 +208,7 @@
void trap(int, unsigned int, unsigned int, struct frame);
/* ufs_disklabel.c */
-char *readdisklabel(int dev, int (*)(void *, int, daddr_t, size_t, void *, size_t *), struct disklabel *);
+char *readdisklabel(int, int, struct disklabel *);
#define DELAY(n) \
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/sc.c
--- a/sys/arch/luna68k/stand/boot/sc.c Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/sc.c Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sc.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */
+/* $NetBSD: sc.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -76,7 +76,7 @@
*/
-#define NSC 1
+#define NSC 2
#include <sys/param.h>
#include <luna68k/stand/boot/samachdep.h>
@@ -111,7 +111,14 @@
scinit(void *arg)
{
struct hp_ctlr *hc = arg;
- struct scsi_softc *hs = &scsi_softc[hc->hp_unit];
+ struct scsi_softc *hs;
+ int unit;
+
+ unit = hc->hp_unit;
+ if (unit < 0 || unit >= NSC)
+ return 0;
+
+ hs = &scsi_softc[unit];
hc->hp_ipl = SCSI_IPL;
hs->sc_hc = hc;
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/sd.c
--- a/sys/arch/luna68k/stand/boot/sd.c Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/sd.c Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */
+/* $NetBSD: sd.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -252,7 +252,7 @@
/*
* read disklabel
*/
- msg = readdisklabel(hd->hp_slave, sdstrategy, lp);
+ msg = readdisklabel(hd->hp_ctlr, hd->hp_slave, lp);
if (msg != NULL)
printf("sd%d: %s\n", hd->hp_unit, msg);
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/ufs_disksubr.c
--- a/sys/arch/luna68k/stand/boot/ufs_disksubr.c Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/ufs_disksubr.c Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_disksubr.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */
+/* $NetBSD: ufs_disksubr.c,v 1.2 2013/01/14 01:37:57 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -89,7 +89,7 @@
* Returns null on success and an error string on failure.
*/
char *
-readdisklabel(int dev, int (*strat)(void *, int, daddr_t, size_t, void *, size_t *), struct disklabel *lp)
+readdisklabel(int ctlr, int id, struct disklabel *lp)
{
u_char *bp = lbl_buff;
struct disklabel *dlp;
@@ -106,7 +106,7 @@
lp->d_partitions[0].p_size = 0x1fffffff;
lp->d_partitions[0].p_offset = 0;
- if (scsi_immed_command(0, dev, 0, &cdb, bp, DEV_BSIZE) != 0) {
+ if (scsi_immed_command(ctlr, id, 0, &cdb, bp, DEV_BSIZE) != 0) {
msg = "I/O error";
} else {
for (dlp = (struct disklabel *)bp;
diff -r c7a43c5f2744 -r 7733dd6bfe0e sys/arch/luna68k/stand/boot/version
--- a/sys/arch/luna68k/stand/boot/version Mon Jan 14 00:07:29 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/version Mon Jan 14 01:37:57 2013 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.2 2013/01/13 14:10:55 tsutsui Exp $
+$NetBSD: version,v 1.3 2013/01/14 01:37:57 tsutsui Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
file is important - make sure the entries are appended on end, last item
@@ -6,3 +6,4 @@
1.0: Initial revision, based on 4.4BSD-Lite2/luna68k and NetBSD/hp300
1.1: Add netboot support.
+1.2: Add support for secondary SPC SCSI on LUNA-II.
Home |
Main Index |
Thread Index |
Old Index