Merge tag 'drm-misc-next-fixes-2018-06-15' of git://anongit.freedesktop.org/drm/drm...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3288-phycore-som.dtsi
1 /*
2  * Device tree file for Phytec phyCORE-RK3288 SoM
3  * Copyright (C) 2017 PHYTEC Messtechnik GmbH
4  * Author: Wadim Egorov <w.egorov@phytec.de>
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  * Or, alternatively,
22  *
23  *  b) Permission is hereby granted, free of charge, to any person
24  *     obtaining a copy of this software and associated documentation
25  *     files (the "Software"), to deal in the Software without
26  *     restriction, including without limitation the rights to use,
27  *     copy, modify, merge, publish, distribute, sublicense, and/or
28  *     sell copies of the Software, and to permit persons to whom the
29  *     Software is furnished to do so, subject to the following
30  *     conditions:
31  *
32  *     The above copyright notice and this permission notice shall be
33  *     included in all copies or substantial portions of the Software.
34  *
35  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42  *     OTHER DEALINGS IN THE SOFTWARE.
43  */
44
45 #include <dt-bindings/net/ti-dp83867.h>
46 #include "rk3288.dtsi"
47
48 / {
49         model = "Phytec RK3288 phyCORE";
50         compatible = "phytec,rk3288-phycore-som", "rockchip,rk3288";
51
52         /*
53          * Set the minimum memory size here and
54          * let the bootloader set the real size.
55          */
56         memory {
57                 device_type = "memory";
58                 reg = <0x0 0x0 0x0 0x8000000>;
59         };
60
61         aliases {
62                 rtc0 = &i2c_rtc;
63                 rtc1 = &rk818;
64         };
65
66         ext_gmac: external-gmac-clock {
67                 compatible = "fixed-clock";
68                 #clock-cells = <0>;
69                 clock-frequency = <125000000>;
70                 clock-output-names = "ext_gmac";
71         };
72
73         leds: user-leds {
74                 compatible = "gpio-leds";
75                 pinctrl-names = "default";
76                 pinctrl-0 = <&user_led>;
77
78                 user {
79                         label = "green_led";
80                         gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
81                         linux,default-trigger = "heartbeat";
82                         default-state = "keep";
83                 };
84         };
85
86         vdd_emmc_io: vdd-emmc-io {
87                 compatible = "regulator-fixed";
88                 regulator-name = "vdd_emmc_io";
89                 regulator-min-microvolt = <1800000>;
90                 regulator-max-microvolt = <1800000>;
91                 vin-supply = <&vdd_3v3_io>;
92         };
93
94         vdd_in_otg_out: vdd-in-otg-out {
95                 compatible = "regulator-fixed";
96                 regulator-name = "vdd_in_otg_out";
97                 regulator-always-on;
98                 regulator-boot-on;
99                 regulator-min-microvolt = <5000000>;
100                 regulator-max-microvolt = <5000000>;
101         };
102
103         vdd_misc_1v8: vdd-misc-1v8 {
104                 compatible = "regulator-fixed";
105                 regulator-name = "vdd_misc_1v8";
106                 regulator-always-on;
107                 regulator-boot-on;
108                 regulator-min-microvolt = <1800000>;
109                 regulator-max-microvolt = <1800000>;
110         };
111 };
112
113 &emmc {
114         status = "okay";
115         bus-width = <8>;
116         cap-mmc-highspeed;
117         disable-wp;
118         non-removable;
119         pinctrl-names = "default";
120         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
121         vmmc-supply = <&vdd_3v3_io>;
122         vqmmc-supply = <&vdd_emmc_io>;
123 };
124
125 &gmac {
126         assigned-clocks = <&cru SCLK_MAC>;
127         assigned-clock-parents = <&ext_gmac>;
128         clock_in_out = "input";
129         pinctrl-names = "default";
130         pinctrl-0 = <&rgmii_pins &phy_rst &phy_int>;
131         phy-handle = <&phy0>;
132         phy-supply = <&vdd_eth_2v5>;
133         phy-mode = "rgmii-id";
134         snps,reset-active-low;
135         snps,reset-delays-us = <0 10000 1000000>;
136         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_HIGH>;
137         tx_delay = <0x0>;
138         rx_delay = <0x0>;
139
140         mdio0 {
141                 compatible = "snps,dwmac-mdio";
142                 #address-cells = <1>;
143                 #size-cells = <0>;
144
145                 phy0: ethernet-phy@0 {
146                         compatible = "ethernet-phy-ieee802.3-c22";
147                         reg = <0>;
148                         interrupt-parent = <&gpio4>;
149                         interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
150                         ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
151                         ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
152                         ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
153                         enet-phy-lane-no-swap;
154                         ti,clk-output-sel = <DP83867_CLK_O_SEL_CHN_A_TCLK>;
155                 };
156         };
157 };
158
159 &hdmi {
160         ddc-i2c-bus = <&i2c5>;
161 };
162
163 &io_domains {
164         status = "okay";
165         sdcard-supply = <&vdd_io_sd>;
166         flash0-supply = <&vdd_emmc_io>;
167         flash1-supply = <&vdd_misc_1v8>;
168         gpio1830-supply = <&vdd_3v3_io>;
169         gpio30-supply = <&vdd_3v3_io>;
170         bb-supply = <&vdd_3v3_io>;
171         dvp-supply = <&vdd_3v3_io>;
172         lcdc-supply = <&vdd_3v3_io>;
173         wifi-supply = <&vdd_3v3_io>;
174         audio-supply = <&vdd_3v3_io>;
175 };
176
177 &i2c0 {
178         status = "okay";
179         clock-frequency = <400000>;
180
181         rk818: pmic@1c {
182                 compatible = "rockchip,rk818";
183                 reg = <0x1c>;
184                 interrupt-parent = <&gpio0>;
185                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
186                 pinctrl-names = "default";
187                 pinctrl-0 = <&pmic_int>;
188                 rockchip,system-power-controller;
189                 wakeup-source;
190                 #clock-cells = <1>;
191
192                 vcc1-supply = <&vdd_sys>;
193                 vcc2-supply = <&vdd_sys>;
194                 vcc3-supply = <&vdd_sys>;
195                 vcc4-supply = <&vdd_sys>;
196                 boost-supply = <&vdd_in_otg_out>;
197                 vcc6-supply = <&vdd_sys>;
198                 vcc7-supply = <&vdd_misc_1v8>;
199                 vcc8-supply = <&vdd_misc_1v8>;
200                 vcc9-supply = <&vdd_3v3_io>;
201                 vddio-supply = <&vdd_3v3_io>;
202
203                 regulators {
204                         vdd_log: DCDC_REG1 {
205                                 regulator-name = "vdd_log";
206                                 regulator-always-on;
207                                 regulator-boot-on;
208                                 regulator-min-microvolt = <1100000>;
209                                 regulator-max-microvolt = <1100000>;
210                                 regulator-state-mem {
211                                         regulator-off-in-suspend;
212                                 };
213                         };
214
215                         vdd_gpu: DCDC_REG2 {
216                                 regulator-name = "vdd_gpu";
217                                 regulator-always-on;
218                                 regulator-boot-on;
219                                 regulator-min-microvolt = <800000>;
220                                 regulator-max-microvolt = <1250000>;
221                                 regulator-state-mem {
222                                         regulator-on-in-suspend;
223                                         regulator-suspend-microvolt = <1000000>;
224                                 };
225                         };
226
227                         vcc_ddr: DCDC_REG3 {
228                                 regulator-name = "vcc_ddr";
229                                 regulator-always-on;
230                                 regulator-boot-on;
231                                 regulator-state-mem {
232                                         regulator-on-in-suspend;
233                                 };
234                         };
235
236                         vdd_3v3_io: DCDC_REG4 {
237                                 regulator-name = "vdd_3v3_io";
238                                 regulator-always-on;
239                                 regulator-boot-on;
240                                 regulator-min-microvolt = <3300000>;
241                                 regulator-max-microvolt = <3300000>;
242                                 regulator-state-mem {
243                                         regulator-on-in-suspend;
244                                         regulator-suspend-microvolt = <3300000>;
245                                 };
246                         };
247
248                         vdd_sys: DCDC_BOOST {
249                                 regulator-name = "vdd_sys";
250                                 regulator-always-on;
251                                 regulator-boot-on;
252                                 regulator-min-microvolt = <5000000>;
253                                 regulator-max-microvolt = <5000000>;
254                                 regulator-state-mem {
255                                         regulator-on-in-suspend;
256                                         regulator-suspend-microvolt = <5000000>;
257                                 };
258                         };
259
260                         /* vcc9 */
261                         vdd_sd: SWITCH_REG {
262                                 regulator-name = "vdd_sd";
263                                 regulator-always-on;
264                                 regulator-boot-on;
265                                 regulator-state-mem {
266                                         regulator-off-in-suspend;
267                                 };
268                         };
269
270                         /* vcc6 */
271                         vdd_eth_2v5: LDO_REG2 {
272                                 regulator-name = "vdd_eth_2v5";
273                                 regulator-always-on;
274                                 regulator-boot-on;
275                                 regulator-min-microvolt = <2500000>;
276                                 regulator-max-microvolt = <2500000>;
277                                 regulator-state-mem {
278                                         regulator-on-in-suspend;
279                                         regulator-suspend-microvolt = <2500000>;
280                                 };
281                         };
282
283                         /* vcc7 */
284                         vdd_1v0: LDO_REG3 {
285                                 regulator-name = "vdd_1v0";
286                                 regulator-always-on;
287                                 regulator-boot-on;
288                                 regulator-min-microvolt = <1000000>;
289                                 regulator-max-microvolt = <1000000>;
290                                 regulator-state-mem {
291                                         regulator-on-in-suspend;
292                                         regulator-suspend-microvolt = <1000000>;
293                                 };
294                         };
295
296                         /* vcc8 */
297                         vdd_1v8_lcd_ldo: LDO_REG4 {
298                                 regulator-name = "vdd_1v8_lcd_ldo";
299                                 regulator-always-on;
300                                 regulator-boot-on;
301                                 regulator-min-microvolt = <1800000>;
302                                 regulator-max-microvolt = <1800000>;
303                                 regulator-state-mem {
304                                         regulator-on-in-suspend;
305                                         regulator-suspend-microvolt = <1800000>;
306                                 };
307                         };
308
309                         /* vcc8 */
310                         vdd_1v0_lcd: LDO_REG6 {
311                                 regulator-name = "vdd_1v0_lcd";
312                                 regulator-always-on;
313                                 regulator-boot-on;
314                                 regulator-min-microvolt = <1000000>;
315                                 regulator-max-microvolt = <1000000>;
316                                 regulator-state-mem {
317                                         regulator-on-in-suspend;
318                                         regulator-suspend-microvolt = <1000000>;
319                                 };
320                         };
321
322                         /* vcc7 */
323                         vdd_1v8_ldo: LDO_REG7 {
324                                 regulator-name = "vdd_1v8_ldo";
325                                 regulator-always-on;
326                                 regulator-boot-on;
327                                 regulator-min-microvolt = <1800000>;
328                                 regulator-max-microvolt = <1800000>;
329                                 regulator-state-mem {
330                                         regulator-off-in-suspend;
331                                         regulator-suspend-microvolt = <1800000>;
332                                 };
333                         };
334
335                         /* vcc9 */
336                         vdd_io_sd: LDO_REG9 {
337                                 regulator-name = "vdd_io_sd";
338                                 regulator-always-on;
339                                 regulator-boot-on;
340                                 regulator-min-microvolt = <1800000>;
341                                 regulator-max-microvolt = <3300000>;
342                                 regulator-state-mem {
343                                         regulator-off-in-suspend;
344                                 };
345                         };
346                 };
347         };
348
349         /* M24C32-D */
350         i2c_eeprom: eeprom@50 {
351                 compatible = "atmel,24c32";
352                 reg = <0x50>;
353                 pagesize = <32>;
354         };
355
356         vdd_cpu: regulator@60 {
357                 compatible = "fcs,fan53555";
358                 reg = <0x60>;
359                 fcs,suspend-voltage-selector = <1>;
360                 regulator-always-on;
361                 regulator-boot-on;
362                 regulator-enable-ramp-delay = <300>;
363                 regulator-name = "vdd_cpu";
364                 regulator-min-microvolt = <800000>;
365                 regulator-max-microvolt = <1430000>;
366                 regulator-ramp-delay = <8000>;
367                 vin-supply = <&vdd_sys>;
368         };
369 };
370
371 &pinctrl {
372         pcfg_output_high: pcfg-output-high {
373                 output-high;
374         };
375
376         emmc {
377                 /*
378                  * We run eMMC at max speed; bump up drive strength.
379                  * We also have external pulls, so disable the internal ones.
380                  */
381                 emmc_clk: emmc-clk {
382                         rockchip,pins = <3 18 RK_FUNC_2 &pcfg_pull_none_12ma>;
383                 };
384
385                 emmc_cmd: emmc-cmd {
386                         rockchip,pins = <3 16 RK_FUNC_2 &pcfg_pull_none_12ma>;
387                 };
388
389                 emmc_bus8: emmc-bus8 {
390                         rockchip,pins = <3 0 RK_FUNC_2 &pcfg_pull_none_12ma>,
391                                         <3 1 RK_FUNC_2 &pcfg_pull_none_12ma>,
392                                         <3 2 RK_FUNC_2 &pcfg_pull_none_12ma>,
393                                         <3 3 RK_FUNC_2 &pcfg_pull_none_12ma>,
394                                         <3 4 RK_FUNC_2 &pcfg_pull_none_12ma>,
395                                         <3 5 RK_FUNC_2 &pcfg_pull_none_12ma>,
396                                         <3 6 RK_FUNC_2 &pcfg_pull_none_12ma>,
397                                         <3 7 RK_FUNC_2 &pcfg_pull_none_12ma>;
398                 };
399         };
400
401         gmac {
402                 phy_int: phy-int {
403                         rockchip,pins = <4 2 RK_FUNC_GPIO &pcfg_pull_up>;
404                 };
405
406                 phy_rst: phy-rst {
407                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
408                 };
409         };
410
411         leds {
412                 user_led: user-led {
413                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_output_high>;
414                 };
415         };
416
417         pmic {
418                 pmic_int: pmic-int {
419                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
420                 };
421
422                 /* Pin for switching state between sleep and non-sleep state */
423                 pmic_sleep: pmic-sleep {
424                         rockchip,pins = <RK_GPIO0 0 RK_FUNC_GPIO &pcfg_pull_up>;
425                 };
426         };
427 };
428
429 &pwm1 {
430         status = "okay";
431 };
432
433 &saradc {
434         status = "okay";
435         vref-supply = <&vdd_1v8_ldo>;
436 };
437
438 &spi2 {
439         status = "okay";
440
441         serial_flash: flash@0 {
442                 compatible = "micron,n25q128a13", "jedec,spi-nor";
443                 reg = <0x0>;
444                 spi-max-frequency = <50000000>;
445                 m25p,fast-read;
446                 #address-cells = <1>;
447                 #size-cells = <1>;
448                 status = "okay";
449         };
450 };
451
452 &tsadc {
453         status = "okay";
454         rockchip,hw-tshut-mode = <0>;
455         rockchip,hw-tshut-polarity = <0>;
456 };
457
458 &vopb {
459         status = "okay";
460 };
461
462 &vopb_mmu {
463         status = "okay";
464 };
465
466 &vopl {
467         status = "okay";
468 };
469
470 &vopl_mmu {
471         status = "okay";
472 };
473
474 &wdt {
475         status = "okay";
476 };