Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2017-2018 Sean Wang <sean.wang@mediatek.com>
0003  *
0004  * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0005  */
0006 
0007 /dts-v1/;
0008 #include <dt-bindings/input/input.h>
0009 #include "mt7623n.dtsi"
0010 #include "mt6323.dtsi"
0011 
0012 / {
0013         model = "Bananapi BPI-R2";
0014         compatible = "bananapi,bpi-r2", "mediatek,mt7623";
0015 
0016         aliases {
0017                 serial2 = &uart2;
0018         };
0019 
0020         chosen {
0021                 stdout-path = "serial2:115200n8";
0022         };
0023 
0024         connector {
0025                 compatible = "hdmi-connector";
0026                 label = "hdmi";
0027                 type = "d";
0028                 ddc-i2c-bus = <&hdmiddc0>;
0029 
0030                 port {
0031                         hdmi_connector_in: endpoint {
0032                                 remote-endpoint = <&hdmi0_out>;
0033                         };
0034                 };
0035         };
0036 
0037         cpus {
0038                 cpu@0 {
0039                         proc-supply = <&mt6323_vproc_reg>;
0040                 };
0041 
0042                 cpu@1 {
0043                         proc-supply = <&mt6323_vproc_reg>;
0044                 };
0045 
0046                 cpu@2 {
0047                         proc-supply = <&mt6323_vproc_reg>;
0048                 };
0049 
0050                 cpu@3 {
0051                         proc-supply = <&mt6323_vproc_reg>;
0052                 };
0053         };
0054 
0055         reg_1p8v: regulator-1p8v {
0056                 compatible = "regulator-fixed";
0057                 regulator-name = "fixed-1.8V";
0058                 regulator-min-microvolt = <1800000>;
0059                 regulator-max-microvolt = <1800000>;
0060                 regulator-boot-on;
0061                 regulator-always-on;
0062         };
0063 
0064         reg_3p3v: regulator-3p3v {
0065                 compatible = "regulator-fixed";
0066                 regulator-name = "fixed-3.3V";
0067                 regulator-min-microvolt = <3300000>;
0068                 regulator-max-microvolt = <3300000>;
0069                 regulator-boot-on;
0070                 regulator-always-on;
0071         };
0072 
0073         reg_5v: regulator-5v {
0074                 compatible = "regulator-fixed";
0075                 regulator-name = "fixed-5V";
0076                 regulator-min-microvolt = <5000000>;
0077                 regulator-max-microvolt = <5000000>;
0078                 regulator-boot-on;
0079                 regulator-always-on;
0080         };
0081 
0082         reg_vgpu: fixedregulator@0 {
0083                 compatible = "regulator-fixed";
0084                 regulator-name = "vdd_fixed_vgpu";
0085                 regulator-min-microvolt = <1150000>;
0086                 regulator-max-microvolt = <1150000>;
0087         };
0088 
0089         gpio-keys {
0090                 compatible = "gpio-keys";
0091                 pinctrl-names = "default";
0092                 pinctrl-0 = <&key_pins_a>;
0093 
0094                 button-factory {
0095                         label = "factory";
0096                         linux,code = <BTN_0>;
0097                         gpios = <&pio 256 GPIO_ACTIVE_LOW>;
0098                 };
0099 
0100                 button-wps {
0101                         label = "wps";
0102                         linux,code = <KEY_WPS_BUTTON>;
0103                         gpios = <&pio 257 GPIO_ACTIVE_HIGH>;
0104                 };
0105         };
0106 
0107         leds {
0108                 compatible = "gpio-leds";
0109                 pinctrl-names = "default";
0110                 pinctrl-0 = <&led_pins_a>;
0111 
0112                 blue {
0113                         label = "bpi-r2:pio:blue";
0114                         gpios = <&pio 240 GPIO_ACTIVE_LOW>;
0115                         default-state = "off";
0116                 };
0117 
0118                 green {
0119                         label = "bpi-r2:pio:green";
0120                         gpios = <&pio 241 GPIO_ACTIVE_LOW>;
0121                         default-state = "off";
0122                 };
0123 
0124                 red {
0125                         label = "bpi-r2:pio:red";
0126                         gpios = <&pio 239 GPIO_ACTIVE_LOW>;
0127                         default-state = "off";
0128                 };
0129         };
0130 
0131         memory@80000000 {
0132                 device_type = "memory";
0133                 reg = <0 0x80000000 0 0x80000000>;
0134         };
0135 };
0136 
0137 &bls {
0138         status = "okay";
0139 };
0140 
0141 &btif {
0142         status = "okay";
0143 };
0144 
0145 &cec {
0146         status = "okay";
0147 };
0148 
0149 &cir {
0150         pinctrl-names = "default";
0151         pinctrl-0 = <&cir_pins_a>;
0152         status = "okay";
0153 };
0154 
0155 &crypto {
0156         status = "okay";
0157 };
0158 
0159 &dpi0 {
0160         status = "okay";
0161 
0162         ports {
0163                 #address-cells = <1>;
0164                 #size-cells = <0>;
0165                 port@0 {
0166                         reg = <0>;
0167                         dpi0_out: endpoint {
0168                                 remote-endpoint = <&hdmi0_in>;
0169                         };
0170                 };
0171         };
0172 };
0173 
0174 &eth {
0175         status = "okay";
0176 
0177         gmac0: mac@0 {
0178                 compatible = "mediatek,eth-mac";
0179                 reg = <0>;
0180                 phy-mode = "trgmii";
0181 
0182                 fixed-link {
0183                         speed = <1000>;
0184                         full-duplex;
0185                         pause;
0186                 };
0187         };
0188 
0189         mdio: mdio-bus {
0190                 #address-cells = <1>;
0191                 #size-cells = <0>;
0192 
0193                 switch@0 {
0194                         compatible = "mediatek,mt7530";
0195                         reg = <0>;
0196                         reset-gpios = <&pio 33 0>;
0197                         core-supply = <&mt6323_vpa_reg>;
0198                         io-supply = <&mt6323_vemc3v3_reg>;
0199 
0200                         ports {
0201                                 #address-cells = <1>;
0202                                 #size-cells = <0>;
0203 
0204                                 port@0 {
0205                                         reg = <0>;
0206                                         label = "wan";
0207                                 };
0208 
0209                                 port@1 {
0210                                         reg = <1>;
0211                                         label = "lan0";
0212                                 };
0213 
0214                                 port@2 {
0215                                         reg = <2>;
0216                                         label = "lan1";
0217                                 };
0218 
0219                                 port@3 {
0220                                         reg = <3>;
0221                                         label = "lan2";
0222                                 };
0223 
0224                                 port@4 {
0225                                         reg = <4>;
0226                                         label = "lan3";
0227                                 };
0228 
0229                                 port@6 {
0230                                         reg = <6>;
0231                                         label = "cpu";
0232                                         ethernet = <&gmac0>;
0233                                         phy-mode = "trgmii";
0234 
0235                                         fixed-link {
0236                                                 speed = <1000>;
0237                                                 full-duplex;
0238                                                 pause;
0239                                         };
0240                                 };
0241                         };
0242                 };
0243         };
0244 };
0245 
0246 &hdmi0 {
0247         pinctrl-names = "default";
0248         pinctrl-0 = <&hdmi_pins_a>;
0249         status = "okay";
0250 
0251         ports {
0252                 #address-cells = <1>;
0253                 #size-cells = <0>;
0254                 port@0 {
0255                         reg = <0>;
0256                         hdmi0_in: endpoint {
0257                                 remote-endpoint = <&dpi0_out>;
0258                         };
0259                 };
0260 
0261                 port@1 {
0262                         reg = <1>;
0263                         hdmi0_out: endpoint {
0264                                 remote-endpoint = <&hdmi_connector_in>;
0265                         };
0266                 };
0267         };
0268 };
0269 
0270 &hdmiddc0 {
0271         pinctrl-names = "default";
0272         pinctrl-0 = <&hdmi_ddc_pins_a>;
0273         status = "okay";
0274 };
0275 
0276 &hdmi_phy {
0277         mediatek,ibias = <0xa>;
0278         mediatek,ibias_up = <0x1c>;
0279         status = "okay";
0280 };
0281 
0282 &i2c0 {
0283         pinctrl-names = "default";
0284         pinctrl-0 = <&i2c0_pins_a>;
0285         status = "okay";
0286 };
0287 
0288 &i2c1 {
0289         pinctrl-names = "default";
0290         pinctrl-0 = <&i2c1_pins_a>;
0291         status = "okay";
0292 };
0293 
0294 &mali {
0295         mali-supply = <&reg_vgpu>;
0296         status = "okay";
0297 };
0298 
0299 &mmc0 {
0300         pinctrl-names = "default", "state_uhs";
0301         pinctrl-0 = <&mmc0_pins_default>;
0302         pinctrl-1 = <&mmc0_pins_uhs>;
0303         status = "okay";
0304         bus-width = <8>;
0305         max-frequency = <50000000>;
0306         cap-mmc-highspeed;
0307         vmmc-supply = <&reg_3p3v>;
0308         vqmmc-supply = <&reg_1p8v>;
0309         non-removable;
0310 };
0311 
0312 &mmc1 {
0313         pinctrl-names = "default", "state_uhs";
0314         pinctrl-0 = <&mmc1_pins_default>;
0315         pinctrl-1 = <&mmc1_pins_uhs>;
0316         status = "okay";
0317         bus-width = <4>;
0318         max-frequency = <50000000>;
0319         cap-sd-highspeed;
0320         cd-gpios = <&pio 261 GPIO_ACTIVE_LOW>;
0321         vmmc-supply = <&reg_3p3v>;
0322         vqmmc-supply = <&reg_3p3v>;
0323 };
0324 
0325 &mt6323_leds {
0326         status = "okay";
0327 
0328         led@0 {
0329                 reg = <0>;
0330                 label = "bpi-r2:isink:green";
0331                 default-state = "off";
0332         };
0333 
0334         led@1 {
0335                 reg = <1>;
0336                 label = "bpi-r2:isink:red";
0337                 default-state = "off";
0338         };
0339 
0340         led@2 {
0341                 reg = <2>;
0342                 label = "bpi-r2:isink:blue";
0343                 default-state = "off";
0344         };
0345 };
0346 
0347 &pcie {
0348         pinctrl-names = "default";
0349         pinctrl-0 = <&pcie_default>;
0350         status = "okay";
0351 
0352         pcie@0,0 {
0353                 status = "okay";
0354         };
0355 
0356         pcie@1,0 {
0357                 status = "okay";
0358         };
0359 };
0360 
0361 &pcie0_phy {
0362         status = "okay";
0363 };
0364 
0365 &pcie1_phy {
0366         status = "okay";
0367 };
0368 
0369 &pio {
0370         musb_pins: musb {
0371                 pins-musb {
0372                         pinmux = <MT7623_PIN_237_EXT_SDIO2_FUNC_DRV_VBUS>;
0373                 };
0374         };
0375 };
0376 
0377 &pwm {
0378         pinctrl-names = "default";
0379         pinctrl-0 = <&pwm_pins_a>;
0380         status = "okay";
0381 };
0382 
0383 &spi0 {
0384         pinctrl-names = "default";
0385         pinctrl-0 = <&spi0_pins_a>;
0386         status = "okay";
0387 };
0388 
0389 &uart0 {
0390         pinctrl-names = "default";
0391         pinctrl-0 = <&uart0_pins_a>;
0392         status = "okay";
0393 };
0394 
0395 &uart1 {
0396         pinctrl-names = "default";
0397         pinctrl-0 = <&uart1_pins_a>;
0398         status = "okay";
0399 };
0400 
0401 &uart2 {
0402         pinctrl-names = "default";
0403         pinctrl-0 = <&uart2_pins_a>;
0404         status = "okay";
0405 };
0406 
0407 &usb0 {
0408         pinctrl-names = "default";
0409         pinctrl-0 = <&musb_pins>;
0410         status = "okay";
0411         usb-role-switch;
0412 
0413         connector {
0414                 compatible = "gpio-usb-b-connector", "usb-b-connector";
0415                 type = "micro";
0416                 id-gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
0417         };
0418 };
0419 
0420 &usb1 {
0421         vusb33-supply = <&reg_3p3v>;
0422         vbus-supply = <&reg_5v>;
0423         status = "okay";
0424 };
0425 
0426 &usb2 {
0427         vusb33-supply = <&reg_3p3v>;
0428         vbus-supply = <&reg_5v>;
0429         status = "okay";
0430 };
0431 
0432 &u2phy1 {
0433         status = "okay";
0434 };
0435 
0436 &u3phy1 {
0437         status = "okay";
0438 };
0439 
0440 &u3phy2 {
0441         status = "okay";
0442 };