From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 17 19:53:54 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 C29321065672 for ; Fri, 17 Jul 2009 19:53:54 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outU.internet-mail-service.net (outu.internet-mail-service.net [216.240.47.244]) by mx1.freebsd.org (Postfix) with ESMTP id 61AD98FC15 for ; Fri, 17 Jul 2009 19:53:54 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 34C45B96A6; Fri, 17 Jul 2009 12:53:55 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id C23872D6016; Fri, 17 Jul 2009 12:53:53 -0700 (PDT) Message-ID: <4A60D6D1.3050703@elischer.org> Date: Fri, 17 Jul 2009 12:53:53 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Andre Albsmeier References: <20090717190450.GA4697@curry.mchp.siemens.de> In-Reply-To: <20090717190450.GA4697@curry.mchp.siemens.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Rui Paulo Subject: Re: Reading acpi memory from a driver attached to hostb 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: Fri, 17 Jul 2009 19:53:55 -0000 Andre Albsmeier wrote: > [CC'ing this to Rui Paulo since he tried to help me a while ago] > > I have written a driver that is a child of hostb (similar to agp) for > RELENG_7. However, on some chipsets (e.g. i975) it has to read some > memory locations (not pci configuration space) which were registered > by acpi as system resources. > > Since my driver is a child of hostb0, I have no idea of how to access > this memory area. Here is a devinfo -r to make things clear: > > nexus0 > acpi0 > Interrupt request lines: > 9 > I/O ports: > 0x10-0x1f > 0x22-0x3f > ... > 0x800-0x87f > I/O memory addresses: > 0xc0000-0xdffff > 0xe0000-0xfffff > 0xf0000000-0xf3ffffff > 0xfec00000-0xfec00fff > 0xfed13000-0xfed19fff <--- the memory needed > 0xfed1c000-0xfed1ffff > .... > 0xfed20000-0xfed3ffff > 0xfff00000-0xffffffff > cpu0 > coretemp0 > acpi_throttle0 > ACPI I/O ports: > 0x810-0x813 > cpufreq0 > cpu1 > coretemp1 > pcib0 > pci0 > I/O ports: > 0x170-0x177 > 0x376 > hostb0 > I/O memory addresses: > 0xe4000000-0xe7ffffff > MYDRIVER0 <--- my driver > agp0 > pcib1 > pci7 > vgapci0 > Interrupt request lines: > 16 > > I had the same problem under RELENG_6 six month ago which could be > solved by a bus_set_resource() but since the driver now attaches to > hostb, this is not possible anymore. > > Earlier, I was given the hint to attach as a child of acpi (see the > old mail attached below) but in this case I didn't have access to the > hostb registers which I need as well. > > The only thing I see is: Attach two drivers -- one as child of acpi > and another as child of hostb and let them communicate somehow (no > idea how to do this). > > I have also done crazy things like searching for acpi0 and trying > to bus_alloc_resource() the memory I am interested in but this also > failed. > > Or is it possible to free(!) somehow the address space from acpi0 > and pass it to hostb0 so I can bus_alloc_resource() it? > > Thanks a lot for all ideas, > > -Andre > You can probably make two drivers in one which cooperate to allow access to both sets of resources. >