Subject: Re: Fwd: Re: Queries about bus_space (MIPS: TX49)
To: Anand Lalgondar <solarflares@fastmail.fm>
From: Jachym Holecek <freza@psi.cz>
List: tech-kern
Date: 02/03/2004 15:47:44
Hello,
> > > But is it neccessary
> > > to create all the tags before autoconfiguration process?
> > What do you mean with "all the tags"? You have only one. (Or maybe two
> > for distinct I/O and memory spaces. But this depends on your hardware
> > and implementation.) All tags (bus space and bus dma) must be valid at
> > the start of autoconfig. The tags are passed along down the device tree
> > in the attach args. Device drivers copy them to there internal data
> > structures at attach time.
> >
> Well I have the __BS(init) function call in one of the parent driver.
> This is with resepect to the case of PCI I/O and memory space tag
> creation.
>
> something like the below in the 'mainbus' driver:
>
> /* Initialise the interrupt part of our PCI chipset tag. */
> rbtx4927_pci_init(&sc->sc_pci_chipset, sc);
>
> /* Initialise the PCI spaces. */
> rbtx4927_bus_io_init(&sc->sc_pci_iot, sc);
> rbtx4927_bus_mem_init(&sc->sc_pci_memt, sc);
>
> Now if I have to support a PCMCIA protocol which supports three address
> space(attribute, memory and I/O each of 64MB) then I have create three
> new tags to access the individual addresses. ??
Depends what your architecture looks like, bus space tags should represnt
the CPU bus (as I understand it). Look at
sys/arch/arm/sa11x0/sa11xx_pcic.c
for an example - the StrongARM has only one bus space tag (since all
I/O is memory mapped), so access to PCMCIA attr/mem/io is translated
to access to well-defined physical memory areas.
Hope this helps,
-- Jachym Holecek