1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2c9ccf3a3SEmmanuel Vadot# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries 3c9ccf3a3SEmmanuel Vadot%YAML 1.2 4c9ccf3a3SEmmanuel Vadot--- 5c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/i2c/atmel,at91sam-i2c.yaml# 6c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 7c9ccf3a3SEmmanuel Vadot 8c9ccf3a3SEmmanuel Vadottitle: I2C for Atmel/Microchip platforms 9c9ccf3a3SEmmanuel Vadot 10c9ccf3a3SEmmanuel Vadotmaintainers: 11c9ccf3a3SEmmanuel Vadot - Alexandre Belloni <alexandre.belloni@bootlin.com> 12c9ccf3a3SEmmanuel Vadot 13c9ccf3a3SEmmanuel Vadotproperties: 14c9ccf3a3SEmmanuel Vadot compatible: 15c9ccf3a3SEmmanuel Vadot oneOf: 16c9ccf3a3SEmmanuel Vadot - items: 17c9ccf3a3SEmmanuel Vadot - enum: 18c9ccf3a3SEmmanuel Vadot - atmel,at91rm9200-i2c 19c9ccf3a3SEmmanuel Vadot - atmel,at91sam9261-i2c 20c9ccf3a3SEmmanuel Vadot - atmel,at91sam9260-i2c 21c9ccf3a3SEmmanuel Vadot - atmel,at91sam9g20-i2c 22c9ccf3a3SEmmanuel Vadot - atmel,at91sam9g10-i2c 23c9ccf3a3SEmmanuel Vadot - atmel,at91sam9x5-i2c 24c9ccf3a3SEmmanuel Vadot - atmel,sama5d4-i2c 25c9ccf3a3SEmmanuel Vadot - atmel,sama5d2-i2c 26c9ccf3a3SEmmanuel Vadot - microchip,sam9x60-i2c 27c9ccf3a3SEmmanuel Vadot - items: 2801950c46SEmmanuel Vadot - enum: 29*0e8011faSEmmanuel Vadot - microchip,sama7d65-i2c 3001950c46SEmmanuel Vadot - microchip,sama7g5-i2c 3101950c46SEmmanuel Vadot - microchip,sam9x7-i2c 32c9ccf3a3SEmmanuel Vadot - const: microchip,sam9x60-i2c 33c9ccf3a3SEmmanuel Vadot 34c9ccf3a3SEmmanuel Vadot reg: 35c9ccf3a3SEmmanuel Vadot maxItems: 1 36c9ccf3a3SEmmanuel Vadot 37c9ccf3a3SEmmanuel Vadot interrupts: 38c9ccf3a3SEmmanuel Vadot maxItems: 1 39c9ccf3a3SEmmanuel Vadot 40c9ccf3a3SEmmanuel Vadot clocks: 41c9ccf3a3SEmmanuel Vadot maxItems: 1 42c9ccf3a3SEmmanuel Vadot 43c9ccf3a3SEmmanuel Vadot clock-frequency: 44c9ccf3a3SEmmanuel Vadot default: 100000 45c9ccf3a3SEmmanuel Vadot 46c9ccf3a3SEmmanuel Vadot dmas: 47c9ccf3a3SEmmanuel Vadot items: 48c9ccf3a3SEmmanuel Vadot - description: TX DMA Channel Specifier 49c9ccf3a3SEmmanuel Vadot - description: RX DMA Channel Specifier 50c9ccf3a3SEmmanuel Vadot 51c9ccf3a3SEmmanuel Vadot dma-names: 52c9ccf3a3SEmmanuel Vadot items: 53c9ccf3a3SEmmanuel Vadot - const: tx 54c9ccf3a3SEmmanuel Vadot - const: rx 55c9ccf3a3SEmmanuel Vadot 56c9ccf3a3SEmmanuel Vadot atmel,fifo-size: 57c9ccf3a3SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 58c9ccf3a3SEmmanuel Vadot description: | 59c9ccf3a3SEmmanuel Vadot Maximum number of data the RX and TX FIFOs can store for 60c9ccf3a3SEmmanuel Vadot FIFO capable I2C controllers. 61c9ccf3a3SEmmanuel Vadot 62c9ccf3a3SEmmanuel Vadot scl-gpios: true 63c9ccf3a3SEmmanuel Vadot 64c9ccf3a3SEmmanuel Vadot sda-gpios: true 65c9ccf3a3SEmmanuel Vadot 66c9ccf3a3SEmmanuel Vadotrequired: 67c9ccf3a3SEmmanuel Vadot - compatible 68c9ccf3a3SEmmanuel Vadot - reg 69c9ccf3a3SEmmanuel Vadot - interrupts 70c9ccf3a3SEmmanuel Vadot - clocks 71c9ccf3a3SEmmanuel Vadot 72c9ccf3a3SEmmanuel VadotallOf: 737d0873ebSEmmanuel Vadot - $ref: /schemas/i2c/i2c-controller.yaml# 74c9ccf3a3SEmmanuel Vadot - if: 75c9ccf3a3SEmmanuel Vadot properties: 76c9ccf3a3SEmmanuel Vadot compatible: 77c9ccf3a3SEmmanuel Vadot contains: 78c9ccf3a3SEmmanuel Vadot enum: 79c9ccf3a3SEmmanuel Vadot - atmel,sama5d4-i2c 80c9ccf3a3SEmmanuel Vadot - atmel,sama5d2-i2c 81c9ccf3a3SEmmanuel Vadot - microchip,sam9x60-i2c 82*0e8011faSEmmanuel Vadot - microchip,sama7d65-i2c 83c9ccf3a3SEmmanuel Vadot - microchip,sama7g5-i2c 84c9ccf3a3SEmmanuel Vadot then: 85c9ccf3a3SEmmanuel Vadot properties: 86c9ccf3a3SEmmanuel Vadot i2c-sda-hold-time-ns: 87c9ccf3a3SEmmanuel Vadot description: 88c9ccf3a3SEmmanuel Vadot TWD hold time 89c9ccf3a3SEmmanuel Vadot maxItems: 1 90c9ccf3a3SEmmanuel Vadot 91c9ccf3a3SEmmanuel VadotunevaluatedProperties: false 92c9ccf3a3SEmmanuel Vadot 93c9ccf3a3SEmmanuel Vadotexamples: 94c9ccf3a3SEmmanuel Vadot - | 95c9ccf3a3SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 96c9ccf3a3SEmmanuel Vadot #include <dt-bindings/dma/at91.h> 97c9ccf3a3SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 98c9ccf3a3SEmmanuel Vadot 99c9ccf3a3SEmmanuel Vadot i2c0: i2c@fff84000 { 100c9ccf3a3SEmmanuel Vadot compatible = "atmel,at91sam9g20-i2c"; 101c9ccf3a3SEmmanuel Vadot reg = <0xfff84000 0x100>; 102c9ccf3a3SEmmanuel Vadot interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>; 103c9ccf3a3SEmmanuel Vadot #address-cells = <1>; 104c9ccf3a3SEmmanuel Vadot #size-cells = <0>; 105c9ccf3a3SEmmanuel Vadot clocks = <&twi0_clk>; 106c9ccf3a3SEmmanuel Vadot clock-frequency = <400000>; 107c9ccf3a3SEmmanuel Vadot 108c9ccf3a3SEmmanuel Vadot eeprom@50 { 109c9ccf3a3SEmmanuel Vadot compatible = "atmel,24c512"; 110c9ccf3a3SEmmanuel Vadot reg = <0x50>; 111c9ccf3a3SEmmanuel Vadot pagesize = <128>; 112c9ccf3a3SEmmanuel Vadot }; 113c9ccf3a3SEmmanuel Vadot }; 114c9ccf3a3SEmmanuel Vadot 115c9ccf3a3SEmmanuel Vadot i2c1: i2c@f8034600 { 116c9ccf3a3SEmmanuel Vadot compatible = "atmel,sama5d2-i2c"; 117c9ccf3a3SEmmanuel Vadot reg = <0xf8034600 0x100>; 118c9ccf3a3SEmmanuel Vadot interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>; 119c9ccf3a3SEmmanuel Vadot dmas = <&dma0 120c9ccf3a3SEmmanuel Vadot (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)) 121c9ccf3a3SEmmanuel Vadot AT91_XDMAC_DT_PERID(11)>, 122c9ccf3a3SEmmanuel Vadot <&dma0 123c9ccf3a3SEmmanuel Vadot (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)) 124c9ccf3a3SEmmanuel Vadot AT91_XDMAC_DT_PERID(12)>; 125c9ccf3a3SEmmanuel Vadot dma-names = "tx", "rx"; 126c9ccf3a3SEmmanuel Vadot #address-cells = <1>; 127c9ccf3a3SEmmanuel Vadot #size-cells = <0>; 128c9ccf3a3SEmmanuel Vadot clocks = <&flx0>; 129c9ccf3a3SEmmanuel Vadot atmel,fifo-size = <16>; 130c9ccf3a3SEmmanuel Vadot i2c-sda-hold-time-ns = <336>; 131c9ccf3a3SEmmanuel Vadot pinctrl-names = "default", "gpio"; 132c9ccf3a3SEmmanuel Vadot pinctrl-0 = <&pinctrl_i2c0>; 133c9ccf3a3SEmmanuel Vadot pinctrl-1 = <&pinctrl_i2c0_gpio>; 134c9ccf3a3SEmmanuel Vadot sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>; 135c9ccf3a3SEmmanuel Vadot scl-gpios = <&pioA 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 136c9ccf3a3SEmmanuel Vadot 137c9ccf3a3SEmmanuel Vadot eeprom@54 { 138c9ccf3a3SEmmanuel Vadot compatible = "atmel,24c02"; 139c9ccf3a3SEmmanuel Vadot reg = <0x54>; 140c9ccf3a3SEmmanuel Vadot pagesize = <16>; 141c9ccf3a3SEmmanuel Vadot }; 142c9ccf3a3SEmmanuel Vadot }; 143