sun50i-a64-pinetab.dts 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (C) 2019 Icenowy Zheng <[email protected]>
  4. *
  5. */
  6. /dts-v1/;
  7. #include "sun50i-a64.dtsi"
  8. #include "sun50i-a64-cpu-opp.dtsi"
  9. #include <dt-bindings/gpio/gpio.h>
  10. #include <dt-bindings/input/input.h>
  11. #include <dt-bindings/pwm/pwm.h>
  12. / {
  13. model = "PineTab, Development Sample";
  14. compatible = "pine64,pinetab", "allwinner,sun50i-a64";
  15. chassis-type = "tablet";
  16. aliases {
  17. serial0 = &uart0;
  18. ethernet0 = &rtl8723cs;
  19. };
  20. backlight: backlight {
  21. compatible = "pwm-backlight";
  22. pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
  23. brightness-levels = <0 16 18 20 22 24 26 29 32 35 38 42 46 51 56 62 68 75 83 91 100>;
  24. default-brightness-level = <15>;
  25. enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
  26. power-supply = <&vdd_bl>;
  27. };
  28. chosen {
  29. stdout-path = "serial0:115200n8";
  30. };
  31. hdmi-connector {
  32. compatible = "hdmi-connector";
  33. type = "c";
  34. port {
  35. hdmi_con_in: endpoint {
  36. remote-endpoint = <&hdmi_out_con>;
  37. };
  38. };
  39. };
  40. i2c-csi {
  41. compatible = "i2c-gpio";
  42. sda-gpios = <&pio 4 13 GPIO_ACTIVE_HIGH>; /* PE13 */
  43. scl-gpios = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */
  44. i2c-gpio,delay-us = <5>;
  45. #address-cells = <1>;
  46. #size-cells = <0>;
  47. /* Rear camera */
  48. ov5640: camera@3c {
  49. compatible = "ovti,ov5640";
  50. reg = <0x3c>;
  51. pinctrl-names = "default";
  52. pinctrl-0 = <&csi_mclk_pin>;
  53. clocks = <&ccu CLK_CSI_MCLK>;
  54. clock-names = "xclk";
  55. AVDD-supply = <&reg_dldo3>;
  56. DOVDD-supply = <&reg_aldo1>;
  57. DVDD-supply = <&reg_eldo3>;
  58. reset-gpios = <&pio 4 14 GPIO_ACTIVE_LOW>; /* PE14 */
  59. powerdown-gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */
  60. port {
  61. ov5640_ep: endpoint {
  62. remote-endpoint = <&csi_ep>;
  63. bus-width = <8>;
  64. hsync-active = <1>; /* Active high */
  65. vsync-active = <0>; /* Active low */
  66. data-active = <1>; /* Active high */
  67. pclk-sample = <1>; /* Rising */
  68. };
  69. };
  70. };
  71. };
  72. speaker_amp: audio-amplifier {
  73. compatible = "simple-audio-amplifier";
  74. enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
  75. sound-name-prefix = "Speaker Amp";
  76. };
  77. vdd_bl: regulator {
  78. compatible = "regulator-fixed";
  79. regulator-name = "bl-3v3";
  80. regulator-min-microvolt = <3300000>;
  81. regulator-max-microvolt = <3300000>;
  82. gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
  83. enable-active-high;
  84. };
  85. wifi_pwrseq: wifi_pwrseq {
  86. compatible = "mmc-pwrseq-simple";
  87. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
  88. post-power-on-delay-ms = <200>;
  89. };
  90. };
  91. &codec {
  92. status = "okay";
  93. };
  94. &codec_analog {
  95. cpvdd-supply = <&reg_eldo1>;
  96. status = "okay";
  97. };
  98. &cpu0 {
  99. cpu-supply = <&reg_dcdc2>;
  100. };
  101. &cpu1 {
  102. cpu-supply = <&reg_dcdc2>;
  103. };
  104. &cpu2 {
  105. cpu-supply = <&reg_dcdc2>;
  106. };
  107. &cpu3 {
  108. cpu-supply = <&reg_dcdc2>;
  109. };
  110. &csi {
  111. status = "okay";
  112. port {
  113. csi_ep: endpoint {
  114. remote-endpoint = <&ov5640_ep>;
  115. bus-width = <8>;
  116. hsync-active = <1>; /* Active high */
  117. vsync-active = <0>; /* Active low */
  118. data-active = <1>; /* Active high */
  119. pclk-sample = <1>; /* Rising */
  120. };
  121. };
  122. };
  123. &dai {
  124. status = "okay";
  125. };
  126. &de {
  127. status = "okay";
  128. };
  129. &dphy {
  130. status = "okay";
  131. };
  132. &dsi {
  133. vcc-dsi-supply = <&reg_dldo1>;
  134. status = "okay";
  135. panel@0 {
  136. compatible = "feixin,k101-im2ba02";
  137. reg = <0>;
  138. avdd-supply = <&reg_dc1sw>;
  139. dvdd-supply = <&reg_dc1sw>;
  140. cvdd-supply = <&reg_ldo_io1>;
  141. reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
  142. backlight = <&backlight>;
  143. };
  144. };
  145. &ehci0 {
  146. status = "okay";
  147. };
  148. &ehci1 {
  149. status = "okay";
  150. };
  151. &i2c0 {
  152. status = "okay";
  153. touchscreen@5d {
  154. compatible = "goodix,gt9271";
  155. reg = <0x5d>;
  156. interrupt-parent = <&pio>;
  157. interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
  158. irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  159. reset-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
  160. AVDD28-supply = <&reg_ldo_io1>;
  161. };
  162. };
  163. &i2c0_pins {
  164. bias-pull-up;
  165. };
  166. &i2c1 {
  167. status = "okay";
  168. /* TODO: add Bochs BMA223 accelerometer here */
  169. };
  170. &lradc {
  171. vref-supply = <&reg_aldo3>;
  172. status = "okay";
  173. button-200 {
  174. label = "Volume Up";
  175. linux,code = <KEY_VOLUMEUP>;
  176. channel = <0>;
  177. voltage = <200000>;
  178. };
  179. button-400 {
  180. label = "Volume Down";
  181. linux,code = <KEY_VOLUMEDOWN>;
  182. channel = <0>;
  183. voltage = <400000>;
  184. };
  185. };
  186. &mixer1 {
  187. status = "okay";
  188. };
  189. &mmc0 {
  190. pinctrl-names = "default";
  191. pinctrl-0 = <&mmc0_pins>;
  192. vmmc-supply = <&reg_dcdc1>;
  193. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
  194. disable-wp;
  195. bus-width = <4>;
  196. status = "okay";
  197. };
  198. &mmc1 {
  199. pinctrl-names = "default";
  200. pinctrl-0 = <&mmc1_pins>;
  201. vmmc-supply = <&reg_dldo4>;
  202. vqmmc-supply = <&reg_eldo1>;
  203. mmc-pwrseq = <&wifi_pwrseq>;
  204. bus-width = <4>;
  205. non-removable;
  206. status = "okay";
  207. rtl8723cs: wifi@1 {
  208. reg = <1>;
  209. };
  210. };
  211. &mmc2 {
  212. pinctrl-names = "default";
  213. pinctrl-0 = <&mmc2_pins>;
  214. vmmc-supply = <&reg_dcdc1>;
  215. vqmmc-supply = <&reg_dcdc1>;
  216. bus-width = <8>;
  217. non-removable;
  218. cap-mmc-hw-reset;
  219. status = "okay";
  220. };
  221. &ohci0 {
  222. status = "okay";
  223. };
  224. &pwm {
  225. status = "okay";
  226. };
  227. &r_rsb {
  228. status = "okay";
  229. axp803: pmic@3a3 {
  230. compatible = "x-powers,axp803";
  231. reg = <0x3a3>;
  232. interrupt-parent = <&r_intc>;
  233. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  234. x-powers,drive-vbus-en;
  235. };
  236. };
  237. #include "axp803.dtsi"
  238. &ac_power_supply {
  239. status = "okay";
  240. };
  241. &battery_power_supply {
  242. status = "okay";
  243. };
  244. &reg_aldo1 {
  245. regulator-min-microvolt = <2800000>;
  246. regulator-max-microvolt = <2800000>;
  247. regulator-name = "dovdd-csi";
  248. };
  249. &reg_aldo2 {
  250. regulator-always-on;
  251. regulator-min-microvolt = <1800000>;
  252. regulator-max-microvolt = <3300000>;
  253. regulator-name = "vcc-pl";
  254. };
  255. &reg_aldo3 {
  256. regulator-always-on;
  257. regulator-min-microvolt = <2700000>;
  258. regulator-max-microvolt = <3300000>;
  259. regulator-name = "vcc-pll-avcc";
  260. };
  261. &reg_dc1sw {
  262. regulator-name = "vcc-lcd";
  263. };
  264. &reg_dcdc1 {
  265. regulator-always-on;
  266. regulator-min-microvolt = <3300000>;
  267. regulator-max-microvolt = <3300000>;
  268. regulator-name = "vcc-3v3";
  269. };
  270. &reg_dcdc2 {
  271. regulator-always-on;
  272. regulator-min-microvolt = <1000000>;
  273. regulator-max-microvolt = <1300000>;
  274. regulator-name = "vdd-cpux";
  275. };
  276. /* DCDC3 is polyphased with DCDC2 */
  277. &reg_dcdc5 {
  278. regulator-always-on;
  279. regulator-min-microvolt = <1200000>;
  280. regulator-max-microvolt = <1200000>;
  281. regulator-name = "vcc-dram";
  282. };
  283. &reg_dcdc6 {
  284. regulator-always-on;
  285. regulator-min-microvolt = <1100000>;
  286. regulator-max-microvolt = <1100000>;
  287. regulator-name = "vdd-sys";
  288. };
  289. &reg_dldo1 {
  290. regulator-always-on;
  291. regulator-min-microvolt = <3300000>;
  292. regulator-max-microvolt = <3300000>;
  293. regulator-name = "vcc-hdmi-dsi-sensor";
  294. };
  295. &reg_dldo3 {
  296. regulator-min-microvolt = <2800000>;
  297. regulator-max-microvolt = <2800000>;
  298. regulator-name = "avdd-csi";
  299. };
  300. &reg_dldo4 {
  301. regulator-min-microvolt = <3300000>;
  302. regulator-max-microvolt = <3300000>;
  303. regulator-name = "vcc-wifi";
  304. };
  305. &reg_drivevbus {
  306. regulator-name = "usb0-vbus";
  307. status = "okay";
  308. };
  309. &reg_eldo1 {
  310. regulator-always-on;
  311. regulator-min-microvolt = <1800000>;
  312. regulator-max-microvolt = <1800000>;
  313. regulator-name = "cpvdd";
  314. };
  315. &reg_eldo2 {
  316. regulator-min-microvolt = <1800000>;
  317. regulator-max-microvolt = <1800000>;
  318. regulator-name = "vcca-1v8";
  319. };
  320. &reg_eldo3 {
  321. regulator-min-microvolt = <1800000>;
  322. regulator-max-microvolt = <1800000>;
  323. regulator-name = "dvdd-1v8-csi";
  324. };
  325. &reg_fldo1 {
  326. regulator-min-microvolt = <1200000>;
  327. regulator-max-microvolt = <1200000>;
  328. regulator-name = "vcc-1v2-hsic";
  329. };
  330. &reg_fldo2 {
  331. regulator-always-on;
  332. regulator-min-microvolt = <1100000>;
  333. regulator-max-microvolt = <1100000>;
  334. regulator-name = "vdd-cpus";
  335. };
  336. &reg_ldo_io0 {
  337. regulator-min-microvolt = <3300000>;
  338. regulator-max-microvolt = <3300000>;
  339. regulator-name = "vcc-usb";
  340. status = "okay";
  341. };
  342. &reg_ldo_io1 {
  343. regulator-min-microvolt = <3300000>;
  344. regulator-max-microvolt = <3300000>;
  345. regulator-enable-ramp-delay = <3500000>;
  346. regulator-name = "vcc-touchscreen";
  347. status = "okay";
  348. };
  349. &reg_rtc_ldo {
  350. regulator-name = "vcc-rtc";
  351. };
  352. &simplefb_hdmi {
  353. vcc-hdmi-supply = <&reg_dldo1>;
  354. };
  355. &hdmi {
  356. hvcc-supply = <&reg_dldo1>;
  357. status = "okay";
  358. };
  359. &hdmi_out {
  360. hdmi_out_con: endpoint {
  361. remote-endpoint = <&hdmi_con_in>;
  362. };
  363. };
  364. &sound {
  365. status = "okay";
  366. simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
  367. simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
  368. "Microphone", "Internal Microphone Right",
  369. "Headphone", "Headphone Jack",
  370. "Speaker", "Internal Speaker";
  371. simple-audio-card,routing =
  372. "Left DAC", "DACL",
  373. "Right DAC", "DACR",
  374. "Speaker Amp INL", "LINEOUT",
  375. "Speaker Amp INR", "LINEOUT",
  376. "Internal Speaker", "Speaker Amp OUTL",
  377. "Internal Speaker", "Speaker Amp OUTR",
  378. "Headphone Jack", "HP",
  379. "ADCL", "Left ADC",
  380. "ADCR", "Right ADC",
  381. "Internal Microphone Left", "MBIAS",
  382. "MIC1", "Internal Microphone Left",
  383. "Internal Microphone Right", "HBIAS",
  384. "MIC2", "Internal Microphone Right";
  385. };
  386. &uart0 {
  387. pinctrl-names = "default";
  388. pinctrl-0 = <&uart0_pb_pins>;
  389. status = "okay";
  390. };
  391. &usb_otg {
  392. dr_mode = "otg";
  393. status = "okay";
  394. };
  395. &usb_power_supply {
  396. status = "okay";
  397. };
  398. &usbphy {
  399. usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
  400. usb0_vbus_power-supply = <&usb_power_supply>;
  401. usb0_vbus-supply = <&reg_drivevbus>;
  402. usb1_vbus-supply = <&reg_ldo_io0>;
  403. status = "okay";
  404. };