sun50i-h6-orangepi-3-lts.dts 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. // Copyright (C) 2019 Ondřej Jirman <megous@megous.com>
  3. /dts-v1/;
  4. #include "sun50i-h6.dtsi"
  5. #include "sun50i-h6-cpu-opp.dtsi"
  6. #include <dt-bindings/input/linux-event-codes.h>
  7. #include <dt-bindings/gpio/gpio.h>
  8. / {
  9. model = "OrangePi 3 LTS";
  10. compatible = "xunlong,orangepi-3-lts", "allwinner,sun50i-h6";
  11. aliases {
  12. serial0 = &uart0;
  13. serial1 = &uart1;
  14. serial9 = &r_uart;
  15. ethernet0 = &emac;
  16. };
  17. chosen {
  18. stdout-path = "serial0:115200n8";
  19. };
  20. connector {
  21. compatible = "hdmi-connector";
  22. ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
  23. type = "a";
  24. port {
  25. hdmi_con_in: endpoint {
  26. remote-endpoint = <&hdmi_out_con>;
  27. };
  28. };
  29. };
  30. ext_osc32k: ext_osc32k_clk {
  31. #clock-cells = <0>;
  32. compatible = "fixed-clock";
  33. clock-frequency = <32768>;
  34. clock-output-names = "ext_osc32k";
  35. };
  36. leds {
  37. compatible = "gpio-leds";
  38. power {
  39. label = "red-led";
  40. gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
  41. default-state = "on";
  42. };
  43. status {
  44. label = "green-led";
  45. gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
  46. };
  47. };
  48. reg_vcc5v: vcc5v {
  49. /* board wide 5V supply directly from the DC jack */
  50. compatible = "regulator-fixed";
  51. regulator-name = "vcc-5v";
  52. regulator-min-microvolt = <5000000>;
  53. regulator-max-microvolt = <5000000>;
  54. regulator-always-on;
  55. };
  56. reg_gmac_3v3: gmac-3v3 {
  57. compatible = "regulator-fixed";
  58. regulator-name = "vcc-gmac-3v3";
  59. regulator-min-microvolt = <3300000>;
  60. regulator-max-microvolt = <3300000>;
  61. startup-delay-us = <100000>;
  62. gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
  63. enable-active-high;
  64. };
  65. reg_vcc33_wifi: vcc33-wifi {
  66. /* Always on 3.3V regulator for WiFi and BT */
  67. compatible = "regulator-fixed";
  68. regulator-name = "vcc33-wifi";
  69. regulator-min-microvolt = <3300000>;
  70. regulator-max-microvolt = <3300000>;
  71. enable-active-high;
  72. gpio = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
  73. };
  74. reg_vcc_wifi_io: vcc-wifi-io {
  75. /* Always on 1.8V/300mA regulator for WiFi and BT IO */
  76. compatible = "regulator-fixed";
  77. regulator-name = "vcc-wifi-io";
  78. regulator-min-microvolt = <1800000>;
  79. regulator-max-microvolt = <1800000>;
  80. regulator-always-on;
  81. vin-supply = <&reg_vcc33_wifi>;
  82. };
  83. wifi_pwrseq: wifi-pwrseq {
  84. compatible = "mmc-pwrseq-simple";
  85. clocks = <&rtc 1>;
  86. clock-names = "ext_clock";
  87. reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */
  88. post-power-on-delay-ms = <200>;
  89. };
  90. };
  91. &spi1 {
  92. status="okay";
  93. ili9341: ili9341@0{
  94. compatible = "ilitek,ili9341";//这个要跟fb_ili9341.c对应上
  95. reg = <0>;
  96. status = "okay";
  97. spi-max-frequency = <24000000>;//最大速率
  98. spi-cpol;//spi模式
  99. spi-cpha;
  100. rotate = <0>;//屏幕翻转
  101. fps = <60>;//帧率
  102. buswidth = <8>;//数据位宽
  103. rgb;
  104. dc-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; // PD23 gpio 0对应A、1对应B...
  105. reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; // PD24
  106. led-gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; // PD15
  107. PL2-gpios = <&pio 11 2 GPIO_ACTIVE_HIGH>;
  108. PL3-gpios = <&pio 11 3 GPIO_ACTIVE_HIGH>;
  109. PL8-gpios = <&pio 11 8 GPIO_ACTIVE_HIGH>;
  110. PL10-gpios = <&pio 11 10 GPIO_ACTIVE_HIGH>;
  111. PD16-gpios = <&pio 3 16 GPIO_ACTIVE_HIGH>;
  112. PD18-gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>;
  113. PD21-gpios = <&pio 3 21 GPIO_ACTIVE_HIGH>;
  114. debug = <0>;
  115. };
  116. };
  117. &cpu0 {
  118. cpu-supply = <&reg_dcdca>;
  119. };
  120. &de {
  121. status = "okay";
  122. };
  123. &dwc3 {
  124. status = "okay";
  125. };
  126. &ehci0 {
  127. status = "okay";
  128. };
  129. &ehci3 {
  130. status = "okay";
  131. };
  132. &gpu {
  133. mali-supply = <&reg_dcdcc>;
  134. status = "okay";
  135. };
  136. &hdmi {
  137. status = "okay";
  138. };
  139. &hdmi_sound {
  140. status = "okay";
  141. };
  142. &i2s1 {
  143. status = "okay";
  144. };
  145. &ac200_sound {
  146. status = "okay";
  147. };
  148. &hdmi_out {
  149. hdmi_out_con: endpoint {
  150. remote-endpoint = <&hdmi_con_in>;
  151. };
  152. };
  153. &emac {
  154. pinctrl-names = "default";
  155. pinctrl-0 = <&ext_rgmii_pins>;
  156. phy-mode = "rgmii-id";
  157. phy-handle = <&ext_rgmii_phy>;
  158. phy-supply = <&reg_gmac_3v3>;
  159. allwinner,rx-delay-ps = <200>;
  160. allwinner,tx-delay-ps = <300>;
  161. status = "okay";
  162. };
  163. &mdio {
  164. ext_rgmii_phy: ethernet-phy@1 {
  165. compatible = "ethernet-phy-ieee802.3-c22";
  166. reg = <1>;
  167. reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */
  168. reset-assert-us = <15000>;
  169. reset-deassert-us = <40000>;
  170. };
  171. };
  172. &mmc0 {
  173. vmmc-supply = <&reg_cldo1>;
  174. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  175. bus-width = <4>;
  176. status = "okay";
  177. };
  178. &mmc1 {
  179. vmmc-supply = <&reg_vcc33_wifi>;
  180. vqmmc-supply = <&reg_vcc_wifi_io>;
  181. mmc-pwrseq = <&wifi_pwrseq>;
  182. bus-width = <4>;
  183. non-removable;
  184. status = "okay";
  185. };
  186. &mmc2 {
  187. pinctrl-names = "default";
  188. pinctrl-0 = <&mmc2_pins>;
  189. vmmc-supply = <&reg_cldo1>;
  190. vqmmc-supply = <&reg_bldo2>;
  191. bus-width = <8>;
  192. non-removable;
  193. cap-mmc-hw-reset;
  194. mmc-hs200-1_8v;
  195. status = "okay";
  196. };
  197. &ohci0 {
  198. status = "okay";
  199. };
  200. &ohci3 {
  201. status = "okay";
  202. };
  203. &pio {
  204. vcc-pc-supply = <&reg_bldo2>;
  205. vcc-pd-supply = <&reg_cldo1>;
  206. vcc-pg-supply = <&reg_vcc_wifi_io>;
  207. };
  208. &r_i2c {
  209. status = "okay";
  210. axp805: pmic@36 {
  211. compatible = "x-powers,axp805", "x-powers,axp806";
  212. reg = <0x36>;
  213. interrupt-parent = <&r_intc>;
  214. interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
  215. interrupt-controller;
  216. #interrupt-cells = <1>;
  217. x-powers,self-working-mode;
  218. vina-supply = <&reg_vcc5v>;
  219. vinb-supply = <&reg_vcc5v>;
  220. vinc-supply = <&reg_vcc5v>;
  221. vind-supply = <&reg_vcc5v>;
  222. vine-supply = <&reg_vcc5v>;
  223. aldoin-supply = <&reg_vcc5v>;
  224. bldoin-supply = <&reg_vcc5v>;
  225. cldoin-supply = <&reg_vcc5v>;
  226. regulators {
  227. reg_aldo1: aldo1 {
  228. regulator-always-on;
  229. regulator-min-microvolt = <3300000>;
  230. regulator-max-microvolt = <3300000>;
  231. regulator-name = "vcc-pl-led-ir";
  232. };
  233. reg_aldo2: aldo2 {
  234. regulator-always-on;
  235. regulator-min-microvolt = <3300000>;
  236. regulator-max-microvolt = <3300000>;
  237. regulator-name = "vcc33-audio-tv-ephy-mac";
  238. regulator-enable-ramp-delay = <100000>;
  239. };
  240. /* ALDO3 is shorted to CLDO1 */
  241. reg_aldo3: aldo3 {
  242. regulator-always-on;
  243. regulator-min-microvolt = <3300000>;
  244. regulator-max-microvolt = <3300000>;
  245. regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-1";
  246. };
  247. reg_bldo1: bldo1 {
  248. regulator-always-on;
  249. regulator-min-microvolt = <1800000>;
  250. regulator-max-microvolt = <1800000>;
  251. regulator-name = "vcc18-dram-bias-pll";
  252. };
  253. reg_bldo2: bldo2 {
  254. regulator-always-on;
  255. regulator-min-microvolt = <1800000>;
  256. regulator-max-microvolt = <1800000>;
  257. regulator-name = "vcc-efuse-pcie-hdmi-pc";
  258. };
  259. reg_bldo3: bldo3 {
  260. regulator-always-on;
  261. regulator-min-microvolt = <1800000>;
  262. regulator-max-microvolt = <1800000>;
  263. regulator-name = "vcc-dcxoio";
  264. };
  265. reg_cldo1: cldo1 {
  266. regulator-always-on;
  267. regulator-min-microvolt = <3300000>;
  268. regulator-max-microvolt = <3300000>;
  269. regulator-name = "vcc33-io-pd-emmc-sd-usb-uart-2";
  270. };
  271. reg_cldo2: cldo2 {
  272. /*
  273. * This regulator is connected with CLDO3.
  274. * Before the kernel can support synchronized
  275. * enable of coupled regulators, keep them
  276. * both always on as a ugly hack.
  277. */
  278. regulator-always-on;
  279. regulator-min-microvolt = <3300000>;
  280. regulator-max-microvolt = <3300000>;
  281. regulator-name = "vcc-wifi-1";
  282. };
  283. cldo3 {
  284. /*
  285. * This regulator is connected with CLDO2.
  286. * See the comments for CLDO2.
  287. */
  288. regulator-always-on;
  289. regulator-min-microvolt = <3300000>;
  290. regulator-max-microvolt = <3300000>;
  291. regulator-name = "vcc-wifi-2";
  292. };
  293. reg_dcdca: dcdca {
  294. regulator-always-on;
  295. regulator-min-microvolt = <800000>;
  296. regulator-max-microvolt = <1160000>;
  297. regulator-ramp-delay = <2500>;
  298. regulator-name = "vdd-cpu";
  299. };
  300. reg_dcdcc: dcdcc {
  301. regulator-enable-ramp-delay = <32000>;
  302. regulator-min-microvolt = <810000>;
  303. regulator-max-microvolt = <1080000>;
  304. regulator-ramp-delay = <2500>;
  305. regulator-name = "vdd-gpu";
  306. };
  307. reg_dcdcd: dcdcd {
  308. regulator-always-on;
  309. regulator-min-microvolt = <960000>;
  310. regulator-max-microvolt = <960000>;
  311. regulator-name = "vdd-sys";
  312. };
  313. reg_dcdce: dcdce {
  314. regulator-always-on;
  315. regulator-min-microvolt = <1200000>;
  316. regulator-max-microvolt = <1200000>;
  317. regulator-name = "vcc-dram";
  318. };
  319. sw {
  320. /* unused */
  321. };
  322. };
  323. };
  324. };
  325. &pwm {
  326. status = "okay";
  327. };
  328. &ac200_pwm_clk {
  329. status = "okay";
  330. };
  331. &i2s3 {
  332. status = "okay";
  333. };
  334. &i2c3 {
  335. status = "okay";
  336. };
  337. &r_ir {
  338. status = "okay";
  339. };
  340. &rtc {
  341. clocks = <&ext_osc32k>;
  342. };
  343. /delete-node/ &spi0;
  344. &uart0 {
  345. pinctrl-names = "default";
  346. pinctrl-0 = <&uart0_ph_pins>;
  347. status = "okay";
  348. };
  349. &uart1 {
  350. pinctrl-names = "default";
  351. pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
  352. uart-has-rtscts;
  353. status = "disabled";
  354. };
  355. &usb2otg {
  356. /*
  357. * This board doesn't have a controllable VBUS even though it
  358. * does have an ID pin. Using it as anything but a USB host is
  359. * unsafe.
  360. */
  361. dr_mode = "host";
  362. status = "okay";
  363. };
  364. &usb2phy {
  365. usb0_id_det-gpios = <&pio 2 15 GPIO_ACTIVE_HIGH>; /* PC15 */
  366. usb0_vbus-supply = <&reg_vcc5v>;
  367. usb3_vbus-supply = <&reg_vcc5v>;
  368. status = "okay";
  369. };
  370. &usb3phy {
  371. status = "okay";
  372. };