Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
0002 /*
0003  * Broadcom BCM470X / BCM5301X ARM platform code.
0004  * DTS for Buffalo WZR-1166DHP and WZR-1166DHP2
0005  *
0006  * Copyright (C) 2014 Rafał Miłecki <zajec5@gmail.com>
0007  * Copyright (C) 2022 SHIMAMOTO Takayoshi <takayoshi.shimamoto.360@gmail.com>
0008  */
0009 
0010 
0011 #include "bcm4708.dtsi"
0012 #include "bcm5301x-nand-cs0-bch8.dtsi"
0013 #include <dt-bindings/leds/common.h>
0014 
0015 / {
0016         spi {
0017                 compatible = "spi-gpio";
0018                 num-chipselects = <1>;
0019                 gpio-sck = <&chipcommon 7 0>;
0020                 gpio-mosi = <&chipcommon 4 0>;
0021                 cs-gpios = <&chipcommon 6 0>;
0022                 #address-cells = <1>;
0023                 #size-cells = <0>;
0024 
0025                 hc595: gpio_spi@0 {
0026                         compatible = "fairchild,74hc595";
0027                         reg = <0>;
0028                         registers-number = <1>;
0029                         spi-max-frequency = <100000>;
0030 
0031                         gpio-controller;
0032                         #gpio-cells = <2>;
0033 
0034                 };
0035         };
0036 
0037         leds {
0038                 compatible = "gpio-leds";
0039 
0040                 usb {
0041                         /* label = "bcm53xx:blue:usb"; */
0042                         function = LED_FUNCTION_USB;
0043                         color = <LED_COLOR_ID_BLUE>;
0044                         gpios = <&hc595 0 GPIO_ACTIVE_HIGH>;
0045                         trigger-sources = <&ohci_port1>, <&ehci_port1>,
0046                                           <&xhci_port1>, <&ohci_port2>,
0047                                           <&ehci_port2>;
0048                         linux,default-trigger = "usbport";
0049                 };
0050 
0051                 power0 {
0052                         /* label = "bcm53xx:red:power"; */
0053                         function = LED_FUNCTION_FAULT;
0054                         color = <LED_COLOR_ID_RED>;
0055                         gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
0056                 };
0057 
0058                 power1 {
0059                         /* label = "bcm53xx:white:power"; */
0060                         function = LED_FUNCTION_POWER;
0061                         color = <LED_COLOR_ID_WHITE>;
0062                         gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
0063                         linux,default-trigger = "default-on";
0064                 };
0065 
0066                 router0 {
0067                         /*  label = "bcm53xx:blue:router"; */
0068                         function = LED_FUNCTION_STATUS;
0069                         color = <LED_COLOR_ID_BLUE>;
0070                         gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
0071                         linux,default-trigger = "default-on";
0072                 };
0073 
0074                 router1 {
0075                         /* label = "bcm53xx:amber:router"; */
0076                         function = LED_FUNCTION_STATUS;
0077                         color = <LED_COLOR_ID_AMBER>;
0078                         gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
0079                 };
0080 
0081                 wan {
0082                         /* label = "bcm53xx:blue:wan"; */
0083                         function = LED_FUNCTION_WAN;
0084                         color = <LED_COLOR_ID_BLUE>;
0085                         gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
0086                         linux,default-trigger = "default-on";
0087                 };
0088 
0089                 wireless0 {
0090                         /* label = "bcm53xx:blue:wireless"; */
0091                         function = LED_FUNCTION_WLAN;
0092                         color = <LED_COLOR_ID_BLUE>;
0093                         gpios = <&hc595 6 GPIO_ACTIVE_HIGH>;
0094                 };
0095 
0096                 wireless1 {
0097                         /* label = "bcm53xx:amber:wireless"; */
0098                         function = LED_FUNCTION_WLAN;
0099                         color = <LED_COLOR_ID_AMBER>;
0100                         gpios = <&hc595 7 GPIO_ACTIVE_HIGH>;
0101                 };
0102         };
0103 
0104         gpio-keys {
0105                 compatible = "gpio-keys";
0106 
0107                 button-restart {
0108                         label = "Reset";
0109                         linux,code = <KEY_RESTART>;
0110                         gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
0111                 };
0112 
0113                 button-aoss {
0114                         label = "AOSS";
0115                         linux,code = <KEY_WPS_BUTTON>;
0116                         gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>;
0117                 };
0118 
0119                 /* Commit mode set by switch? */
0120                 button-mode {
0121                         label = "Mode";
0122                         linux,code = <KEY_SETUP>;
0123                         gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
0124                 };
0125 
0126                 /* Switch: AP mode */
0127                 button-sw-ap {
0128                         label = "AP";
0129                         linux,code = <BTN_0>;
0130                         gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
0131                 };
0132 
0133                 button-eject {
0134                         label = "USB eject";
0135                         linux,code = <KEY_EJECTCD>;
0136                         gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
0137                 };
0138         };
0139 };
0140 
0141 &usb2 {
0142         vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
0143 };
0144 
0145 &usb3 {
0146         vcc-gpio = <&chipcommon 10 GPIO_ACTIVE_LOW>;
0147 };
0148 
0149 &spi_nor {
0150         status = "okay";
0151 };
0152 
0153 &usb3_phy {
0154         status = "okay";
0155 };
0156 
0157 &srab {
0158         status = "okay";
0159 
0160         ports {
0161                 port@0 {
0162                         reg = <0>;
0163                         label = "lan1";
0164                 };
0165 
0166                 port@1 {
0167                         reg = <1>;
0168                         label = "lan2";
0169                 };
0170 
0171                 port@2 {
0172                         reg = <2>;
0173                         label = "lan3";
0174                 };
0175 
0176                 port@3 {
0177                         reg = <3>;
0178                         label = "lan4";
0179                 };
0180 
0181                 port@4 {
0182                         reg = <4>;
0183                         label = "wan";
0184                 };
0185 
0186                 port@5 {
0187                         reg = <5>;
0188                         label = "cpu";
0189                         ethernet = <&gmac0>;
0190                 };
0191         };
0192 };