1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org> 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 = ðmac; 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 clocks = <&clkc CLKID_MPLL2>, 83 <&clkc CLKID_MPLL0>, 84 <&clkc CLKID_MPLL1>; 85 86 assigned-clocks = <&clkc CLKID_MPLL2>, 87 <&clkc CLKID_MPLL0>, 88 <&clkc CLKID_MPLL1>; 89 assigned-clock-parents = <0>, <0>, <0>; 90 assigned-clock-rates = <294912000>, 91 <270950400>, 92 <393216000>; 93 94 dai-link-0 { 95 sound-dai = <&frddr_a>; 96 }; 97 98 dai-link-1 { 99 sound-dai = <&frddr_b>; 100 }; 101 102 dai-link-2 { 103 sound-dai = <&frddr_c>; 104 }; 105 106 dai-link-3 { 107 sound-dai = <&toddr_a>; 108 }; 109 110 dai-link-4 { 111 sound-dai = <&toddr_b>; 112 }; 113 114 dai-link-5 { 115 sound-dai = <&toddr_c>; 116 }; 117 118 /* 8ch hdmi interface */ 119 dai-link-6 { 120 sound-dai = <&tdmif_a>; 121 dai-format = "i2s"; 122 dai-tdm-slot-tx-mask-0 = <1 1>; 123 dai-tdm-slot-tx-mask-1 = <1 1>; 124 dai-tdm-slot-tx-mask-2 = <1 1>; 125 dai-tdm-slot-tx-mask-3 = <1 1>; 126 mclk-fs = <256>; 127 128 codec { 129 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>; 130 }; 131 }; 132 133 /* Analog Audio */ 134 dai-link-7 { 135 sound-dai = <&tdmif_b>; 136 dai-format = "i2s"; 137 dai-tdm-slot-tx-mask-0 = <1 1>; 138 mclk-fs = <256>; 139 140 codec { 141 sound-dai = <&wm8960>; 142 }; 143 }; 144 145 /* hdmi glue */ 146 dai-link-8 { 147 sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; 148 149 codec { 150 sound-dai = <&hdmi_tx>; 151 }; 152 }; 153 }; 154 155 reg_main_1v8: regulator-main-1v8 { 156 compatible = "regulator-fixed"; 157 regulator-name = "1V8"; 158 regulator-min-microvolt = <1800000>; 159 regulator-max-microvolt = <1800000>; 160 vin-supply = <®_main_3v3>; 161 }; 162 163 reg_main_1v2: regulator-main-1v2 { 164 compatible = "regulator-fixed"; 165 regulator-name = "1V2"; 166 regulator-min-microvolt = <1200000>; 167 regulator-max-microvolt = <1200000>; 168 vin-supply = <®_main_5v>; 169 }; 170 171 reg_main_3v3: regulator-main-3v3 { 172 compatible = "regulator-fixed"; 173 regulator-name = "3V3"; 174 regulator-min-microvolt = <3300000>; 175 regulator-max-microvolt = <3300000>; 176 }; 177 178 reg_main_5v: regulator-main-5v { 179 compatible = "regulator-fixed"; 180 regulator-name = "5V"; 181 regulator-min-microvolt = <5000000>; 182 regulator-max-microvolt = <5000000>; 183 }; 184 185 reg_main_usb: regulator-main-usb { 186 compatible = "regulator-fixed"; 187 regulator-name = "USB_PWR"; 188 regulator-min-microvolt = <5000000>; 189 regulator-max-microvolt = <5000000>; 190 vin-supply = <®_main_5v>; 191 }; 192 193 backlight: backlight { 194 compatible = "pwm-backlight"; 195 pwms = <&pwm_AO_ab 0 10000 0>; 196 power-supply = <®_main_usb>; 197 enable-gpios = <&gpio 58 GPIO_ACTIVE_HIGH>; 198 brightness-levels = <0 32 64 128 160 200 255>; 199 default-brightness-level = <6>; 200 }; 201 202 panel { 203 compatible = "innolux,n125hce-gn1"; 204 power-supply = <®_main_3v3>; 205 backlight = <&backlight>; 206 no-hpd; 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 222&mipi_analog_dphy { 223 status = "okay"; 224}; 225 226&mipi_dphy { 227 status = "okay"; 228}; 229 230&mipi_dsi { 231 status = "okay"; 232 233 assigned-clocks = <&clkc CLKID_GP0_PLL>, 234 <&clkc CLKID_MIPI_DSI_PXCLK_SEL>, 235 <&clkc CLKID_MIPI_DSI_PXCLK>, 236 <&clkc CLKID_CTS_ENCL_SEL>, 237 <&clkc CLKID_VCLK2_SEL>; 238 assigned-clock-parents = <0>, 239 <&clkc CLKID_GP0_PLL>, 240 <0>, 241 <&clkc CLKID_VCLK2_DIV1>, 242 <&clkc CLKID_GP0_PLL>; 243 assigned-clock-rates = <936000000>, 244 <0>, 245 <936000000>, 246 <0>, 247 <0>; 248}; 249 250&mipi_dsi_panel_port { 251 mipi_dsi_out: endpoint { 252 remote-endpoint = <&edp_bridge_in>; 253 }; 254}; 255 256&cecb_AO { 257 status = "okay"; 258}; 259 260ðmac { 261 status = "okay"; 262}; 263 264&hdmi_tx { 265 status = "okay"; 266}; 267 268&hdmi_tx_tmds_port { 269 hdmi_tx_tmds_out: endpoint { 270 remote-endpoint = <&hdmi_connector_in>; 271 }; 272}; 273 274&pwm_AO_ab { 275 pinctrl-names = "default"; 276 pinctrl-0 = <&pwm_ao_a_pins>; 277 status = "okay"; 278}; 279 280&i2c0 { 281 status = "okay"; 282}; 283 284&i2c3 { 285 status = "okay"; 286 287 edp_bridge: bridge@2c { 288 compatible = "ti,sn65dsi86"; 289 reg = <0x2c>; 290 enable-gpios = <&gpio GPIOX_10 GPIO_ACTIVE_HIGH>; // PIN_24 / GPIO8 291 vccio-supply = <®_main_1v8>; 292 vpll-supply = <®_main_1v8>; 293 vcca-supply = <®_main_1v2>; 294 vcc-supply = <®_main_1v2>; 295 296 ports { 297 #address-cells = <1>; 298 #size-cells = <0>; 299 300 port@0 { 301 reg = <0>; 302 303 edp_bridge_in: endpoint { 304 remote-endpoint = <&mipi_dsi_out>; 305 }; 306 }; 307 308 port@1 { 309 reg = <1>; 310 311 edp_bridge_out: endpoint { 312 remote-endpoint = <&panel_in>; 313 }; 314 }; 315 }; 316 }; 317}; 318 319&i2c2 { 320 status = "okay"; 321 322 wm8960: codec@1a { 323 compatible = "wlf,wm8960"; 324 reg = <0x1a>; 325 clocks = <&clock_12288>; 326 clock-names = "mclk"; 327 #sound-dai-cells = <0>; 328 wlf,shared-lrclk; 329 }; 330 331 rtc@68 { 332 compatible = "nxp,pcf8523"; 333 reg = <0x68>; 334 }; 335}; 336 337&pcie { 338 status = "okay"; 339}; 340 341&sd_emmc_b { 342 status = "okay"; 343}; 344 345&tdmif_a { 346 status = "okay"; 347}; 348 349&tdmout_a { 350 status = "okay"; 351}; 352 353&tdmif_b { 354 pinctrl-0 = <&tdm_b_dout0_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>, <&tdm_b_din1_pins>; 355 pinctrl-names = "default"; 356 357 assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>, 358 <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>; 359 assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_SCLK>, 360 <&clkc_audio AUD_CLKID_MST_B_LRCLK>; 361 assigned-clock-rates = <0>, <0>; 362}; 363 364&tdmin_b { 365 status = "okay"; 366}; 367 368&toddr_a { 369 status = "okay"; 370}; 371 372&toddr_b { 373 status = "okay"; 374}; 375 376&toddr_c { 377 status = "okay"; 378}; 379 380&tohdmitx { 381 status = "okay"; 382}; 383 384&usb { 385 dr_mode = "host"; 386 387 status = "okay"; 388}; 389