sun50i-a64-pinebook.dts 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. // Copyright (C) 2017 Icenowy Zheng <[email protected]>
  3. // Copyright (C) 2018 Vasily Khoruzhick <[email protected]>
  4. /dts-v1/;
  5. #include "sun50i-a64.dtsi"
  6. #include "sun50i-a64-cpu-opp.dtsi"
  7. #include <dt-bindings/gpio/gpio.h>
  8. #include <dt-bindings/input/gpio-keys.h>
  9. #include <dt-bindings/input/input.h>
  10. #include <dt-bindings/pwm/pwm.h>
  11. / {
  12. model = "Pinebook";
  13. compatible = "pine64,pinebook", "allwinner,sun50i-a64";
  14. chassis-type = "laptop";
  15. aliases {
  16. serial0 = &uart0;
  17. ethernet0 = &rtl8723cs;
  18. };
  19. backlight: backlight {
  20. compatible = "pwm-backlight";
  21. pwms = <&pwm 0 50000 0>;
  22. brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
  23. default-brightness-level = <2>;
  24. enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
  25. power-supply = <&reg_vbklt>;
  26. };
  27. chosen {
  28. stdout-path = "serial0:115200n8";
  29. };
  30. gpio-keys {
  31. compatible = "gpio-keys";
  32. lid-switch {
  33. label = "Lid Switch";
  34. gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
  35. linux,input-type = <EV_SW>;
  36. linux,code = <SW_LID>;
  37. linux,can-disable;
  38. wakeup-source;
  39. wakeup-event-action = <EV_ACT_DEASSERTED>;
  40. };
  41. };
  42. panel_edp: panel-edp {
  43. compatible = "neweast,wjfh116008a";
  44. backlight = <&backlight>;
  45. power-supply = <&reg_dc1sw>;
  46. port {
  47. panel_edp_in: endpoint {
  48. remote-endpoint = <&anx6345_out_edp>;
  49. };
  50. };
  51. };
  52. reg_vbklt: vbklt {
  53. compatible = "regulator-fixed";
  54. regulator-name = "vbklt";
  55. regulator-min-microvolt = <18000000>;
  56. regulator-max-microvolt = <18000000>;
  57. gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
  58. enable-active-high;
  59. };
  60. reg_vcc5v0: vcc5v0 {
  61. compatible = "regulator-fixed";
  62. regulator-name = "vcc5v0";
  63. regulator-min-microvolt = <5000000>;
  64. regulator-max-microvolt = <5000000>;
  65. gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
  66. enable-active-high;
  67. };
  68. wifi_pwrseq: wifi_pwrseq {
  69. compatible = "mmc-pwrseq-simple";
  70. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
  71. };
  72. speaker_amp: audio-amplifier {
  73. compatible = "simple-audio-amplifier";
  74. VCC-supply = <&reg_vcc5v0>;
  75. enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
  76. sound-name-prefix = "Speaker Amp";
  77. };
  78. };
  79. &codec {
  80. status = "okay";
  81. };
  82. &codec_analog {
  83. cpvdd-supply = <&reg_eldo1>;
  84. status = "okay";
  85. };
  86. &cpu0 {
  87. cpu-supply = <&reg_dcdc2>;
  88. };
  89. &cpu1 {
  90. cpu-supply = <&reg_dcdc2>;
  91. };
  92. &cpu2 {
  93. cpu-supply = <&reg_dcdc2>;
  94. };
  95. &cpu3 {
  96. cpu-supply = <&reg_dcdc2>;
  97. };
  98. &dai {
  99. status = "okay";
  100. };
  101. &de {
  102. status = "okay";
  103. };
  104. &ehci0 {
  105. status = "okay";
  106. };
  107. &ehci1 {
  108. status = "okay";
  109. };
  110. &mixer0 {
  111. status = "okay";
  112. };
  113. &mmc0 {
  114. pinctrl-names = "default";
  115. pinctrl-0 = <&mmc0_pins>;
  116. vmmc-supply = <&reg_dcdc1>;
  117. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  118. disable-wp;
  119. bus-width = <4>;
  120. status = "okay";
  121. };
  122. &mmc1 {
  123. pinctrl-names = "default";
  124. pinctrl-0 = <&mmc1_pins>;
  125. vmmc-supply = <&reg_dldo4>;
  126. vqmmc-supply = <&reg_eldo1>;
  127. mmc-pwrseq = <&wifi_pwrseq>;
  128. bus-width = <4>;
  129. non-removable;
  130. status = "okay";
  131. rtl8723cs: wifi@1 {
  132. reg = <1>;
  133. };
  134. };
  135. &mmc2 {
  136. pinctrl-names = "default";
  137. pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
  138. vmmc-supply = <&reg_dcdc1>;
  139. vqmmc-supply = <&reg_eldo1>;
  140. max-frequency = <200000000>;
  141. bus-width = <8>;
  142. non-removable;
  143. cap-mmc-hw-reset;
  144. mmc-hs200-1_8v;
  145. status = "okay";
  146. };
  147. &ohci0 {
  148. status = "okay";
  149. };
  150. &ohci1 {
  151. status = "okay";
  152. };
  153. &pio {
  154. vcc-pc-supply = <&reg_eldo1>;
  155. vcc-pd-supply = <&reg_dcdc1>;
  156. vcc-pe-supply = <&reg_aldo1>;
  157. vcc-pg-supply = <&reg_eldo1>;
  158. };
  159. &pwm {
  160. status = "okay";
  161. };
  162. &r_i2c {
  163. clock-frequency = <100000>;
  164. pinctrl-names = "default";
  165. pinctrl-0 = <&r_i2c_pl89_pins>;
  166. status = "okay";
  167. anx6345: anx6345@38 {
  168. compatible = "analogix,anx6345";
  169. reg = <0x38>;
  170. reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
  171. dvdd25-supply = <&reg_dldo2>;
  172. dvdd12-supply = <&reg_fldo1>;
  173. ports {
  174. #address-cells = <1>;
  175. #size-cells = <0>;
  176. anx6345_in: port@0 {
  177. reg = <0>;
  178. anx6345_in_tcon0: endpoint {
  179. remote-endpoint = <&tcon0_out_anx6345>;
  180. };
  181. };
  182. anx6345_out: port@1 {
  183. reg = <1>;
  184. anx6345_out_edp: endpoint {
  185. remote-endpoint = <&panel_edp_in>;
  186. };
  187. };
  188. };
  189. };
  190. };
  191. &r_pio {
  192. /*
  193. * FIXME: We can't add that supply for now since it would
  194. * create a circular dependency between pinctrl, the regulator
  195. * and the RSB Bus.
  196. *
  197. * vcc-pl-supply = <&reg_aldo2>;
  198. */
  199. };
  200. &r_rsb {
  201. status = "okay";
  202. axp803: pmic@3a3 {
  203. compatible = "x-powers,axp803";
  204. reg = <0x3a3>;
  205. interrupt-parent = <&r_intc>;
  206. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  207. };
  208. };
  209. #include "axp803.dtsi"
  210. &ac_power_supply {
  211. status = "okay";
  212. };
  213. &battery_power_supply {
  214. status = "okay";
  215. };
  216. &reg_aldo1 {
  217. regulator-name = "vcc-pe";
  218. };
  219. &reg_aldo2 {
  220. regulator-always-on;
  221. regulator-min-microvolt = <1800000>;
  222. regulator-max-microvolt = <3300000>;
  223. regulator-name = "vcc-pl";
  224. };
  225. &reg_aldo3 {
  226. regulator-always-on;
  227. regulator-min-microvolt = <2700000>;
  228. regulator-max-microvolt = <3300000>;
  229. regulator-name = "vcc-pll-avcc";
  230. };
  231. &reg_dc1sw {
  232. regulator-name = "vcc-lcd";
  233. };
  234. &reg_dcdc1 {
  235. regulator-always-on;
  236. regulator-min-microvolt = <3300000>;
  237. regulator-max-microvolt = <3300000>;
  238. regulator-name = "vcc-3v3";
  239. };
  240. &reg_dcdc2 {
  241. regulator-always-on;
  242. regulator-min-microvolt = <1000000>;
  243. regulator-max-microvolt = <1300000>;
  244. regulator-name = "vdd-cpux";
  245. };
  246. /* DCDC3 is polyphased with DCDC2 */
  247. &reg_dcdc5 {
  248. regulator-always-on;
  249. regulator-min-microvolt = <1200000>;
  250. regulator-max-microvolt = <1200000>;
  251. regulator-name = "vcc-dram";
  252. };
  253. &reg_dcdc6 {
  254. regulator-always-on;
  255. regulator-min-microvolt = <1100000>;
  256. regulator-max-microvolt = <1100000>;
  257. regulator-name = "vdd-sys";
  258. };
  259. &reg_dldo1 {
  260. regulator-min-microvolt = <3300000>;
  261. regulator-max-microvolt = <3300000>;
  262. regulator-name = "vcc-hdmi";
  263. };
  264. &reg_dldo2 {
  265. regulator-min-microvolt = <2500000>;
  266. regulator-max-microvolt = <2500000>;
  267. regulator-name = "vcc-edp";
  268. };
  269. &reg_dldo4 {
  270. regulator-min-microvolt = <3300000>;
  271. regulator-max-microvolt = <3300000>;
  272. regulator-name = "vcc-wifi";
  273. };
  274. &reg_eldo1 {
  275. regulator-always-on;
  276. regulator-min-microvolt = <1800000>;
  277. regulator-max-microvolt = <1800000>;
  278. regulator-name = "cpvdd";
  279. };
  280. &reg_fldo1 {
  281. regulator-min-microvolt = <1200000>;
  282. regulator-max-microvolt = <1200000>;
  283. regulator-name = "vcc-1v2-hsic";
  284. };
  285. &reg_fldo2 {
  286. regulator-always-on;
  287. regulator-min-microvolt = <1100000>;
  288. regulator-max-microvolt = <1100000>;
  289. regulator-name = "vdd-cpus";
  290. };
  291. &reg_rtc_ldo {
  292. regulator-name = "vcc-rtc";
  293. };
  294. &simplefb_lcd {
  295. panel-supply = <&reg_dc1sw>;
  296. dvdd25-supply = <&reg_dldo2>;
  297. dvdd12-supply = <&reg_fldo1>;
  298. };
  299. &simplefb_hdmi {
  300. vcc-hdmi-supply = <&reg_dldo1>;
  301. };
  302. &sound {
  303. status = "okay";
  304. simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
  305. simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
  306. "Microphone", "Internal Microphone Right",
  307. "Headphone", "Headphone Jack",
  308. "Speaker", "Internal Speaker";
  309. simple-audio-card,routing =
  310. "Left DAC", "DACL",
  311. "Right DAC", "DACR",
  312. "Speaker Amp INL", "LINEOUT",
  313. "Speaker Amp INR", "LINEOUT",
  314. "Internal Speaker", "Speaker Amp OUTL",
  315. "Internal Speaker", "Speaker Amp OUTR",
  316. "Headphone Jack", "HP",
  317. "ADCL", "Left ADC",
  318. "ADCR", "Right ADC",
  319. "Internal Microphone Left", "MBIAS",
  320. "MIC1", "Internal Microphone Left",
  321. "Internal Microphone Right", "HBIAS",
  322. "MIC2", "Internal Microphone Right";
  323. };
  324. &tcon0 {
  325. pinctrl-names = "default";
  326. pinctrl-0 = <&lcd_rgb666_pins>;
  327. status = "okay";
  328. };
  329. &tcon0_out {
  330. tcon0_out_anx6345: endpoint {
  331. remote-endpoint = <&anx6345_in_tcon0>;
  332. };
  333. };
  334. &uart0 {
  335. pinctrl-names = "default";
  336. pinctrl-0 = <&uart0_pb_pins>;
  337. status = "okay";
  338. };
  339. &usb_otg {
  340. dr_mode = "host";
  341. };
  342. &usbphy {
  343. usb0_vbus-supply = <&reg_vcc5v0>;
  344. usb1_vbus-supply = <&reg_vcc5v0>;
  345. status = "okay";
  346. };