Subject: Re: Ordering device probes
To: Peter Seebach <seebs@plethora.net>
From: Jachym Holecek <freza@dspfpga.com>
List: tech-kern
Date: 02/21/2006 11:23:27
> [reading i2c seeprom during early bootstrap]
>
> See, the i2c controller, so far as I can tell, doesn't start out mapped in.
> It gets mapped during the attach of the bus it's attached to, and at least
> some mapping happens during its own attach.

Actually, if your startup code is close-enough to that of Walnut,
you have all on-chip peripherals mapped in the initial TLB setup.
Take a look at powerpc/include/ibm4xx/ibm405gp.h for (physical) base
addresses -- now in walnut_start.S you'll see that 0xef000000
upto 0xff000000 is mapped in. You can use opb_get_bus_space_tag()
to get a tag for bus_space(9) to use.

> Thus, my "simple" bootstrap code ends up needing AT LEAST to fully map the
> device, and this in turn requires information which simply may not exist that
> early in the boot.
> 
> Worse, since it's an error to remap the same space, I have to undo the maps
> when I'm done so the attach won't be violating the bus_space_map API.

opb_get_bus_space_tag() can be called multiple times by your
machdep code if you really need (which I don't think -- just
reuse the one you're using for UART console).

> But it may not matter; I'm not even entirely sure that the addresses
> in question are guaranteed to be constants [...]

They are constants on your core -- see 405GP user's guide.

	-- Jachym