Skip to contentSkip to conversation

dm: led: add BCM6328 led support

PATCH New Álvaro Fernández Rojas 3 participants 18 messages May 3, 2017 – May 10, 2017 MIPS

lore
Share & tools
lore
#0 lore raw

cover dm: led: add BCM6328 led support

BCM6328 supports controlling LEDs both by using the GPIO controller and the LED controller. However, LED controller allows HW blinking and supports serial LEDs.

Álvaro Fernández Rojas (5):
dm: led: add BCM6328 led driver
mips: bmips: add bcm6328-led driver support for BCM6328
mips: bmips: add bcm6328-led driver support for BCM63268
mips: bmips: add Comtrend AR-5387un bcm6328-leds
mips: bmips: add Comtrend VR-3032u bcm6328-leds

 arch/mips/dts/brcm,bcm63268.dtsi        |   9 ++
 arch/mips/dts/brcm,bcm6328.dtsi         |   9 ++
 arch/mips/dts/comtrend,ar-5387un.dts    |  30 ++++
 arch/mips/dts/comtrend,vr-3032u.dts     |  43 ++++++
 configs/comtrend_ar5387un_ram_defconfig |   4 +
 configs/comtrend_vr3032u_ram_defconfig  |   4 +
 drivers/led/Kconfig                     |   7 +
 drivers/led/Makefile                    |   1 +
 drivers/led/led_bcm6328.c               | 262 ++++++++++++++++++++++++++++++++
 9 files changed, 369 insertions(+)
 create mode 100644 drivers/led/led_bcm6328.c
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/5 dm: led: add BCM6328 led driver

This driver is a simplified version of linux/drivers/leds/leds-bcm6328.c, simplified to remove HW leds and blink fallbacks.

---
 drivers/led/Kconfig       |   7 ++
 drivers/led/Makefile      |   1 +
 drivers/led/led_bcm6328.c | 262 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 drivers/led/led_bcm6328.c
drivers/led/Kconfig +7 -0
index 309372a..50b27bd 100644
@@ -9,6 +9,13 @@ config LED
 	  can provide access to board-specific LEDs. Use of the device tree
 	  for configuration is encouraged.
 
+config LED_BCM6328
+	bool "LED Support for BCM6328"
+	depends on LED && ARCH_BMIPS
+	help
+	  This option enables support for LEDs connected to the BCM6328
+	  LED HW controller accessed via MMIO registers.
+
 config LED_BLINK
 	bool "Support LED blinking"
 	depends on LED
drivers/led/Makefile +1 -0
index 02367fd..d371ed5 100644
@@ -6,4 +6,5 @@
 #
 
 obj-y += led-uclass.o
+obj-$(CONFIG_LED_BCM6328) += led_bcm6328.o
 obj-$(CONFIG_$(SPL_)LED_GPIO) += led_gpio.o
drivers/led/led_bcm6328.c new file +262 -0

262 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw

PATCH 1/5 dm: led: add BCM6328 led driver

Quoted 11 lines · Álvaro Fernández Rojas

This driver is a simplified version of linux/drivers/leds/leds-bcm6328.c, simplified to remove HW leds and blink fallbacks.

---
 drivers/led/Kconfig       |   7 ++
 drivers/led/Makefile      |   1 +
 drivers/led/led_bcm6328.c | 262 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+)
 create mode 100644 drivers/led/led_bcm6328.c

But please see below.

Can you a DT binding file for this?

Quoted 5 lines
drivers/led/Kconfig +0 -0
index 309372a..50b27bd 100644

drivers/led/Kconfig config LED · line 17

Quoted 9 lines
drivers/led/Kconfig +6 -0
@@ -9,6 +9,13 @@ config LED
          can provide access to board-specific LEDs. Use of the device tree
          for configuration is encouraged.
 
+config LED_BCM6328
+       bool "LED Support for BCM6328"
+       depends on LED && ARCH_BMIPS
+       help
+         This option enables support for LEDs connected to the BCM6328
+         LED HW controller accessed via MMIO registers.

What features does it support? Flashing? How many LEDs?

[...]

Quoted 9 lines
drivers/led/Kconfig +9 -0
+static int bcm6328_led_probe(struct udevice *dev)
+{
+       struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
+       fdt_addr_t addr;
+       fdt_size_t size;
+
+       /* Top-level LED node */
+       if (!uc_plat->label) {
+               void __iomem *regs;

drivers/led/Kconfig config LED

Quoted 10 lines
drivers/led/Kconfig +10 -0
+               u32 set_bits = 0;
+
+               addr = dev_get_addr_size_index(dev, 0, &size);
+               if (addr == FDT_ADDR_T_NONE)
+                       return -EINVAL;
+
+               regs = ioremap(addr, size);
+
+               if (fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
+                               "brcm,serial-leds", NULL))

Can you use fdtdec_get_bool() ?

Quoted 37 lines
drivers/led/Kconfig +37 -0
+                       set_bits |= LED_INIT_SLEDEN_MASK;
+               if (fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
+                               "brcm,serial-mux", NULL))
+                       set_bits |= LED_INIT_SLEDMUX_MASK;
+               if (fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
+                               "brcm,serial-clk-low", NULL))
+                       set_bits |= LED_INIT_SLEDCLKNPOL_MASK;
+               if (!fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
+                                "brcm,serial-dat-low", NULL))
+                       set_bits |= LED_INIT_SLEDDATANPOL_MASK;
+               if (!fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
+                                "brcm,serial-shift-inv", NULL))
+                       set_bits |= LED_INIT_SLEDSHIFTDIR_MASK;
+
+               clrsetbits_be32(regs + LED_INIT_REG, ~0, set_bits);
+       } else {
+               struct bcm6328_led_priv *priv = dev_get_priv(dev);
+               unsigned int pin;
+
+               addr = dev_get_addr_size_index(dev_get_parent(dev), 0, &size);
+               if (addr == FDT_ADDR_T_NONE)
+                       return -EINVAL;
+
+               pin = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), "reg",
+                                     LEDS_MAX);
+               if (pin >= LEDS_MAX)
+                       return -EINVAL;
+
+               priv->regs = ioremap(addr, size);
+               if (pin < 8) {
+                       /* LEDs 0-7 (bits 47:32) */
+                       priv->mode = priv->regs + LED_MODE_REG_HI;
+                       priv->shift = (pin << 1);
+               } else {
+                       /* LEDs 8-23 (bits 31:0) */
+                       priv->mode = priv->regs + LED_MODE_REG_LO;
+                       priv->shift = ((pin - 8) << 1);

drivers/led/Kconfig

Quoted 10 lines
drivers/led/Kconfig +10 -0
+               }
+
+               if (fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "active-low",
+                               NULL))
+                       priv->active_low = true;
+       }
+
+       return 0;
+}
+

[..]

Regards,
Simon

#3 lore raw

PATCH 2/5 mips: bmips: add bcm6328-led driver support for BCM6328

In reply to Álvaro Fernández Rojas

This driver can control up to 24 LEDs and supports HW blinking and serial leds.

---
 arch/mips/dts/brcm,bcm6328.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/mips/dts/brcm,bcm6328.dtsi +9 -0
index 30c2ee8..a5b43ae 100644
@@ -88,6 +88,15 @@
 			status = "disabled";
 		};
 
+		leds: led-controller at 10000800 {
+			compatible = "brcm,bcm6328-leds";
+			reg = <0x10000800 0x24>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+		};
+
 		memory-controller at 10003000 {
 			compatible = "brcm,bcm6328-mc";
 			reg = <0x10003000 0x1000>;
Signature · 1 line
2.1.4
#5 lore raw

PATCH 3/5 mips: bmips: add bcm6328-led driver support for BCM63268

In reply to Álvaro Fernández Rojas

This driver can control up to 24 LEDs and supports HW blinking and serial leds.

---
 arch/mips/dts/brcm,bcm63268.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/mips/dts/brcm,bcm63268.dtsi +9 -0
index 3eda77d..11c6729 100644
@@ -98,6 +98,15 @@
 			status = "disabled";
 		};
 
+		leds: led-controller at 10001900 {
+			compatible = "brcm,bcm6328-leds";
+			reg = <0x10001900 0x24>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+		};
+
 		memory-controller at 10003000 {
 			compatible = "brcm,bcm6328-mc";
 			reg = <0x10003000 0x1000>;
Signature · 1 line
2.1.4
#7 lore raw

PATCH 4/5 mips: bmips: add Comtrend AR-5387un bcm6328-leds

In reply to Álvaro Fernández Rojas

This board has several LEDs attached to its BCM6328 led controller.

---
 arch/mips/dts/comtrend,ar-5387un.dts    | 30 ++++++++++++++++++++++++++++++
 configs/comtrend_ar5387un_ram_defconfig |  4 ++++
 2 files changed, 34 insertions(+)
arch/mips/dts/comtrend,ar-5387un.dts +30 -0
index 73f3be4..73f2b49 100644
@@ -21,6 +21,36 @@
 	};
 };
 
+&leds {
+	status = "okay";
+
+	led at 1 {
+		reg = <1>;
+		label = "AR-5387un:red:inet";
+	};
+
+	led at 4 {
+		reg = <4>;
+		label = "AR-5387un:red:power";
+	};
+
+	led at 7 {
+		reg = <7>;
+		label = "AR-5387un:green:inet";
+	};
+
+	led at 8 {
+		reg = <8>;
+		label = "AR-5387un:green:power";
+	};
+
+	led at 11 {
+		reg = <11>;
+		active-low;
+		label = "AR-5387un:green:dsl";
+	};
+};
+
 &uart0 {
 	u-boot,dm-pre-reloc;
 	status = "okay";
configs/comtrend_ar5387un_ram_defconfig +4 -0
index c95a369..f8656c4 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_CPU=y
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_LED=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_LOADB=y
 # CONFIG_CMD_LOADS is not set
@@ -31,6 +32,9 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_LED=y
+CONFIG_LED_BCM6328=y
+CONFIG_LED_BLINK=y
 CONFIG_MIPS=y
 # CONFIG_MIPS_BOOT_CMDLINE_LEGACY is not set
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
Signature · 1 line
2.1.4
#9 lore raw

PATCH 5/5 mips: bmips: add Comtrend VR-3032u bcm6328-leds

In reply to Álvaro Fernández Rojas

This board has several LEDs attached to its BCM6328 led controller.

---
 arch/mips/dts/comtrend,vr-3032u.dts    | 43 ++++++++++++++++++++++++++++++++++
 configs/comtrend_vr3032u_ram_defconfig |  4 ++++
 2 files changed, 47 insertions(+)
arch/mips/dts/comtrend,vr-3032u.dts +43 -0
index 6715304..54e738c 100644
@@ -21,6 +21,49 @@
 	};
 };
 
+&leds {
+	status = "okay";
+	brcm,serial-leds;
+	brcm,serial-dat-low;
+	brcm,serial-shift-inv;
+
+	led at 2 {
+		reg = <2>;
+		active-low;
+		label = "VR-3032u:red:inet";
+	};
+
+	led at 3 {
+		reg = <3>;
+		active-low;
+		label = "VR-3032u:green:dsl";
+	};
+
+	led at 4 {
+		reg = <4>;
+		active-low;
+		label = "VR-3032u:green:usb";
+	};
+
+	led at 7 {
+		reg = <7>;
+		active-low;
+		label = "VR-3032u:green:wps";
+	};
+
+	led at 8 {
+		reg = <8>;
+		active-low;
+		label = "VR-3032u:green:inet";
+	};
+
+	led at 20 {
+		reg = <20>;
+		active-low;
+		label = "VR-3032u:green:power";
+	};
+};
+
 &uart0 {
 	u-boot,dm-pre-reloc;
 	status = "okay";
configs/comtrend_vr3032u_ram_defconfig +4 -0
index c62ef0c..a04b0e5 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_CPU=y
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_LED=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_LOADB=y
 # CONFIG_CMD_LOADS is not set
@@ -31,6 +32,9 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_LED=y
+CONFIG_LED_BCM6328=y
+CONFIG_LED_BLINK=y
 CONFIG_MIPS=y
 # CONFIG_MIPS_BOOT_CMDLINE_LEGACY is not set
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
Signature · 1 line
2.1.4
#11 lore raw

v2 cover dm: led: add BCM6328 led support

In reply to Álvaro Fernández Rojas

BCM6328 supports controlling LEDs both by using the GPIO controller and the LED controller. However, LED controller allows HW blinking and supports serial LEDs.

v2: Introduce changes suggested by Simon Glass

Álvaro Fernández Rojas (5):
dm: led: add BCM6328 led driver
mips: bmips: add bcm6328-led driver support for BCM6328
mips: bmips: add bcm6328-led driver support for BCM63268
mips: bmips: add Comtrend AR-5387un bcm6328-leds
mips: bmips: add Comtrend VR-3032u bcm6328-leds

 arch/mips/dts/brcm,bcm63268.dtsi               |   9 +
 arch/mips/dts/brcm,bcm6328.dtsi                |   9 +
 arch/mips/dts/comtrend,ar-5387un.dts           |  30 +++
 arch/mips/dts/comtrend,vr-3032u.dts            |  43 ++++
 configs/comtrend_ar5387un_ram_defconfig        |   4 +
 configs/comtrend_vr3032u_ram_defconfig         |   4 +
 doc/device-tree-bindings/leds/leds-bcm6328.txt | 106 ++++++++++
 drivers/led/Kconfig                            |  11 ++
 drivers/led/Makefile                           |   1 +
 drivers/led/led_bcm6328.c                      | 262 +++++++++++++++++++++++++
 10 files changed, 479 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-bcm6328.txt
 create mode 100644 drivers/led/led_bcm6328.c
Signature · 1 line
2.1.4
#12 lore raw

PATCH v2 1/5 dm: led: add BCM6328 led driver

This driver is a simplified version of linux/drivers/leds/leds-bcm6328.c, simplified to remove HW leds and blink fallbacks.

---
v2: Introduce changes suggested by Simon Glass:
- Add DT binding file.
- Add features description.
- Switch to fdtdec_get_bool().

 doc/device-tree-bindings/leds/leds-bcm6328.txt | 106 ++++++++++
 drivers/led/Kconfig                            |  11 ++
 drivers/led/Makefile                           |   1 +
 drivers/led/led_bcm6328.c                      | 262 +++++++++++++++++++++++++
 4 files changed, 380 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-bcm6328.txt
 create mode 100644 drivers/led/led_bcm6328.c
doc/device-tree-bindings/leds/leds-bcm6328.txt new file +106 -0
new file mode 100644
index 0000000..7f5597b
@@ -0,0 +1,106 @@
+LEDs connected to Broadcom BCM6328 controller
+
+This controller is present on BCM6318, BCM6328, BCM6362 and BCM63268.
+In these SoCs it's possible to control LEDs both as GPIOs or by hardware.
+However, on some devices there are Serial LEDs (LEDs connected to a 74x164
+controller), which can either be controlled by software (exporting the 74x164
+as spi-gpio. See Documentation/devicetree/bindings/gpio/gpio-74x164.txt), or
+by hardware using this driver.
+Some of these Serial LEDs are hardware controlled (e.g. ethernet LEDs) and
+exporting the 74x164 as spi-gpio prevents those LEDs to be hardware
+controlled, so the only chance to keep them working is by using this driver.
+
+Required properties:
+  - compatible : should be "brcm,bcm6328-leds".
+  - #address-cells : must be 1.
+  - #size-cells : must be 0.
+  - reg : BCM6328 LED controller address and size.
+
+Optional properties:
+  - brcm,serial-leds : Boolean, enables Serial LEDs.
+    Default : false
+  - brcm,serial-mux : Boolean, enables Serial LEDs multiplexing.
+    Default : false
+  - brcm,serial-clk-low : Boolean, makes clock signal active low.
+    Default : false
+  - brcm,serial-dat-low : Boolean, makes data signal active low.
+    Default : false
+  - brcm,serial-shift-inv : Boolean, inverts Serial LEDs shift direction.
+    Default : false
+
+Each LED is represented as a sub-node of the brcm,bcm6328-leds device.
+
+LED sub-node required properties:
+  - reg : LED pin number (only LEDs 0 to 23 are valid).
+
+LED sub-node optional properties:
+  - label : see Documentation/devicetree/bindings/leds/common.txt
+  - active-low : Boolean, makes LED active low.
+    Default : false
+
+Examples:
+Scenario 1 : BCM6328 with 4 GPIO LEDs
+	leds0: led-controller at 10000800 {
+		compatible = "brcm,bcm6328-leds";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x10000800 0x24>;
+
+		alarm_red at 2 {
+			reg = <2>;
+			active-low;
+			label = "red:alarm";
+		};
+		inet_green at 3 {
+			reg = <3>;
+			active-low;
+			label = "green:inet";
+		};
+		power_green at 4 {
+			reg = <4>;
+			active-low;
+			label = "green:power";
+		};
+	};
+
+Scenario 2 : BCM63268 with Serial LEDs
+	leds0: led-controller at 10001900 {
+		compatible = "brcm,bcm6328-leds";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x10001900 0x24>;
+		brcm,serial-leds;
+		brcm,serial-dat-low;
+		brcm,serial-shift-inv;
+
+		inet_red at 2 {
+			reg = <2>;
+			active-low;
+			label = "red:inet";
+		};
+		dsl_green at 3 {
+			reg = <3>;
+			active-low;
+			label = "green:dsl";
+		};
+		usb_green at 4 {
+			reg = <4>;
+			active-low;
+			label = "green:usb";
+		};
+		wps_green at 7 {
+			reg = <7>;
+			active-low;
+			label = "green:wps";
+		};
+		inet_green at 8 {
+			reg = <8>;
+			active-low;
+			label = "green:inet";
+		};
+		power_green at 20 {
+			reg = <20>;
+			active-low;
+			label = "green:power";
+		};
+	};
drivers/led/Kconfig +11 -0
index 309372a..dc19f4f 100644
@@ -9,6 +9,17 @@ config LED
 	  can provide access to board-specific LEDs. Use of the device tree
 	  for configuration is encouraged.
 
+config LED_BCM6328
+	bool "LED Support for BCM6328"
+	depends on LED && ARCH_BMIPS
+	help
+	  This option enables support for LEDs connected to the BCM6328
+	  LED HW controller accessed via MMIO registers.
+	  HW blinking is supported and up to 24 LEDs can be controlled.
+	  All LEDs can blink at the same time but the delay is shared, which
+	  means that if one LED is set to blink at 100ms and then a different
+	  LED is set to blink at 200ms, both will blink at 200ms.
+
 config LED_BLINK
 	bool "Support LED blinking"
 	depends on LED
drivers/led/Makefile +1 -0
index 02367fd..d371ed5 100644
@@ -6,4 +6,5 @@
 #
 
 obj-y += led-uclass.o
+obj-$(CONFIG_LED_BCM6328) += led_bcm6328.o
 obj-$(CONFIG_$(SPL_)LED_GPIO) += led_gpio.o
drivers/led/led_bcm6328.c new file +262 -0

262 lines not on this page · raw message

Signature · 1 line
2.1.4
#13 lore raw

PATCH v2 2/5 mips: bmips: add bcm6328-led driver support for BCM6328

In reply to Álvaro Fernández Rojas

This driver can control up to 24 LEDs and supports HW blinking and serial leds.

---
v2: no changes.

 arch/mips/dts/brcm,bcm6328.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/mips/dts/brcm,bcm6328.dtsi +9 -0
index 30c2ee8..a5b43ae 100644
@@ -88,6 +88,15 @@
 			status = "disabled";
 		};
 
+		leds: led-controller at 10000800 {
+			compatible = "brcm,bcm6328-leds";
+			reg = <0x10000800 0x24>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+		};
+
 		memory-controller at 10003000 {
 			compatible = "brcm,bcm6328-mc";
 			reg = <0x10003000 0x1000>;
Signature · 1 line
2.1.4
#14 lore raw

PATCH v2 3/5 mips: bmips: add bcm6328-led driver support for BCM63268

In reply to Álvaro Fernández Rojas

This driver can control up to 24 LEDs and supports HW blinking and serial leds.

---
v2: no changes.

 arch/mips/dts/brcm,bcm63268.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/mips/dts/brcm,bcm63268.dtsi +9 -0
index 3eda77d..11c6729 100644
@@ -98,6 +98,15 @@
 			status = "disabled";
 		};
 
+		leds: led-controller at 10001900 {
+			compatible = "brcm,bcm6328-leds";
+			reg = <0x10001900 0x24>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+		};
+
 		memory-controller at 10003000 {
 			compatible = "brcm,bcm6328-mc";
 			reg = <0x10003000 0x1000>;
Signature · 1 line
2.1.4
#15 lore raw

PATCH v2 4/5 mips: bmips: add Comtrend AR-5387un bcm6328-leds

In reply to Álvaro Fernández Rojas

This board has several LEDs attached to its BCM6328 led controller.

---
v2: no changes.

 arch/mips/dts/comtrend,ar-5387un.dts    | 30 ++++++++++++++++++++++++++++++
 configs/comtrend_ar5387un_ram_defconfig |  4 ++++
 2 files changed, 34 insertions(+)
arch/mips/dts/comtrend,ar-5387un.dts +30 -0
index 73f3be4..73f2b49 100644
@@ -21,6 +21,36 @@
 	};
 };
 
+&leds {
+	status = "okay";
+
+	led at 1 {
+		reg = <1>;
+		label = "AR-5387un:red:inet";
+	};
+
+	led at 4 {
+		reg = <4>;
+		label = "AR-5387un:red:power";
+	};
+
+	led at 7 {
+		reg = <7>;
+		label = "AR-5387un:green:inet";
+	};
+
+	led at 8 {
+		reg = <8>;
+		label = "AR-5387un:green:power";
+	};
+
+	led at 11 {
+		reg = <11>;
+		active-low;
+		label = "AR-5387un:green:dsl";
+	};
+};
+
 &uart0 {
 	u-boot,dm-pre-reloc;
 	status = "okay";
configs/comtrend_ar5387un_ram_defconfig +4 -0
index c95a369..f8656c4 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_CPU=y
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_LED=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_LOADB=y
 # CONFIG_CMD_LOADS is not set
@@ -31,6 +32,9 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_LED=y
+CONFIG_LED_BCM6328=y
+CONFIG_LED_BLINK=y
 CONFIG_MIPS=y
 # CONFIG_MIPS_BOOT_CMDLINE_LEGACY is not set
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
Signature · 1 line
2.1.4
#16 lore raw

PATCH v2 5/5 mips: bmips: add Comtrend VR-3032u bcm6328-leds

In reply to Álvaro Fernández Rojas

This board has several LEDs attached to its BCM6328 led controller.

---
v2: no changes.

 arch/mips/dts/comtrend,vr-3032u.dts    | 43 ++++++++++++++++++++++++++++++++++
 configs/comtrend_vr3032u_ram_defconfig |  4 ++++
 2 files changed, 47 insertions(+)
arch/mips/dts/comtrend,vr-3032u.dts +43 -0
index 6715304..54e738c 100644
@@ -21,6 +21,49 @@
 	};
 };
 
+&leds {
+	status = "okay";
+	brcm,serial-leds;
+	brcm,serial-dat-low;
+	brcm,serial-shift-inv;
+
+	led at 2 {
+		reg = <2>;
+		active-low;
+		label = "VR-3032u:red:inet";
+	};
+
+	led at 3 {
+		reg = <3>;
+		active-low;
+		label = "VR-3032u:green:dsl";
+	};
+
+	led at 4 {
+		reg = <4>;
+		active-low;
+		label = "VR-3032u:green:usb";
+	};
+
+	led at 7 {
+		reg = <7>;
+		active-low;
+		label = "VR-3032u:green:wps";
+	};
+
+	led at 8 {
+		reg = <8>;
+		active-low;
+		label = "VR-3032u:green:inet";
+	};
+
+	led at 20 {
+		reg = <20>;
+		active-low;
+		label = "VR-3032u:green:power";
+	};
+};
+
 &uart0 {
 	u-boot,dm-pre-reloc;
 	status = "okay";
configs/comtrend_vr3032u_ram_defconfig +4 -0
index c62ef0c..a04b0e5 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_CPU=y
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_IMPORTENV is not set
+CONFIG_CMD_LED=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_LOADB=y
 # CONFIG_CMD_LOADS is not set
@@ -31,6 +32,9 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_SERIAL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_LED=y
+CONFIG_LED_BCM6328=y
+CONFIG_LED_BLINK=y
 CONFIG_MIPS=y
 # CONFIG_MIPS_BOOT_CMDLINE_LEGACY is not set
 # CONFIG_MIPS_BOOT_ENV_LEGACY is not set
Signature · 1 line
2.1.4
#17 lore raw

v2 cover dm: led: add BCM6328 led support

In reply to Álvaro Fernández Rojas

Am 07.05.2017 um 20:10 schrieb Álvaro Fernández Rojas:

Quoted 13 lines

BCM6328 supports controlling LEDs both by using the GPIO controller and the LED controller. However, LED controller allows HW blinking and supports serial LEDs.

v2: Introduce changes suggested by Simon Glass

Álvaro Fernández Rojas (5):
dm: led: add BCM6328 led driver
mips: bmips: add bcm6328-led driver support for BCM6328
mips: bmips: add bcm6328-led driver support for BCM63268
mips: bmips: add Comtrend AR-5387un bcm6328-leds
mips: bmips: add Comtrend VR-3032u bcm6328-leds

Quoted 14 lines
 arch/mips/dts/brcm,bcm63268.dtsi               |   9 +
 arch/mips/dts/brcm,bcm6328.dtsi                |   9 +
 arch/mips/dts/comtrend,ar-5387un.dts           |  30 +++
 arch/mips/dts/comtrend,vr-3032u.dts            |  43 ++++
 configs/comtrend_ar5387un_ram_defconfig        |   4 +
 configs/comtrend_vr3032u_ram_defconfig         |   4 +
 doc/device-tree-bindings/leds/leds-bcm6328.txt | 106 ++++++++++
 drivers/led/Kconfig                            |  11 ++
 drivers/led/Makefile                           |   1 +
 drivers/led/led_bcm6328.c                      | 262 +++++++++++++++++++++++++
 10 files changed, 479 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-bcm6328.txt
 create mode 100644 drivers/led/led_bcm6328.c

series applied to u-boot-mips/next, thanks

Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170510/bfdd8a90/attachment.sig>