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