Questions on newbus...

Brian J. McGovern mcgovern at beta.com
Thu May 15 18:21:50 PDT 2003


I've been starting to update my Cyclades-Z driver to work with FreeBSD 5.0.
I've read the docs in the developer's handbook, and the article on new bus. 
Searching the mailing lists for "newbus" found 2 items... I've been trying to
use other drivers as guides, but they don't seem to be either consistent
or well documented :)

I seem to be getting stuck during the mapping of resources. I currently go
out and use bus_alloc_resource() to get the PCI resources for the two
configuration registers that will give me the board's registers and 
memory window. I then use rman_get_bustag and rman_get_bushandle to get the
tags and handles, respectively, then call bus_space_read_4() to read the
configuration registers.

Now, I haven't done a lot of testing with the actual hardware (I haven't
updated the initialization code yet), but I'm assuming that these 
bus_space_read() calls should give me physical address locations... In 4.x
(and earlier), the routines for allocating the resources would provide both
physical and virtual addresses. 

If I'm on track, how would I then properly convert these physical addresses
to usable virtual addresses?

If I'm off track (and I somehow expect I am), can someone take a few minutes
and coach me on how to read the PCI configuration registers, and get my
two memory windows mapped so I can start bit-banging the hardware? :)

	-Brian


More information about the freebsd-hackers mailing list