All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/arm/raspi4b: NOP all DTB nodes when removing unimplemented devices
@ 2026-04-20 16:21 Osama Abdelkader
  2026-04-27  9:53 ` Peter Maydell
  0 siblings, 1 reply; 4+ messages in thread
From: Osama Abdelkader @ 2026-04-20 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Osama Abdelkader, Peter Maydell, open list:ARM TCG CPUs

fdt_node_offset_by_compatible(fdt, -1, compat) only finds the first match.
If the blob has more than one node with the same compatible string, extra
nodes will remain active. using the same loop as imx8mp-evk.c

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 hw/arm/raspi4b.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/arm/raspi4b.c b/hw/arm/raspi4b.c
index 3eeb8f447e..06aeb8db01 100644
--- a/hw/arm/raspi4b.c
+++ b/hw/arm/raspi4b.c
@@ -72,12 +72,14 @@ static void raspi4_modify_dtb(const struct arm_boot_info *info, void *fdt)
 
     for (int i = 0; i < ARRAY_SIZE(nodes_to_remove); i++) {
         const char *dev_str = nodes_to_remove[i];
+        int offset;
 
-        int offset = fdt_node_offset_by_compatible(fdt, -1, dev_str);
-        if (offset >= 0) {
-            if (!fdt_nop_node(fdt, offset)) {
-                warn_report("bcm2711 dtc: %s has been disabled!", dev_str);
+        offset = fdt_node_offset_by_compatible(fdt, -1, dev_str);
+        while (offset >= 0) {
+            if (fdt_nop_node(fdt, offset) == 0) {
+                warn_report("bcm2711 dtb: %s has been disabled!", dev_str);
             }
+            offset = fdt_node_offset_by_compatible(fdt, offset, dev_str);
         }
     }
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-28 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 16:21 [PATCH] hw/arm/raspi4b: NOP all DTB nodes when removing unimplemented devices Osama Abdelkader
2026-04-27  9:53 ` Peter Maydell
2026-04-27 11:07   ` Philippe Mathieu-Daudé
2026-04-28 17:14     ` Osama Abdelkader

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.