ARM: dts: bcm2835: replace deprecated LED fragment
Subsystems (3)
cover ARM: dts: bcm2835: replace deprecated LED fragment
The Raspberry Pi Zero and Model B device trees include the deprecated bcm283x-rpi-led-deprecated.dtsi fragment to define their ACT LEDs.
Replace the fragment with board-local gpio-leds nodes, preserving the existing GPIO assignments, polarity, default state, and heartbeat trigger.
The changes are split into separate patches for each board.
Artem Novak (2):
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi
Zero
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi
Model B
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts | 14 +++++++++++--- arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-)
Signature · 1 line
2.56.1
PATCH 1/2 ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Zero
Replace the deprecated LED fragment with a board-local gpio-leds node, preserving the ACT LED GPIO assignment and configuration.
--- arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +11 -3
@@ -7,7 +7,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-usb-otg.dtsi" / {
@@ -101,8 +100,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; +/ { + leds { + compatible = "gpio-leds"; + + led-act { + label = "ACT"; + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; }; &sdhost {
Signature · 1 line
2.56.1
[email protected]
AI reviewRe: [PATCH 1/2] ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Zero
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] ARM: dts: bcm2835: loss of leds and led_act symbols in bcm2835-rpi-zero.dtb - [Low] ARM: dts…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] ARM: dts: bcm2835: loss of leds and led_act symbols in bcm2835-rpi-zero.dtb
- [Low] ARM: dts: bcm2835: redundant inlining of bcm283x-rpi-led-deprecated.dtsi
--
commit 739b5e27f1887a8552cb53d11c780143b2a0ef69
Author: Artem Novak <[email protected]>
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Zero
This commit replaces the included bcm283x-rpi-led-deprecated.dtsi fragment in bcm2835-rpi-zero.dts with an inline gpio-leds node for the ACT LED.
Quoted 13 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +0
-1@@ -7,7 +7,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-usb-otg.dtsi" / {
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts &hdmi { · line 107
Quoted 10 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +5
-2@@ -101,8 +100,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; +/ { + leds { + compatible = "gpio-leds"; + + led-act {
[Severity: Medium]
Does dropping the leds: and led_act: node labels here remove the leds and led_act entries from /__symbols__ in bcm2835-rpi-zero.dtb?
arch/arm/boot/dts/broadcom/Makefile compiles bcm2835-rpi-zero.dtb with -@ (DTC_FLAGS_bcm2835-rpi-zero := -@), and bcm283x-rpi-led-deprecated.dtsi defined leds: leds and led_act: led-act. Without those labels, Device Tree overlays and bootloader dtparam overrides targeting &leds or &led_act will fail to resolve on Raspberry Pi Zero.
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts &hdmi { · line 114
Quoted 7 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +6
-0+ label = "ACT"; + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; };
[Severity: Low]
Does open-coding bcm283x-rpi-led-deprecated.dtsi here defeat the purpose of 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi")?
What is deprecated in Documentation/devicetree/bindings/leds/common.yaml is the label = "ACT" property (in favor of function and color), which has to be kept on existing boards to preserve the /sys/class/leds/ACT userspace interface. Commit 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi") moved that legacy node into bcm283x-rpi-led-deprecated.dtsi so existing boards share one definition while new boards do not inherit it; inlining the same label = "ACT" definition into a second root / { ... }; block in the middle of the phandle overrides duplicates the shared fragment without removing the deprecated property.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH 2/2 ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Model B
In reply to Artem NovakReplace the deprecated LED fragment with a board-local gpio-leds node, preserving the ACT LED GPIO assignment and configuration.
--- arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +11 -3
@@ -3,7 +3,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-smsc9512.dtsi" #include "bcm283x-rpi-usb-host.dtsi"
@@ -93,8 +92,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +/ { + leds { + compatible = "gpio-leds"; + + led-act { + label = "ACT"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; }; &pwm {
Signature · 1 line
2.56.1
[email protected]
AI reviewRe: [PATCH 2/2] ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Model B
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] ARM: dts: bcm2835: dropped leds and led_act overlay symbols in bcm2835-rpi-b - [Low] ARM: dts…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] ARM: dts: bcm2835: dropped leds and led_act overlay symbols in bcm2835-rpi-b
- [Low] ARM: dts: bcm2835: inlining deprecated LED dtsi duplicates legacy label node
--
commit 49ba1cd9cda13f0341e152094b002fc2c5f37a35
Author: Artem Novak <[email protected]>
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Model B
This commit removes the bcm283x-rpi-led-deprecated.dtsi include from bcm2835-rpi-b.dts and defines a board-local gpio-leds node for the ACT LED.
Quoted 13 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +0
-1@@ -3,7 +3,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-smsc9512.dtsi" #include "bcm283x-rpi-usb-host.dtsi"
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts &hdmi { · line 99
Quoted 10 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +5
-2@@ -93,8 +92,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +/ { + leds { + compatible = "gpio-leds"; + + led-act {
[Severity: Medium]
Does dropping the leds: and led_act: node labels here remove those symbols from /__symbols__ in the compiled DTB?
arch/arm/boot/dts/broadcom/Makefile builds bcm2835-rpi-b.dtb with -@ for device-tree overlay support, and bcm283x-rpi-led-deprecated.dtsi defined
leds: leds and led_act: led-act. Omitting both labels removes leds and led_act from /__symbols__, breaking overlays and bootloader dtparam fixups that target &leds or &led_act.
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts &hdmi { · line 106
Quoted 7 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +6
-0+ label = "ACT"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; };
[Severity: Low]
Why inline bcm283x-rpi-led-deprecated.dtsi into bcm2835-rpi-b.dts while keeping the deprecated label = "ACT" property?
Commit 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi") moved this node into bcm283x-rpi-led-deprecated.dtsi specifically so existing boards could preserve the legacy /sys/class/leds/ACT userspace ABI in one shared fragment without new boards inheriting the deprecated gpio-leds label property. Open-coding the same definition here also introduces a second / { ... }; root node block in the middle of the board's phandle overrides.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
v2 cover ARM: dts: bcm2835: replace deprecated LED fragment
In reply to Artem NovakThe Raspberry Pi Zero and Model B device trees include the deprecated bcm283x-rpi-led-deprecated.dtsi fragment to define their ACT LEDs.
Replace the fragment with board-local gpio-leds nodes, preserving the existing GPIO assignments, polarity, default state, and heartbeat trigger.
Restore the leds and led_act labels to preserve the device tree symbols used by overlays.
Changes in v2:
Restore the leds and led_act labels on both boards to preserve overlay compatibility.
&
Add commit descriptions explaining the purpose of the changes.
Artem Novak (2):
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi
Zero
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi
Model B
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts | 14 +++++++++++--- arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-)
Signature · 1 line
2.56.1
PATCH v2 1/2 ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Zero
Preserve the leds and led_act labels when replacing the deprecated LED fragment with a board-local gpio-leds node.
These labels are exported as device tree symbols and may be referenced by overlays.
--- arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +11 -3
@@ -7,7 +7,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-usb-otg.dtsi" / {
@@ -101,8 +100,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; +/ { + leds: leds { + compatible = "gpio-leds"; + + led_act: led-act { + label = "ACT"; + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; }; &sdhost {
Signature · 1 line
2.56.1
[email protected]
AI reviewRe: [PATCH v2 1/2] ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Zero
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ARM: dts: bcm2835: redundant inlining of bcm283x-rpi-led-deprecated.dtsi --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] ARM: dts: bcm2835: redundant inlining of bcm283x-rpi-led-deprecated.dtsi
--
commit 6102946db777d06293b2fcb5e3eab012124a2da6
Author: Artem Novak <[email protected]>
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Zero
This commit replaces the bcm283x-rpi-led-deprecated.dtsi include in bcm2835-rpi-zero.dts with an inline gpio-leds node.
Quoted 20 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +2
-3@@ -7,7 +7,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-usb-otg.dtsi" / {@@ -101,8 +100,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; +/ { + leds: leds {
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts &hdmi { · line 114
Quoted 10 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-zero.dts +9
-0+ compatible = "gpio-leds"; + + led_act: led-act { + label = "ACT"; + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; };
[Severity: Low]
Why inline bcm283x-rpi-led-deprecated.dtsi here?
Commit 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi") factored the legacy leds and led_act node into bcm283x-rpi-led-deprecated.dtsi so existing Raspberry Pi boards could share the deprecated label = "ACT" property (needed to preserve /sys/class/leds/ACT for userspace) without new boards inheriting it from bcm2835-rpi.dtsi.
Open-coding the same node in bcm2835-rpi-zero.dts retains the deprecated label = "ACT" property while duplicating the shared fragment used by the other Raspberry Pi boards, and introduces a second / { ... }; root node block in the middle of the phandle overrides.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v2 2/2 ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Model B
In reply to Artem NovakPreserve the leds and led_act labels when replacing the deprecated LED fragment with a board-local gpio-leds node.
These labels are exported as device tree symbols and may be referenced by overlays.
--- arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +11 -3
@@ -3,7 +3,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-smsc9512.dtsi" #include "bcm283x-rpi-usb-host.dtsi"
@@ -93,8 +92,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +/ { + leds: leds { + compatible = "gpio-leds"; + + led_act: led-act { + label = "ACT"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; }; &pwm {
Signature · 1 line
2.56.1
[email protected]
AI reviewRe: [PATCH v2 2/2] ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Model B
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ARM: dts: bcm2835: inlining deprecated LED dtsi duplicates legacy label node --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] ARM: dts: bcm2835: inlining deprecated LED dtsi duplicates legacy label node
--
commit 63b377a339b5c423a1e61107aa45808a3f4ef120
Author: Artem Novak <[email protected]>
ARM: dts: bcm2835: replace deprecated LED fragment on Raspberry Pi Model B
This commit replaces the bcm283x-rpi-led-deprecated.dtsi include in bcm2835-rpi-b.dts with an inline gpio-leds node defining the ACT LED.
Quoted 22 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +4
-3@@ -3,7 +3,6 @@ #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" #include "bcm2835-rpi-common.dtsi" -#include "bcm283x-rpi-led-deprecated.dtsi" #include "bcm283x-rpi-smsc9512.dtsi" #include "bcm283x-rpi-usb-host.dtsi"@@ -93,8 +92,17 @@ &hdmi { status = "okay"; }; -&led_act { - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; +/ { + leds: leds { + compatible = "gpio-leds"; +
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts &hdmi { · line 108
Quoted 10 lines
arch/arm/boot/dts/broadcom/bcm2835-rpi-b.dts +7
-0+ led_act: led-act { + label = "ACT"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + default-state = "keep"; + linux,default-trigger = "heartbeat"; + }; + }; }; &pwm {
[Severity: Low]
Why inline bcm283x-rpi-led-deprecated.dtsi back into bcm2835-rpi-b.dts while keeping the deprecated label = "ACT" property?
Commit 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi") factored this node out into bcm283x-rpi-led-deprecated.dtsi specifically so existing Raspberry Pi boards can share the legacy label definition (Needed to preserve the /sys/class/leds/ACT userspace ABI) without duplicating it in every board file. Replacing the shared include with an open-coded copy produces an identical DTB while reverting that consolidation and adding a second root node block (/ { ... };) in the middle of the phandle overrides.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2