From owner-freebsd-stable Tue Feb 13 21:22:36 1996 Return-Path: owner-stable Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA08643 for stable-outgoing; Tue, 13 Feb 1996 21:22:36 -0800 (PST) Received: from localhost.cdrom.com (localhost.cdrom.com [127.0.0.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id VAA08632 Tue, 13 Feb 1996 21:22:33 -0800 (PST) Message-Id: <199602140522.VAA08632@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: Host localhost.cdrom.com [127.0.0.1] didn't use HELO protocol To: Richard J Kuhns cc: freebsd-stable@freebsd.org Subject: Re: One problem && one question In-reply-to: Your message of "Tue, 13 Feb 1996 14:27:19 +0500." <9602131927.AA23929@sparcmill.grauel.com> Date: Tue, 13 Feb 1996 21:22:33 -0800 From: "Justin T. Gibbs" Sender: owner-stable@freebsd.org Precedence: bulk >Justin T. Gibbs writes: > > >Justin T. Gibbs writes: > > > int a irq 10 pci 0:13 > > > mapreg[10] type 1 addr 0x00006000 size ffff0004 > > >bt0: Invalid base address > > > > boot -v with the old kernel and then use dmesg to retrieve the info. > > > >That works fine for any ``working'' kernel; apparently none of the boot >messages from a non-working kernel end up in the circular buffer dmesg >uses. IE, if I boot-working then boot-nonworking then boot-working and run >dmesg, I get the messages from the 2 boot-working kernels only. How would you expect the dmesg buffer to be written to disk if the probe for your disk controller isn't successful? 8-) > > When you get a chance, try this one. Now that I'm not editing over a link > > with 50% packet loss, its much easier to check my work. :) > > > >I tried it; I'm afraid it made no difference. By the way, here's one more >line from the (failing) pci-probe: > >bt0: uses 4 bytes of I/O space from 6000 upto 6003 Ahh. It did make a difference. Unfortunately, when I was cleaning up the bt driver, I assumed that the PCI probe would always return one of the ISA compatibility addresses. As Rod pointed out, this is not always the case. This patch should do the trick >-- >Rich Kuhns rjk@grauel.com >PO Box 6249 >100 Sawmill Road >Lafayette, IN 47903 >(317)477-6000 x319 -- Justin T. Gibbs =========================================== FreeBSD: Turning PCs into workstations =========================================== Index: i386/scsi/bt.c =================================================================== RCS file: /usr/cvs/src/sys/i386/scsi/bt.c,v retrieving revision 1.5 diff -c -r1.5 bt.c *** bt.c 1996/01/25 23:03:07 1.5 --- bt.c 1996/02/14 05:03:01 *************** *** 462,471 **** } } } - if (i >= sizeof(found)/sizeof(struct bt_found)) { - printf("bt%d: Invalid base address\n", unit); - return NULL; - } bt = malloc(sizeof(struct bt_data), M_DEVBUF, M_NOWAIT); if (!bt) { --- 462,467 ---- Index: i386/pci/bt9xx.c =================================================================== RCS file: /usr/cvs/src/sys/pci/bt9xx.c,v retrieving revision 1.4 diff -c -r1.4 bt9xx.c *** bt9xx.c 1996/01/23 21:46:57 1.4 --- bt9xx.c 1996/02/13 15:46:23 *************** *** 35,42 **** #include /* XXX Need more device IDs */ ! #define PCI_BASEADR0 PCI_MAP_REG_START ! #define PCI_DEVICE_ID_BUSLOGIC_946 0x104B1040ul static char* bt_pci_probe __P((pcici_t tag, pcidi_t type)); static void bt_pci_attach __P((pcici_t config_id, int unit)); --- 35,41 ---- #include /* XXX Need more device IDs */ ! #define PCI_DEVICE_ID_BUSLOGIC_946 0x1040104Bul static char* bt_pci_probe __P((pcici_t tag, pcidi_t type)); static void bt_pci_attach __P((pcici_t config_id, int unit)); *************** *** 70,86 **** pcici_t config_id; int unit; { u_long io_port; unsigned opri = 0; struct bt_data *bt; ! if(!(io_port = pci_conf_read(config_id, PCI_BASEADR0))) return; - /* - * The first bit of PCI_BASEADR0 is always - * set hence we mask it off. - */ - io_port &= 0xfffffffe; if(!(bt = bt_alloc(unit, io_port))) return; /* XXX PCI code should take return status */ --- 69,89 ---- pcici_t config_id; int unit; { + u_char reg; u_long io_port; unsigned opri = 0; struct bt_data *bt; ! for(reg = PCI_MAP_REG_START; reg < PCI_MAP_REG_END; reg+=4) { ! io_port = pci_conf_read(config_id, reg); ! if ((io_port&~7)==0) continue; ! if(io_port & PCI_MAP_IO) { ! io_port &= ~PCI_MAP_IO; ! break; ! } ! } ! if(reg == PCI_MAP_REG_END) return; if(!(bt = bt_alloc(unit, io_port))) return; /* XXX PCI code should take return status */