From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 14 15:31:32 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3127510656C0; Tue, 14 Jul 2009 15:31:32 +0000 (UTC) (envelope-from nkoch@demig.de) Received: from www61.your-server.de (www61.your-server.de [213.133.104.61]) by mx1.freebsd.org (Postfix) with ESMTP id E05D18FC1C; Tue, 14 Jul 2009 15:31:31 +0000 (UTC) (envelope-from nkoch@demig.de) Received: from [217.7.243.216] (helo=firewall.demig.intra) by www61.your-server.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MQjyc-0008Qf-0w; Tue, 14 Jul 2009 17:31:30 +0200 Received: from [192.168.148.72] (ws-pr-3.demig.intra [192.168.148.72]) by firewall.demig.intra (8.14.3/8.14.0) with ESMTP id n6EFUtdA019224; Tue, 14 Jul 2009 17:30:55 +0200 (CEST) (envelope-from nkoch@demig.de) Message-ID: <4A5CA4AA.6050307@demig.de> Date: Tue, 14 Jul 2009 15:30:50 +0000 From: Norbert Koch Organization: demig Prozessautomatisierung GmbH User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: John Baldwin References: <4A5B3F1B.3040207@demig.de> <200907131435.30452.jhb@freebsd.org> <4A5C2EF8.3080208@demig.de> <200907140849.51702.jhb@freebsd.org> In-Reply-To: <200907140849.51702.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 192.168.148.235 X-Authenticated-Sender: webmaster@demig.de X-Virus-Scanned: Clear (ClamAV 0.95.1/9562/Tue Jul 14 15:54:21 2009) Cc: freebsd-hackers@freebsd.org Subject: Re: bus device driver X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2009 15:31:32 -0000 > 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?