Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/leds/leds-bcm6328.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: LEDs connected to Broadcom BCM6328 controller
0008 
0009 maintainers:
0010   - Álvaro Fernández Rojas <noltari@gmail.com>
0011 
0012 description: |
0013   This controller is present on BCM6318, BCM6328, BCM6362 and BCM63268.
0014   In these SoCs it's possible to control LEDs both as GPIOs or by hardware.
0015   However, on some devices there are Serial LEDs (LEDs connected to a 74x164
0016   controller), which can either be controlled by software (exporting the 74x164
0017   as spi-gpio. See
0018   Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml), or by hardware
0019   using this driver.
0020   Some of these Serial LEDs are hardware controlled (e.g. ethernet LEDs) and
0021   exporting the 74x164 as spi-gpio prevents those LEDs to be hardware
0022   controlled, so the only chance to keep them working is by using this driver.
0023 
0024   BCM6328 LED controller has a HWDIS register, which controls whether a LED
0025   should be controlled by a hardware signal instead of the MODE register value,
0026   with 0 meaning hardware control enabled and 1 hardware control disabled. This
0027   is usually 1:1 for hardware to LED signals, but through the activity/link
0028   registers you have some limited control over rerouting the LEDs (as
0029   explained later in brcm,link-signal-sources). Even if a LED is hardware
0030   controlled you are still able to make it blink or light it up if it isn't,
0031   but you can't turn it off if the hardware decides to light it up. For this
0032   reason, hardware controlled LEDs aren't registered as LED class devices.
0033 
0034   Each LED is represented as a sub-node of the brcm,bcm6328-leds device.
0035 
0036 properties:
0037   compatible:
0038     const: brcm,bcm6328-leds
0039 
0040   reg:
0041     maxItems: 1
0042 
0043   brcm,serial-leds:
0044     type: boolean
0045     description: Enables Serial LEDs.
0046 
0047   brcm,serial-mux:
0048     type: boolean
0049     description: Enables Serial LEDs multiplexing.
0050 
0051   brcm,serial-clk-low:
0052     type: boolean
0053     description: Makes clock signal active low.
0054 
0055   brcm,serial-dat-low:
0056     type: boolean
0057     description: Makes data signal active low.
0058 
0059   brcm,serial-shift-inv:
0060     type: boolean
0061     description: Inverts Serial LEDs shift direction.
0062 
0063   "#address-cells":
0064     const: 1
0065 
0066   "#size-cells":
0067     const: 0
0068 
0069 patternProperties:
0070   "@[a-f0-9]+$":
0071     type: object
0072 
0073     $ref: common.yaml#
0074 
0075     properties:
0076       reg:
0077         items:
0078           - maximum: 23
0079         description: LED pin number (only LEDs 0 to 23 are valid).
0080 
0081       active-low:
0082         type: boolean
0083         description: Makes LED active low.
0084 
0085       brcm,hardware-controlled:
0086         type: boolean
0087         description: Makes this LED hardware controlled.
0088 
0089       brcm,link-signal-sources:
0090         $ref: /schemas/types.yaml#/definitions/uint32-array
0091         minItems: 1
0092         maxItems: 4
0093         description: >
0094           An array of hardware link signal sources. Up to four link hardware
0095           signals can get muxed into these LEDs. Only valid for LEDs 0 to 7,
0096           where LED signals 0 to 3 may be muxed to LEDs 0 to 3, and signals 4 to
0097           7 may be muxed to LEDs 4 to 7. A signal can be muxed to more than one
0098           LED, and one LED can have more than one source signal.
0099 
0100       brcm,activity-signal-sources:
0101         $ref: /schemas/types.yaml#/definitions/uint32-array
0102         minItems: 1
0103         maxItems: 4
0104         description: >
0105           An array of hardware activity signal sources. Up to four activity
0106           hardware signals can get muxed into these LEDs. Only valid for LEDs 0
0107           to 7, where LED signals 0 to 3 may be muxed to LEDs 0 to 3, and
0108           signals 4 to 7 may be muxed to LEDs 4 to 7. A signal can be muxed to
0109           more than one LED, and one LED can have more than one source signal.
0110 
0111     required:
0112       - reg
0113 
0114     unevaluatedProperties: false
0115 
0116 required:
0117   - reg
0118   - "#address-cells"
0119   - "#size-cells"
0120 
0121 additionalProperties: false
0122 
0123 examples:
0124   - |
0125     /* BCM6328 with 4 EPHY LEDs */
0126     led-controller@10000800 {
0127         compatible = "brcm,bcm6328-leds";
0128         #address-cells = <1>;
0129         #size-cells = <0>;
0130         reg = <0x10000800 0x24>;
0131 
0132         alarm_red@2 {
0133             reg = <2>;
0134             active-low;
0135             label = "red:alarm";
0136         };
0137 
0138         inet_green@3 {
0139             reg = <3>;
0140             active-low;
0141             label = "green:inet";
0142         };
0143 
0144         power_green@4 {
0145             reg = <4>;
0146             active-low;
0147             label = "green:power";
0148             default-state = "on";
0149         };
0150 
0151         ephy0_spd@17 {
0152             reg = <17>;
0153             brcm,hardware-controlled;
0154         };
0155 
0156         ephy1_spd@18 {
0157             reg = <18>;
0158             brcm,hardware-controlled;
0159         };
0160 
0161         ephy2_spd@19 {
0162             reg = <19>;
0163             brcm,hardware-controlled;
0164         };
0165 
0166         ephy3_spd@20 {
0167             reg = <20>;
0168             brcm,hardware-controlled;
0169         };
0170     };
0171   - |
0172     /* BCM63268 with Serial/GPHY0 LEDs */
0173     led-controller@10001900 {
0174         compatible = "brcm,bcm6328-leds";
0175         #address-cells = <1>;
0176         #size-cells = <0>;
0177         reg = <0x10001900 0x24>;
0178         brcm,serial-leds;
0179         brcm,serial-dat-low;
0180         brcm,serial-shift-inv;
0181 
0182         gphy0_spd0@0 {
0183             reg = <0>;
0184             brcm,hardware-controlled;
0185             brcm,link-signal-sources = <0>;
0186         };
0187 
0188         gphy0_spd1@1 {
0189             reg = <1>;
0190             brcm,hardware-controlled;
0191             brcm,link-signal-sources = <1>;
0192         };
0193 
0194         inet_red@2 {
0195             reg = <2>;
0196             active-low;
0197             label = "red:inet";
0198         };
0199 
0200         dsl_green@3 {
0201             reg = <3>;
0202             active-low;
0203             label = "green:dsl";
0204         };
0205 
0206         usb_green@4 {
0207             reg = <4>;
0208             active-low;
0209             label = "green:usb";
0210         };
0211 
0212         wps_green@7 {
0213             reg = <7>;
0214             active-low;
0215             label = "green:wps";
0216         };
0217 
0218         inet_green@8 {
0219             reg = <8>;
0220             active-low;
0221             label = "green:inet";
0222         };
0223 
0224         ephy0_act@9 {
0225             reg = <9>;
0226             brcm,hardware-controlled;
0227         };
0228 
0229         ephy1_act@10 {
0230             reg = <10>;
0231             brcm,hardware-controlled;
0232         };
0233 
0234         ephy2_act@11 {
0235             reg = <11>;
0236             brcm,hardware-controlled;
0237         };
0238 
0239         gphy0_act@12 {
0240             reg = <12>;
0241             brcm,hardware-controlled;
0242         };
0243 
0244         ephy0_spd@13 {
0245             reg = <13>;
0246             brcm,hardware-controlled;
0247         };
0248 
0249         ephy1_spd@14 {
0250             reg = <14>;
0251             brcm,hardware-controlled;
0252         };
0253 
0254         ephy2_spd@15 {
0255             reg = <15>;
0256             brcm,hardware-controlled;
0257         };
0258 
0259         power_green@20 {
0260             reg = <20>;
0261             active-low;
0262             label = "green:power";
0263             default-state = "on";
0264         };
0265     };
0266   - |
0267     /* BCM6362 with 1 LED for each EPHY */
0268     led-controller@10001900 {
0269         compatible = "brcm,bcm6328-leds";
0270         #address-cells = <1>;
0271         #size-cells = <0>;
0272         reg = <0x10001900 0x24>;
0273 
0274         usb@0 {
0275             reg = <0>;
0276             brcm,hardware-controlled;
0277             brcm,link-signal-sources = <0>;
0278             brcm,activity-signal-sources = <0>;
0279             /* USB link/activity routed to USB LED */
0280         };
0281 
0282         inet@1 {
0283             reg = <1>;
0284             brcm,hardware-controlled;
0285             brcm,activity-signal-sources = <1>;
0286             /* INET activity routed to INET LED */
0287         };
0288 
0289         ephy0@4 {
0290             reg = <4>;
0291             brcm,hardware-controlled;
0292             brcm,link-signal-sources = <4>;
0293             /* EPHY0 link routed to EPHY0 LED */
0294         };
0295 
0296         ephy1@5 {
0297             reg = <5>;
0298             brcm,hardware-controlled;
0299             brcm,link-signal-sources = <5>;
0300             /* EPHY1 link routed to EPHY1 LED */
0301         };
0302 
0303         ephy2@6 {
0304             reg = <6>;
0305             brcm,hardware-controlled;
0306             brcm,link-signal-sources = <6>;
0307             /* EPHY2 link routed to EPHY2 LED */
0308         };
0309 
0310         ephy3@7 {
0311             reg = <7>;
0312             brcm,hardware-controlled;
0313             brcm,link-signal-sources = <7>;
0314             /* EPHY3 link routed to EPHY3 LED */
0315         };
0316 
0317         power_green@20 {
0318             reg = <20>;
0319             active-low;
0320             label = "green:power";
0321             default-state = "on";
0322         };
0323     };
0324   - |
0325     /* BCM6362 with 1 LED for all EPHYs */
0326     led-controller@10001900 {
0327         compatible = "brcm,bcm6328-leds";
0328         #address-cells = <1>;
0329         #size-cells = <0>;
0330         reg = <0x10001900 0x24>;
0331 
0332         usb@0 {
0333             reg = <0>;
0334             brcm,hardware-controlled;
0335             brcm,link-signal-sources = <0 1>;
0336             brcm,activity-signal-sources = <0 1>;
0337             /* USB/INET link/activity routed to USB LED */
0338         };
0339 
0340         ephy@4 {
0341             reg = <4>;
0342             brcm,hardware-controlled;
0343             brcm,link-signal-sources = <4 5 6 7>;
0344             /* EPHY0/1/2/3 link routed to EPHY0 LED */
0345         };
0346 
0347         power_green@20 {
0348             reg = <20>;
0349             active-low;
0350             label = "green:power";
0351             default-state = "on";
0352         };
0353     };
0354   - |
0355     /* BCM6362 with EPHY LEDs swapped */
0356     led-controller@10001900 {
0357         compatible = "brcm,bcm6328-leds";
0358         #address-cells = <1>;
0359         #size-cells = <0>;
0360         reg = <0x10001900 0x24>;
0361 
0362         usb@0 {
0363             reg = <0>;
0364             brcm,hardware-controlled;
0365             brcm,link-signal-sources = <0>;
0366             brcm,activity-signal-sources = <0 1>;
0367             /* USB link/act and INET act routed to USB LED */
0368         };
0369 
0370         ephy0@4 {
0371             reg = <4>;
0372             brcm,hardware-controlled;
0373             brcm,link-signal-sources = <7>;
0374             /* EPHY3 link routed to EPHY0 LED */
0375         };
0376 
0377         ephy1@5 {
0378             reg = <5>;
0379             brcm,hardware-controlled;
0380             brcm,link-signal-sources = <6>;
0381             /* EPHY2 link routed to EPHY1 LED */
0382         };
0383 
0384         ephy2@6 {
0385             reg = <6>;
0386             brcm,hardware-controlled;
0387             brcm,link-signal-sources = <5>;
0388             /* EPHY1 link routed to EPHY2 LED */
0389         };
0390 
0391         ephy3@7 {
0392             reg = <7>;
0393             brcm,hardware-controlled;
0394             brcm,link-signal-sources = <4>;
0395             /* EPHY0 link routed to EPHY3 LED */
0396         };
0397 
0398         power_green@20 {
0399             reg = <20>;
0400             active-low;
0401             label = "green:power";
0402             default-state = "on";
0403         };
0404     };