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: 28c9ccf3a3SEmmanuel Vadot - const: microchip,sama7g5-i2c 29c9ccf3a3SEmmanuel Vadot - const: microchip,sam9x60-i2c 30c9ccf3a3SEmmanuel Vadot 31c9ccf3a3SEmmanuel Vadot reg: 32c9ccf3a3SEmmanuel Vadot maxItems: 1 33c9ccf3a3SEmmanuel Vadot 34c9ccf3a3SEmmanuel Vadot interrupts: 35c9ccf3a3SEmmanuel Vadot maxItems: 1 36c9ccf3a3SEmmanuel Vadot 37c9ccf3a3SEmmanuel Vadot "#address-cells": 38c9ccf3a3SEmmanuel Vadot const: 1 39c9ccf3a3SEmmanuel Vadot 40c9ccf3a3SEmmanuel Vadot "#size-cells": 41c9ccf3a3SEmmanuel Vadot const: 0 42c9ccf3a3SEmmanuel Vadot 43c9ccf3a3SEmmanuel Vadot clocks: 44c9ccf3a3SEmmanuel Vadot maxItems: 1 45c9ccf3a3SEmmanuel Vadot 46c9ccf3a3SEmmanuel Vadot clock-frequency: 47c9ccf3a3SEmmanuel Vadot default: 100000 48c9ccf3a3SEmmanuel Vadot 49c9ccf3a3SEmmanuel Vadot dmas: 50c9ccf3a3SEmmanuel Vadot items: 51c9ccf3a3SEmmanuel Vadot - description: TX DMA Channel Specifier 52c9ccf3a3SEmmanuel Vadot - description: RX DMA Channel Specifier 53c9ccf3a3SEmmanuel Vadot 54c9ccf3a3SEmmanuel Vadot dma-names: 55c9ccf3a3SEmmanuel Vadot items: 56c9ccf3a3SEmmanuel Vadot - const: tx 57c9ccf3a3SEmmanuel Vadot - const: rx 58c9ccf3a3SEmmanuel Vadot 59c9ccf3a3SEmmanuel Vadot atmel,fifo-size: 60c9ccf3a3SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 61c9ccf3a3SEmmanuel Vadot description: | 62c9ccf3a3SEmmanuel Vadot Maximum number of data the RX and TX FIFOs can store for 63c9ccf3a3SEmmanuel Vadot FIFO capable I2C controllers. 64c9ccf3a3SEmmanuel Vadot 65c9ccf3a3SEmmanuel Vadot scl-gpios: true 66c9ccf3a3SEmmanuel Vadot 67c9ccf3a3SEmmanuel Vadot sda-gpios: true 68c9ccf3a3SEmmanuel Vadot 69c9ccf3a3SEmmanuel Vadotrequired: 70c9ccf3a3SEmmanuel Vadot - compatible 71c9ccf3a3SEmmanuel Vadot - reg 72c9ccf3a3SEmmanuel Vadot - interrupts 73c9ccf3a3SEmmanuel Vadot - "#address-cells" 74c9ccf3a3SEmmanuel Vadot - "#size-cells" 75c9ccf3a3SEmmanuel Vadot - clocks 76c9ccf3a3SEmmanuel Vadot 77c9ccf3a3SEmmanuel VadotallOf: 78*fac71e4eSEmmanuel Vadot - $ref: i2c-controller.yaml 79c9ccf3a3SEmmanuel Vadot - if: 80c9ccf3a3SEmmanuel Vadot properties: 81c9ccf3a3SEmmanuel Vadot compatible: 82c9ccf3a3SEmmanuel Vadot contains: 83c9ccf3a3SEmmanuel Vadot enum: 84c9ccf3a3SEmmanuel Vadot - atmel,sama5d4-i2c 85c9ccf3a3SEmmanuel Vadot - atmel,sama5d2-i2c 86c9ccf3a3SEmmanuel Vadot - microchip,sam9x60-i2c 87c9ccf3a3SEmmanuel Vadot - microchip,sama7g5-i2c 88c9ccf3a3SEmmanuel Vadot then: 89c9ccf3a3SEmmanuel Vadot properties: 90c9ccf3a3SEmmanuel Vadot i2c-sda-hold-time-ns: 91c9ccf3a3SEmmanuel Vadot description: 92c9ccf3a3SEmmanuel Vadot TWD hold time 93c9ccf3a3SEmmanuel Vadot maxItems: 1 94c9ccf3a3SEmmanuel Vadot 95c9ccf3a3SEmmanuel VadotunevaluatedProperties: false 96c9ccf3a3SEmmanuel Vadot 97c9ccf3a3SEmmanuel Vadotexamples: 98c9ccf3a3SEmmanuel Vadot - | 99c9ccf3a3SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 100c9ccf3a3SEmmanuel Vadot #include <dt-bindings/dma/at91.h> 101c9ccf3a3SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 102c9ccf3a3SEmmanuel Vadot 103c9ccf3a3SEmmanuel Vadot i2c0: i2c@fff84000 { 104c9ccf3a3SEmmanuel Vadot compatible = "atmel,at91sam9g20-i2c"; 105c9ccf3a3SEmmanuel Vadot reg = <0xfff84000 0x100>; 106c9ccf3a3SEmmanuel Vadot interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>; 107c9ccf3a3SEmmanuel Vadot #address-cells = <1>; 108c9ccf3a3SEmmanuel Vadot #size-cells = <0>; 109c9ccf3a3SEmmanuel Vadot clocks = <&twi0_clk>; 110c9ccf3a3SEmmanuel Vadot clock-frequency = <400000>; 111c9ccf3a3SEmmanuel Vadot 112c9ccf3a3SEmmanuel Vadot eeprom@50 { 113c9ccf3a3SEmmanuel Vadot compatible = "atmel,24c512"; 114c9ccf3a3SEmmanuel Vadot reg = <0x50>; 115c9ccf3a3SEmmanuel Vadot pagesize = <128>; 116c9ccf3a3SEmmanuel Vadot }; 117c9ccf3a3SEmmanuel Vadot }; 118c9ccf3a3SEmmanuel Vadot 119c9ccf3a3SEmmanuel Vadot i2c1: i2c@f8034600 { 120c9ccf3a3SEmmanuel Vadot compatible = "atmel,sama5d2-i2c"; 121c9ccf3a3SEmmanuel Vadot reg = <0xf8034600 0x100>; 122c9ccf3a3SEmmanuel Vadot interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>; 123c9ccf3a3SEmmanuel Vadot dmas = <&dma0 124c9ccf3a3SEmmanuel Vadot (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)) 125c9ccf3a3SEmmanuel Vadot AT91_XDMAC_DT_PERID(11)>, 126c9ccf3a3SEmmanuel Vadot <&dma0 127c9ccf3a3SEmmanuel Vadot (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)) 128c9ccf3a3SEmmanuel Vadot AT91_XDMAC_DT_PERID(12)>; 129c9ccf3a3SEmmanuel Vadot dma-names = "tx", "rx"; 130c9ccf3a3SEmmanuel Vadot #address-cells = <1>; 131c9ccf3a3SEmmanuel Vadot #size-cells = <0>; 132c9ccf3a3SEmmanuel Vadot clocks = <&flx0>; 133c9ccf3a3SEmmanuel Vadot atmel,fifo-size = <16>; 134c9ccf3a3SEmmanuel Vadot i2c-sda-hold-time-ns = <336>; 135c9ccf3a3SEmmanuel Vadot pinctrl-names = "default", "gpio"; 136c9ccf3a3SEmmanuel Vadot pinctrl-0 = <&pinctrl_i2c0>; 137c9ccf3a3SEmmanuel Vadot pinctrl-1 = <&pinctrl_i2c0_gpio>; 138c9ccf3a3SEmmanuel Vadot sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>; 139c9ccf3a3SEmmanuel Vadot scl-gpios = <&pioA 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 140c9ccf3a3SEmmanuel Vadot 141c9ccf3a3SEmmanuel Vadot eeprom@54 { 142c9ccf3a3SEmmanuel Vadot compatible = "atmel,24c02"; 143c9ccf3a3SEmmanuel Vadot reg = <0x54>; 144c9ccf3a3SEmmanuel Vadot pagesize = <16>; 145c9ccf3a3SEmmanuel Vadot }; 146c9ccf3a3SEmmanuel Vadot }; 147