1
0

006-rockchip-rk3328-Add-support-for-ThinkPenguin-TPE-R1400.patch 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. --- /dev/null
  2. +++ b/arch/arm64/boot/dts/rockchip/rk3328-tpe-r1400.dts
  3. @@ -0,0 +1,411 @@
  4. +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  5. +/*
  6. + * Copyright (c) 2020 David Bauer <mail@david-bauer.net>
  7. + */
  8. +
  9. +/dts-v1/;
  10. +
  11. +#include <dt-bindings/input/input.h>
  12. +#include <dt-bindings/gpio/gpio.h>
  13. +#include "rk3328.dtsi"
  14. +
  15. +/ {
  16. + model = "ThinkPenguin TPE-R1400";
  17. + compatible = "thinkpenguin,tpe-r1400", "rockchip,rk3328";
  18. +
  19. + aliases {
  20. + led-boot = &sys_led;
  21. + led-failsafe = &sys_led;
  22. + led-running = &sys_led;
  23. + led-upgrade = &sys_led;
  24. + };
  25. +
  26. + chosen {
  27. + stdout-path = "serial2:1500000n8";
  28. + };
  29. +
  30. + gmac_clk: gmac-clock {
  31. + compatible = "fixed-clock";
  32. + clock-frequency = <125000000>;
  33. + clock-output-names = "gmac_clk";
  34. + #clock-cells = <0>;
  35. + };
  36. +
  37. + keys {
  38. + compatible = "gpio-keys";
  39. + pinctrl-0 = <&reset_button_pin>;
  40. + pinctrl-names = "default";
  41. +
  42. + reset {
  43. + label = "reset";
  44. + gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
  45. + linux,code = <KEY_RESTART>;
  46. + debounce-interval = <50>;
  47. + };
  48. + };
  49. +
  50. + vcc_rtl8153: vcc-rtl8153-regulator {
  51. + compatible = "regulator-fixed";
  52. + gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
  53. + pinctrl-names = "default";
  54. + pinctrl-0 = <&rtl8153_en_drv>;
  55. + regulator-always-on;
  56. + regulator-name = "vcc_rtl8153";
  57. + regulator-min-microvolt = <5000000>;
  58. + regulator-max-microvolt = <5000000>;
  59. + enable-active-high;
  60. + };
  61. +
  62. + leds {
  63. + compatible = "gpio-leds";
  64. + pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
  65. + pinctrl-names = "default";
  66. +
  67. + lan_led: led-0 {
  68. + gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
  69. + label = "tpe-r1400:green:lan";
  70. + };
  71. +
  72. + sys_led: led-1 {
  73. + gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
  74. + label = "tpe-r1400:red:sys";
  75. + };
  76. +
  77. + wan_led: led-2 {
  78. + gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
  79. + label = "tpe-r1400:green:wan";
  80. + };
  81. + };
  82. +
  83. + vcc_io_sdio: sdmmcio-regulator {
  84. + compatible = "regulator-gpio";
  85. + enable-active-high;
  86. + gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>;
  87. + pinctrl-0 = <&sdio_vcc_pin>;
  88. + pinctrl-names = "default";
  89. + regulator-name = "vcc_io_sdio";
  90. + regulator-always-on;
  91. + regulator-min-microvolt = <1800000>;
  92. + regulator-max-microvolt = <3300000>;
  93. + regulator-settling-time-us = <5000>;
  94. + regulator-type = "voltage";
  95. + startup-delay-us = <2000>;
  96. + states = <1800000 0x1
  97. + 3300000 0x0>;
  98. + vin-supply = <&vcc_io_33>;
  99. + };
  100. +
  101. + vcc_sd: sdmmc-regulator {
  102. + compatible = "regulator-fixed";
  103. + gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
  104. + pinctrl-0 = <&sdmmc0m1_gpio>;
  105. + pinctrl-names = "default";
  106. + regulator-name = "vcc_sd";
  107. + regulator-boot-on;
  108. + regulator-min-microvolt = <3300000>;
  109. + regulator-max-microvolt = <3300000>;
  110. + vin-supply = <&vcc_io_33>;
  111. + };
  112. +
  113. + vdd_5v: vdd-5v {
  114. + compatible = "regulator-fixed";
  115. + regulator-name = "vdd_5v";
  116. + regulator-always-on;
  117. + regulator-boot-on;
  118. + regulator-min-microvolt = <5000000>;
  119. + regulator-max-microvolt = <5000000>;
  120. + };
  121. +};
  122. +
  123. +&cpu0 {
  124. + cpu-supply = <&vdd_arm>;
  125. +};
  126. +
  127. +&cpu1 {
  128. + cpu-supply = <&vdd_arm>;
  129. +};
  130. +
  131. +&cpu2 {
  132. + cpu-supply = <&vdd_arm>;
  133. +};
  134. +
  135. +&cpu3 {
  136. + cpu-supply = <&vdd_arm>;
  137. +};
  138. +
  139. +&gmac2io {
  140. + assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
  141. + assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
  142. + clock_in_out = "input";
  143. + phy-handle = <&rtl8211e>;
  144. + phy-mode = "rgmii";
  145. + phy-supply = <&vcc_io_33>;
  146. + pinctrl-0 = <&rgmiim1_pins>;
  147. + pinctrl-names = "default";
  148. + rx_delay = <0x18>;
  149. + snps,aal;
  150. + tx_delay = <0x24>;
  151. + status = "okay";
  152. +
  153. + mdio {
  154. + compatible = "snps,dwmac-mdio";
  155. + #address-cells = <1>;
  156. + #size-cells = <0>;
  157. +
  158. + rtl8211e: ethernet-phy@1 {
  159. + compatible = "ethernet-phy-id001c.c915",
  160. + "ethernet-phy-ieee802.3-c22";
  161. + reg = <1>;
  162. + pinctrl-0 = <&eth_phy_reset_pin>;
  163. + pinctrl-names = "default";
  164. + reset-assert-us = <10000>;
  165. + reset-deassert-us = <50000>;
  166. + reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
  167. + };
  168. + };
  169. +};
  170. +
  171. +&i2c1 {
  172. + status = "okay";
  173. +
  174. + rk805: pmic@18 {
  175. + compatible = "rockchip,rk805";
  176. + reg = <0x18>;
  177. + interrupt-parent = <&gpio1>;
  178. + interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
  179. + #clock-cells = <1>;
  180. + clock-output-names = "xin32k", "rk805-clkout2";
  181. + gpio-controller;
  182. + #gpio-cells = <2>;
  183. + pinctrl-0 = <&pmic_int_l>;
  184. + pinctrl-names = "default";
  185. + rockchip,system-power-controller;
  186. + wakeup-source;
  187. +
  188. + vcc1-supply = <&vdd_5v>;
  189. + vcc2-supply = <&vdd_5v>;
  190. + vcc3-supply = <&vdd_5v>;
  191. + vcc4-supply = <&vdd_5v>;
  192. + vcc5-supply = <&vcc_io_33>;
  193. + vcc6-supply = <&vdd_5v>;
  194. +
  195. + regulators {
  196. + vdd_log: DCDC_REG1 {
  197. + regulator-name = "vdd_log";
  198. + regulator-always-on;
  199. + regulator-boot-on;
  200. + regulator-min-microvolt = <712500>;
  201. + regulator-max-microvolt = <1450000>;
  202. + regulator-ramp-delay = <12500>;
  203. +
  204. + regulator-state-mem {
  205. + regulator-on-in-suspend;
  206. + regulator-suspend-microvolt = <1000000>;
  207. + };
  208. + };
  209. +
  210. + vdd_arm: DCDC_REG2 {
  211. + regulator-name = "vdd_arm";
  212. + regulator-always-on;
  213. + regulator-boot-on;
  214. + regulator-min-microvolt = <712500>;
  215. + regulator-max-microvolt = <1450000>;
  216. + regulator-ramp-delay = <12500>;
  217. +
  218. + regulator-state-mem {
  219. + regulator-on-in-suspend;
  220. + regulator-suspend-microvolt = <950000>;
  221. + };
  222. + };
  223. +
  224. + vcc_ddr: DCDC_REG3 {
  225. + regulator-name = "vcc_ddr";
  226. + regulator-always-on;
  227. + regulator-boot-on;
  228. +
  229. + regulator-state-mem {
  230. + regulator-on-in-suspend;
  231. + };
  232. + };
  233. +
  234. + vcc_io_33: DCDC_REG4 {
  235. + regulator-name = "vcc_io_33";
  236. + regulator-always-on;
  237. + regulator-boot-on;
  238. + regulator-min-microvolt = <3300000>;
  239. + regulator-max-microvolt = <3300000>;
  240. +
  241. + regulator-state-mem {
  242. + regulator-on-in-suspend;
  243. + regulator-suspend-microvolt = <3300000>;
  244. + };
  245. + };
  246. +
  247. + vcc_18: LDO_REG1 {
  248. + regulator-name = "vcc_18";
  249. + regulator-always-on;
  250. + regulator-boot-on;
  251. + regulator-min-microvolt = <1800000>;
  252. + regulator-max-microvolt = <1800000>;
  253. +
  254. + regulator-state-mem {
  255. + regulator-on-in-suspend;
  256. + regulator-suspend-microvolt = <1800000>;
  257. + };
  258. + };
  259. +
  260. + vcc18_emmc: LDO_REG2 {
  261. + regulator-name = "vcc18_emmc";
  262. + regulator-always-on;
  263. + regulator-boot-on;
  264. + regulator-min-microvolt = <1800000>;
  265. + regulator-max-microvolt = <1800000>;
  266. +
  267. + regulator-state-mem {
  268. + regulator-on-in-suspend;
  269. + regulator-suspend-microvolt = <1800000>;
  270. + };
  271. + };
  272. +
  273. + vdd_10: LDO_REG3 {
  274. + regulator-name = "vdd_10";
  275. + regulator-always-on;
  276. + regulator-boot-on;
  277. + regulator-min-microvolt = <1000000>;
  278. + regulator-max-microvolt = <1000000>;
  279. +
  280. + regulator-state-mem {
  281. + regulator-on-in-suspend;
  282. + regulator-suspend-microvolt = <1000000>;
  283. + };
  284. + };
  285. + };
  286. + };
  287. +
  288. + usb {
  289. + rtl8153_en_drv: rtl8153-en-drv {
  290. + rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
  291. + };
  292. + };
  293. +};
  294. +
  295. +&io_domains {
  296. + pmuio-supply = <&vcc_io_33>;
  297. + vccio1-supply = <&vcc_io_33>;
  298. + vccio2-supply = <&vcc18_emmc>;
  299. + vccio3-supply = <&vcc_io_sdio>;
  300. + vccio4-supply = <&vcc_18>;
  301. + vccio5-supply = <&vcc_io_33>;
  302. + vccio6-supply = <&vcc_io_33>;
  303. + status = "okay";
  304. +};
  305. +
  306. +&pinctrl {
  307. + button {
  308. + reset_button_pin: reset-button-pin {
  309. + rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
  310. + };
  311. + };
  312. +
  313. + ethernet-phy {
  314. + eth_phy_reset_pin: eth-phy-reset-pin {
  315. + rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
  316. + };
  317. + };
  318. +
  319. + leds {
  320. + lan_led_pin: lan-led-pin {
  321. + rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
  322. + };
  323. +
  324. + sys_led_pin: sys-led-pin {
  325. + rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
  326. + };
  327. +
  328. + wan_led_pin: wan-led-pin {
  329. + rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
  330. + };
  331. + };
  332. +
  333. + pmic {
  334. + pmic_int_l: pmic-int-l {
  335. + rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
  336. + };
  337. + };
  338. +
  339. + sd {
  340. + sdio_vcc_pin: sdio-vcc-pin {
  341. + rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
  342. + };
  343. + };
  344. +};
  345. +
  346. +&pwm2 {
  347. + status = "okay";
  348. +};
  349. +
  350. +&sdmmc {
  351. + bus-width = <4>;
  352. + cap-sd-highspeed;
  353. + disable-wp;
  354. + pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
  355. + pinctrl-names = "default";
  356. + sd-uhs-sdr12;
  357. + sd-uhs-sdr25;
  358. + sd-uhs-sdr50;
  359. + sd-uhs-sdr104;
  360. + vmmc-supply = <&vcc_sd>;
  361. + vqmmc-supply = <&vcc_io_sdio>;
  362. + status = "okay";
  363. +};
  364. +
  365. +&tsadc {
  366. + rockchip,hw-tshut-mode = <0>;
  367. + rockchip,hw-tshut-polarity = <0>;
  368. + status = "okay";
  369. +};
  370. +
  371. +&u2phy {
  372. + status = "okay";
  373. +};
  374. +
  375. +&u2phy_host {
  376. + status = "okay";
  377. +};
  378. +
  379. +&u2phy_otg {
  380. + status = "okay";
  381. +};
  382. +
  383. +&uart2 {
  384. + status = "okay";
  385. +};
  386. +
  387. +&usb20_otg {
  388. + status = "okay";
  389. + dr_mode = "host";
  390. +};
  391. +
  392. +&usb_host0_ehci {
  393. + status = "okay";
  394. +};
  395. +
  396. +&usb_host0_ohci {
  397. + status = "okay";
  398. +};
  399. +
  400. +&usbdrd3 {
  401. + status = "okay";
  402. +};
  403. +
  404. +&usbdrd_dwc3 {
  405. + dr_mode = "host";
  406. + status = "okay";
  407. +
  408. + usb-eth@2 {
  409. + compatible = "realtek,rtl8153";
  410. + reg = <2>;
  411. +
  412. + realtek,led-data = <0x87>;
  413. + };
  414. +};
  415. --- a/arch/arm64/boot/dts/rockchip/Makefile
  416. +++ b/arch/arm64/boot/dts/rockchip/Makefile
  417. @@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-px
  418. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-r88.dtb
  419. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-evb.dtb
  420. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb
  421. +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-tpe-r1400.dtb
  422. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-firefly.dtb
  423. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-kevin.dtb
  424. dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb