rk3328-nanopi-r2s.dts 8.0 KB

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