Skip to contentSkip to conversation

led: add initial support for bcm6858

PATCH New Philippe Reynes 3 participants 17 messages Mar 22, 2019 – Apr 24, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/8 led: add initial support for bcm6858

The driver add the support of the led IP on bcm6858. This led IP can drive up to 32 leds, and can handle blinking.

---
Changelog:
v2:
- use const for array bcm6858_flash_rate (thanks Daniel)
- use int for array bcm6858_flash_rate (thanks Daniel)

 doc/device-tree-bindings/leds/leds-bcm6858.txt |  51 +++++
 drivers/led/Kconfig                            |   7 +
 drivers/led/Makefile                           |   1 +
 drivers/led/led_bcm6858.c                      | 250 +++++++++++++++++++++++++
 4 files changed, 309 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-bcm6858.txt
 create mode 100644 drivers/led/led_bcm6858.c
doc/device-tree-bindings/leds/leds-bcm6858.txt new file +51 -0
new file mode 100644
index 0000000..ea2fe23
@@ -0,0 +1,51 @@
+LEDs connected to Broadcom BCM6858 controller
+
+This controller is present on BCM6858, BCM6328, BCM6362 and BCM63268.
+In these SoCs it's possible to control LEDs both as GPIOs or by hardware.
+
+Required properties:
+  - compatible : should be "brcm,bcm6858-leds".
+  - #address-cells : must be 1.
+  - #size-cells : must be 0.
+  - reg : BCM6858 LED controller address and size.
+
+Optional properties:
+  - brcm,serial-led-msb-first : Boolean, msb data come out first on serial data pin
+    Default : false
+  - brcm,serial-led-en-pol : Boolean, serial led polarity (true => active high)
+    Default : false
+  - brcm,serial-led-clk-pol : Boolean, serial clock polarity (true => active high)
+    Default : false
+  - brcm,serial-led-data-ppol : Boolean, serial data polarity (true => active high)
+    Default : false
+  - brcm,serial-shift-inv : Boolean, led test mode
+    Default : false
+
+Each LED is represented as a sub-node of the brcm,bcm6858-leds device.
+
+LED sub-node required properties:
+  - reg : LED pin number (only LEDs 0 to 32 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:
+BCM6328 with 2 GPIO LEDs
+	leds0: led-controller at ff800800 {
+		compatible = "brcm,bcm6858-leds";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0xff800800 0x0 0xe4>;
+
+		led at 2 {
+			reg = <2>;
+			label = "green:inet";
+		};
+
+		led at 5 {
+			reg = <5>;
+			label = "red:alarm";
+		};
+	};
drivers/led/Kconfig +7 -0
index 5da5c4a..4c8582d 100644
@@ -28,6 +28,13 @@ config LED_BCM6358
 	  LED HW controller accessed via MMIO registers.
 	  HW has no blinking capabilities and up to 32 LEDs can be controlled.
 
+config LED_BCM6858
+	bool "LED Support for BCM6858"
+	depends on LED && ARCH_BCM6858
+	help
+	  This option enables support for LEDs connected to the BCM6858
+	  HW has blinking capabilities and up to 32 LEDs can be controlled.
+
 config LED_BLINK
 	bool "Support LED blinking"
 	depends on LED
drivers/led/Makefile +1 -0
index 160a8f3..3654dd3 100644
@@ -6,4 +6,5 @@
 obj-y += led-uclass.o
 obj-$(CONFIG_LED_BCM6328) += led_bcm6328.o
 obj-$(CONFIG_LED_BCM6358) += led_bcm6358.o
+obj-$(CONFIG_LED_BCM6858) += led_bcm6858.o
 obj-$(CONFIG_$(SPL_)LED_GPIO) += led_gpio.o
drivers/led/led_bcm6858.c new file +250 -0

250 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 2/8 dt: bcm6858: add led controller

Add the led controller in the bcm6858 device tree.

---
Changelog:
v2:
- no change

 arch/arm/dts/bcm6858.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/bcm6858.dtsi +7 -0
index 23b80c6..0359417 100644
@@ -82,6 +82,13 @@
 			status = "disabled";
 		};
 
+		leds: led-controller at ff800800 {
+			compatible = "brcm,bcm6858-leds";
+			reg = <0x0 0xff800800 0x0 0xe4>;
+
+			status = "disabled";
+		};
+
 		wdt1: watchdog at ff802780 {
 			compatible = "brcm,bcm6345-wdt";
 			reg = <0x0 0xff802780 0x0 0x14>;
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/8 dt: bcm6858: add led controller

Quoted 3 lines · Philippe Reynes

Add the led controller in the bcm6858 device tree.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/bda731ca/attachment.sig>
#3 lore raw

PATCH v2 3/8 dt: bcm968580xref: enable led controller

In reply to Philippe Reynes

Enable the led controller in the device tree
of the board bcm968580xref.

---
Changelog:
v2:
- no change

 arch/arm/dts/bcm968580xref.dts | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
arch/arm/dts/bcm968580xref.dts +48 -0
index 0c59f94..c11246a 100644
@@ -29,3 +29,51 @@
 	u-boot,dm-pre-reloc;
 	status = "okay";
 };
+
+&leds {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	brcm,serial-led-en-pol;
+	brcm,serial-led-data-ppol;
+
+	led at 2 {
+		reg = <2>;
+		label = "green:inet";
+	};
+
+	led at 5 {
+		reg = <5>;
+		label = "red:alarm";
+	};
+
+	led at 8 {
+		reg = <8>;
+		label = "green:wlan_link";
+	};
+
+	led at 11 {
+		reg = <11>;
+		label = "green:fxs1";
+	};
+
+	led at 14 {
+		reg = <14>;
+		label = "green:fxs2";
+	};
+
+	led at 15 {
+		reg = <15>;
+		label = "green:usb0";
+	};
+
+	led at 16 {
+		reg = <16>;
+		label = "green:usb1";
+	};
+
+	led at 17 {
+		reg = <17>;
+		label = "green:wps";
+	};
+};
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 3/8 dt: bcm968580xref: enable led controller

Quoted 4 lines · Philippe Reynes

Enable the led controller in the device tree
of the board bcm968580xref.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/3481adc6/attachment.sig>
#5 lore raw

PATCH v2 4/8 bcm968580xref: enable led support

In reply to Philippe Reynes

Enable the led support in the configuration
of the board bcm968580xref.

---
Changelog:
v2:
- no change

 configs/bcm968580xref_ram_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/bcm968580xref_ram_defconfig +3 -0
index e8cb3a0..887ccb8 100644
@@ -22,6 +22,9 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm968580xref"
 # CONFIG_NET is not set
 CONFIG_BLK=y
 CONFIG_CLK=y
+CONFIG_LED=y
+CONFIG_LED_BCM6858=y
+CONFIG_LED_BLINK=y
 # CONFIG_MMC is not set
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 # CONFIG_SPL_SERIAL_PRESENT is not set
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 4/8 bcm968580xref: enable led support

Quoted 4 lines · Philippe Reynes

Enable the led support in the configuration
of the board bcm968580xref.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/1688cfe9/attachment.sig>
#7 lore raw

PATCH v2 5/8 led: bcm6858: allow to use this driver on ARCH_963158

In reply to Philippe Reynes

Allow the led bcm6858 driver to be used on bcm63158. They have the same led controller.

---
Changelog:
v2:
- no change

 drivers/led/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/led/Kconfig +1 -1
index 4c8582d..5643939 100644
@@ -30,7 +30,7 @@ config LED_BCM6358
 
 config LED_BCM6858
 	bool "LED Support for BCM6858"
-	depends on LED && ARCH_BCM6858
+	depends on LED && (ARCH_BCM6858 || ARCH_BCM63158)
 	help
 	  This option enables support for LEDs connected to the BCM6858
 	  HW has blinking capabilities and up to 32 LEDs can be controlled.
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 5/8 led: bcm6858: allow to use this driver on ARCH_963158

Quoted 4 lines · Philippe Reynes

Allow the led bcm6858 driver to be used on bcm63158. They have the same led controller.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/ca59daa7/attachment.sig>
#9 lore raw

PATCH v2 6/8 dt: bcm63158: add led controller

In reply to Philippe Reynes

Add the led controller in the bcm63158 device tree.

---
Changelog:
v2:
- no change

 arch/arm/dts/bcm63158.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/bcm63158.dtsi +7 -0
index 6a3fbc9..0967a3d 100644
@@ -82,6 +82,13 @@
 			status = "disabled";
 		};
 
+		leds: led-controller at ff800800 {
+			compatible = "brcm,bcm6858-leds";
+			reg = <0x0 0xff800800 0x0 0xe4>;
+
+			status = "disabled";
+		};
+
 		wdt1: watchdog at ff800480 {
 			compatible = "brcm,bcm6345-wdt";
 			reg = <0x0 0xff800480 0x0 0x14>;
Signature · 1 line
2.7.4
#10 lore raw

PATCH v2 6/8 dt: bcm63158: add led controller

Quoted 3 lines · Philippe Reynes

Add the led controller in the bcm63158 device tree.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/c6ace1d4/attachment.sig>
#11 lore raw

PATCH v2 7/8 dt: bcm963158: enable led controller

In reply to Philippe Reynes

Enable the led controller in the device tree
of the board bcm963158.

---
Changelog:
v2:
- no change

 arch/arm/dts/bcm963158.dts | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
arch/arm/dts/bcm963158.dts +49 -0
index dc5afb5..15e87de 100644
@@ -29,3 +29,52 @@
 	u-boot,dm-pre-reloc;
 	status = "okay";
 };
+
+&leds {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	brcm,serial-led-en-pol;
+	brcm,serial-led-data-ppol;
+
+	led at 16 {
+		reg = <16>;
+		label = "red:dsl2";
+	};
+
+	led at 17 {
+		reg = <17>;
+		label = "green:dsl1";
+	};
+
+	led at 18 {
+		reg = <18>;
+		label = "green:fxs2";
+	};
+
+	led at 19 {
+		reg = <19>;
+		label = "green:fxs1";
+	};
+
+	led at 26 {
+		reg = <26>;
+		label = "green:wan1_act";
+	};
+
+	led at 27 {
+		reg = <27>;
+		label = "green:wps";
+	};
+
+	led at 28 {
+		reg = <28>;
+		active-low;
+		label = "green:aggregate_act";
+	};
+
+	led at 29 {
+		reg = <29>;
+		label = "green:aggregate_link";
+	};
+};
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 7/8 dt: bcm963158: enable led controller

Quoted 4 lines · Philippe Reynes

Enable the led controller in the device tree
of the board bcm963158.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/ef6eff76/attachment.sig>
#13 lore raw

PATCH v2 8/8 bcm963158: enable led support

In reply to Philippe Reynes

Enable the led support in the configuration
of the board bcm963158.

---
Changelog:
v2:
- no change

 configs/bcm963158_ram_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/bcm963158_ram_defconfig +3 -0
index fc55e98..c93a8f6 100644
@@ -28,6 +28,9 @@ CONFIG_DEFAULT_DEVICE_TREE="bcm963158"
 # CONFIG_NET is not set
 CONFIG_BLK=y
 CONFIG_CLK=y
+CONFIG_LED=y
+CONFIG_LED_BCM6858=y
+CONFIG_LED_BLINK=y
 # CONFIG_MMC is not set
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 # CONFIG_SPL_SERIAL_PRESENT is not set
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 8/8 bcm963158: enable led support

Quoted 4 lines · Philippe Reynes

Enable the led support in the configuration
of the board bcm963158.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/d5b8b7af/attachment.sig>
#15 lore raw

PATCH v2 1/8 led: add initial support for bcm6858

In reply to Philippe Reynes

Am 22.03.19 um 17:02 schrieb Philippe Reynes:

Quoted 11 lines

The driver add the support of the led IP on bcm6858. This led IP can drive up to 32 leds, and can handle blinking.

---
Changelog:
v2:
- use const for array bcm6858_flash_rate (thanks Daniel)
- use int for array bcm6858_flash_rate (thanks Daniel)

Quoted 8 lines
 doc/device-tree-bindings/leds/leds-bcm6858.txt |  51 +++++
 drivers/led/Kconfig                            |   7 +
 drivers/led/Makefile                           |   1 +
 drivers/led/led_bcm6858.c                      | 250 +++++++++++++++++++++++++
 4 files changed, 309 insertions(+)
 create mode 100644 doc/device-tree-bindings/leds/leds-bcm6858.txt
 create mode 100644 drivers/led/led_bcm6858.c
Signature · 1 line
- Daniel
#16 lore raw

PATCH v2 1/8 led: add initial support for bcm6858

In reply to Philippe Reynes
Quoted 6 lines · Philippe Reynes

The driver add the support of the led IP on bcm6858. This led IP can drive up to 32 leds, and can handle blinking.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190424/a852976c/attachment.sig>