sun50i-h5-nanopi-r1s-h5.dts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (C) 2021 Chukun Pan <[email protected]>
  4. *
  5. * Based on sun50i-h5-nanopi-neo-plus2.dts, which is:
  6. * Copyright (C) 2017 Antony Antony <[email protected]>
  7. * Copyright (C) 2016 ARM Ltd.
  8. */
  9. /dts-v1/;
  10. #include "sun50i-h5.dtsi"
  11. #include "sun50i-h5-cpu-opp.dtsi"
  12. #include <dt-bindings/gpio/gpio.h>
  13. #include <dt-bindings/input/input.h>
  14. #include <dt-bindings/leds/common.h>
  15. / {
  16. model = "FriendlyARM NanoPi R1S H5";
  17. compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5";
  18. aliases {
  19. ethernet0 = &emac;
  20. ethernet1 = &rtl8189etv;
  21. serial0 = &uart0;
  22. };
  23. chosen {
  24. stdout-path = "serial0:115200n8";
  25. };
  26. leds {
  27. compatible = "gpio-leds";
  28. led-0 {
  29. function = LED_FUNCTION_LAN;
  30. color = <LED_COLOR_ID_GREEN>;
  31. gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>;
  32. };
  33. led-1 {
  34. function = LED_FUNCTION_STATUS;
  35. color = <LED_COLOR_ID_RED>;
  36. gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
  37. linux,default-trigger = "heartbeat";
  38. };
  39. led-2 {
  40. function = LED_FUNCTION_WAN;
  41. color = <LED_COLOR_ID_GREEN>;
  42. gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>;
  43. };
  44. };
  45. gpio-keys {
  46. compatible = "gpio-keys";
  47. key-reset {
  48. label = "reset";
  49. linux,code = <KEY_RESTART>;
  50. gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
  51. };
  52. };
  53. reg_gmac_3v3: gmac-3v3 {
  54. compatible = "regulator-fixed";
  55. regulator-name = "gmac-3v3";
  56. regulator-min-microvolt = <3300000>;
  57. regulator-max-microvolt = <3300000>;
  58. startup-delay-us = <100000>;
  59. enable-active-high;
  60. gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
  61. };
  62. reg_vcc3v3: vcc3v3 {
  63. compatible = "regulator-fixed";
  64. regulator-name = "vcc3v3";
  65. regulator-min-microvolt = <3300000>;
  66. regulator-max-microvolt = <3300000>;
  67. };
  68. reg_usb0_vbus: usb0-vbus {
  69. compatible = "regulator-fixed";
  70. regulator-name = "usb0-vbus";
  71. regulator-min-microvolt = <5000000>;
  72. regulator-max-microvolt = <5000000>;
  73. enable-active-high;
  74. gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
  75. status = "okay";
  76. };
  77. vdd_cpux: gpio-regulator {
  78. compatible = "regulator-gpio";
  79. regulator-name = "vdd-cpux";
  80. regulator-type = "voltage";
  81. regulator-boot-on;
  82. regulator-always-on;
  83. regulator-min-microvolt = <1100000>;
  84. regulator-max-microvolt = <1300000>;
  85. regulator-ramp-delay = <50>; /* 4ms */
  86. gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
  87. gpios-states = <0x1>;
  88. states = <1100000 0x0>, <1300000 0x1>;
  89. };
  90. wifi_pwrseq: wifi_pwrseq {
  91. compatible = "mmc-pwrseq-simple";
  92. reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
  93. post-power-on-delay-ms = <200>;
  94. };
  95. };
  96. &cpu0 {
  97. cpu-supply = <&vdd_cpux>;
  98. };
  99. &ehci1 {
  100. status = "okay";
  101. };
  102. &ehci2 {
  103. status = "okay";
  104. };
  105. &emac {
  106. pinctrl-names = "default";
  107. pinctrl-0 = <&emac_rgmii_pins>;
  108. phy-supply = <&reg_gmac_3v3>;
  109. phy-handle = <&ext_rgmii_phy>;
  110. phy-mode = "rgmii-id";
  111. status = "okay";
  112. };
  113. &external_mdio {
  114. ext_rgmii_phy: ethernet-phy@7 {
  115. compatible = "ethernet-phy-ieee802.3-c22";
  116. reg = <7>;
  117. };
  118. };
  119. &i2c0 {
  120. status = "okay";
  121. eeprom@51 {
  122. compatible = "microchip,24c02", "atmel,24c02";
  123. reg = <0x51>;
  124. pagesize = <16>;
  125. read-only;
  126. #address-cells = <1>;
  127. #size-cells = <1>;
  128. eth_mac1: mac-address@fa {
  129. reg = <0xfa 0x06>;
  130. };
  131. };
  132. };
  133. &mmc0 {
  134. vmmc-supply = <&reg_vcc3v3>;
  135. bus-width = <4>;
  136. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  137. status = "okay";
  138. };
  139. &mmc1 {
  140. vmmc-supply = <&reg_vcc3v3>;
  141. vqmmc-supply = <&reg_vcc3v3>;
  142. mmc-pwrseq = <&wifi_pwrseq>;
  143. bus-width = <4>;
  144. non-removable;
  145. status = "okay";
  146. rtl8189etv: sdio_wifi@1 {
  147. reg = <1>;
  148. };
  149. };
  150. &ohci1 {
  151. status = "okay";
  152. };
  153. &ohci2 {
  154. status = "okay";
  155. };
  156. &uart0 {
  157. pinctrl-names = "default";
  158. pinctrl-0 = <&uart0_pa_pins>;
  159. status = "okay";
  160. };
  161. &usb_otg {
  162. dr_mode = "peripheral";
  163. status = "okay";
  164. };
  165. &usbphy {
  166. /* USB Type-A port's VBUS is always on */
  167. usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
  168. usb0_vbus-supply = <&reg_usb0_vbus>;
  169. status = "okay";
  170. };