Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Oct 2000 00:57:58 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        Jonathan Chen <jon+fbsd@spock.org>
Cc:        hackers@freebsd.org
Subject:   Re: PCI secondary bus 
Message-ID:  <200010150757.e9F7vwh00361@mass.osd.bsdi.com>
In-Reply-To: Your message of "Sat, 14 Oct 2000 23:44:41 EDT." <20001014234441.F78298@spock.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> While writing the new cardbus code, I ran into a problem where certain
> BIOSes (Dells in particular) does not initialize the pci configuration
> space of the pci to cardbus bridge.  On a "normal" laptop, the BIOS will
> fill in a memory address, irq lines, and the secondary and subordinate bus
> numbers.  On a dell laptop, those would be left as 0.

Warner and I just chatted about this and PCI IRQ routing for a bit.  There
are a couple of issues that need to be resolved here:

 - We need a function which will hand out valid PCI bus numbers.  We need 
   to do a little exploring to see whether we can just hand them out at 
   random (I don't think we can do this) or whether we need to be more
   choosy.  I get the general impression that we'll need to allocate a
   range of bus numbers for a bridge based on its parents' space 
   allocation.

 - We need a callout in the PCI bus' code which handles 
   bus_alloc_resource for SYS_RES_IRQ; specifically, if the indicated
   interrupt's corresponding configuration space register still contains
   0xff (want an interrupt, not assigned), we need to ripple back up 
   through the parent PCI bridge(s) to route a suitable interrupt.

   To do this we need to get at the $PIR structure and/or the ACPI 
   PCI interrupt routing data for PCI bridges; we're pretty close to 
   having both of these working now.

> I could work around
> the memory/irq issues, but I have no clue what to fill in for the secondary
> and subordinate bus numbers.  Is there a magical function (in kernel,
> pcibios or otherwise) that would generate these values for me?  And if not,
> how do I get the numbers?  Would it be alright if I assign an arbitrary
> number as long as there is no conflict?  Any help would be
> appreciated.  Thanks.

In the short term, as long as the device is a child of bus 0 and there 
are no other root busses you can probably just use eg. 2 (save 1 because 
it'll probably get eaten by your AGP bridge).

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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