[U-Boot] [PATCH 2/2] Powerpc/i2c: Force i2c to become bus master out of reset

Huang Changming-R66093 r66093 at freescale.com
Fri Oct 28 07:21:13 CEST 2011


> > >
> > These tow part codes are doing the different thing due to the
> different reason:
> > 1. Kernel's code:
> > because Sometimes 9th clock pulse isn't generated, that code is to
> generate the 9th clock pulse.
> 
> What code are you looking at? Are you just reading the comment?
> Look at http://git.kernel.org/?p=linux/kernel/git/next/linux-
> next.git;a=commit;h=0c2daaafcdec726e89cbccca61d576de8429c537
> to get a clue.
> 
> Your code isn't complete, you cannot trust the manual to be the whole
> truth.
> 
I am very confused, why do you always say my code isn't complete?
I have described I want to do detailed in comment.
"when a system reset does not cause all I2C devices to be reset", 
My codes will force the I2c module to become bus master and drive SCL,
which force this i2c module to generate SCL so that the device driving SDA can finish its transaction.
These codes have been used on Emerson's P1022 board and resolved his issue (board will hang when u-boot booting, with my codes, this issue is resolved and board can boot well)
This is one feature of FSL I2C almost cover all 85xx platform, and the code according to the RM has been verified, don't you think the manual can be trust?

Below is the description from your link:
This patch improves the recovery of the MPC's I2C bus from errors like bus
hangs resulting in timeouts:
1. make the bus timeout configurable, as it depends on the bus clock and
    the attached slave chip(s); default is still 1 second;
2. detect any of the cases indicated by the CF, BB and RXAK MSR flags if a
    timeout occurs, and add a missing (required) MAL reset;
3. use a more reliable method to fixup the bus if a hang has been detected.
    The sequence is sent 9 times which seems to be necessary if a slave
    "misses" more than one clock cycle.  For 400 kHz bus speed, the fixup is
    also ~70us (81us vs. 150us) faster.

This patch is created because a slave miss more than one clock cycle and can resolve this issue.

So, the kernel's patch and my patch is to resolve the different issue. 




More information about the U-Boot mailing list