[PATCH v4 3/7] um: Unconditionally call unflatten_device_tree()

2024-02-16 Thread Stephen Boyd
Call this function unconditionally so that we can populate an empty DTB on platforms that don't boot with a command line provided DTB. There's no harm in calling unflatten_device_tree() unconditionally. If there isn't a valid initial_boot_params dtb then unflatten_device_tree() returns early. Cc:

[PATCH v4 7/7] of: Add KUnit test to confirm DTB is loaded

2024-02-16 Thread Stephen Boyd
Add a KUnit test that confirms a DTB has been loaded, i.e. there is a root node, and that the of_have_populated_dt() API works properly. We skip the test when CONFIG_OF_EARLY_FLATREE=n because in that case we know architecture code hasn't called unflatten_(and_copy_)?device_tree() which would popul

[PATCH v4 0/7] of: populate of_root node if bootloader doesn't

2024-02-16 Thread Stephen Boyd
Arch maintainers, please ack/review patches. This is a resend of a series from Frank last year[1]. I worked in Rob's review comments to unconditionally call unflatten_device_tree() and fixup/audit calls to of_have_populated_dt() so that behavior doesn't change. I need this series so I can add DT

[PATCH v4 5/7] arm64: Unconditionally call unflatten_device_tree()

2024-02-16 Thread Stephen Boyd
Call this function unconditionally so that we can populate an empty DTB on platforms that don't boot with a firmware provided or builtin DTB. When ACPI is in use, unflatten_device_tree() ignores the 'initial_boot_params' pointer so the live DT on those systems won't be whatever that's pointing to.

[PATCH v4 4/7] x86/of: Unconditionally call unflatten_and_copy_device_tree()

2024-02-16 Thread Stephen Boyd
Call this function unconditionally so that we can populate an empty DTB on platforms that don't boot with a firmware provided or builtin DTB. There's no harm in calling unflatten_device_tree() unconditionally here. If there isn't a non-NULL 'initial_boot_params' pointer then unflatten_device_tree()

[PATCH v4 6/7] of: unittest: treat missing of_root as error instead of fixing up

2024-02-16 Thread Stephen Boyd
From: Frank Rowand unflatten_device_tree() now ensures that the 'of_root' node is populated with the root of a default empty devicetree. Remove the unittest code that created 'of_root' if it was missing. Verify that 'of_root' is valid before attempting to attach the testcase-data subtree. Remove

[PATCH v4 1/7] of: Always unflatten in unflatten_and_copy_device_tree()

2024-02-16 Thread Stephen Boyd
We want to populate an empty DT whenever CONFIG_OF is enabled so that overlays can be applied and the DT unit tests can be run. Make unflatten_and_copy_device_tree() stop printing a warning if the 'initial_boot_params' pointer is NULL. Instead, simply copy the dtb if there is one and then unflatten

[PATCH v4 2/7] of: Create of_root if no dtb provided by firmware

2024-02-16 Thread Stephen Boyd
From: Frank Rowand When enabling CONFIG_OF on a platform where 'of_root' is not populated by firmware, we end up without a root node. In order to apply overlays and create subnodes of the root node, we need one. Create this root node by unflattening an empty builtin dtb. If firmware provides a f