Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2000 14:13:46 +1100
From:      "Tony Frank (EPA)" <Tony.Frank@ericsson.com.au>
To:        "'Matthew N. Dodd'" <winter@jurai.net>
Cc:        "'freebsd-hackers@freebsd.org'" <freebsd-hackers@FreeBSD.ORG>
Subject:   RE: How do I allocate 2 blocks of memory?
Message-ID:  <4B6BC00CD15FD2119E5F0008C7A419A5069CB74A@eaubrnt018.epa.ericsson.se>

next in thread | raw e-mail | index | archive | help
Hi,

	>> 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?

Basically, it would mean manually configuring the card (eg using LANAIDC via
bootable floppy) to have the configuration described above.

Since the card supports having the MMIO and the SRAM in seperate areas,
essentially the driver should support this also.

I'm not sure whether the card will let me arrange the memory locations so
that it's all continuous.

	> 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:

Hmm...  I have the "IBM Auto 16/4 Token-Ring Adapter"...  I have about 3
different revisions too, although they all appear to work the same way.  

One issue that I havn't really looked at yet is having the adapter in 'plug
and play' mode.  

So far, if the adapter is in PnP mode, when I do my "normal" probing, it
appears that there is no configuration stored, ie I read 0x0 instead of some
valid details.

I assume that I need to do some form of 'PnP configuration' but I am yet to
start looking into this.

	>> 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.

I think bus_set_resource() is what I'm looking for, as opposed to
bus_alloc_resource()...

One other general sort of question...  is there any kind of description on
how these bus_* functions operate and interact?

I've basically been working my way through a few different drivers and from
other assorted files in the /usr/src/sys area, but although I see examples
of what other drivers are doing, I'm not always sure on why.   It seems to
be mostly luck for me to accidentally stumble on an answer to a question I'm
wondering about...

Thanks for you help,

Tony




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?4B6BC00CD15FD2119E5F0008C7A419A5069CB74A>