Subject: Fwd: Re: Queries about bus_space (MIPS: TX49)
To: NetBSD tech-kern <tech-kern@netbsd.org>
From: Anand Lalgondar <solarflares@fastmail.fm>
List: tech-kern
Date: 02/02/2004 20:35:07
> 
> >    - Now is this with respect to a device driver file or the
> >    'sys/arch/mips/bus_space_alignstride_chipdep.c'
> Device driver file. bus_space_alignstride_chipdep.c is the file that
> implements bus_space.
> -- 
But these contains only macro definition, how to use this is a question?


> > 4. Access to regions of bus space is facilitated by use of bus space
> > handles, which are usually created by mapping a specific range of a
> > bus space.
> >    - bus_space_map function should be used to get the same - but I
> >    could not find one in the MIPS specific directory.
> See
> __BS(map)(void *v, bus_addr_t addr, bus_size_t size, int flags,
>     bus_space_handle_t *hp, int acct)
> in the file you mention below.
> 
Now suppose if I want to create a new bus space, can I do it like this:
--------------------------------------------------------------------------
bus_space_tag_t st;
bus_space_handle_t sh;

bus_space_map(st, address, size, flags, &sh); 
/* I could not see bus_space_map function call only __BS(map) is there.
*/
--------------------------------------------------------------------------

OR some other method should be used?
What is the function of __BS(init), does it create a tag OR something
else?


> > 5. Handles may also be created by allocating and mapping a range of
> > bus space, the actual location of which is picked by the
> > implementation within bounds specified by the caller of the allocation
> > function.
> >    - Is it like this -> some on-board peripherals/devices (ROM, SDRAM,
> >    RTC, Ethernet Chip) have been allocated fixed physical address
> >    range(Registers) by the board designer, so only option is to map
> >    them and use the bus space functions to access the registers of the
> >    on-board peripherals/devices?
> Yes. 
Atleast I got one correct :-)


Can I call bus_space_map to a region that is already mapped using the
same bus_space_map function call. I got this doubt because I used the
'PCI space tag' to map the framebuffer memory of the 69030 HiQVideo
Grahpics card. Now in this condition I assue that the PCI space tag is
mapped by calling bus_space_map function call which provides mapping to
the child devices connected.


Thank you for the replies.

 - Anand

-- 
http://www.fastmail.fm - The way an email service should be