[PATCH] arm64: dts: marvell: uDPU: define pinctrl state for alarm LEDs
Gabor Juhos
j4g8y7 at gmail.com
Fri May 9 06:48:52 PDT 2025
The two alarm LEDs of on the uDPU board are stopped working since
commit 78efa53e715e ("leds: Init leds class earlier").
The LEDs are driven by the GPIO{15,16} pins of the North Bridge
GPIO controller. These pins are part of the 'spi_quad' pin group
for which the 'spi' function is selected via the default pinctrl
state of the 'spi' node. This is wrong however, since in order to
allow controlling the LEDs, the pins should use the 'gpio' function.
Before the commit mentined above, the 'spi' function is selected
first by the pinctrl core before probing the spi driver, but then
it gets overridden to 'gpio' implicitly via the
devm_gpiod_get_index_optional() call from the 'leds-gpio' driver.
After the commit, the LED subsystem gets initialized before the
SPI subsystem, so the function of the pin group remains 'spi'
which in turn prevents controlling of the LEDs.
Despite the change of the initialization order, the root cause is
that the pinctrl state definition is wrong since its initial commit
0d45062cfc89 ("arm64: dts: marvell: Add device tree for uDPU board"),
To fix the problem, override the function in the 'spi_quad_pins'
node to 'gpio' and move the pinctrl state definition from the
'spi' node into the 'leds' node.
Cc: stable at vger.kernel.org # needs adjustment for < 6.1
Fixes: 0d45062cfc89 ("arm64: dts: marvell: Add device tree for uDPU board")
Signed-off-by: Gabor Juhos <j4g8y7 at gmail.com>
Signed-off-by: Imre Kaloz <kaloz at openwrt.org>
---
Notes:
1. DTB check shows a bunch of warnings, but none of those are new:
DTC [C] arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/watchdog at 8300: failed to match any schema with compatible: ['marvell,armada-3700-wdt']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/serial at 12000: failed to match any schema with compatible: ['marvell,armada-3700-uart']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/serial at 12200: failed to match any schema with compatible: ['marvell,armada-3700-uart-ext']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/nb-periph-clk at 13000: failed to match any schema with compatible: ['marvell,armada-3700-periph-clock-nb', 'syscon']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/sb-periph-clk at 18000: failed to match any schema with compatible: ['marvell,armada-3700-periph-clock-sb']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/tbg at 13200: failed to match any schema with compatible: ['marvell,armada-3700-tbg-clock']
<...>/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: pinctrl at 13800: reg: [[79872, 256], [80896, 32]] is too long
from schema $id: http://devicetree.org/schemas/mfd/syscon-common.yaml#
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/pinctrl at 13800: failed to match any schema with compatible: ['marvell,armada3710-nb-pinctrl', 'syscon', 'simple-mfd']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/pinctrl at 13800/xtal-clk: failed to match any schema with compatible: ['marvell,armada-3700-xtal-clock']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/phy at 18300: failed to match any schema with compatible: ['marvell,comphy-a3700']
<...>/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: pinctrl at 18800: reg: [[100352, 256], [101376, 32]] is too long
from schema $id: http://devicetree.org/schemas/mfd/syscon-common.yaml#
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/pinctrl at 18800: failed to match any schema with compatible: ['marvell,armada3710-sb-pinctrl', 'syscon', 'simple-mfd']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/ethernet at 30000: failed to match any schema with compatible: ['marvell,armada-3700-neta']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/ethernet at 40000: failed to match any schema with compatible: ['marvell,armada-3700-neta']
<...>/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: usb at 58000: Unevaluated properties are not allowed ('marvell,usb-misc-reg' was unexpected)
from schema $id: http://devicetree.org/schemas/usb/generic-xhci.yaml#
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/system-controller at 5d800: failed to match any schema with compatible: ['marvell,armada-3700-usb2-host-device-misc', 'syscon']
<...>/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: usb at 5e000: phy-names:0: 'usb' was expected
from schema $id: http://devicetree.org/schemas/usb/generic-ehci.yaml#
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/xor at 60900: failed to match any schema with compatible: ['marvell,armada-3700-xor']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/bus at d0000000/mailbox at b0000: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-mailbox']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /soc/pcie at d0070000: failed to match any schema with compatible: ['marvell,armada-3700-pcie']
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
2. Just for the record, here is the bisect log:
git bisect start
# status: waiting for both good and bad commits
# bad: [7cdabafc001202de9984f22c973305f424e0a8b7] Merge tag 'trace-v6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
git bisect bad 7cdabafc001202de9984f22c973305f424e0a8b7
# status: waiting for good commit(s), bad commit known
# good: [0c3836482481200ead7b416ca80c68a29cfdaabd] Linux 6.10
git bisect good 0c3836482481200ead7b416ca80c68a29cfdaabd
# bad: [fcc79e1714e8c2b8e216dc3149812edd37884eef] Merge tag 'net-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
git bisect bad fcc79e1714e8c2b8e216dc3149812edd37884eef
# good: [26bb0d3f38a764b743a3ad5c8b6e5b5044d7ceb4] Merge tag 'for-6.12/block-20240913' of git://git.kernel.dk/linux
git bisect good 26bb0d3f38a764b743a3ad5c8b6e5b5044d7ceb4
# bad: [5e5466433d266046790c0af40a15af0a6be139a1] Merge tag 'char-misc-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
git bisect bad 5e5466433d266046790c0af40a15af0a6be139a1
# good: [de848da12f752170c2ebe114804a985314fd5a6a] Merge tag 'drm-next-2024-09-19' of https://gitlab.freedesktop.org/drm/kernel
git bisect good de848da12f752170c2ebe114804a985314fd5a6a
# bad: [962ad08780a5bfb3240bc793e565181eacfceafb] Merge tag 'pinctrl-v6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
git bisect bad 962ad08780a5bfb3240bc793e565181eacfceafb
# good: [440b65232829fad69947b8de983c13a525cc8871] Merge tag 'bpf-next-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
git bisect good 440b65232829fad69947b8de983c13a525cc8871
# good: [f8ffbc365f703d74ecca8ca787318d05bbee2bf7] Merge tag 'pull-stable-struct_fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
git bisect good f8ffbc365f703d74ecca8ca787318d05bbee2bf7
# good: [18ba6034468e7949a9e2c2cf28e2e123b4fe7a50] Merge tag 'nfsd-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
git bisect good 18ba6034468e7949a9e2c2cf28e2e123b4fe7a50
# bad: [bb78146c18ac67f22cabb2448b501bcac30f8801] Merge branch 'pci/controller/xilinx'
git bisect bad bb78146c18ac67f22cabb2448b501bcac30f8801
# bad: [b893f8ea38c530c2c8a337c3429f9f37e6bf65e8] Merge branch 'pci/controller/brcmstb'
git bisect bad b893f8ea38c530c2c8a337c3429f9f37e6bf65e8
# bad: [207bcb73fb08841e242fa1d66e1d0381836da562] Merge branch 'pci/dt-bindings'
git bisect bad 207bcb73fb08841e242fa1d66e1d0381836da562
# good: [e642aa6b38762a2af3a7e0c5e6dac5841c15dea0] Merge branch 'pci/iommu'
git bisect good e642aa6b38762a2af3a7e0c5e6dac5841c15dea0
# good: [f500a2f1282750fb344ce535d78071cf1493efd1] dt-bindings: PCI: imx6q-pcie: Add reg-name "dbi2" and "atu" for i.MX8M PCIe Endpoint
git bisect good f500a2f1282750fb344ce535d78071cf1493efd1
# bad: [d774674f3492740503a3cd3f5da131d088202f1b] Merge branch 'pci/pwrctl'
git bisect bad d774674f3492740503a3cd3f5da131d088202f1b
# bad: [759ec28242894f2006a1606c1d6e9aca48cecfcf] PCI/NPEM: Add _DSM PCIe SSD status LED management
git bisect bad 759ec28242894f2006a1606c1d6e9aca48cecfcf
# bad: [4e893545ef8712d25f3176790ebb95beb073637e] PCI/NPEM: Add Native PCIe Enclosure Management support
git bisect bad 4e893545ef8712d25f3176790ebb95beb073637e
# bad: [78efa53e715e21a97c722dba20f8437a0860521e] leds: Init leds class earlier
git bisect bad 78efa53e715e21a97c722dba20f8437a0860521e
# first bad commit: [78efa53e715e21a97c722dba20f8437a0860521e] leds: Init leds class earlier
---
arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtsi | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtsi b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtsi
index 3a9b6907185d0363dff41178543a0210ce99dbf7..24282084570787630cb0beeab3997b943bdf45dc 100644
--- a/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtsi
@@ -26,6 +26,8 @@ memory at 0 {
leds {
compatible = "gpio-leds";
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_quad_pins>;
led-power1 {
label = "udpu:green:power";
@@ -82,8 +84,6 @@ &sdhci0 {
&spi0 {
status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&spi_quad_pins>;
flash at 0 {
compatible = "jedec,spi-nor";
@@ -108,6 +108,10 @@ partition at 180000 {
};
};
+&spi_quad_pins {
+ function = "gpio";
+};
+
&pinctrl_nb {
i2c2_recovery_pins: i2c2-recovery-pins {
groups = "i2c2";
---
base-commit: 92a09c47464d040866cf2b4cd052bc60555185fb
change-id: 20250509-udpu-alarm-led-fix-62828f7e11eb
Best regards,
--
Gabor Juhos <j4g8y7 at gmail.com>
More information about the linux-arm-kernel
mailing list