1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Device tree definitions shared by the Orange Pi 5 and Orange Pi 5B 4 * but not the Orange Pi 5 Pro. 5 */ 6 7#include <dt-bindings/usb/pd.h> 8#include "rk3588s-orangepi-5.dtsi" 9 10/ { 11 aliases { 12 ethernet0 = &gmac1; 13 }; 14 15 analog-sound { 16 compatible = "simple-audio-card"; 17 pinctrl-names = "default"; 18 pinctrl-0 = <&hp_detect>; 19 simple-audio-card,name = "rockchip,es8388"; 20 simple-audio-card,bitclock-master = <&masterdai>; 21 simple-audio-card,format = "i2s"; 22 simple-audio-card,frame-master = <&masterdai>; 23 simple-audio-card,hp-det-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>; 24 simple-audio-card,mclk-fs = <256>; 25 simple-audio-card,routing = 26 "Headphones", "LOUT1", 27 "Headphones", "ROUT1", 28 "LINPUT1", "Microphone Jack", 29 "RINPUT1", "Microphone Jack", 30 "LINPUT2", "Onboard Microphone", 31 "RINPUT2", "Onboard Microphone"; 32 simple-audio-card,widgets = 33 "Microphone", "Microphone Jack", 34 "Microphone", "Onboard Microphone", 35 "Headphone", "Headphones"; 36 37 simple-audio-card,cpu { 38 sound-dai = <&i2s1_8ch>; 39 }; 40 41 masterdai: simple-audio-card,codec { 42 sound-dai = <&es8388>; 43 system-clock-frequency = <12288000>; 44 }; 45 }; 46 47 pwm-leds { 48 compatible = "pwm-leds"; 49 50 led { 51 color = <LED_COLOR_ID_GREEN>; 52 function = LED_FUNCTION_STATUS; 53 linux,default-trigger = "heartbeat"; 54 max-brightness = <255>; 55 pwms = <&pwm0 0 25000 0>; 56 }; 57 }; 58 59 vbus_typec: regulator-vbus-typec { 60 compatible = "regulator-fixed"; 61 enable-active-high; 62 gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>; 63 pinctrl-names = "default"; 64 pinctrl-0 = <&typec5v_pwren>; 65 regulator-name = "vbus_typec"; 66 regulator-min-microvolt = <5000000>; 67 regulator-max-microvolt = <5000000>; 68 vin-supply = <&vcc5v0_sys>; 69 }; 70}; 71 72&gmac1 { 73 clock_in_out = "output"; 74 phy-handle = <&rgmii_phy1>; 75 phy-mode = "rgmii-rxid"; 76 pinctrl-0 = <&gmac1_miim 77 &gmac1_tx_bus2 78 &gmac1_rx_bus2 79 &gmac1_rgmii_clk 80 &gmac1_rgmii_bus>; 81 pinctrl-names = "default"; 82 tx_delay = <0x42>; 83 status = "okay"; 84}; 85 86&i2c6 { 87 es8388: audio-codec@10 { 88 compatible = "everest,es8388", "everest,es8328"; 89 reg = <0x10>; 90 clocks = <&cru I2S1_8CH_MCLKOUT>; 91 AVDD-supply = <&vcca_3v3_s0>; 92 DVDD-supply = <&vcca_1v8_s0>; 93 HPVDD-supply = <&vcca_3v3_s0>; 94 PVDD-supply = <&vcca_3v3_s0>; 95 assigned-clocks = <&cru I2S1_8CH_MCLKOUT>; 96 assigned-clock-rates = <12288000>; 97 #sound-dai-cells = <0>; 98 }; 99 100 usbc0: usb-typec@22 { 101 compatible = "fcs,fusb302"; 102 reg = <0x22>; 103 interrupt-parent = <&gpio0>; 104 interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>; 105 pinctrl-names = "default"; 106 pinctrl-0 = <&usbc0_int>; 107 vbus-supply = <&vbus_typec>; 108 status = "okay"; 109 110 usb_con: connector { 111 compatible = "usb-c-connector"; 112 label = "USB-C"; 113 data-role = "dual"; 114 op-sink-microwatt = <1000000>; 115 power-role = "dual"; 116 sink-pdos = 117 <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>; 118 source-pdos = 119 <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; 120 try-power-role = "source"; 121 122 ports { 123 #address-cells = <1>; 124 #size-cells = <0>; 125 126 port@0 { 127 reg = <0>; 128 usbc0_hs: endpoint { 129 remote-endpoint = <&usb_host0_xhci_drd_sw>; 130 }; 131 }; 132 133 port@1 { 134 reg = <1>; 135 usbc0_ss: endpoint { 136 remote-endpoint = <&usbdp_phy0_typec_ss>; 137 }; 138 }; 139 140 port@2 { 141 reg = <2>; 142 usbc0_sbu: endpoint { 143 remote-endpoint = <&usbdp_phy0_typec_sbu>; 144 }; 145 }; 146 }; 147 }; 148 }; 149}; 150 151&mdio1 { 152 rgmii_phy1: ethernet-phy@1 { 153 compatible = "ethernet-phy-ieee802.3-c22"; 154 reg = <0x1>; 155 reset-assert-us = <20000>; 156 reset-deassert-us = <100000>; 157 reset-gpios = <&gpio3 RK_PB2 GPIO_ACTIVE_LOW>; 158 }; 159}; 160 161&pinctrl { 162 usb-typec { 163 usbc0_int: usbc0-int { 164 rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; 165 }; 166 167 typec5v_pwren: typec5v-pwren { 168 rockchip,pins = <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; 169 }; 170 }; 171}; 172 173&i2s1_8ch { 174 rockchip,i2s-tx-route = <3 2 1 0>; 175 rockchip,i2s-rx-route = <1 3 2 0>; 176 pinctrl-names = "default"; 177 pinctrl-0 = <&i2s1m0_sclk 178 &i2s1m0_mclk 179 &i2s1m0_lrck 180 &i2s1m0_sdi1 181 &i2s1m0_sdo3>; 182 status = "okay"; 183}; 184 185&pwm0 { 186 pinctrl-0 = <&pwm0m2_pins>; 187 pinctrl-names = "default"; 188 status = "okay"; 189}; 190 191&rk806 { 192 regulators { 193 vcc_1v8_s0: pldo-reg1 { 194 regulator-name = "vcc_1v8_s0"; 195 regulator-always-on; 196 regulator-boot-on; 197 regulator-min-microvolt = <1800000>; 198 regulator-max-microvolt = <1800000>; 199 200 regulator-state-mem { 201 regulator-off-in-suspend; 202 }; 203 }; 204 205 vcca_1v8_s0: pldo-reg2 { 206 regulator-name = "vcca_1v8_s0"; 207 regulator-always-on; 208 regulator-boot-on; 209 regulator-min-microvolt = <1800000>; 210 regulator-max-microvolt = <1800000>; 211 212 regulator-state-mem { 213 regulator-off-in-suspend; 214 regulator-suspend-microvolt = <1800000>; 215 }; 216 }; 217 }; 218}; 219 220 221&usb_host0_xhci { 222 dr_mode = "otg"; 223 usb-role-switch; 224 225 port { 226 usb_host0_xhci_drd_sw: endpoint { 227 remote-endpoint = <&usbc0_hs>; 228 }; 229 }; 230}; 231 232&usb_host2_xhci { 233 status = "okay"; 234}; 235 236&usbdp_phy0 { 237 mode-switch; 238 orientation-switch; 239 sbu1-dc-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; 240 sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; 241 242 port { 243 #address-cells = <1>; 244 #size-cells = <0>; 245 246 usbdp_phy0_typec_ss: endpoint@0 { 247 reg = <0>; 248 remote-endpoint = <&usbc0_ss>; 249 }; 250 251 usbdp_phy0_typec_sbu: endpoint@1 { 252 reg = <1>; 253 remote-endpoint = <&usbc0_sbu>; 254 }; 255 }; 256}; 257