Guest User

Untitled

a guest
Oct 26th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.07 KB | None | 0 0
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2023 Neil Armstrong <[email protected]>
  4. * Copyright 2023 MNT Research GmbH
  5. */
  6.  
  7. /dts-v1/;
  8.  
  9. #include "meson-g12b-bananapi-cm4.dtsi"
  10. #include <dt-bindings/input/input.h>
  11. #include <dt-bindings/leds/common.h>
  12. #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
  13.  
  14. / {
  15. model = "MNT Reform 2 with BPI-CM4 Module";
  16. compatible = "mntre,reform2-cm4", "bananapi,bpi-cm4", "amlogic,a311d", "amlogic,g12b";
  17. chassis-type = "laptop";
  18.  
  19. aliases {
  20. ethernet0 = &ethmac;
  21. i2c0 = &i2c1;
  22. i2c1 = &i2c3;
  23. };
  24.  
  25. hdmi_connector: hdmi-connector {
  26. compatible = "hdmi-connector";
  27. type = "a";
  28.  
  29. port {
  30. hdmi_connector_in: endpoint {
  31. remote-endpoint = <&hdmi_tx_tmds_out>;
  32. };
  33. };
  34. };
  35.  
  36. leds {
  37. compatible = "gpio-leds";
  38.  
  39. led-blue {
  40. color = <LED_COLOR_ID_BLUE>;
  41. function = LED_FUNCTION_STATUS;
  42. gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
  43. linux,default-trigger = "heartbeat";
  44. };
  45.  
  46. led-green {
  47. color = <LED_COLOR_ID_GREEN>;
  48. function = LED_FUNCTION_STATUS;
  49. gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
  50. };
  51. };
  52.  
  53. sound {
  54. compatible = "amlogic,axg-sound-card";
  55. model = "MNT-REFORM2-BPI-CM4";
  56. audio-widgets = "Headphone", "Headphone Jack",
  57. "Speaker", "External Speaker",
  58. "Microphone", "Mic Jack";
  59. audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmin_b>;
  60. audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
  61. "TDMOUT_A IN 1", "FRDDR_B OUT 0",
  62. "TDMOUT_A IN 2", "FRDDR_C OUT 0",
  63. "TDM_A Playback", "TDMOUT_A OUT",
  64. "TDMOUT_B IN 0", "FRDDR_A OUT 1",
  65. "TDMOUT_B IN 1", "FRDDR_B OUT 1",
  66. "TDMOUT_B IN 2", "FRDDR_C OUT 1",
  67. "TDM_B Playback", "TDMOUT_B OUT",
  68. "TDMIN_B IN 1", "TDM_B Capture",
  69. "TDMIN_B IN 4", "TDM_B Loopback",
  70. "TODDR_A IN 1", "TDMIN_B OUT",
  71. "TODDR_B IN 1", "TDMIN_B OUT",
  72. "TODDR_C IN 1", "TDMIN_B OUT",
  73. "Headphone Jack", "HP_L",
  74. "Headphone Jack", "HP_R",
  75. "External Speaker", "SPK_LP",
  76. "External Speaker", "SPK_LN",
  77. "External Speaker", "SPK_RP",
  78. "External Speaker", "SPK_RN",
  79. "LINPUT1", "Mic Jack",
  80. "Mic Jack", "MICB";
  81.  
  82. assigned-clocks = <&clkc CLKID_MPLL2>,
  83. <&clkc CLKID_MPLL0>,
  84. <&clkc CLKID_MPLL1>;
  85. assigned-clock-parents = <0>, <0>, <0>;
  86. assigned-clock-rates = <294912000>,
  87. <270950400>,
  88. <393216000>;
  89.  
  90. dai-link-0 {
  91. sound-dai = <&frddr_a>;
  92. };
  93.  
  94. dai-link-1 {
  95. sound-dai = <&frddr_b>;
  96. };
  97.  
  98. dai-link-2 {
  99. sound-dai = <&frddr_c>;
  100. };
  101.  
  102. dai-link-3 {
  103. sound-dai = <&toddr_a>;
  104. };
  105.  
  106. dai-link-4 {
  107. sound-dai = <&toddr_b>;
  108. };
  109.  
  110. dai-link-5 {
  111. sound-dai = <&toddr_c>;
  112. };
  113.  
  114. /* 8ch hdmi interface */
  115. dai-link-6 {
  116. sound-dai = <&tdmif_a>;
  117. dai-format = "i2s";
  118. dai-tdm-slot-tx-mask-0 = <1 1>;
  119. dai-tdm-slot-tx-mask-1 = <1 1>;
  120. dai-tdm-slot-tx-mask-2 = <1 1>;
  121. dai-tdm-slot-tx-mask-3 = <1 1>;
  122. mclk-fs = <256>;
  123.  
  124. codec {
  125. sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
  126. };
  127. };
  128.  
  129. /* Analog Audio */
  130. dai-link-7 {
  131. sound-dai = <&tdmif_b>;
  132. dai-format = "i2s";
  133. dai-tdm-slot-tx-mask-0 = <1 1>;
  134. mclk-fs = <256>;
  135.  
  136. codec {
  137. sound-dai = <&wm8960>;
  138. };
  139. };
  140.  
  141. /* hdmi glue */
  142. dai-link-8 {
  143. sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
  144.  
  145. codec {
  146. sound-dai = <&hdmi_tx>;
  147. };
  148. };
  149. };
  150.  
  151. reg_main_1v8: regulator-main-1v8 {
  152. compatible = "regulator-fixed";
  153. regulator-name = "1V8";
  154. regulator-min-microvolt = <1800000>;
  155. regulator-max-microvolt = <1800000>;
  156. vin-supply = <&reg_main_3v3>;
  157. };
  158.  
  159. reg_main_1v2: regulator-main-1v2 {
  160. compatible = "regulator-fixed";
  161. regulator-name = "1V2";
  162. regulator-min-microvolt = <1200000>;
  163. regulator-max-microvolt = <1200000>;
  164. vin-supply = <&reg_main_5v>;
  165. };
  166.  
  167. reg_main_3v3: regulator-main-3v3 {
  168. compatible = "regulator-fixed";
  169. regulator-name = "3V3";
  170. regulator-min-microvolt = <3300000>;
  171. regulator-max-microvolt = <3300000>;
  172. };
  173.  
  174. reg_main_5v: regulator-main-5v {
  175. compatible = "regulator-fixed";
  176. regulator-name = "5V";
  177. regulator-min-microvolt = <5000000>;
  178. regulator-max-microvolt = <5000000>;
  179. };
  180.  
  181. reg_main_usb: regulator-main-usb {
  182. compatible = "regulator-fixed";
  183. regulator-name = "USB_PWR";
  184. regulator-min-microvolt = <5000000>;
  185. regulator-max-microvolt = <5000000>;
  186. vin-supply = <&reg_main_5v>;
  187. };
  188.  
  189. backlight: backlight {
  190. compatible = "pwm-backlight";
  191. pwms = <&pwm_AO_ab 0 10000 0>;
  192. power-supply = <&reg_main_usb>;
  193. enable-gpios = <&gpio 58 GPIO_ACTIVE_HIGH>;
  194. brightness-levels = <0 32 64 128 160 200 255>;
  195. default-brightness-level = <6>;
  196.  
  197. status = "okay";
  198. };
  199.  
  200. panel {
  201. compatible = "innolux,n125hce-gn1-a311d", "simple-panel";
  202. power-supply = <&reg_main_3v3>;
  203. backlight = <&backlight>;
  204. no-hpd;
  205.  
  206. status = "okay";
  207.  
  208. port {
  209. panel_in: endpoint {
  210. remote-endpoint = <&edp_bridge_out>;
  211. };
  212. };
  213. };
  214.  
  215. clock_12288: clock_12288 {
  216. compatible = "fixed-clock";
  217. #clock-cells = <0>;
  218. clock-frequency = <12288000>;
  219. };
  220.  
  221. spi {
  222. compatible = "spi-gpio";
  223. #address-cells = <0x1>;
  224. ranges;
  225.  
  226. sck-gpios = <&gpio_ao GPIOAO_5 0>; // GPIOAO_5 / GPIO7
  227. miso-gpios = <&gpio GPIOH_4 0>; // GPIOH_4 / GPIO5
  228. mosi-gpios = <&gpio_ao GPIOAO_10 0>; // GPIOAO_10 / GPIO6
  229. cs-gpios = <&gpio GPIOA_10 0>; // GPIOA_10 / GPIO4
  230. num-chipselects = <1>;
  231.  
  232. spidev@0 {
  233. compatible = "mntre,lpc11u24";
  234. spi-max-frequency = <1000000>;
  235. reg = <0>;
  236. };
  237. };
  238. };
  239.  
  240. &mipi_analog_dphy {
  241. status = "okay";
  242. };
  243.  
  244. &mipi_dphy {
  245. status = "okay";
  246. };
  247.  
  248. &mipi_dsi {
  249. status = "okay";
  250.  
  251. assigned-clocks = <&clkc CLKID_GP0_PLL>,
  252. <&clkc CLKID_MIPI_DSI_PXCLK_SEL>,
  253. <&clkc CLKID_MIPI_DSI_PXCLK>,
  254. <&clkc CLKID_CTS_ENCL_SEL>,
  255. <&clkc CLKID_VCLK2_SEL>;
  256. assigned-clock-parents = <0>,
  257. <&clkc CLKID_GP0_PLL>,
  258. <0>,
  259. <&clkc CLKID_VCLK2_DIV1>,
  260. <&clkc CLKID_GP0_PLL>;
  261. assigned-clock-rates = <936000000>,
  262. <0>,
  263. <936000000>,
  264. <0>,
  265. <0>;
  266. };
  267.  
  268. &mipi_dsi_panel_port {
  269. mipi_dsi_out: endpoint {
  270. remote-endpoint = <&edp_bridge_in>;
  271. };
  272. };
  273.  
  274. &cecb_AO {
  275. status = "okay";
  276. };
  277.  
  278. &ethmac {
  279. status = "okay";
  280. };
  281.  
  282. &hdmi_tx {
  283. status = "okay";
  284. };
  285.  
  286. &hdmi_tx_tmds_port {
  287. hdmi_tx_tmds_out: endpoint {
  288. remote-endpoint = <&hdmi_connector_in>;
  289. };
  290. };
  291.  
  292. &pwm_AO_ab {
  293. pinctrl-names = "default";
  294. pinctrl-0 = <&pwm_ao_a_pins>;
  295. status = "okay";
  296. };
  297.  
  298. &i2c0 {
  299. status = "okay";
  300. };
  301.  
  302. &i2c2 {
  303. status = "okay";
  304. };
  305.  
  306. &i2c3 {
  307. status = "okay";
  308.  
  309. edp_bridge: bridge@2c {
  310. compatible = "ti,sn65dsi86";
  311. reg = <0x2c>;
  312. enable-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_HIGH>; // PIN_24 / GPIO8
  313. vccio-supply = <&reg_main_1v8>;
  314. vpll-supply = <&reg_main_1v8>;
  315. vcca-supply = <&reg_main_1v2>;
  316. vcc-supply = <&reg_main_1v2>;
  317. burst-mode;
  318.  
  319. ports {
  320. #address-cells = <1>;
  321. #size-cells = <0>;
  322.  
  323. port@0 {
  324. reg = <0>;
  325.  
  326. edp_bridge_in: endpoint {
  327. remote-endpoint = <&mipi_dsi_out>;
  328. };
  329. };
  330.  
  331. port@1 {
  332. reg = <1>;
  333.  
  334. edp_bridge_out: endpoint {
  335. remote-endpoint = <&panel_in>;
  336. };
  337. };
  338. };
  339. };
  340.  
  341. wm8960: codec@1a {
  342. compatible = "wlf,wm8960";
  343. reg = <0x1a>;
  344. clocks = <&clock_12288>;
  345. clock-names = "mclk";
  346. #sound-dai-cells = <0>;
  347. wlf,shared-lrclk;
  348. };
  349.  
  350. rtc@68 {
  351. compatible = "nxp,pcf8523";
  352. reg = <0x68>;
  353. };
  354. };
  355.  
  356. &pcie {
  357. status = "okay";
  358. };
  359.  
  360. &sd_emmc_b {
  361. status = "okay";
  362. };
  363.  
  364. &tdmif_a {
  365. status = "okay";
  366. };
  367.  
  368. &tdmout_a {
  369. status = "okay";
  370. };
  371.  
  372. &tdmif_b {
  373. pinctrl-0 = <&tdm_b_dout0_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>, <&tdm_b_din1_pins>;
  374. pinctrl-names = "default";
  375.  
  376. assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>,
  377. <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>;
  378. assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_SCLK>,
  379. <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
  380. assigned-clock-rates = <0>, <0>;
  381. };
  382.  
  383. &tdmin_b {
  384. status = "okay";
  385. };
  386.  
  387. &toddr_a {
  388. status = "okay";
  389. };
  390.  
  391. &toddr_b {
  392. status = "okay";
  393. };
  394.  
  395. &toddr_c {
  396. status = "okay";
  397. };
  398.  
  399. &tohdmitx {
  400. status = "okay";
  401. };
  402.  
  403. &usb {
  404. dr_mode = "host";
  405.  
  406. status = "okay";
  407. };
  408.  
Advertisement
Add Comment
Please, Sign In to add comment