Subject: Re: can't figure bus_space_map() out
To: None <tech-kern@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-kern
Date: 04/17/2002 09:26:31
On Wed, Apr 17, 2002 at 05:10:55 +0200, Alexander Funcke wrote:

>     if (bus_space_map(I386_BUS_SPACE_IO, (bus_addr_t) gx_base, 
> 	GX_BASE_SIZE, BUS_SPACE_MAP_LINEAR, gx1_control) != 0) 
> 
> In linux it's done with gx1_control = ioremap(gx_base, GX_BASE_SIZE).

As far as I can tell, linux ioremap() remaps memory space, not io
space.  So you probably want some other space, not I386_BUS_SPACE_IO.


> If I'll run it like this, it just return non-zero and my printf()
> draw attention.

Because BUS_SPACE_MAP_LINEAR tells that you want to be able to access
the region with pointer dereferencing.  On i386 i/o cycles are
generated by special in/out instructions, so it cannot be mapped
"linear" on i386.

> But running without BUS_SPACE_MAP_LINEAR (i.e. insted with 0
> as flags.) I'll get this error message at boot-time:
> 
> BASE_ADDR: 0x40000000

You are, obviously, trying to use wrong bus space.


SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen