Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 #include "qcom-ipq8064.dtsi"
0003 #include <dt-bindings/input/input.h>
0004 #include <dt-bindings/leds/common.h>
0005 
0006 / {
0007         model = "MikroTik RB3011UiAS-RM";
0008         compatible = "mikrotik,rb3011";
0009 
0010         aliases {
0011                 serial0 = &gsbi7_serial;
0012                 ethernet0 = &gmac0;
0013                 ethernet1 = &gmac3;
0014                 mdio-gpio0 = &mdio0;
0015                 mdio-gpio1 = &mdio1;
0016         };
0017 
0018         chosen {
0019                 bootargs = "loglevel=8 console=ttyMSM0,115200";
0020                 stdout-path = "serial0:115200n8";
0021         };
0022 
0023         memory@42000000 {
0024                 reg = <0x42000000 0x3e000000>;
0025                 device_type = "memory";
0026         };
0027 
0028         mdio0: mdio-0 {
0029                 status = "okay";
0030                 compatible = "virtual,mdio-gpio";
0031                 gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH>,
0032                         <&qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
0033                 #address-cells = <1>;
0034                 #size-cells = <0>;
0035 
0036                 pinctrl-0 = <&mdio0_pins>;
0037                 pinctrl-names = "default";
0038 
0039                 switch0: switch@10 {
0040                         compatible = "qca,qca8337";
0041                         #address-cells = <1>;
0042                         #size-cells = <0>;
0043 
0044                         dsa,member = <0 0>;
0045 
0046                         pinctrl-0 = <&sw0_reset_pin>;
0047                         pinctrl-names = "default";
0048 
0049                         reset-gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
0050                         reg = <0x10>;
0051 
0052                         ports {
0053                                 #address-cells = <1>;
0054                                 #size-cells = <0>;
0055 
0056                                 switch0cpu: port@0 {
0057                                         reg = <0>;
0058                                         label = "cpu";
0059                                         ethernet = <&gmac0>;
0060                                         phy-mode = "rgmii-id";
0061                                         fixed-link {
0062                                                 speed = <1000>;
0063                                                 full-duplex;
0064                                         };
0065                                 };
0066 
0067                                 port@1 {
0068                                         reg = <1>;
0069                                         label = "sw1";
0070                                 };
0071 
0072                                 port@2 {
0073                                         reg = <2>;
0074                                         label = "sw2";
0075                                 };
0076 
0077                                 port@3 {
0078                                         reg = <3>;
0079                                         label = "sw3";
0080                                 };
0081 
0082                                 port@4 {
0083                                         reg = <4>;
0084                                         label = "sw4";
0085                                 };
0086 
0087                                 port@5 {
0088                                         reg = <5>;
0089                                         label = "sw5";
0090                                 };
0091                         };
0092                 };
0093         };
0094 
0095         mdio1: mdio-1 {
0096                 status = "okay";
0097                 compatible = "virtual,mdio-gpio";
0098                 gpios = <&qcom_pinmux 11 GPIO_ACTIVE_HIGH>,
0099                         <&qcom_pinmux 10 GPIO_ACTIVE_HIGH>;
0100                 #address-cells = <1>;
0101                 #size-cells = <0>;
0102 
0103                 pinctrl-0 = <&mdio1_pins>;
0104                 pinctrl-names = "default";
0105 
0106                 switch1: switch@14 {
0107                         compatible = "qca,qca8337";
0108                         #address-cells = <1>;
0109                         #size-cells = <0>;
0110 
0111                         dsa,member = <1 0>;
0112 
0113                         pinctrl-0 = <&sw1_reset_pin>;
0114                         pinctrl-names = "default";
0115 
0116                         reset-gpios = <&qcom_pinmux 17 GPIO_ACTIVE_LOW>;
0117                         reg = <0x10>;
0118 
0119                         ports {
0120                                 #address-cells = <1>;
0121                                 #size-cells = <0>;
0122 
0123                                 switch1cpu: port@0 {
0124                                         reg = <0>;
0125                                         label = "cpu";
0126                                         ethernet = <&gmac3>;
0127                                         phy-mode = "sgmii";
0128                                         fixed-link {
0129                                                 speed = <1000>;
0130                                                 full-duplex;
0131                                         };
0132                                 };
0133 
0134                                 port@1 {
0135                                         reg = <1>;
0136                                         label = "sw6";
0137                                 };
0138 
0139                                 port@2 {
0140                                         reg = <2>;
0141                                         label = "sw7";
0142                                 };
0143 
0144                                 port@3 {
0145                                         reg = <3>;
0146                                         label = "sw8";
0147                                 };
0148 
0149                                 port@4 {
0150                                         reg = <4>;
0151                                         label = "sw9";
0152                                 };
0153 
0154                                 port@5 {
0155                                         reg = <5>;
0156                                         label = "sw10";
0157                                 };
0158                         };
0159                 };
0160         };
0161 
0162         soc {
0163                 gsbi5: gsbi@1a200000 {
0164                         qcom,mode = <GSBI_PROT_SPI>;
0165                         status = "okay";
0166 
0167                         spi4: spi@1a280000 {
0168                                 status = "okay";
0169                                 spi-max-frequency = <50000000>;
0170 
0171                                 pinctrl-0 = <&spi_pins>;
0172                                 pinctrl-names = "default";
0173 
0174                                 cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
0175 
0176                                 norflash: flash@0 {
0177                                         compatible = "jedec,spi-nor";
0178                                         #address-cells = <1>;
0179                                         #size-cells = <1>;
0180                                         spi-max-frequency = <50000000>;
0181                                         reg = <0>;
0182 
0183                                         partition@0 {
0184                                                 label = "RouterBoot";
0185                                                 reg = <0x0 0x40000>;
0186                                         };
0187                                 };
0188                         };
0189                 };
0190 
0191                 gpio-keys {
0192                         compatible = "gpio-keys";
0193                         pinctrl-0 = <&buttons_pins>;
0194                         pinctrl-names = "default";
0195 
0196                         button {
0197                                 label = "reset";
0198                                 linux,code = <KEY_RESTART>;
0199                                 gpios = <&qcom_pinmux 66 GPIO_ACTIVE_LOW>;
0200                                 linux,input-type = <1>;
0201                                 debounce-interval = <60>;
0202                         };
0203                 };
0204 
0205                 leds {
0206                         compatible = "gpio-leds";
0207                         pinctrl-0 = <&leds_pins>;
0208                         pinctrl-names = "default";
0209 
0210                         led@7 {
0211                                 label = "rb3011:green:user";
0212                                 color = <LED_COLOR_ID_GREEN>;
0213                                 gpios = <&qcom_pinmux 33 GPIO_ACTIVE_HIGH>;
0214                                 default-state = "off";
0215                         };
0216                 };
0217 
0218         };
0219 };
0220 
0221 &adm_dma {
0222         status = "okay";
0223 };
0224 
0225 &gmac0 {
0226         status = "okay";
0227 
0228         phy-mode = "rgmii";
0229         qcom,id = <0>;
0230         phy-handle = <&switch0cpu>;
0231 
0232         fixed-link {
0233                 speed = <1000>;
0234                 full-duplex;
0235         };
0236 };
0237 
0238 &gmac3 {
0239         status = "okay";
0240 
0241         phy-mode = "sgmii";
0242         qcom,id = <3>;
0243         phy-handle = <&switch1cpu>;
0244 
0245         fixed-link {
0246                 speed = <1000>;
0247                 full-duplex;
0248         };
0249 };
0250 
0251 &gsbi7 {
0252         status = "okay";
0253         qcom,mode = <GSBI_PROT_I2C_UART>;
0254 };
0255 
0256 &gsbi7_serial {
0257         status = "okay";
0258 };
0259 
0260 &hs_phy_1 {
0261         status = "okay";
0262 };
0263 
0264 &nand {
0265         status = "okay";
0266 
0267         nandcs@0 {
0268                 compatible = "qcom,nandcs";
0269                 reg = <0>;
0270 
0271                 nand-ecc-strength = <4>;
0272                 nand-bus-width = <8>;
0273                 nand-ecc-step-size = <512>;
0274 
0275                 partitions {
0276                         compatible = "fixed-partitions";
0277                         #address-cells = <1>;
0278                         #size-cells = <1>;
0279 
0280                         boot@0 {
0281                                 label = "RouterBoard NAND 1 Boot";
0282                                 reg = <0x0000000 0x0800000>;
0283                         };
0284 
0285                         main@800000 {
0286                                 label = "RouterBoard NAND 1 Main";
0287                                 reg = <0x0800000 0x7800000>;
0288                         };
0289                 };
0290         };
0291 };
0292 
0293 &qcom_pinmux {
0294         buttons_pins: buttons_pins {
0295                 mux {
0296                         pins = "gpio66";
0297                         drive-strength = <16>;
0298                         bias-disable;
0299                 };
0300         };
0301 
0302         leds_pins: leds_pins {
0303                 mux {
0304                         pins = "gpio33";
0305                         drive-strength = <16>;
0306                         bias-disable;
0307                 };
0308         };
0309 
0310         mdio1_pins: mdio1_pins {
0311                 mux {
0312                         pins = "gpio10", "gpio11";
0313                         function = "gpio";
0314                         drive-strength = <8>;
0315                         bias-disable;
0316                 };
0317         };
0318 
0319         sw0_reset_pin: sw0_reset_pin {
0320                 mux {
0321                         pins = "gpio16";
0322                         drive-strength = <16>;
0323                         function = "gpio";
0324                         bias-disable;
0325                         input-disable;
0326                 };
0327         };
0328 
0329         sw1_reset_pin: sw1_reset_pin {
0330                 mux {
0331                         pins = "gpio17";
0332                         drive-strength = <16>;
0333                         function = "gpio";
0334                         bias-disable;
0335                         input-disable;
0336                 };
0337         };
0338 
0339         usb1_pwr_en_pins: usb1_pwr_en_pins {
0340                 mux {
0341                         pins = "gpio4";
0342                         function = "gpio";
0343                         drive-strength = <16>;
0344                         bias-disable;
0345                         output-high;
0346                 };
0347         };
0348 };
0349 
0350 &ss_phy_1 {
0351         status = "okay";
0352 };
0353 
0354 &usb3_1 {
0355         pinctrl-0 = <&usb1_pwr_en_pins>;
0356         pinctrl-names = "default";
0357 
0358         status = "okay";
0359 };