Dear Timur,

In message <[EMAIL PROTECTED]> you wrote:
> 
> How early?  Is there anyone with an 8xx board that can test this out for me?
> I2C is used for programming DDR on 8xxx boards, and that's pretty early, but
> 8xxx doesn't have this problem.

For example, check the "LWMON" board (CONFIG_LWMON). This is a MPC823
based system, where the SCC2 port can be switched (yes, even  at  run
time)  to  be  used  either  as a serial port or as Ethernet. If this
board is configured as serial console, this configuration must (1) be
detected by reading a register from an  I2C  attached  PIC,  and  (2)
Ethernet must be switched off by writing a register in a I2C attached
PIC - see "cpu/mpc8xx/serial.c":

415 static int scc_init (void)
416 {
...
432 #if defined(CONFIG_LWMON) && defined(CONFIG_8xx_CONS_SCC2)
433     {   /* Disable Ethernet, enable Serial */
434         uchar c;
435
436         c = pic_read  (0x61);
437         c &= ~0x40;     /* enable COM3 */
438         c |=  0x80;     /* disable Ethernet */
439         pic_write (0x61, c);

pic_read() and pic_write() in turn call directly i2c_reg_read() resp.
i2c_reg_write().

I guess there are other places where things like this are used.  Some
boards  also  come  with  a  "console over modem" configuration which
might use I2C very early, IIRC.

> It seems "wrong" that i2c_reg_read() needs to initialize I2C, but i2c_read()
> doesn't.

You are certainly right. But when this code was added  everthing  was
much smaller and simpler ...

> I was going to CC: all the maintainers of 8xx boards, but they're too many of 
> them.

He.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Some programming languages manage to  absorb  change,  but  withstand
progress.          -- Epigrams in Programming, ACM SIGPLAN Sept. 1982

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to