Skip to contentSkip to conversation

arm/arm64: dts: Enable device-tree overlay support for RPi devices

PATCH RESEND In review Aurelien Jarno 4 participants 8 messages Apr 27, 2022 – Jun 27, 2023

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

cover arm/arm64: dts: Enable device-tree overlay support for RPi devices

This patchset changes the generation of the Raspberry Pi devices DTB files to improve the support for out-of-tree device-tree overlays, like it has recently been done for the Nvidia SoCs.

I personally only need that for arm64, but I have added a similar patch to do the same on arm.

Aurelien Jarno (2):
arm64: dts: broadcom: Enable device-tree overlay support for RPi
devices
arm: dts: Enable device-tree overlay support for RPi devices

 arch/arm/boot/dts/Makefile            | 18 ++++++++++++++++++
 arch/arm64/boot/dts/broadcom/Makefile | 11 +++++++++++
 2 files changed, 29 insertions(+)
Signature · 1 line
2.35.1
#1 lore raw

PATCH RESEND 1/2 arm64: dts: broadcom: Enable device-tree overlay support for RPi devices

Add the '-@' DTC option for the Raspberry Pi devices. This option populates the '__symbols__' node that contains all the necessary symbols for supporting device-tree overlays (for instance from the firmware or the bootloader) on these devices.

The Rasbperry Pi devices are well known for their GPIO header, that allow various "HATs" or other modules do be connected and this enables users to create out-of-tree device-tree overlays for these modules.

Please note that this change does increase the size of the resulting DTB by ~40%. For example, with v5.17 increase in size is as follows:

  bcm2711-rpi-400.dtb       26481 -> 36830 bytes
  bcm2711-rpi-4-b.dtb       26537 -> 36886 bytes
  bcm2711-rpi-cm4-io.dtb    26426 -> 36945 bytes
  bcm2837-rpi-3-a-plus.dtb  14133 -> 19740 bytes
  bcm2837-rpi-3-b.dtb       14310 -> 20006 bytes
  bcm2837-rpi-3-b-plus.dtb  14670 -> 20474 bytes
  bcm2837-rpi-cm3-io3.dtb   13680 -> 19266 bytes
---
 arch/arm64/boot/dts/broadcom/Makefile | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/broadcom/Makefile +11 -0
index 5082fcd1fea5..0aa8ee2afdd5 100644
@@ -1,4 +1,15 @@
 # SPDX-License-Identifier: GPL-2.0
+
+# Enables support for device-tree overlays
+DTC_FLAGS_bcm2711-rpi-400 := -@
+DTC_FLAGS_bcm2711-rpi-4-b := -@
+DTC_FLAGS_bcm2711-rpi-cm4-io := -@
+DTC_FLAGS_bcm2837-rpi-3-a-plus := -@
+DTC_FLAGS_bcm2837-rpi-3-b := -@
+DTC_FLAGS_bcm2837-rpi-3-b-plus := -@
+DTC_FLAGS_bcm2837-rpi-cm3-io3 := -@
+DTC_FLAGS_bcm2837-rpi-zero-2-w := -@
+
 dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
 			      bcm2711-rpi-4-b.dtb \
 			      bcm2711-rpi-cm4-io.dtb \
Signature · 1 line
2.35.1
#2 lore raw

PATCH RESEND 2/2 arm: dts: Enable device-tree overlay support for RPi devices

In reply to Aurelien Jarno

Add the '-@' DTC option for the Raspberry Pi devices. This option populates the '__symbols__' node that contains all the necessary symbols for supporting device-tree overlays (for instance from the firmware or the bootloader) on these devices.

The Rasbperry Pi devices are well known for their GPIO header, that allow various "HATs" or other modules do be connected and this enables users to create out-of-tree device-tree overlays for these modules.

