xref: /openbmc/linux/Documentation/devicetree/bindings/i2c/i2c-rk3x.yaml (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
187ff65b5SJohan Jonker# SPDX-License-Identifier: GPL-2.0
287ff65b5SJohan Jonker%YAML 1.2
387ff65b5SJohan Jonker---
487ff65b5SJohan Jonker$id: http://devicetree.org/schemas/i2c/i2c-rk3x.yaml#
587ff65b5SJohan Jonker$schema: http://devicetree.org/meta-schemas/core.yaml#
687ff65b5SJohan Jonker
787ff65b5SJohan Jonkertitle: Rockchip RK3xxx I2C controller
887ff65b5SJohan Jonker
987ff65b5SJohan Jonkerdescription:
1087ff65b5SJohan Jonker  This driver interfaces with the native I2C controller present in Rockchip
1187ff65b5SJohan Jonker  RK3xxx SoCs.
1287ff65b5SJohan Jonker
1387ff65b5SJohan JonkerallOf:
1487ff65b5SJohan Jonker  - $ref: /schemas/i2c/i2c-controller.yaml#
1587ff65b5SJohan Jonker
1687ff65b5SJohan Jonkermaintainers:
1787ff65b5SJohan Jonker  - Heiko Stuebner <heiko@sntech.de>
1887ff65b5SJohan Jonker
1987ff65b5SJohan Jonker# Everything else is described in the common file
2087ff65b5SJohan Jonkerproperties:
2187ff65b5SJohan Jonker  compatible:
2287ff65b5SJohan Jonker    oneOf:
2387ff65b5SJohan Jonker      - const: rockchip,rv1108-i2c
2487ff65b5SJohan Jonker      - const: rockchip,rk3066-i2c
2587ff65b5SJohan Jonker      - const: rockchip,rk3188-i2c
2687ff65b5SJohan Jonker      - const: rockchip,rk3228-i2c
2787ff65b5SJohan Jonker      - const: rockchip,rk3288-i2c
2887ff65b5SJohan Jonker      - const: rockchip,rk3399-i2c
2987ff65b5SJohan Jonker      - items:
3087ff65b5SJohan Jonker          - enum:
31e44296eaSJohan Jonker              - rockchip,rk3036-i2c
32*ada378f3SJohan Jonker              - rockchip,rk3128-i2c
33e5b250dfSJohan Jonker              - rockchip,rk3368-i2c
34e44296eaSJohan Jonker          - const: rockchip,rk3288-i2c
35e44296eaSJohan Jonker      - items:
36e44296eaSJohan Jonker          - enum:
37a0f17945SJohan Jonker              - rockchip,px30-i2c
389354371dSJohan Jonker              - rockchip,rk3308-i2c
3987ff65b5SJohan Jonker              - rockchip,rk3328-i2c
40469668a5SLiang Chen              - rockchip,rk3568-i2c
41066ab294SSebastian Reichel              - rockchip,rk3588-i2c
4249897cfeSJagan Teki              - rockchip,rv1126-i2c
4387ff65b5SJohan Jonker          - const: rockchip,rk3399-i2c
4487ff65b5SJohan Jonker
4587ff65b5SJohan Jonker  reg:
4687ff65b5SJohan Jonker    maxItems: 1
4787ff65b5SJohan Jonker
4887ff65b5SJohan Jonker  interrupts:
4987ff65b5SJohan Jonker    maxItems: 1
5087ff65b5SJohan Jonker
5187ff65b5SJohan Jonker  clocks:
5287ff65b5SJohan Jonker    minItems: 1
5387ff65b5SJohan Jonker    items:
5487ff65b5SJohan Jonker      - description:
5587ff65b5SJohan Jonker          For older hardware (rk3066, rk3188, rk3228, rk3288)
5687ff65b5SJohan Jonker          there is one clock that is used both to derive the functional clock
5787ff65b5SJohan Jonker          for the device and as the bus clock.
5887ff65b5SJohan Jonker          For newer hardware (rk3399) this clock is used to derive
5987ff65b5SJohan Jonker          the functional clock
6087ff65b5SJohan Jonker      - description:
6187ff65b5SJohan Jonker          For newer hardware (rk3399) this is the bus clock
6287ff65b5SJohan Jonker
6387ff65b5SJohan Jonker  clock-names:
6487ff65b5SJohan Jonker    minItems: 1
6587ff65b5SJohan Jonker    items:
6687ff65b5SJohan Jonker      - const: i2c
6787ff65b5SJohan Jonker      - const: pclk
6887ff65b5SJohan Jonker
6987ff65b5SJohan Jonker  rockchip,grf:
7087ff65b5SJohan Jonker    $ref: /schemas/types.yaml#/definitions/phandle
7187ff65b5SJohan Jonker    description:
7287ff65b5SJohan Jonker      Required on RK3066, RK3188 the phandle of the syscon node for
7387ff65b5SJohan Jonker      the general register file (GRF)
7487ff65b5SJohan Jonker      On those SoCs an alias with the correct I2C bus ID
7587ff65b5SJohan Jonker      (bit offset in the GRF) is also required.
7687ff65b5SJohan Jonker
7787ff65b5SJohan Jonker  clock-frequency:
7887ff65b5SJohan Jonker    default: 100000
7987ff65b5SJohan Jonker    description:
8087ff65b5SJohan Jonker      SCL frequency to use (in Hz). If omitted, 100kHz is used.
8187ff65b5SJohan Jonker
8287ff65b5SJohan Jonker  i2c-scl-rising-time-ns:
8387ff65b5SJohan Jonker    default: 1000
8487ff65b5SJohan Jonker    description:
8587ff65b5SJohan Jonker      Number of nanoseconds the SCL signal takes to rise
8687ff65b5SJohan Jonker      (t(r) in I2C specification). If not specified this is assumed to be
8787ff65b5SJohan Jonker      the maximum the specification allows(1000 ns for Standard-mode,
8887ff65b5SJohan Jonker      300 ns for Fast-mode) which might cause slightly slower communication.
8987ff65b5SJohan Jonker
9087ff65b5SJohan Jonker  i2c-scl-falling-time-ns:
9187ff65b5SJohan Jonker    default: 300
9287ff65b5SJohan Jonker    description:
9387ff65b5SJohan Jonker      Number of nanoseconds the SCL signal takes to fall
9487ff65b5SJohan Jonker      (t(f) in the I2C specification). If not specified this is assumed to
9587ff65b5SJohan Jonker      be the maximum the specification allows (300 ns) which might cause
9687ff65b5SJohan Jonker      slightly slower communication.
9787ff65b5SJohan Jonker
9887ff65b5SJohan Jonker  i2c-sda-falling-time-ns:
9987ff65b5SJohan Jonker    default: 300
10087ff65b5SJohan Jonker    description:
10187ff65b5SJohan Jonker      Number of nanoseconds the SDA signal takes to fall
10287ff65b5SJohan Jonker      (t(f) in the I2C specification). If not specified we will use the SCL
10387ff65b5SJohan Jonker      value since they are the same in nearly all cases.
10487ff65b5SJohan Jonker
10587ff65b5SJohan Jonkerrequired:
10687ff65b5SJohan Jonker  - compatible
10787ff65b5SJohan Jonker  - reg
10887ff65b5SJohan Jonker  - interrupts
10987ff65b5SJohan Jonker  - clocks
11087ff65b5SJohan Jonker  - clock-names
11187ff65b5SJohan Jonker
11287ff65b5SJohan Jonkerif:
11387ff65b5SJohan Jonker  properties:
11487ff65b5SJohan Jonker    compatible:
11587ff65b5SJohan Jonker      contains:
11687ff65b5SJohan Jonker        enum:
11787ff65b5SJohan Jonker          - rockchip,rk3066-i2c
11887ff65b5SJohan Jonker          - rockchip,rk3188-i2c
11987ff65b5SJohan Jonker
12087ff65b5SJohan Jonkerthen:
12187ff65b5SJohan Jonker  required:
12287ff65b5SJohan Jonker    - rockchip,grf
12387ff65b5SJohan Jonker
1246fdc6e23SRob HerringunevaluatedProperties: false
1256fdc6e23SRob Herring
12687ff65b5SJohan Jonkerexamples:
12787ff65b5SJohan Jonker  - |
12887ff65b5SJohan Jonker    #include <dt-bindings/clock/rk3188-cru-common.h>
12987ff65b5SJohan Jonker    #include <dt-bindings/interrupt-controller/arm-gic.h>
13087ff65b5SJohan Jonker    #include <dt-bindings/interrupt-controller/irq.h>
13187ff65b5SJohan Jonker    i2c0: i2c@2002d000 {
13287ff65b5SJohan Jonker      compatible = "rockchip,rk3188-i2c";
13387ff65b5SJohan Jonker      reg = <0x2002d000 0x1000>;
13487ff65b5SJohan Jonker      interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
13587ff65b5SJohan Jonker      clocks = <&cru PCLK_I2C0>;
13687ff65b5SJohan Jonker      clock-names = "i2c";
13787ff65b5SJohan Jonker      rockchip,grf = <&grf>;
13887ff65b5SJohan Jonker      i2c-scl-falling-time-ns = <100>;
13987ff65b5SJohan Jonker      i2c-scl-rising-time-ns = <800>;
14087ff65b5SJohan Jonker      #address-cells = <1>;
14187ff65b5SJohan Jonker      #size-cells = <0>;
14287ff65b5SJohan Jonker    };
143