Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 2000 12:23:18 -0700
From:      "Simon Block" <sblock@computer.org>
To:        <new-bus@freebsd.org>
Subject:   PCI resources with bus_alloc_resource(9)
Message-ID:  <LOBBJIBIIEAFNGPIGIKNAENPCHAA.sblock@computer.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?LOBBJIBIIEAFNGPIGIKNAENPCHAA.sblock>