Please note that this change does increase the size of the resulting DTB by ~40%. For example, with v5.17 increase in size is as follows:

  bcm2711-rpi-400.dtb       26481 -> 36830 bytes
  bcm2711-rpi-4-b.dtb       26537 -> 36886 bytes
  bcm2711-rpi-cm4-io.dtb    26426 -> 36945 bytes
  bcm2835-rpi-a.dtb         12641 -> 17852 bytes
  bcm2835-rpi-a-plus.dtb    12765 -> 17976 bytes
  bcm2835-rpi-b.dtb         12763 -> 17998 bytes
  bcm2835-rpi-b-plus.dtb    12979 -> 18263 bytes
  bcm2835-rpi-b-rev2.dtb    12847 -> 18131 bytes
  bcm2835-rpi-cm1-io1.dtb   12839 -> 18113 bytes
  bcm2835-rpi-zero.dtb      12681 -> 17924 bytes
  bcm2835-rpi-zero-w.dtb    13135 -> 18430 bytes
  bcm2836-rpi-2-b.dtb       13687 -> 19255 bytes
  bcm2837-rpi-3-a-plus.dtb  14133 -> 19740 bytes
  bcm2837-rpi-3-b.dtb       14310 -> 20006 bytes
  bcm2837-rpi-3-b-plus.dtb  14670 -> 20474 bytes
  bcm2837-rpi-cm3-io3.dtb   13680 -> 19266 bytes
---
 arch/arm/boot/dts/Makefile | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/boot/dts/Makefile +18 -0
index 7c16f8a2b738..85644149de44 100644
@@ -81,6 +81,24 @@ dtb-$(CONFIG_SOC_SAMA7G5) += \
 	at91-sama7g5ek.dtb
 dtb-$(CONFIG_ARCH_AXXIA) += \
 	axm5516-amarillo.dtb
+# Enables support for device-tree overlays
+DTC_FLAGS_bcm2835-rpi-b := -@
+DTC_FLAGS_bcm2835-rpi-a := -@
+DTC_FLAGS_bcm2835-rpi-b-rev2 := -@
+DTC_FLAGS_bcm2835-rpi-b-plus := -@
+DTC_FLAGS_bcm2835-rpi-a-plus := -@
+DTC_FLAGS_bcm2835-rpi-cm1-io1 := -@
+DTC_FLAGS_bcm2836-rpi-2-b := -@
+DTC_FLAGS_bcm2837-rpi-3-a-plus := -@
+DTC_FLAGS_bcm2837-rpi-3-b := -@
+DTC_FLAGS_bcm2837-rpi-3-b-plus := -@
+DTC_FLAGS_bcm2837-rpi-cm3-io3 := -@
+DTC_FLAGS_bcm2837-rpi-zero-2-w := -@
+DTC_FLAGS_bcm2711-rpi-400 := -@
+DTC_FLAGS_bcm2711-rpi-4-b := -@
+DTC_FLAGS_bcm2711-rpi-cm4-io := -@
+DTC_FLAGS_bcm2835-rpi-zero := -@
+DTC_FLAGS_bcm2835-rpi-zero-w := -@
 dtb-$(CONFIG_ARCH_BCM2835) += \
 	bcm2835-rpi-b.dtb \
 	bcm2835-rpi-a.dtb \
Signature · 1 line
2.35.1
#3 lore raw
In reply to Aurelien Jarno
Quoted 6 lines · Aurelien Jarno

This patchset changes the generation of the Raspberry Pi devices DTB files to improve the support for out-of-tree device-tree overlays, like it has recently been done for the Nvidia SoCs.

I personally only need that for arm64, but I have added a similar patch to do the same on arm.

This looks good to me, Rob, does that approach work for you?

Signature · 1 line
Florian
#4 lore raw
Quoted 11 lines · Florian Fainelli
Quoted 6 lines · Aurelien Jarno

This patchset changes the generation of the Raspberry Pi devices DTB files to improve the support for out-of-tree device-tree overlays, like it has recently been done for the Nvidia SoCs.

I personally only need that for arm64, but I have added a similar patch to do the same on arm.

This looks good to me, Rob, does that approach work for you?

