Subject: Re: Ordering device probes
To: Peter Seebach <seebs@plethora.net>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 02/20/2006 15:25:29
On Feb 20, 2006, at 3:18 PM, Jason Thorpe wrote:
>
> On Feb 20, 2006, at 3:10 PM, Peter Seebach wrote:
>
>> Well, the alternative proposed appears to be to essentially
>> completely
>> duplicate the entire i2c bus architecture in a given platform's
>> machdep.c,
>> giving us two copies of all of that code, and leaving it subject
>> to bit rot
>> and divergence.
>
> No, that's not the alternative. If you need to use I2C early, then
> bootstrap the I2C back-end driver early and use it (the I2C exec
> code can handle this -- Wasabi has/had at least one platform that
> uses I2C early in this way, although that code is not available in
> the public tree, unfortunately).
Here's a hint:
1- Modify the chip-specific i2c back-end to return an i2c_tag_t
suitable for use in early bootstrap.
2- In machdep code, get the bootstrap i2c tag and use it to call
seeprom_bootstrap_read() to get the data you want.
3- In device_register(), use device properties to associate the data
read out of the SEEPROM with the appropriate emac instance.
-- thorpej