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

[pbsd-mg2] APA-1460



 | APA-1460と外付のHDDを買ってきて試してみたのですが、disklabelを読もうとす
 | ると、ドライバの中でbus errorを起こします。HDDそのものは認識されています。
 | (ベンダ名や容量などの情報は表示される。)

 APA-1460Dで試してみたんですが、僕の思うところPCMCIA的なdisableと割り込みハンドラ
のdiableのタイミングがなんかいやらしい感じがして、

int
aic_pcmcia_enable(arg, onoff)
	void *arg;
	int onoff;
{
	struct aic_pcmcia_softc *psc = arg;
	static int xxx;
	if (!xxx++)
	{
		/* Establish the interrupt handler. */
		psc->sc_ih = pcmcia_intr_establish(psc->sc_pf, IPL_BIO,
		    aicintr, &psc->sc_aic);
		if (psc->sc_ih == NULL) {
			printf("%s: couldn't establish interrupt handler\n",
			    psc->sc_aic.sc_dev.dv_xname);
			return (EIO);
		}

		if (pcmcia_function_enable(psc->sc_pf)) {
			printf("%s: couldn't enable PCMCIA function\n",
			    psc->sc_aic.sc_dev.dv_xname);
			pcmcia_intr_disestablish(psc->sc_pf, psc->sc_ih);
			return (EIO);
		}
	}

	return (0);
}

 として、probeした時にenableしっぱなしにしてみたところ、SCSIディスクを
マウントしてブートできました。どうしたものかな、と思ってるとこですが...
 と、そろそろ、hpcmips/hpcmips/conf.cを整理しましょう。添付したのは
ブートログと、僕のconf.cです。こんなのどうでしょう?
---
UCHIYAMA Yasushi
uch@nop.or.jp 
/*	$NetBSD: conf.c,v 1.6 1999/06/26 09:17:29 takemura Exp $	*/

/*
 * Copyright (c) 1992, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Ralph Campbell.
 *
 * 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.
 *
 *	@(#)conf.c	8.2 (Berkeley) 11/14/93
 */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/conf.h>
#include <sys/vnode.h>

bdev_decl(sw);
#include "fdc.h"
bdev_decl(fd);
#include "wd.h"
bdev_decl(wd);
#include "sd.h"
bdev_decl(sd);
#include "st.h"
bdev_decl(st);
#include "cd.h"
bdev_decl(cd);
#include "vnd.h"
bdev_decl(vnd);
#include "raid.h"
bdev_decl(raid);
#include "ccd.h"
bdev_decl(ccd);
#include "md.h"
bdev_decl(md);

struct bdevsw	bdevsw[] =
{
	bdev_swap_init(1,sw),		/* 0: swap pseudo-device */
	bdev_disk_init(NWD,wd),		/* 1: IDE disk driver */
	bdev_disk_init(NFDC,fd),	/* 2: PC-ish floppy disk driver */
	bdev_disk_init(NSD,sd),		/* 3: SCSI disk driver */
	bdev_tape_init(NST,st),		/* 4: SCSI tape */
	bdev_disk_init(NCD,cd),		/* 5: SCSI CD-ROM */
	bdev_disk_init(NMD,md),		/* 6: memory disk driver */
	bdev_disk_init(NCCD,ccd),	/* 7: concatenated disk driver */
	bdev_disk_init(NVND,vnd),	/* 8: vnode disk driver */
	bdev_disk_init(NRAID,raid),	/* 9: RAIDframe disk driver */
};
int	nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);

/*
 * Swapdev is a fake block device implemented  in sw.c and only used 
 * internally to get to swstrategy.  It cannot be provided to the
 * users, because the swstrategy routine munches the b_dev and b_blkno
 * entries before calling the appropriate driver.  This would horribly
 * confuse, e.g. the hashing routines.   User access (e.g., for libkvm
 * and ps) is provided through the /dev/drum character (raw) device.
 */
dev_t	swapdev = makedev(0, 0);

cdev_decl(cn);
cdev_decl(ctty);
#define	mmread	mmrw
#define	mmwrite	mmrw
dev_type_read(mmrw);
cdev_decl(mm);
cdev_decl(sw);
#include "pty.h"
#define ptstty ptytty
#define ptsioctl ptyioctl
cdev_decl(pts);
#define ptctty ptytty
#define ptcioctl ptyioctl
cdev_decl(ptc);
cdev_decl(log);

cdev_decl(biconsdev);