Any news about that?

Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net
#5 lore raw
In reply to Florian Fainelli
Quoted 9 lines · Florian Fainelli
Quoted 6 lines · Aurelien Jarno

This patchset changes the generation of the Raspberry Pi devices DTB
files to improve the support for out-of-tree device-tree overlays, like
it has recently been done for the Nvidia SoCs.

Quoted 5 lines
Quoted 3 lines

I personally only need that for arm64, but I have added a similar patch
to do the same on arm.

This looks good to me, Rob, does that approach work for you?

Since May 2023 this patch is integrated into the Debian kernel build [1]. However it would be better if we could integrate it into the kernel directly. Is there anything blocking? For me, the patch looks fine. Similar patches for Nvidia boards also already got integrated [2].

If there is no general objection against enabling the overlays, I plan to send patches for the sun8i-h3 arm boards as well.

Best regards,
Felix Moessbauer
Siemens AG

[1]
https://salsa.debian.org/kernel-team/linux/-/commit/fae42149fd0a37c68a496efbbb11f1dac484a163
[2]
https://lore.kernel.org/all/[email protected]/T/

#6 lore raw

Hi Felix,

Am 27.06.23 um 03:56 schrieb Moessbauer Felix:

Quoted 16 lines · Florian Fainelli
Quoted 9 lines · Aurelien Jarno
Quoted 6 lines

This patchset changes the generation of the Raspberry Pi devices DTB
files to improve the support for out-of-tree device-tree overlays, like
it has recently been done for the Nvidia SoCs.

Quoted 5 lines
Quoted 3 lines

I personally only need that for arm64, but I have added a similar patch
to do the same on arm.

This looks good to me, Rob, does that approach work for you?

Quoted 8 lines

Since May 2023 this patch is integrated into the Debian kernel build [1]. However it would be better if we could integrate it into the kernel directly. Is there anything blocking? For me, the patch looks fine. Similar patches for Nvidia boards also already got integrated [2].

If there is no general objection against enabling the overlays, I plan to send patches for the sun8i-h3 arm boards as well.

this series has been resubmitted recently and applied. Could you please check current linux-next?

Best regards

Quoted 9 lines

Best regards,
Felix Moessbauer
Siemens AG

[1]
https://salsa.debian.org/kernel-team/linux/-/commit/fae42149fd0a37c68a496efbbb11f1dac484a163
[2]
https://lore.kernel.org/all/[email protected]/T/

#7 lore raw
Quoted 30 lines · Stefan Wahren

Hi Felix,

Am 27.06.23 um 03:56 schrieb Moessbauer Felix:

Quoted 27 lines · Florian Fainelli
Quoted 11 lines · Aurelien Jarno
Quoted 8 lines

This patchset changes the generation of the Raspberry Pi devices
DTB
files to improve the support for out-of-tree device-tree overlays,
like
it has recently been done for the Nvidia SoCs.

Quoted 6 lines
Quoted 4 lines

I personally only need that for arm64, but I have added a similar
patch
to do the same on arm.

This looks good to me, Rob, does that approach work for you?

Since May 2023 this patch is integrated into the Debian kernel build
[1]. However it would be better if we could integrate it into the kernel directly. Is there anything blocking? For me, the patch looks
fine. Similar patches for Nvidia boards also already got integrated [2].

Quoted 7 lines
Quoted 3 lines

If there is no general objection against enabling the overlays, I plan
to send patches for the sun8i-h3 arm boards as well.

this series has been resubmitted recently and applied. Could you please
check current linux-next?

Thanks for the quick response. That was indeed a very recent change (not yet in a release) which I missed.

Then I'll send the patches for the sun8i-h3-*pi*.dts by end of today.

Felix

Quoted 12 lines

Best regards

Quoted 9 lines

Best regards,
Felix Moessbauer
Siemens AG

[1]
https://salsa.debian.org/kernel-team/linux/-/commit/fae42149fd0a37c68a496efbbb11f1dac484a163
[2]
https://lore.kernel.org/all/[email protected]/T/