diff options
Diffstat (limited to 'Documentation/devicetree/bindings/i2c/i2c-ocores.txt')
-rw-r--r-- | Documentation/devicetree/bindings/i2c/i2c-ocores.txt | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt index 1637c298a1b3..17bef9a34e50 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt | |||
@@ -4,24 +4,60 @@ Required properties: | |||
4 | - compatible : "opencores,i2c-ocores" or "aeroflexgaisler,i2cmst" | 4 | - compatible : "opencores,i2c-ocores" or "aeroflexgaisler,i2cmst" |
5 | - reg : bus address start and address range size of device | 5 | - reg : bus address start and address range size of device |
6 | - interrupts : interrupt number | 6 | - interrupts : interrupt number |
7 | - clock-frequency : frequency of bus clock in Hz | 7 | - clocks : handle to the controller clock; see the note below. |
8 | Mutually exclusive with opencores,ip-clock-frequency | ||
9 | - opencores,ip-clock-frequency: frequency of the controller clock in Hz; | ||
10 | see the note below. Mutually exclusive with clocks | ||
8 | - #address-cells : should be <1> | 11 | - #address-cells : should be <1> |
9 | - #size-cells : should be <0> | 12 | - #size-cells : should be <0> |
10 | 13 | ||
11 | Optional properties: | 14 | Optional properties: |
15 | - clock-frequency : frequency of bus clock in Hz; see the note below. | ||
16 | Defaults to 100 KHz when the property is not specified | ||
12 | - reg-shift : device register offsets are shifted by this value | 17 | - reg-shift : device register offsets are shifted by this value |
13 | - reg-io-width : io register width in bytes (1, 2 or 4) | 18 | - reg-io-width : io register width in bytes (1, 2 or 4) |
14 | - regstep : deprecated, use reg-shift above | 19 | - regstep : deprecated, use reg-shift above |
15 | 20 | ||
16 | Example: | 21 | Note |
22 | clock-frequency property is meant to control the bus frequency for i2c bus | ||
23 | drivers, but it was incorrectly used to specify i2c controller input clock | ||
24 | frequency. So the following rules are set to fix this situation: | ||
25 | - if clock-frequency is present and neither opencores,ip-clock-frequency nor | ||
26 | clocks are, then clock-frequency specifies i2c controller clock frequency. | ||
27 | This is to keep backwards compatibility with setups using old DTB. i2c bus | ||
28 | frequency is fixed at 100 KHz. | ||
29 | - if clocks is present it specifies i2c controller clock. clock-frequency | ||
30 | property specifies i2c bus frequency. | ||
31 | - if opencores,ip-clock-frequency is present it specifies i2c controller | ||
32 | clock frequency. clock-frequency property specifies i2c bus frequency. | ||
17 | 33 | ||
34 | Examples: | ||
35 | |||
36 | i2c0: ocores@a0000000 { | ||
37 | #address-cells = <1>; | ||
38 | #size-cells = <0>; | ||
39 | compatible = "opencores,i2c-ocores"; | ||
40 | reg = <0xa0000000 0x8>; | ||
41 | interrupts = <10>; | ||
42 | opencores,ip-clock-frequency = <20000000>; | ||
43 | |||
44 | reg-shift = <0>; /* 8 bit registers */ | ||
45 | reg-io-width = <1>; /* 8 bit read/write */ | ||
46 | |||
47 | dummy@60 { | ||
48 | compatible = "dummy"; | ||
49 | reg = <0x60>; | ||
50 | }; | ||
51 | }; | ||
52 | or | ||
18 | i2c0: ocores@a0000000 { | 53 | i2c0: ocores@a0000000 { |
19 | #address-cells = <1>; | 54 | #address-cells = <1>; |
20 | #size-cells = <0>; | 55 | #size-cells = <0>; |
21 | compatible = "opencores,i2c-ocores"; | 56 | compatible = "opencores,i2c-ocores"; |
22 | reg = <0xa0000000 0x8>; | 57 | reg = <0xa0000000 0x8>; |
23 | interrupts = <10>; | 58 | interrupts = <10>; |
24 | clock-frequency = <20000000>; | 59 | clocks = <&osc>; |
60 | clock-frequency = <400000>; /* i2c bus frequency 400 KHz */ | ||
25 | 61 | ||
26 | reg-shift = <0>; /* 8 bit registers */ | 62 | reg-shift = <0>; /* 8 bit registers */ |
27 | reg-io-width = <1>; /* 8 bit read/write */ | 63 | reg-io-width = <1>; /* 8 bit read/write */ |