Merge tag 'docs-5.11-2' of git://git.lwn.net/linux
[linux-2.6-microblaze.git] / arch / arm / boot / dts / imx7d-flex-concentrator.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Device Tree Source for Kamstrup OMNIA Flex Concentrator.
4  *
5  * Copyright (C) 2020 Kamstrup A/S
6  * Author: Bruno Thomsen <bruno.thomsen@gmail.com>
7  */
8
9 /dts-v1/;
10
11 #include "imx7d-tqma7.dtsi"
12
13 /* One I2C device on TQMa7 SoM is not mounted */
14 /delete-node/ &ds1339;
15
16 / {
17         model = "Kamstrup OMNIA Flex Concentrator";
18         compatible = "kam,imx7d-flex-concentrator", "fsl,imx7d";
19
20         memory@80000000 {
21                 device_type = "memory";
22                 /* 1024 MB - TQMa7D board configuration */
23                 reg = <0x80000000 0x40000000>;
24         };
25
26         reg_usb_otg2_vbus: regulator-usb-otg2-vbus {
27                 compatible = "regulator-fixed";
28                 regulator-name = "VBUS_USBOTG2";
29                 regulator-min-microvolt = <5000000>;
30                 regulator-max-microvolt = <5000000>;
31                 gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
32                 enable-active-high;
33         };
34
35         reg_vref_1v8: regulator-vref-1v8 {
36                 compatible = "regulator-fixed";
37                 regulator-name = "VCC1V8_REF";
38                 regulator-min-microvolt = <1800000>;
39                 regulator-max-microvolt = <1800000>;
40                 regulator-always-on;
41                 vin-supply = <&sw2_reg>;
42         };
43
44         /*
45          * Human Machine Interface consists of 4 dual red/green LEDs.
46          * hmi-a:green is controlled directly by the switch-mode power supply.
47          * hmi-a:red is not used.
48          */
49         gpio-leds {
50                 compatible = "gpio-leds";
51                 pinctrl-names = "default";
52                 pinctrl-0 = <&pinctrl_leds>;
53
54                 led-0 {
55                         label = "hmi-b:red:heartbeat-degraded";
56                         gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
57                 };
58
59                 led-1 {
60                         label = "hmi-b:green:heartbeat-running";
61                         gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
62                         linux,default-trigger = "heartbeat";
63                 };
64
65                 led-2 {
66                         label = "hmi-c:red:mesh-error";
67                         gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
68                 };
69
70                 led-3 {
71                         label = "hmi-c:green:mesh-activity";
72                         gpios = <&gpio2 30 GPIO_ACTIVE_HIGH>;
73                 };
74
75                 led-4 {
76                         label = "hmi-d:red:omnia-error";
77                         gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
78                 };
79
80                 led-5 {
81                         label = "hmi-d:green:omnia-activity";
82                         gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
83                 };
84         };
85
86         /*
87          * Errata e10574 board restart workaround.
88          */
89         gpio-restart {
90                 pinctrl-names = "default";
91                 pinctrl-0 = <&pinctrl_restart>;
92                 compatible = "gpio-restart";
93                 gpios = <&gpio7 12 GPIO_ACTIVE_LOW>;
94                 priority = <200>;
95         };
96 };
97
98 /*
99  * Analog signals
100  * ADC1_IN0: SMPS - 5V output monitor (voltage divider: 1/0.2806)
101  */
102 &adc1 {
103         vref-supply = <&reg_vref_1v8>;
104         status = "okay";
105 };
106
107 &ecspi2 {
108         pinctrl-names = "default";
109         pinctrl-0 = <&pinctrl_ecspi2>;
110         num-chipselects = <1>;
111         cs-gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
112         status = "okay";
113
114         pcf2127: rtc@0 {
115                 compatible = "nxp,pcf2127";
116                 reg = <0>;
117                 spi-max-frequency = <2000000>;
118         };
119 };
120
121 &ecspi4 {
122         pinctrl-names = "default";
123         pinctrl-0 = <&pinctrl_ecspi4>;
124         num-chipselects = <1>;
125         cs-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
126         status = "okay";
127
128         /*
129          * ST chip maximum SPI clock frequency is 33 MHz.
130          *
131          * TCG specification - Section 6.4.1 Clocking:
132          * TPM shall support a SPI clock frequency range of 10-24 MHz.
133          */
134         st33htph: tpm-tis@0 {
135                 compatible = "st,st33htpm-spi", "tcg,tpm_tis-spi";
136                 reg = <0>;
137                 spi-max-frequency = <24000000>;
138         };
139 };
140
141 &fec1 {
142         pinctrl-names = "default";
143         pinctrl-0 = <&pinctrl_enet1>;
144         phy-mode = "rmii";
145         phy-handle = <&ethphy>;
146         status = "okay";
147
148         /*
149          * MDIO bus reset is used to generate PHY device reset before
150          * Ethernet PHY type ID auto-detection. Otherwise this communication
151          * fails as device does not answer when recommended reset circuit
152          * is used.
153          */
154         mdio {
155                 #address-cells = <1>;
156                 #size-cells = <0>;
157
158                 reset-delay-us = <100000>;
159                 reset-post-delay-us = <500000>;
160                 reset-gpios = <&gpio7 15 GPIO_ACTIVE_LOW>;
161
162                 /* Microchip/Micrel KSZ8081RNB */
163                 ethphy: ethernet-phy@1 {
164                         compatible = "ethernet-phy-ieee802.3-c22";
165                         interrupt-parent = <&gpio1>;
166                         interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
167                         reg = <1>;
168                 };
169         };
170 };
171
172 /*
173  * Detection signals for internal USB modules.
174  * Used for robust USB plug and play handling such as USB downstream port
175  * power-cycle and USB hub reset in case of misbehaving or crashed modules.
176  *
177  * SMPS - AC input monitor based on zero crossing.
178  * Used for last gasp notification.
179  */
180 &gpio3 {
181         gpio-line-names = "", "", "", "", "", "", "", "",
182         "", "", "", "", "smps-ac-monitor", "", "usb-hub-reset", "",
183         "", "", "", "", "", "", "", "",
184         "", "module-b-detection", "", "module-a-detection", "", "", "", "";
185 };
186
187 /*
188  * Tamper IRQ trigger timestamp reading.
189  * Used for sealed cover opened/closed notification.
190  */
191 &gpio5 {
192         gpio-line-names = "", "", "", "", "", "", "", "",
193         "", "", "", "", "rtc-tamper-irq", "", "", "",
194         "", "", "", "", "", "", "", "",
195         "", "", "", "", "", "", "", "";
196 };
197
198 &iomuxc {
199         pinctrl-names = "default";
200         pinctrl-0 = <&pinctrl_misc>;
201
202         pinctrl_ecspi2: ecspi2grp {
203                 fsl,pins = <
204                         MX7D_PAD_ECSPI2_MISO__ECSPI2_MISO               0x7c /* X2-15 */
205                         MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI               0x74 /* X2-18 */
206                         MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK               0x74 /* X2-13 */
207                         MX7D_PAD_ECSPI2_SS0__GPIO4_IO23                 0x74 /* X2-20 */
208                         /* RTC - Tamper IRQ */
209                         MX7D_PAD_SD2_CLK__GPIO5_IO12                    0x3c /* X1-92 */
210                 >;
211         };
212
213         pinctrl_ecspi4: ecspi4grp {
214                 fsl,pins = <
215                         MX7D_PAD_LCD_CLK__ECSPI4_MISO                   0x7c /* X2-72 */
216                         MX7D_PAD_LCD_ENABLE__ECSPI4_MOSI                0x74 /* X2-68 */
217                         MX7D_PAD_LCD_HSYNC__ECSPI4_SCLK                 0x74 /* X2-76 */
218                         MX7D_PAD_LCD_VSYNC__GPIO3_IO3                   0x74 /* X2-78 */
219                 >;
220         };
221
222         pinctrl_enet1: enet1grp {
223                 fsl,pins = <
224                         MX7D_PAD_GPIO1_IO10__ENET1_MDIO                 0x03 /* X2-48 */
225                         MX7D_PAD_GPIO1_IO11__ENET1_MDC                  0x03 /* X2-46 */
226                         MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0       0x71 /* X2-53 */
227                         MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1       0x71 /* X2-55 */
228                         MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x71 /* X2-61 */
229                         MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0       0x79 /* X2-56 */
230                         MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1       0x79 /* X2-58 */
231                         MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x79 /* X2-64 */
232                         MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER           0x73 /* X2-52 */
233                         /* PHY reset: SRE_FAST, DSE_X1 */
234                         MX7D_PAD_ENET1_COL__GPIO7_IO15                  0x00 /* X1-96 */
235                         /* Clock from PHY to MAC: 100kPU */
236                         MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1          0x70 /* X3-4 */
237                         /* PHY interrupt: 100kPU, HYS */
238                         MX7D_PAD_GPIO1_IO09__GPIO1_IO9                  0x78 /* X1-80 */
239                 >;
240         };
241
242         pinctrl_leds: ledsgrp {
243                 fsl,pins = <
244                         MX7D_PAD_LCD_DATA01__GPIO3_IO6                  0x14 /* X2-82 */
245                         MX7D_PAD_EPDC_BDR0__GPIO2_IO28                  0x14 /* X1-82 */
246                         MX7D_PAD_EPDC_BDR1__GPIO2_IO29                  0x14 /* X1-84 */
247                         MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30               0x14 /* X1-86 */
248                         MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31              0x14 /* X1-88 */
249                         MX7D_PAD_UART2_TX_DATA__GPIO4_IO3               0x14 /* X1-90 */
250                 >;
251         };
252
253         pinctrl_misc: miscgrp {
254                 fsl,pins = <
255                         /* Module A detection (low = present) */
256                         MX7D_PAD_LCD_DATA22__GPIO3_IO27                 0x7c /* X2-105 */
257                         /* Module B detection (low = present) */
258                         MX7D_PAD_LCD_DATA20__GPIO3_IO25                 0x7c /* X2-103 */
259                         /* SMPS - AC input monitor (high = failure) */
260                         MX7D_PAD_LCD_DATA07__GPIO3_IO12                 0x7c /* X2-88 */
261                         /* USB - Hub reset */
262                         MX7D_PAD_LCD_DATA09__GPIO3_IO14                 0x74 /* X2-92 */
263                 >;
264         };
265
266         pinctrl_restart: restartgrp {
267                 fsl,pins = <
268                         MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12       0x74 /* X1-94 */
269                 >;
270         };
271
272         pinctrl_uart4: uart4grp {
273                 fsl,pins = <
274                         MX7D_PAD_SAI2_TX_SYNC__UART4_DCE_RX     0x7e /* X3-14 */
275                         MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX     0x76 /* X3-16 */
276                 >;
277         };
278 };
279
280 &iomuxc_lpsr {
281         pinctrl_usbotg2: usbotg2grp {
282                 fsl,pins = <
283                         MX7D_PAD_LPSR_GPIO1_IO06__USB_OTG2_OC   0x5c /* X3-11 */
284                         MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7     0x59 /* X3-9 */
285                 >;
286         };
287
288 };
289
290 &uart4 {
291         pinctrl-names = "default";
292         pinctrl-0 = <&pinctrl_uart4>;
293         assigned-clocks = <&clks IMX7D_UART4_ROOT_SRC>;
294         assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
295 };
296
297 &usbotg2 {
298         pinctrl-names = "default";
299         pinctrl-0 = <&pinctrl_usbotg2>;
300         vbus-supply = <&reg_usb_otg2_vbus>;
301         srp-disable;
302         hnp-disable;
303         adp-disable;
304         over-current-active-low;
305         dr_mode = "host";
306         status = "okay";
307 };
308
309 /*
310  * External watchdog feature provided by pcf2127.
311  */
312 &wdog1 {
313         status = "disabled";
314 };