Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2003 21:21:46 -0400
From:      "Brian J. McGovern" <mcgovern@beta.com>
To:        hackers@freebsd.org
Subject:   Questions on newbus...
Message-ID:  <200305160121.h4G1LkPS036046@spoon.beta.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305160121.h4G1LkPS036046>