From owner-freebsd-new-bus Wed Oct 4 12:19: 1 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from radiant.net (radiant.net [207.194.200.18]) by hub.freebsd.org (Postfix) with ESMTP id 20E9B37B502 for ; Wed, 4 Oct 2000 12:18:57 -0700 (PDT) Received: from shula [208.181.145.20] by radiant.net (SMTPD32-6.04) id A435CD0024; Wed, 04 Oct 2000 12:25:41 -0700 Reply-To: From: "Simon Block" To: Subject: PCI resources with bus_alloc_resource(9) Date: Wed, 4 Oct 2000 12:23:18 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: High X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dear NewBus Guru's, I am sending this to you at the suggestion of Alex Langer: I am writing a driver for a PCI device I have a question about the man page for bus_alloc_resource(9). (I am using FreeBSD 4.1 STABLE). The man page states for the parameter that 'rid' points to: "For PCI it just happens to be the offset into pci config space which has a word that describes the re­source." My knowledge of PCI would dictate that this should be the value 0x3C (the offset in PCI configuration space where you find the Int PIN and Int Line registers). e.g. rid = 0x3C; sc->irq = bus_alloc_resource( dev, SYS_RES_IRQ, &rid, 0, ~0, 1, (RF_SHAREABLE | RF_ACTIVE) ); sc->irqid = 0x3C; /* save the value in the soft state */ However ALL the drivers on the system appear to use a value of 0 (zero) instead of 0x3C, and 0 appears to be the only way to get it to work (so it must be right)? Can anyone explain this? If this is the case what does the comment quoted above mean in the man page? PS. I have a driver that opens three independent PCI devices (they are all built into the one card as seperate PCI to local bus ASIC chips). My driver maps all the memory regions ok and will map the first two interrupts (using rid=0) but the mapping of the third interrupt fails. These mapping are called by the system as 3 distinct calls to the attach routine. Is there possibly a resource issue with IRQ's that would means I cannot get another one? Can I get around this somehow? On another platform (motherboard) we are having problems allocating the third memory region as well. How do we deal with these PCI resource issues? What are the limits? How can we modify them? Thanks in advance for any help. Regards, Simon Block Shula Consulting Incorporated 1-1430 Maple St Vancouver, BC V6J 3R9 Phone: 604 736 8791 Fax: 604 736 8796 Cell: 604 841 8791 Email: sblock@computer.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message