rk3328-nanopi-r2s.dts 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2020 David Bauer <mail@david-bauer.net>
  4. */
  5. /dts-v1/;
  6. #include <dt-bindings/input/input.h>
  7. #include <dt-bindings/gpio/gpio.h>
  8. #include "rk3328.dtsi"
  9. / {
  10. model = "FriendlyElec NanoPi R2S";
  11. compatible = "friendlyarm,nanopi-r2s", "rockchip,rk3328";
  12. chosen {
  13. stdout-path = "serial2:1500000n8";
  14. };
  15. gmac_clk: gmac-clock {
  16. compatible = "fixed-clock";
  17. clock-frequency = <125000000>;
  18. clock-output-names = "gmac_clkin";
  19. #clock-cells = <0>;
  20. };
  21. keys {
  22. compatible = "gpio-keys";
  23. pinctrl-0 = <&reset_button_pin>;
  24. pinctrl-names = "default";
  25. reset {
  26. label = "reset";
  27. gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
  28. linux,code = <KEY_RESTART>;
  29. debounce-interval = <50>;
  30. };
  31. };
  32. leds {
  33. compatible = "gpio-leds";
  34. pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
  35. pinctrl-names = "default";
  36. lan_led: led-0 {
  37. gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
  38. label = "nanopi-r2s:green:lan";
  39. };
  40. sys_led: led-1 {
  41. gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
  42. label = "nanopi-r2s:red:sys";
  43. };
  44. wan_led: led-2 {
  45. gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
  46. label = "nanopi-r2s:green:wan";
  47. };
  48. };
  49. vcc_io_sdio: sdmmcio-regulator {
  50. compatible = "regulator-gpio";
  51. enable-active-high;
  52. gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>;
  53. pinctrl-0 = <&sdio_vcc_pin>;
  54. pinctrl-names = "default";
  55. regulator-name = "vcc_io_sdio";
  56. regulator-always-on;
  57. regulator-min-microvolt = <1800000>;
  58. regulator-max-microvolt = <3300000>;
  59. regulator-settling-time-us = <5000>;
  60. regulator-type = "voltage";
  61. startup-delay-us = <2000>;
  62. states = <1800000 0x1
  63. 3300000 0x0>;
  64. vin-supply = <&vcc_io_33>;
  65. };
  66. vcc_sd: sdmmc-regulator {
  67. compatible = "regulator-fixed";
  68. gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
  69. pinctrl-0 = <&sdmmc0m1_gpio>;
  70. pinctrl-names = "default";
  71. regulator-name = "vcc_sd";
  72. regulator-boot-on;
  73. regulator-min-microvolt = <3300000>;
  74. regulator-max-microvolt = <3300000>;
  75. vin-supply = <&vcc_io_33>;
  76. };
  77. vdd_5v: vdd-5v {
  78. compatible = "regulator-fixed";
  79. regulator-name = "vdd_5v";
  80. regulator-always-on;
  81. regulator-boot-on;
  82. regulator-min-microvolt = <5000000>;
  83. regulator-max-microvolt = <5000000>;
  84. };
  85. };
  86. &cpu0 {
  87. cpu-supply = <&vdd_arm>;
  88. };
  89. &cpu1 {
  90. cpu-supply = <&vdd_arm>;
  91. };
  92. &cpu2 {
  93. cpu-supply = <&vdd_arm>;
  94. };
  95. &cpu3 {
  96. cpu-supply = <&vdd_arm>;
  97. };
  98. &gmac2io {
  99. assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
  100. assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
  101. clock_in_out = "input";
  102. phy-handle = <&rtl8211e>;
  103. phy-mode = "rgmii";
  104. phy-supply = <&vcc_io_33>;
  105. pinctrl-0 = <&rgmiim1_pins>;
  106. pinctrl-names = "default";
  107. rx_delay = <0x18>;
  108. snps,aal;
  109. tx_delay = <0x24>;
  110. status = "okay";
  111. mdio {
  112. compatible = "snps,dwmac-mdio";
  113. #address-cells = <1>;
  114. #size-cells = <0>;
  115. rtl8211e: ethernet-phy@1 {
  116. compatible = "ethernet-phy-id001c.c915",
  117. "ethernet-phy-ieee802.3-c22";
  118. reg = <1>;
  119. pinctrl-0 = <&eth_phy_reset_pin>;
  120. pinctrl-names = "default";
  121. reset-assert-us = <10000>;
  122. reset-deassert-us = <50000>;
  123. reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
  124. };
  125. };
  126. };
  127. &i2c1 {
  128. status = "okay";
  129. rk805: pmic@18 {
  130. compatible = "rockchip,rk805";
  131. reg = <0x18>;
  132. interrupt-parent = <&gpio1>;
  133. interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
  134. #clock-cells = <1>;
  135. clock-output-names = "xin32k", "rk805-clkout2";
  136. gpio-controller;
  137. #gpio-cells = <2>;
  138. pinctrl-0 = <&pmic_int_l>;
  139. pinctrl-names = "default";
  140. rockchip,system-power-controller;
  141. wakeup-source;
  142. vcc1-supply = <&vdd_5v>;
  143. vcc2-supply = <&vdd_5v>;
  144. vcc3-supply = <&vdd_5v>;
  145. vcc4-supply = <&vdd_5v>;
  146. vcc5-supply = <&vcc_io_33>;
  147. vcc6-supply = <&vdd_5v>;
  148. regulators {
  149. vdd_log: DCDC_REG1 {
  150. regulator-name = "vdd_log";
  151. regulator-always-on;
  152. regulator-boot-on;
  153. regulator-min-microvolt = <712500>;
  154. regulator-max-microvolt = <1450000>;
  155. regulator-ramp-delay = <12500>;
  156. regulator-state-mem {
  157. regulator-on-in-suspend;
  158. regulator-suspend-microvolt = <1000000>;
  159. };
  160. };
  161. vdd_arm: DCDC_REG2 {
  162. regulator-name = "vdd_arm";
  163. regulator-always-on;
  164. regulator-boot-on;
  165. regulator-min-microvolt = <712500>;
  166. regulator-max-microvolt = <1450000>;
  167. regulator-ramp-delay = <12500>;
  168. regulator-state-mem {
  169. regulator-on-in-suspend;
  170. regulator-suspend-microvolt = <950000>;
  171. };
  172. };
  173. vcc_ddr: DCDC_REG3 {
  174. regulator-name = "vcc_ddr";
  175. regulator-always-on;
  176. regulator-boot-on;
  177. regulator-state-mem {
  178. regulator-on-in-suspend;
  179. };
  180. };
  181. vcc_io_33: DCDC_REG4 {
  182. regulator-name = "vcc_io_33";
  183. regulator-always-on;
  184. regulator-boot-on;
  185. regulator-min-microvolt = <3300000>;
  186. regulator-max-microvolt = <3300000>;
  187. regulator-state-mem {
  188. regulator-on-in-suspend;
  189. regulator-suspend-microvolt = <3300000>;
  190. };
  191. };
  192. vcc_18: LDO_REG1 {
  193. regulator-name = "vcc_18";
  194. regulator-always-on;
  195. regulator-boot-on;
  196. regulator-min-microvolt = <1800000>;
  197. regulator-max-microvolt = <1800000>;
  198. regulator-state-mem {
  199. regulator-on-in-suspend;
  200. regulator-suspend-microvolt = <1800000>;
  201. };
  202. };
  203. vcc18_emmc: LDO_REG2 {
  204. regulator-name = "vcc18_emmc";
  205. regulator-always-on;
  206. regulator-boot-on;
  207. regulator-min-microvolt = <1800000>;
  208. regulator-max-microvolt = <1800000>;
  209. regulator-state-mem {
  210. regulator-on-in-suspend;
  211. regulator-suspend-microvolt = <1800000>;
  212. };
  213. };
  214. vdd_10: LDO_REG3 {
  215. regulator-name = "vdd_10";
  216. regulator-always-on;
  217. regulator-boot-on;
  218. regulator-min-microvolt = <1000000>;
  219. regulator-max-microvolt = <1000000>;
  220. regulator-state-mem {
  221. regulator-on-in-suspend;
  222. regulator-suspend-microvolt = <1000000>;
  223. };
  224. };
  225. };
  226. };
  227. };
  228. &io_domains {
  229. pmuio-supply = <&vcc_io_33>;
  230. vccio1-supply = <&vcc_io_33>;
  231. vccio2-supply = <&vcc18_emmc>;
  232. vccio3-supply = <&vcc_io_sdio>;
  233. vccio4-supply = <&vcc_18>;
  234. vccio5-supply = <&vcc_io_33>;
  235. vccio6-supply = <&vcc_io_33>;
  236. status = "okay";
  237. };
  238. &pinctrl {
  239. button {
  240. reset_button_pin: reset-button-pin {
  241. rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
  242. };
  243. };
  244. ethernet-phy {
  245. eth_phy_reset_pin: eth-phy-reset-pin {
  246. rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
  247. };
  248. };
  249. leds {
  250. lan_led_pin: lan-led-pin {
  251. rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
  252. };
  253. sys_led_pin: sys-led-pin {
  254. rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
  255. };
  256. wan_led_pin: wan-led-pin {
  257. rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
  258. };
  259. };
  260. pmic {
  261. pmic_int_l: pmic-int-l {
  262. rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
  263. };
  264. };
  265. sd {
  266. sdio_vcc_pin: sdio-vcc-pin {
  267. rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
  268. };
  269. };
  270. };
  271. &pwm2 {
  272. status = "okay";
  273. };
  274. &sdmmc {
  275. bus-width = <4>;
  276. cap-sd-highspeed;
  277. disable-wp;
  278. pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
  279. pinctrl-names = "default";
  280. sd-uhs-sdr12;
  281. sd-uhs-sdr25;
  282. sd-uhs-sdr50;
  283. sd-uhs-sdr104;
  284. vmmc-supply = <&vcc_sd>;
  285. vqmmc-supply = <&vcc_io_sdio>;
  286. status = "okay";
  287. };
  288. &tsadc {
  289. rockchip,hw-tshut-mode = <0>;
  290. rockchip,hw-tshut-polarity = <0>;
  291. status = "okay";
  292. };
  293. &u2phy {
  294. status = "okay";
  295. };
  296. &u2phy_host {
  297. status = "okay";
  298. };
  299. &u2phy_otg {
  300. status = "okay";
  301. };
  302. &uart2 {
  303. status = "okay";
  304. };
  305. &usb20_otg {
  306. status = "okay";
  307. dr_mode = "host";
  308. };
  309. &usb_host0_ehci {
  310. status = "okay";
  311. };
  312. &usb_host0_ohci {
  313. status = "okay";
  314. };