From owner-freebsd-new-bus Mon Dec 27 4:31:57 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from overcee.netplex.com.au (overcee.netplex.com.au [202.12.86.7]) by hub.freebsd.org (Postfix) with ESMTP id BCC4714EFF for ; Mon, 27 Dec 1999 04:31:54 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 32EB61CA0; Mon, 27 Dec 1999 20:31:49 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.1.1 10/15/1999 To: Warner Losh Cc: new-bus@freebsd.org Subject: Re: config hints In-Reply-To: Message from Warner Losh of "Sat, 18 Dec 1999 23:07:28 MST." <199912190607.XAA01535@harmony.village.org> Date: Mon, 27 Dec 1999 20:31:49 +0800 From: Peter Wemm Message-Id: <19991227123149.32EB61CA0@overcee.netplex.com.au> Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Warner Losh wrote: > > How does one put hints into the kernel for modules that are loaded > later? > > Warner Don't ask silly questions. :-] Presently you can do it by calling the resource_add_*() functions, but that's not much good from userland.. We need some sort of interface to the resource strings. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Wed Dec 29 1:39:43 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 7B97914E46 for ; Wed, 29 Dec 1999 01:39:38 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id CAA42965 for ; Wed, 29 Dec 1999 02:39:36 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id CAA01692 for ; Wed, 29 Dec 1999 02:39:36 -0700 (MST) Message-Id: <199912290939.CAA01692@harmony.village.org> To: new-bus@freebsd.org Subject: Another question Date: Wed, 29 Dec 1999 02:39:36 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have a question about a parent giving a child a portion of the address range that the parent has allocated for that child's use. I've allocated a 16k chunk of system isa memory at the bridge level. From time to time children need a hunk of this memory to map in their attribute memory. The attribute memory has various config registers in it as well as the CIS. My thinking on the matter was that I'd allocate the 16k chunk at bridge attach time, and then just give it out to the children who are requesting a memory area be mapped in as the default. However, when I go to do this, the allocation fails because the bridge is holding the allocation. What's the right new bus way to deal with this. Is it to free the resource at the bridge level and give it to the child? Is there some subspace mapping available that I've missed? Finally, the attribute memory on a pccard can be much bigger than the 4k window which the pcic bridge allows to be mapped at one time. How does one specify a card relative offset using the new bus allocation routines (eg, I want to say "allocate this hunk of memory at the default place and start at offset 16k in the card's address space"). I suppose I could come up with a kludge that moves the offset after it has been allocated/activated, but I thought I'd bounce things off the folks here. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Wed Dec 29 1:47:13 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from sasami.jurai.net (sasami.jurai.net [63.67.141.99]) by hub.freebsd.org (Postfix) with ESMTP id B05A814DAC for ; Wed, 29 Dec 1999 01:47:11 -0800 (PST) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.8.8/8.8.7) with ESMTP id EAA13088; Wed, 29 Dec 1999 04:46:55 -0500 (EST) Date: Wed, 29 Dec 1999 04:46:55 -0500 (EST) From: "Matthew N. Dodd" To: Warner Losh Cc: new-bus@FreeBSD.ORG Subject: Re: Another question In-Reply-To: <199912290939.CAA01692@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 29 Dec 1999, Warner Losh wrote: > I've allocated a 16k chunk of system isa memory at the bridge level. > >From time to time children need a hunk of this memory to map in their > attribute memory. The attribute memory has various config registers > in it as well as the CIS. My thinking on the matter was that I'd > allocate the 16k chunk at bridge attach time, and then just give it > out to the children who are requesting a memory area be mapped in as > the default. However, when I go to do this, the allocation fails > because the bridge is holding the allocation. If I understand the issue correctly, your call to bus_alloc_resource() is failing because you are using bus_generic_alloc_resource() as PCCARD's BUS_ALLOC_RESOURCE() handler. What you should be doing is using your own method to arbitrate access to the parents already allocated resources (ie, not passing the resource allocation up to the parent's parent.) -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | This Space For Rent | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Wed Dec 29 1:50:25 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 2E1CE14E46 for ; Wed, 29 Dec 1999 01:50:23 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id CAA43006; Wed, 29 Dec 1999 02:50:21 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id CAA01762; Wed, 29 Dec 1999 02:50:21 -0700 (MST) Message-Id: <199912290950.CAA01762@harmony.village.org> To: "Matthew N. Dodd" Subject: Re: Another question Cc: new-bus@FreeBSD.ORG In-reply-to: Your message of "Wed, 29 Dec 1999 04:46:55 EST." References: Date: Wed, 29 Dec 1999 02:50:21 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message "Matthew N. Dodd" writes: : If I understand the issue correctly, your call to bus_alloc_resource() is : failing because you are using bus_generic_alloc_resource() as PCCARD's : BUS_ALLOC_RESOURCE() handler. : : What you should be doing is using your own method to arbitrate access to : the parents already allocated resources (ie, not passing the resource : allocation up to the parent's parent.) Ahhhh. The light bulb grows bright where once it was dim. That makes perfect sense. For some things I pass it up, for others I give from the space that I have. I'll have to go look at the nexus code to see what it does... Thanks for the pointer. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Wed Dec 29 2:36: 4 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id DAE6215605 for ; Wed, 29 Dec 1999 02:36:00 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id KAA25175; Wed, 29 Dec 1999 10:36:17 GMT (envelope-from dfr@nlsystems.com) Date: Wed, 29 Dec 1999 10:36:05 +0000 (GMT) From: Doug Rabson To: Warner Losh Cc: new-bus@freebsd.org Subject: Re: Another question In-Reply-To: <199912290939.CAA01692@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 29 Dec 1999, Warner Losh wrote: > > I have a question about a parent giving a child a portion of the > address range that the parent has allocated for that child's use. > > I've allocated a 16k chunk of system isa memory at the bridge level. > >From time to time children need a hunk of this memory to map in their > attribute memory. The attribute memory has various config registers > in it as well as the CIS. My thinking on the matter was that I'd > allocate the 16k chunk at bridge attach time, and then just give it > out to the children who are requesting a memory area be mapped in as > the default. However, when I go to do this, the allocation fails > because the bridge is holding the allocation. > > What's the right new bus way to deal with this. Is it to free the > resource at the bridge level and give it to the child? Is there some > subspace mapping available that I've missed? What you probably need to do is call the rman_* functions directly. Allocate the 16k chunk with the parent as you do now, then define a new resource manager using something like this: sc->attr_rman.rm_start = rman_get_start(res); sc->attr_rman.rm_end = rman_get_end(res); sc->attr_rman.rm_type = RMAN_ARRAY; sc->attr_rman.rm_descr = "Attribute memory"; rman_init(&sc->attr_rman); rman_manage_region(&sc->attr_rman, rman_get_start(res), rman_get_end(res)); You can then implement bus_alloc_resource etc. using rman functions such as rman_reserve_resource() and rman_activate_resource(). > > Finally, the attribute memory on a pccard can be much bigger than the > 4k window which the pcic bridge allows to be mapped at one time. How > does one specify a card relative offset using the new bus allocation > routines (eg, I want to say "allocate this hunk of memory at the > default place and start at offset 16k in the card's address space"). > I suppose I could come up with a kludge that moves the offset after it > has been allocated/activated, but I thought I'd bounce things off the > folks here. I can't quite understand the question. Are you saying that there is a window into a larger address range and that the window is mapped to a 4k range of host addresses? In that case, probably you will need a pccard-specific method on the parent which the child can call to move the window around. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Wed Dec 29 8:23: 6 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 739C815182 for ; Wed, 29 Dec 1999 08:23:04 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id JAA43786; Wed, 29 Dec 1999 09:23:02 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id JAA02848; Wed, 29 Dec 1999 09:23:01 -0700 (MST) Message-Id: <199912291623.JAA02848@harmony.village.org> To: Doug Rabson Subject: Re: Another question Cc: new-bus@FreeBSD.org In-reply-to: Your message of "Wed, 29 Dec 1999 10:36:05 GMT." References: Date: Wed, 29 Dec 1999 09:23:01 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Doug Rabson writes: : I can't quite understand the question. Are you saying that there is a : window into a larger address range and that the window is mapped to a 4k : range of host addresses? Yes. That's exactly what I'm saying. The attribute memory can be up to I think 1MB, and the normal memory window can be up to something like 64MB. : In that case, probably you will need a pccard-specific method on the : parent which the child can call to move the window around. OK. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message