Subject: Re: can't figure bus_space_map() out
To: Alexander Funcke <funcke@daemon.se>
From: Gregory McGarry <g.mcgarry@ieee.org>
List: tech-kern
Date: 04/18/2002 08:14:59
Alexander Funcke wrote:

> >From a function set to cpu_setup in struct cpu_cpuid_nameclass I call
> bus_space_map like this:
> 
> bus_space_handle_t *gx1_control;
> unsigned int gx_base;
> 
>  if(gx_base) {
>     printf("BASE_ADDR: 0x%08x\n", gx_base);
>     if (bus_space_map(I386_BUS_SPACE_IO, (bus_addr_t) gx_base, 
> 	GX_BASE_SIZE, BUS_SPACE_MAP_LINEAR, gx1_control) != 0) 
>       printf("Unable to allocate the GX_BASE I/O region\n");
>   }
> 
> In linux it's done with gx1_control = ioremap(gx_base, GX_BASE_SIZE).
> 
> BASE_ADDR: 0x40000000

bus_space is for use on busses in MI code.  You're not attaching to
a bus, you're not in MI code and uvm hasn't been launched yet.

You'll have to pinch some kv space from the kernel, and map the page
yourself.

Do you really need to memory-map something at 2GB to launch the CPU?

	-- Gregory McGarry <g.mcgarry@ieee.org>