0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 # Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
0003 %YAML 1.2
0004 ---
0005 $id: http://devicetree.org/schemas/i2c/atmel,at91sam-i2c.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007
0008 title: I2C for Atmel/Microchip platforms
0009
0010 maintainers:
0011 - Alexandre Belloni <alexandre.belloni@bootlin.com>
0012
0013 properties:
0014 compatible:
0015 oneOf:
0016 - items:
0017 - enum:
0018 - atmel,at91rm9200-i2c
0019 - atmel,at91sam9261-i2c
0020 - atmel,at91sam9260-i2c
0021 - atmel,at91sam9g20-i2c
0022 - atmel,at91sam9g10-i2c
0023 - atmel,at91sam9x5-i2c
0024 - atmel,sama5d4-i2c
0025 - atmel,sama5d2-i2c
0026 - microchip,sam9x60-i2c
0027 - items:
0028 - const: microchip,sama7g5-i2c
0029 - const: microchip,sam9x60-i2c
0030
0031 reg:
0032 maxItems: 1
0033
0034 interrupts:
0035 maxItems: 1
0036
0037 "#address-cells":
0038 const: 1
0039
0040 "#size-cells":
0041 const: 0
0042
0043 clocks:
0044 maxItems: 1
0045
0046 clock-frequency:
0047 default: 100000
0048
0049 dmas:
0050 items:
0051 - description: TX DMA Channel Specifier
0052 - description: RX DMA Channel Specifier
0053
0054 dma-names:
0055 items:
0056 - const: tx
0057 - const: rx
0058
0059 atmel,fifo-size:
0060 $ref: /schemas/types.yaml#/definitions/uint32
0061 description: |
0062 Maximum number of data the RX and TX FIFOs can store for
0063 FIFO capable I2C controllers.
0064
0065 scl-gpios: true
0066
0067 sda-gpios: true
0068
0069 required:
0070 - compatible
0071 - reg
0072 - interrupts
0073 - "#address-cells"
0074 - "#size-cells"
0075 - clocks
0076
0077 allOf:
0078 - $ref: "i2c-controller.yaml"
0079 - if:
0080 properties:
0081 compatible:
0082 contains:
0083 enum:
0084 - atmel,sama5d4-i2c
0085 - atmel,sama5d2-i2c
0086 - microchip,sam9x60-i2c
0087 - microchip,sama7g5-i2c
0088 then:
0089 properties:
0090 i2c-sda-hold-time-ns:
0091 description:
0092 TWD hold time
0093 maxItems: 1
0094
0095 unevaluatedProperties: false
0096
0097 examples:
0098 - |
0099 #include <dt-bindings/interrupt-controller/irq.h>
0100 #include <dt-bindings/dma/at91.h>
0101 #include <dt-bindings/gpio/gpio.h>
0102
0103 i2c0: i2c@fff84000 {
0104 compatible = "atmel,at91sam9g20-i2c";
0105 reg = <0xfff84000 0x100>;
0106 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
0107 #address-cells = <1>;
0108 #size-cells = <0>;
0109 clocks = <&twi0_clk>;
0110 clock-frequency = <400000>;
0111
0112 eeprom@50 {
0113 compatible = "atmel,24c512";
0114 reg = <0x50>;
0115 pagesize = <128>;
0116 };
0117 };
0118
0119 i2c1: i2c@f8034600 {
0120 compatible = "atmel,sama5d2-i2c";
0121 reg = <0xf8034600 0x100>;
0122 interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
0123 dmas = <&dma0
0124 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
0125 AT91_XDMAC_DT_PERID(11)>,
0126 <&dma0
0127 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
0128 AT91_XDMAC_DT_PERID(12)>;
0129 dma-names = "tx", "rx";
0130 #address-cells = <1>;
0131 #size-cells = <0>;
0132 clocks = <&flx0>;
0133 atmel,fifo-size = <16>;
0134 i2c-sda-hold-time-ns = <336>;
0135 pinctrl-names = "default", "gpio";
0136 pinctrl-0 = <&pinctrl_i2c0>;
0137 pinctrl-1 = <&pinctrl_i2c0_gpio>;
0138 sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>;
0139 scl-gpios = <&pioA 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
0140
0141 eeprom@54 {
0142 compatible = "atmel,24c02";
0143 reg = <0x54>;
0144 pagesize = <16>;
0145 };
0146 };