cdev_decl(fd);
cdev_decl(wd);
cdev_decl(sd);
cdev_decl(st);
cdev_decl(cd);
cdev_decl(md);
cdev_decl(raid);
cdev_decl(vnd);
cdev_decl(ccd);
#include "tun.h"
cdev_decl(tun);
#include "bpfilter.h"
cdev_decl(bpf);
#include "ipfilter.h"
cdev_decl(ipl);

#include "com.h"
cdev_decl(com);
#include "lpt.h"
cdev_decl(lpt);

/* SCSI misc */
#include "scsibus.h"
cdev_decl(scsibus);
#include "ch.h"
cdev_decl(ch);
#include "ss.h"
cdev_decl(ss);
#include "uk.h"
cdev_decl(uk);
#if notyet
/* wscons */
#include "wsdisplay.h"
cdev_decl(wsdisplay);
#include "wskbd.h"
cdev_decl(wskbd);
#include "wsmouse.h"
cdev_decl(wsmouse);

/* USB */
#include "usb.h"
cdev_decl(usb); 
#include "uhid.h"
cdev_decl(uhid);
#include "ugen.h"
cdev_decl(ugen);
#include "ulpt.h"
cdev_decl(ulpt);
#endif
#include "rnd.h"

struct cdevsw	cdevsw[] =
{
	cdev_mm_init(1, mm),            /*  0: /dev/{null,mem,kmem,...} */
	cdev_swap_init(1, sw),          /*  1: /dev/drum (swap pseudo-device) */
	cdev_cn_init(1, cn),            /*  2: virtual console */
	cdev_ctty_init(1,ctty),         /*  3: controlling terminal */
	cdev_fd_init(1,filedesc),	/*  4: file descriptor pseudo-dev */
	cdev_log_init(1,log),           /*  5: /dev/klog */
	cdev_ptc_init(NPTY,ptc),        /*  6: pseudo-tty master */
	cdev_tty_init(NPTY,pts),        /*  7: pseudo-tty slave */
	cdev_tty_init(NCOM,com),	/*  8: serial port */
#if notyet
	cdev_lpt_init(NLPT,lpt),        /*  9: parallel printer */
#else
	cdev_notdef(),
#endif
	cdev_disk_init(NWD, wd),        /* 10: ST506/ESDI/IDE disk */
	cdev_disk_init(NFDC, fd),       /* 11: floppy diskette */
	cdev_disk_init(NMD, md),        /* 12: memory disk driver */
	cdev_disk_init(NCCD,ccd),	/* 13: concatenated disk driver */
	cdev_disk_init(NVND,vnd),       /* 14: vnode disk driver */
	cdev_disk_init(NRAID,raid),	/* 15: RAIDframe disk driver */
	cdev_scsibus_init(NSCSIBUS,scsibus), /* 16: SCSI bus */
	cdev_disk_init(NSD,sd),		/* 17: SCSI disk */
	cdev_tape_init(NST,st),		/* 18: SCSI tape */
	cdev_disk_init(NCD,cd),		/* 19: SCSI CD-ROM */
	cdev_ch_init(NCH,ch),	 	/* 20: SCSI autochanger */
	cdev_uk_init(NUK,uk),	 	/* 21: SCSI unknown */
	cdev_scanner_init(NSS,ss),	/* 22: SCSI scanner */
#if notyet
	cdev_usb_init(NUSB,usb),	/* 23: USB controller */
	cdev_usbdev_init(NUHID,uhid),	/* 24: USB generic HID */
	cdev_lpt_init(NULPT,ulpt),	/* 25: USB printer */
	cdev_ugen_init(NUGEN,ugen),	/* 26: USB generic driver */
#else
	cdev_notdef(),
	cdev_notdef(),
	cdev_notdef(),
	cdev_notdef(),
#endif
	cdev_ipf_init(NIPFILTER,ipl),	/* 27: ip-filter device */
	cdev_bpftun_init(NTUN,tun),	/* 28: network tunnel */
	cdev_bpftun_init(NBPFILTER,bpf),/* 29: Berkeley packet filter */
#if notyet
	cdev_wsdisplay_init(NWSDISPLAY,
	    wsdisplay),			/* 30: frame buffers, etc. */
	cdev_mouse_init(NWSKBD, wskbd),	/* 31: keyboards */
	cdev_mouse_init(NWSMOUSE,
	    wsmouse),			/* 32: mice */
#else
	cdev_notdef(),
	cdev_notdef(),
	cdev_notdef(),
#endif
	cdev_rnd_init(NRND,rnd),	/* 33: random source pseudo-device */
	cdev_tty_init(1,biconsdev),	/* 34: bicons pseudo-dev */	
};

