Subject: 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 12:25:33
Hello,

I have some queries regarding 'bus_space' functions, could some please
clarify the same. I have gone through the man pages of 'bus_space' and
noted some of the points that I found relavent for this discussion. These
queries are oriented towards MIPS based TX49 processor architecture
(supports '36-bit Physical address space' and '32-bit or 64-bit
[configurable] virtual address space').

Some points of bus_space:
1. Bus spaces are described by bus space tags, which can only be created
by machine-dependent code. A given machine may have several different
types of bus space (e.g. memory space and I/O space), and thus may
provide multiple different bus space tags.
   - Now as per my knowledge there is nothing like I/O space in TX49
   architecutre (is it correct), so the only bus space tags that can be
   created would be of type memory bus space.

2. Architectures may have several different tags which represent the same
type of space, for instant because of multiple different host bus
interface chipsets.
   - i.e. multiple bus space tags to the memory bus space (0x00000000 -
   0xffffffff), i.e. for example bus space tags first one representing
   from 0x00000000 - 0x3fffffff, other from 0x40000000 - 0xbfffffff, and
   another from 0xc0000000 - 0xffffffff for the same memory bus space ?

3. A range in bus space is described by a bus address and a bus size. The
bus address describes the start of the range in bus space. The bus size
describes the size of the range in bytes.
   - considering the above example:
     1. 0x00000000 - 0x3fffffff -> bus address = 0x00000000 and bus size
     = 0x40000000
     2. 0x40000000 - 0xbfffffff -> bus address = 0x40000000 and bus size
     = 0x80000000
     3. 0xc0000000 - 0xffffffff -> bus address = 0xc0000000 and bus size
     = 0x40000000
   - Are these addresses pointing to physical addresses. I think so, but
   I am not sure ?

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.

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?

6. The goal of the bus_space functions is to allow a single driver source
file to manipulate a set of devices on different system architectures,
and to allow a single driver object file to manipulate a set of devices
on multiple a set of devices on multiple bus types on a single
architecture.
   - Now is this with respect to a device driver file or the
   'sys/arch/mips/bus_space_alignstride_chipdep.c'

Well I have some more queries w.r.t bus space of MIPS architecture, If I
could get some clarifications regarding this discussion I could resolve
them my self or I will be posting some more.

Thanks anyways.

 - Anand

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html