Debian Codegraph @

arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4-cm4io.dts

raw
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3 * Copyright (c) 2023 Neil Armstrong <[email protected]>
4 */
5
6 /dts-v1/;
7
8 #include "meson-g12b-bananapi-cm4.dtsi"
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/leds/common.h>
11 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
12
13 / {
14 compatible = "bananapi,bpi-cm4io", "bananapi,bpi-cm4", "amlogic,a311d", "amlogic,g12b";
15 model = "BananaPi BPI-CM4IO Baseboard with BPI-CM4 Module";
16
17 aliases {
18 ethernet0 = &ethmac;
19 i2c0 = &i2c1;
20 i2c1 = &i2c3;
21 };
22
23 adc-keys {
24 compatible = "adc-keys";
25 io-channels = <&saradc 2>;
26 io-channel-names = "buttons";
27 keyup-threshold-microvolt = <1710000>;
28
29 button-function {
30 label = "Function";
31 linux,code = <KEY_FN>;
32 press-threshold-microvolt = <10000>;
33 };
34 };
35
36 hdmi_connector: hdmi-connector {
37 compatible = "hdmi-connector";
38 type = "a";
39
40 port {
41 hdmi_connector_in: endpoint {
42 remote-endpoint = <&hdmi_tx_tmds_out>;
43 };
44 };
45 };
46
47 leds {
48 compatible = "gpio-leds";
49
50 led-blue {
51 color = <LED_COLOR_ID_BLUE>;
52 function = LED_FUNCTION_STATUS;
53 gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
54 linux,default-trigger = "heartbeat";
55 };
56
57 led-green {
58 color = <LED_COLOR_ID_GREEN>;
59 function = LED_FUNCTION_STATUS;
60 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
61 };
62 };
63
64 sound {
65 compatible = "amlogic,axg-sound-card";
66 model = "BPI-CM4IO";
67 audio-aux-devs = <&tdmout_b>;
68 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
69 "TDMOUT_B IN 1", "FRDDR_B OUT 1",
70 "TDMOUT_B IN 2", "FRDDR_C OUT 1",
71 "TDM_B Playback", "TDMOUT_B OUT";
72
73 clocks = <&clkc CLKID_MPLL2>,
74 <&clkc CLKID_MPLL0>,
75 <&clkc CLKID_MPLL1>;
76
77 assigned-clocks = <&clkc CLKID_MPLL2>,
78 <&clkc CLKID_MPLL0>,
79 <&clkc CLKID_MPLL1>;
80 assigned-clock-rates = <294912000>,
81 <270950400>,
82 <393216000>;
83
84 dai-link-0 {
85 sound-dai = <&frddr_a>;
86 };
87
88 dai-link-1 {
89 sound-dai = <&frddr_b>;
90 };
91
92 dai-link-2 {
93 sound-dai = <&frddr_c>;
94 };
95
96 /* 8ch hdmi interface */
97 dai-link-3 {
98 sound-dai = <&tdmif_b>;
99 dai-format = "i2s";
100 dai-tdm-slot-tx-mask-0 = <1 1>;
101 dai-tdm-slot-tx-mask-1 = <1 1>;
102 dai-tdm-slot-tx-mask-2 = <1 1>;
103 dai-tdm-slot-tx-mask-3 = <1 1>;
104 mclk-fs = <256>;
105
106 codec {
107 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
108 };
109 };
110
111 /* hdmi glue */
112 dai-link-4 {
113 sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
114
115 codec {
116 sound-dai = <&hdmi_tx>;
117 };
118 };
119 };
120 };
121
122 &cecb_AO {
123 status = "okay";
124 };
125
126 &ethmac {
127 status = "okay";
128 };
129
130 &hdmi_tx {
131 status = "okay";
132 };
133
134 &hdmi_tx_tmds_port {
135 hdmi_tx_tmds_out: endpoint {
136 remote-endpoint = <&hdmi_connector_in>;
137 };
138 };
139
140 /* CSI port */
141 &i2c1 {
142 status = "okay";
143 };
144
145 /* DSI port for touchscreen */
146 &i2c3 {
147 status = "okay";
148 };
149
150 /* miniPCIe port with USB + SIM slot */
151 &pcie {
152 status = "okay";
153 };
154
155 &sd_emmc_b {
156 status = "okay";
157 };
158
159 &tohdmitx {
160 status = "okay";
161 };
162
163 /* Peripheral Only USB-C port */
164 &usb {
165 dr_mode = "peripheral";
166
167 status = "okay";
168 };