commit 0535e46d55d ("scripts/dtc: Update to upstream version 
v1.7.2-35-g52f07dcca47c"),
causes i.MX9 SCMI based platforms boot failure.
SPL panic in fdt_check_node_offset_()->fdt_next_tag(), because offset is -1
and SPL_OF_LIBFDT_ASSUME_MASK is 0xFF.

fdt_check_node_offset_()
       |->fdt_next_tag()
             |->tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);  #tagp is NULL
                    |->tag = fdt32_to_cpu(*tagp);                 #panic here

In [1], Ye report the issue, but per Tom:
"In SPL we must assume a perfect device tree has been passed to us, both
for design reasons (it's not a user interactively, we built it, or it
came from some other firmware stack) as well as practical (performing
the sanity tests would grow all platforms by several kilobytes and
overflow size constraints). I think the SCMI code needs to be reworked,
in short"

So we need to add a check in scmi transport driver, also need to 
add a check in dev_power_domain_ctrl and iommu. Similar to the check in
pinctrl_select_state and the check before call into clk_set_defaults,
if ofnode is not valid, directly bypass. With this change, we could
still keep SPL_OF_LIBFDT_ASSUME_MASK as 0xFF.

https://lore.kernel.org/u-boot/20260207141750.GB2603314@bill-the-cat/

Signed-off-by: Peng Fan <[email protected]>
---
Peng Fan (3):
      firmware: scmi: Validate device tree node before setup channel
      power: domain: Validate device tree node in dev_power_domain_ctrl
      iommu: Validate device tree node in dev_iommu_enable

 drivers/firmware/scmi/mailbox_agent.c      | 2 +-
 drivers/firmware/scmi/optee_agent.c        | 3 ++-
 drivers/iommu/iommu-uclass.c               | 3 +++
 drivers/power/domain/power-domain-uclass.c | 3 +++
 4 files changed, 9 insertions(+), 2 deletions(-)
---
base-commit: b99da05e1538b8fa153322da82917af2aa27e1d6
change-id: 20260210-scmi-fix-8f8ae5f6abce

Best regards,
-- 
Peng Fan <[email protected]>

Reply via email to