* [U-Boot] [MPC8379E-rdb] Question about master bus busy after enabling I2C.
@ 2011-09-02 15:18 shawn Bai
2011-09-05 6:29 ` Heiko Schocher
0 siblings, 1 reply; 3+ messages in thread
From: shawn Bai @ 2011-09-02 15:18 UTC (permalink / raw)
To: u-boot
Hi, here is a question about I2C initialization.
I2C driver of our own references i2c driver implemented in fsl_i2c.c
The init flow is almost the same.
After writing enable-bit MEN into i2c control register to enable I2C controler,
sometimes, Bit 2 in i2c status, MBB bit, will be set, indicating i2c master bus busy.
And this will cause wait4bus return with failing.
Is there anyone around who used to face this question?
Or is there any suggestion or advice anyway?
Thanks in advance.
Best Regards,
Shawn
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [MPC8379E-rdb] Question about master bus busy after enabling I2C.
2011-09-02 15:18 [U-Boot] [MPC8379E-rdb] Question about master bus busy after enabling I2C shawn Bai
@ 2011-09-05 6:29 ` Heiko Schocher
2011-09-08 2:06 ` shawn Bai
0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2011-09-05 6:29 UTC (permalink / raw)
To: u-boot
Hello shawn,
shawn Bai wrote:
> Hi, here is a question about I2C initialization.
>
> I2C driver of our own references i2c driver implemented in fsl_i2c.c
>
> The init flow is almost the same.
>
> After writing enable-bit MEN into i2c control register to enable I2C controler,
>
> sometimes, Bit 2 in i2c status, MBB bit, will be set, indicating i2c master bus busy.
>
> And this will cause wait4bus return with failing.
>
> Is there anyone around who used to face this question?
>
> Or is there any suggestion or advice anyway?
Try a look in u-boot/doc/I2C_Edge_Conditions. Maybe your I2C bus
is left in a blocked state, so try to deblock it. As for an example
look in
board/keymile/common/common.c
There is a deblock sequence also for MPC83xx, maybe this helps you.
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [MPC8379E-rdb] Question about master bus busy after enabling I2C.
2011-09-05 6:29 ` Heiko Schocher
@ 2011-09-08 2:06 ` shawn Bai
0 siblings, 0 replies; 3+ messages in thread
From: shawn Bai @ 2011-09-08 2:06 UTC (permalink / raw)
To: u-boot
Hi, Heiko,
> Date: Mon, 5 Sep 2011 08:29:58 +0200
> From: hs at denx.de
> Subject: Re: [U-Boot] [MPC8379E-rdb] Question about master bus busy after enabling I2C.
> To: programassem at hotmail.com
> CC: u-boot at lists.denx.de
>
> Hello shawn,
>
> shawn Bai wrote:
> > Hi, here is a question about I2C initialization.
> >
> > I2C driver of our own references i2c driver implemented in fsl_i2c.c
> >
> > The init flow is almost the same.
> >
> > After writing enable-bit MEN into i2c control register to enable I2C controler,
> >
> > sometimes, Bit 2 in i2c status, MBB bit, will be set, indicating i2c master bus busy.
> >
> > And this will cause wait4bus return with failing.
> >
> > Is there anyone around who used to face this question?
> >
> > Or is there any suggestion or advice anyway?
>
> Try a look in u-boot/doc/I2C_Edge_Conditions. Maybe your I2C bus
> is left in a blocked state, so try to deblock it. As for an example
> look in
>
> board/keymile/common/common.c
>
> There is a deblock sequence also for MPC83xx, maybe this helps you.
It seems that the deblock sequence is implemented in function called i2c_make_abort, isn't it ?
I find there are some us delays with calling udelay(DELAY_ABORT_SEQ).
And the DELAY_ABORT_SEQ duration is calculated from the i2c bus speed.
Actually,
We have inserted udelay(100) prior to the statement enabling MEN and right after it before in code of our own
when the question comes.
I will review the code to make this duration more suitable for the i2c speed specified.
Thanks.
Best Regards,
--Shawn
>
> bye,
> Heiko
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-08 2:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-02 15:18 [U-Boot] [MPC8379E-rdb] Question about master bus busy after enabling I2C shawn Bai
2011-09-05 6:29 ` Heiko Schocher
2011-09-08 2:06 ` shawn Bai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox