Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2009 15:30:50 +0000
From:      Norbert Koch <nkoch@demig.de>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: bus device driver
Message-ID:  <4A5CA4AA.6050307@demig.de>
In-Reply-To: <200907140849.51702.jhb@freebsd.org>
References:  <4A5B3F1B.3040207@demig.de> <200907131435.30452.jhb@freebsd.org>	<4A5C2EF8.3080208@demig.de> <200907140849.51702.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> From a hardware perspective, how do your devices know which addresses to 
> decode?  Do they consume subranges of BARs or are they assigned fixed 
> addresses somehow?  Do they have programmable decoders of some sort 
> themselves?  If you wish to have the PCI bus assign you resources then that 
> implies that your PCI device has a BAR and that you want to request resources 
> for that BAR and then hand out subranges of that to your children.  If that 
> is the case, then you will need to allocate the resources for the BAR for the 
> PCI device from the PCI bus.  Then your bus driver for the PCI device will 
> need to suballoc from that BAR to your children devices.
>
>   
My device decodes one ram address range (16MB) and gives me
one interrupt line.
As my sub-devices operate on partial address areas my idea was to
let them all call bus_alloc_resource() with the same rid parameter (= 
BAR selector)
and different offsets. So the bookkeeping should be done by the pci 
driver, right?




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