diff options
author | Albrecht Dreß <albrecht.dress@arcor.de> | 2010-02-17 03:59:14 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-08-01 19:06:44 -0400 |
commit | 0c2daaafcdec726e89cbccca61d576de8429c537 (patch) | |
tree | 3d63a499f75ec072aafd8265763392faa8f64930 /Documentation/powerpc | |
parent | 652078bac5f206c628a85a9a6598e6b8076bd8e6 (diff) |
powerpc/5200/i2c: improve i2c bus error recovery
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.
Tested on a custom Lite5200b derived board, with a Dallas RTC, AD sensors
and NXP IO expander chips attached to the i2c.
Changes vs. v1:
- use improved bus fixup sequence for all chips (not only the 5200)
- calculate real clock from defaults if no clock is given in the device tree
- better description (I hope) of the changes.
I didn't split the changes in this file into three parts as recommended by
Grant, as they actually belong together (i.e. they address one single
problem, just in three places of one single source file).
Signed-off-by: Albrecht Dreß <albrecht.dress@arcor.de>
[grant.likely@secretlab.ca: fixup for ->node to ->dev.of_node transition]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'Documentation/powerpc')
-rw-r--r-- | Documentation/powerpc/dts-bindings/fsl/i2c.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt index 50da2031058..1eacd6b20ed 100644 --- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt +++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt | |||
@@ -20,6 +20,7 @@ Recommended properties : | |||
20 | - fsl,preserve-clocking : boolean; if defined, the clock settings | 20 | - fsl,preserve-clocking : boolean; if defined, the clock settings |
21 | from the bootloader are preserved (not touched). | 21 | from the bootloader are preserved (not touched). |
22 | - clock-frequency : desired I2C bus clock frequency in Hz. | 22 | - clock-frequency : desired I2C bus clock frequency in Hz. |
23 | - fsl,timeout : I2C bus timeout in microseconds. | ||
23 | 24 | ||
24 | Examples : | 25 | Examples : |
25 | 26 | ||
@@ -59,4 +60,5 @@ Examples : | |||
59 | interrupts = <43 2>; | 60 | interrupts = <43 2>; |
60 | interrupt-parent = <&mpic>; | 61 | interrupt-parent = <&mpic>; |
61 | clock-frequency = <400000>; | 62 | clock-frequency = <400000>; |
63 | fsl,timeout = <10000>; | ||
62 | }; | 64 | }; |