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