From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] 0/12 Multiadapter/multibus I2C
Date: Tue, 17 Feb 2009 10:21:27 +0100 [thread overview]
Message-ID: <499A8197.4060506@denx.de> (raw)
In-Reply-To: <Pine.LNX.4.64ksi.0902162123560.27482@home-gw.koi8.net>
Hello ksi,
ksi at koi8.net wrote:
> On Mon, 16 Feb 2009, Wolfgang Denk wrote:
>
>
>> Dear ksi at koi8.net,
>>
>> In message <Pine.LNX.4.64ksi.0902142104100.6240@home-gw.koi8.net> you wrote:
>>
>>> OK, please explain how that cur_adap_nr->hwadapnr gets assigned. Please also
>>> explain how can one invoke a function on other adapter than "current".
>>> Remember, i2c_init is quite often called BEFORE the code is relocated to RAM
>>> so you can NOT change "current" adapter.
>>>
>> We could assign an entry in the global data for it.
>>
>> But then - how often will it bbe necessary to switch adapters before
>> relocation? What is I2C being used for? To read the SPD data for the
>> RAM init code. Which other adapter would be needed?
>>
>
> I can not tell it right away. There might be several RAM DIMMs with their
> own SPD EPROMS sitting on different busses or something else. It is not like
> we absolutely need this feature right now, urgently but it is so easy to
> implement that it would've been a crime to not to... :)
>
> There is another problem with choosing a proper i2c_init() function with
> i2c_set_bus_num() -- the latter also reprograms I2C multiplexers/switches if
> there are any so you essentially need an initialized adapter to switch to it
> to initialize it. Catch 22...
>
That would not be a problem:
if we are running from flash we could always init in i2c_set_bus_num()
first the new
controllor to which we switch. And if we are running in ram we can always
check in i2c_set_bus_num() if adap->init_done in i2c_adap_t is 1. If
this is not
so, we first init the bus! With this, it should be possible to get rid
of all this i2c_init
calls all over the code ...
One requirement for this:
All "old" code who directly call i2c_read, i2c_write, ... must, if this new
feature is activated, call a i2c_set_bus_num() before accessing the bus. But
this would be only "work" (grep and fix).
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2009-02-17 9:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 22:09 [U-Boot] [PATCH] 0/12 Multiadapter/multibus I2C ksi at koi8.net
2009-02-13 7:52 ` Heiko Schocher
2009-02-13 20:15 ` ksi at koi8.net
2009-02-14 8:47 ` Heiko Schocher
2009-02-15 5:51 ` ksi at koi8.net
2009-02-15 8:15 ` Heiko Schocher
2009-02-16 7:46 ` ksi at koi8.net
2009-02-16 9:03 ` Heiko Schocher
2009-02-16 21:31 ` Wolfgang Denk
2009-02-17 5:56 ` ksi at koi8.net
2009-02-17 12:30 ` Wolfgang Denk
2009-02-16 21:30 ` Wolfgang Denk
2009-02-17 5:52 ` ksi at koi8.net
2009-02-17 12:27 ` Wolfgang Denk
2009-02-16 21:13 ` Wolfgang Denk
2009-02-17 5:32 ` ksi at koi8.net
2009-02-17 9:21 ` Heiko Schocher [this message]
2009-02-17 12:17 ` Wolfgang Denk
2009-02-16 21:10 ` Wolfgang Denk
2009-02-17 5:23 ` ksi at koi8.net
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=499A8197.4060506@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox