Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2000 21:30:08 -0500 (EST)
From:      "Matthew N. Dodd" <winter@jurai.net>
To:        "Tony Frank (EPA)" <Tony.Frank@ericsson.com.au>
Cc:        "'freebsd-hackers@freebsd.org'" <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: How do I allocate 2 blocks of memory?
Message-ID:  <Pine.BSF.4.21.0001202121480.462-100000@sasami.jurai.net>
In-Reply-To: <4B6BC00CD15FD2119E5F0008C7A419A5069CB744@eaubrnt018.epa.ericsson.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Jan 2000, Tony Frank (EPA) wrote:
> I think I could configure the card to use the range 0xd0000 - 0xd3fff
> for the SRAM and then 0xd4000 - 0xd5fff for the MMIO, thus having a
> continuous block between 0xd0000 and 0xd5fff that I might be able to
> allocate in one hit.  This however seems to be a bit of a workaround.

I'm not sure how using 1 memory area is a workaround; from your driver
point of view you're just going to be assigning pointers in your softc to
physical memory addresses in that range no?

> Essentially I have been using the source from other drivers to try and
> understand how the system works, but I am yet to find one that allocates two
> sets of memory.

Thats what 'rid' is for; since you can probably ask the card what its
resources are you really don't need to use the ISA hint mechanism; you can
do something like this:

device foo0	at isa? port 0xa20

And let your probe routine dig the rest of the resources out of the
adpater and add them using bus_set_resource(), or you can be more tricky
and use a DEVICE_IDENTIFY method to look for any cards, add devices for
them and assign resources to them.  This would net you a config entry
looking something like this:

device foo0

Anyhow, I can help you out with any of the newbus/resource questions you
may have.  I've got the MCA versions of those boards and will add the
bus front ends to your driver when you've got it ready.  I suggest you
split your driver into the driver proper, and the bus front ends:

if_foo_isa.c
if_foo.c
if_fooreg.h
if_foovar.h

etc...

> One other issue that I am wondering about is overriding settings
> provided in the config file.  If I specify an IRQ of 11, when the card
> is programmed to use 9, the bus_alloc_resource will give back an IRQ
> value of 11, which causes problems later as the card is using 9.  I
> can read the IRQ value that the card is set to, but I'm not sure on
> the correct procedure to request that specific IRQ for my driver?

In your probe routine you may use bus_set_resource(dev, SYS_RES_IRQ, 0,
irq#, 1);

This will override the IRQ that was specified in the config file; you
might want to do a test to see if the configured IRQ is different than the
board IRQ though.

-- 
| 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-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0001202121480.462-100000>