17ea75dd3SSergiu Moga# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
27ea75dd3SSergiu Moga# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
37ea75dd3SSergiu Moga%YAML 1.2
47ea75dd3SSergiu Moga---
57ea75dd3SSergiu Moga$id: http://devicetree.org/schemas/i2c/atmel,at91sam-i2c.yaml#
67ea75dd3SSergiu Moga$schema: http://devicetree.org/meta-schemas/core.yaml#
77ea75dd3SSergiu Moga
87ea75dd3SSergiu Mogatitle: I2C for Atmel/Microchip platforms
97ea75dd3SSergiu Moga
107ea75dd3SSergiu Mogamaintainers:
117ea75dd3SSergiu Moga  - Alexandre Belloni <alexandre.belloni@bootlin.com>
127ea75dd3SSergiu Moga
137ea75dd3SSergiu Mogaproperties:
147ea75dd3SSergiu Moga  compatible:
15*2a4013c0SSergiu Moga    oneOf:
16*2a4013c0SSergiu Moga      - items:
17*2a4013c0SSergiu Moga          - enum:
187ea75dd3SSergiu Moga              - atmel,at91rm9200-i2c
197ea75dd3SSergiu Moga              - atmel,at91sam9261-i2c
207ea75dd3SSergiu Moga              - atmel,at91sam9260-i2c
217ea75dd3SSergiu Moga              - atmel,at91sam9g20-i2c
227ea75dd3SSergiu Moga              - atmel,at91sam9g10-i2c
237ea75dd3SSergiu Moga              - atmel,at91sam9x5-i2c
247ea75dd3SSergiu Moga              - atmel,sama5d4-i2c
257ea75dd3SSergiu Moga              - atmel,sama5d2-i2c
267ea75dd3SSergiu Moga              - microchip,sam9x60-i2c
27*2a4013c0SSergiu Moga      - items:
28*2a4013c0SSergiu Moga          - const: microchip,sama7g5-i2c
29*2a4013c0SSergiu Moga          - const: microchip,sam9x60-i2c
307ea75dd3SSergiu Moga
317ea75dd3SSergiu Moga  reg:
327ea75dd3SSergiu Moga    maxItems: 1
337ea75dd3SSergiu Moga
347ea75dd3SSergiu Moga  interrupts:
357ea75dd3SSergiu Moga    maxItems: 1
367ea75dd3SSergiu Moga
377ea75dd3SSergiu Moga  "#address-cells":
387ea75dd3SSergiu Moga    const: 1
397ea75dd3SSergiu Moga
407ea75dd3SSergiu Moga  "#size-cells":
417ea75dd3SSergiu Moga    const: 0
427ea75dd3SSergiu Moga
437ea75dd3SSergiu Moga  clocks:
447ea75dd3SSergiu Moga    maxItems: 1
457ea75dd3SSergiu Moga
467ea75dd3SSergiu Moga  clock-frequency:
477ea75dd3SSergiu Moga    default: 100000
487ea75dd3SSergiu Moga
497ea75dd3SSergiu Moga  dmas:
507ea75dd3SSergiu Moga    items:
517ea75dd3SSergiu Moga      - description: TX DMA Channel Specifier
527ea75dd3SSergiu Moga      - description: RX DMA Channel Specifier
537ea75dd3SSergiu Moga
547ea75dd3SSergiu Moga  dma-names:
557ea75dd3SSergiu Moga    items:
567ea75dd3SSergiu Moga      - const: tx
577ea75dd3SSergiu Moga      - const: rx
587ea75dd3SSergiu Moga
597ea75dd3SSergiu Moga  atmel,fifo-size:
607ea75dd3SSergiu Moga    $ref: /schemas/types.yaml#/definitions/uint32
617ea75dd3SSergiu Moga    description: |
627ea75dd3SSergiu Moga      Maximum number of data the RX and TX FIFOs can store for
637ea75dd3SSergiu Moga      FIFO capable I2C controllers.
647ea75dd3SSergiu Moga
657ea75dd3SSergiu Moga  scl-gpios: true
667ea75dd3SSergiu Moga
677ea75dd3SSergiu Moga  sda-gpios: true
687ea75dd3SSergiu Moga
697ea75dd3SSergiu Mogarequired:
707ea75dd3SSergiu Moga  - compatible
717ea75dd3SSergiu Moga  - reg
727ea75dd3SSergiu Moga  - interrupts
737ea75dd3SSergiu Moga  - "#address-cells"
747ea75dd3SSergiu Moga  - "#size-cells"
757ea75dd3SSergiu Moga  - clocks
767ea75dd3SSergiu Moga
777ea75dd3SSergiu MogaallOf:
787ea75dd3SSergiu Moga  - $ref: "i2c-controller.yaml"
797ea75dd3SSergiu Moga  - if:
807ea75dd3SSergiu Moga      properties:
817ea75dd3SSergiu Moga        compatible:
827ea75dd3SSergiu Moga          contains:
837ea75dd3SSergiu Moga            enum:
847ea75dd3SSergiu Moga              - atmel,sama5d4-i2c
857ea75dd3SSergiu Moga              - atmel,sama5d2-i2c
867ea75dd3SSergiu Moga              - microchip,sam9x60-i2c
87*2a4013c0SSergiu Moga              - microchip,sama7g5-i2c
887ea75dd3SSergiu Moga    then:
897ea75dd3SSergiu Moga      properties:
907ea75dd3SSergiu Moga        i2c-sda-hold-time-ns:
917ea75dd3SSergiu Moga          description:
927ea75dd3SSergiu Moga            TWD hold time
937ea75dd3SSergiu Moga          maxItems: 1
947ea75dd3SSergiu Moga
957ea75dd3SSergiu MogaunevaluatedProperties: false
967ea75dd3SSergiu Moga
977ea75dd3SSergiu Mogaexamples:
987ea75dd3SSergiu Moga  - |
997ea75dd3SSergiu Moga    #include <dt-bindings/interrupt-controller/irq.h>
1007ea75dd3SSergiu Moga    #include <dt-bindings/dma/at91.h>
1017ea75dd3SSergiu Moga    #include <dt-bindings/gpio/gpio.h>
1027ea75dd3SSergiu Moga
1037ea75dd3SSergiu Moga    i2c0: i2c@fff84000 {
1047ea75dd3SSergiu Moga        compatible = "atmel,at91sam9g20-i2c";
1057ea75dd3SSergiu Moga        reg = <0xfff84000 0x100>;
1067ea75dd3SSergiu Moga        interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
1077ea75dd3SSergiu Moga        #address-cells = <1>;
1087ea75dd3SSergiu Moga        #size-cells = <0>;
1097ea75dd3SSergiu Moga        clocks = <&twi0_clk>;
1107ea75dd3SSergiu Moga        clock-frequency = <400000>;
1117ea75dd3SSergiu Moga
1127ea75dd3SSergiu Moga        eeprom@50 {
1137ea75dd3SSergiu Moga            compatible = "atmel,24c512";
1147ea75dd3SSergiu Moga            reg = <0x50>;
1157ea75dd3SSergiu Moga            pagesize = <128>;
1167ea75dd3SSergiu Moga        };
1177ea75dd3SSergiu Moga    };
1187ea75dd3SSergiu Moga
1197ea75dd3SSergiu Moga    i2c1: i2c@f8034600 {
1207ea75dd3SSergiu Moga        compatible = "atmel,sama5d2-i2c";
1217ea75dd3SSergiu Moga        reg = <0xf8034600 0x100>;
1227ea75dd3SSergiu Moga        interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
1237ea75dd3SSergiu Moga        dmas = <&dma0
1247ea75dd3SSergiu Moga            (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
1257ea75dd3SSergiu Moga            AT91_XDMAC_DT_PERID(11)>,
1267ea75dd3SSergiu Moga               <&dma0
1277ea75dd3SSergiu Moga            (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
1287ea75dd3SSergiu Moga            AT91_XDMAC_DT_PERID(12)>;
1297ea75dd3SSergiu Moga        dma-names = "tx", "rx";
1307ea75dd3SSergiu Moga        #address-cells = <1>;
1317ea75dd3SSergiu Moga        #size-cells = <0>;
1327ea75dd3SSergiu Moga        clocks = <&flx0>;
1337ea75dd3SSergiu Moga        atmel,fifo-size = <16>;
1347ea75dd3SSergiu Moga        i2c-sda-hold-time-ns = <336>;
1357ea75dd3SSergiu Moga        pinctrl-names = "default", "gpio";
1367ea75dd3SSergiu Moga        pinctrl-0 = <&pinctrl_i2c0>;
1377ea75dd3SSergiu Moga        pinctrl-1 = <&pinctrl_i2c0_gpio>;
1387ea75dd3SSergiu Moga        sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>;
1397ea75dd3SSergiu Moga        scl-gpios = <&pioA 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
1407ea75dd3SSergiu Moga
1417ea75dd3SSergiu Moga        eeprom@54 {
1427ea75dd3SSergiu Moga            compatible = "atmel,24c02";
1437ea75dd3SSergiu Moga            reg = <0x54>;
1447ea75dd3SSergiu Moga            pagesize = <16>;
1457ea75dd3SSergiu Moga        };
1467ea75dd3SSergiu Moga    };
147