barebox now compiles an initially empty device tree that's combined with
the device tree passed by Qemu. That device tree can hold the FIT public
key or if CONFIG_EXTERNAL_DTS_FRAGMENTS is enabled, device tree nodes
passed at build time. If this device tree fragment adds an alias, it
won't be registered, which can be surprising. Therefore call
of_alias_scan after merging the device trees.

Fixes: 484a0d281408 ("boards: qemu-virt: support passing in FIT public key")
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 common/boards/qemu-virt/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/boards/qemu-virt/board.c b/common/boards/qemu-virt/board.c
index b9df129834d9..4f2f7374c56a 100644
--- a/common/boards/qemu-virt/board.c
+++ b/common/boards/qemu-virt/board.c
@@ -80,6 +80,9 @@ static int virt_board_driver_init(void)
        pubkey = of_unflatten_dtb(__dtb_fitimage_pubkey_start, INT_MAX);
        of_merge_nodes(root, pubkey);
 
+       /* fragment may have added aliases to the DT */
+       of_alias_scan();
+
        /* of_probe() will happen later at of_populate_initcall */
 
        return 0;
-- 
2.39.2


Reply via email to