int	nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);

int	mem_no = 0; 	/* major device number of memory special file */

/*
 * Routine that identifies /dev/mem and /dev/kmem.
 */
int
iskmemdev(dev)
	dev_t dev;
{
	return (major(dev) == mem_no && minor(dev) < 2);
}

/*
 * Returns true if dev is /dev/zero.
 */
int
iszerodev(dev)
	dev_t dev;
{
	return (major(dev) == mem_no && minor(dev) == 12);
}

static int chrtoblktbl[] =  {
	/* XXXX This needs to be dynamic for LKMs. */
	/*VCHR*/	/*VBLK*/
	/*  0 */	NODEV,
	/*  1 */	NODEV,
	/*  2 */	NODEV,
	/*  3 */	NODEV,
	/*  4 */	NODEV,
	/*  5 */	NODEV,
	/*  6 */	NODEV,
	/*  7 */	NODEV,
	/*  8 */	NODEV,
	/*  9 */	NODEV,
	/* 10 */	1, /* wd */
	/* 11 */	2, /* fd */
	/* 12 */	6, /* md */
	/* 13 */	7, /* ccd */
	/* 14 */	8, /* vnd */
	/* 15 */	9, /* raid */
	/* 16 */	NODEV,
	/* 17 */	3, /* sd */
	/* 18 */	4, /* st */
	/* 19 */	5, /* cd */
	/* 20 */	NODEV,
	/* 21 */	NODEV,
	/* 22 */	NODEV,
	/* 23 */	NODEV,
	/* 24 */	NODEV,
	/* 25 */	NODEV,
	/* 26 */	NODEV,
	/* 27 */	NODEV,
	/* 28 */	NODEV,
	/* 29 */	NODEV,
	/* 30 */	NODEV,
	/* 31 */	NODEV,
	/* 32 */	NODEV,
	/* 33 */	NODEV,
	/* 34 */	NODEV,
};

/*
 * Routine to convert from character to block device number.
 */
dev_t
chrtoblk(dev)
	dev_t dev;
{
	int blkmaj;

	if (major(dev) >= nchrdev)
		return (NODEV);
	blkmaj = chrtoblktbl[major(dev)];
	if (blkmaj == NODEV)
		return (NODEV);
	return (makedev(blkmaj, minor(dev)));
}

#include <dev/cons.h>
cons_decl(builtin);

struct consdev constab[] = {
    cons_init(builtin),
    {0}
};
Connected.
Copyright (c) 1996, 1997, 1998, 1999
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.3I (SCSI) #1: Wed Jul 28 03:21:41 JST 1999
    uch@anko:/work/netbsd/hpcmips/sys/arch/hpcmips/compile/SCSI
NEC VR4111 rev0.0
real mem  = 8388608
avail mem = 5890048
using 204 buffers containing 835584 bytes of memory
../../../../arch/hpcmips/vr/vr.c(134): vr_bus_reset() not implemented.
mainbus0 (root)
cpu0 at mainbus0: cpu0: NEC VR4100 CPU Rev. 5.0 with software emulated floating point Rev. 0.0
cpu0: L1 cache: 16kb/16b Instruction, 8kb/16b Data, direct mapped
cpu0: No L2 cache
vrip0 at mainbus0
com0 at vrip0 addr 0xc000000-0xc000007 intr 9base0 offs14 addrab000104
: ns16550a, working fifo
com0: console
vrip_intr_setmask2:
vrrtc0 at vrip0 addr 0xb0000c0-0xb0000df intr 2vrip_intr_setmask2:

vrgiu0 at vrip0 addr 0xb000100-0xb00011f intr 8vrip_intr_setmask2:
level1[8] level2 mask:......................||.|||..||
giubus0 at vrgiu0:ISA port 0x14000000-0x18000000 mem 0x10000000-0x20000000
isa0 at giubus0
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0x70000-0x73fff irq 589827
pcic0: controller 0 (Intel 82365SL Revision 1) has sockets A and B
pcic0: controller 1 (Intel 82365SL Revision 1) has socket A only
ISA IRQ 3 -> GPIO port 9
 level high throughvrip_intr_setmask2:
level1[8] level2 mask:................................

pcmcia0 at pcic0 controller 0 socket 0
pcmcia0: CIS version PC Card Standard 5.0
pcmcia0: CIS info: TDK, TC_N
pcmcia0: Manufacturer code 0x105, product 0x301
pcmcia0: function 0: fixed disk, ccr addr 200 mask f
pcmcia0: function 0, config table entry 0: memory card; irq mask 0; memspace 0-7ff0; powerdown
pcmcia0: function 0, config table entry 1: I/O card; irq mask ffff; iomask 4, iospace 0-f; memspace 0-7ff0; powerdown
pcmcia0: function 0, config table entry 2: I/O card; irq mask 4000; iomask a, iospace 1f0-1f7 3f6-3f7; memspace 0-7ff0; powerdown
pcmcia0: function 0, config table entry 3: I/O card; irq mask 4000; iomask a, iospace 170-177 376-377; memspace 0-7ff0; powerdown
TDK, TC_N (manufacturer 0x105, product 0x301) function 0 not configured
pcmcia1 at pcic0 controller 0 socket 1
pcmcia1: CIS version PCMCIA 2.0 or 2.1
pcmcia1: CIS info: Adaptec, Inc., APA-1460 SCSI Host Adapter, Version 0.01
pcmcia1: Manufacturer code 0x12f, product 0x2
pcmcia1: function 0: unspecified, ccr addr 2000 mask 1
pcmcia1: function 0, config table entry 9: I/O card; irq mask 1e00; iomask a, iospace 340-35f; rdybsy_active wp_active bvd_active io16 irqlevel
pcmcia1: function 0, config table entry 8: I/O card; irq mask 1e00; iomask a, iospace 140-15f; rdybsy_active wp_active bvd_active io16 irqlevel
aic0 at pcmcia1 function 0 port 0x340-0x35f: Adaptec APA-1460/B SCSI Host Adapter
scsibus0 at aic0: 8 targets, 8 luns per target
isa_intr_alloc:............................|...
 level high throughvrip_intr_setmask2:
level1[8] level2 mask:......................|.........

pcmcia1: card irq 3
sd0 at scsibus0 targ 0 lun 0: <FUJITSU, M2682S-512, 2039> SCSI2 0/direct fixed
sd0: 337MB, 2380 cyl, 4 head, 72 sec, 512 bytes/sect x 690507 sectors
pcmcia2 at pcic0 controller 1 socket 0
vrbcu0 at vrip0 addr 0xb000000-0xb00001f
vrkiu0 at vrip0 addr 0xb000180-0xb00019f intr 7vrip_intr_setmask2:
level1[7] level2 mask:.............||.
vrip_intr_setmask2:
level1[7] level2 mask:................
serial line (8, 0): console

../../../../arch/hpcmips/vr/vr.c(134): vr_bus_reset() not implemented.
autconfiguration done, spl back to 0x0
boot device: <unknown>
root on sd0a dumps on sd0b
WARNING: old BSD partition ID!
WARNING: preposterous clock chip time
 -- CHECK AND RESET THE DATE!
Enter pathname of shell or RETURN for sh: 
Don't login as root, use the su command.
# exit
swapctl: adding /dev/sd0b as swap device at priority 0
setting tty flags
/dev/sd0e: file system not clean (fs_flags=4); please fsck(8)
starting network
configuring network interfaces:.
starting system logger
checking for core dump...
savecore: no core dump
starting rpc daemons: portmap.
starting nfs daemons:.
setting securelevel: kern.securelevel: 0 -> 1
checking quotas: done.
building databases...
clearing /tmp
updating motd.
standard daemons: update cron.
starting network daemons: inetd.
starting local daemons:.
Tue Jul 27 20:25:56 PDT 1999

NetBSD/pmax (Amnesiac) (console)

login: root
Jul 27 20:26:01  login: ROOT LOGIN (root) ON console
Jul 27 20:26:01  login: ROOT LOGIN (root) ON console
Copyright (c) 1996, 1997, 1998, 1999
        The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.  All rights reserved.

NetBSD 1.3I (SCSI) #1: Wed Jul 28 03:21:41 JST 1999

Welcome to NetBSD!

Terminal type? [unknown] ^C
# df
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd0a      116033    20333    89898    18%    /
/dev/sd0e      121603    57886    57636    50%    /usr
kernfs              1        1        0   100%    /kern
procfs              4        4        0   100%    /proc
#