Skip to content

[qcom-next] WORKAROUND: Use kernel device tree fixup for reserved memory regions#66

Open
balajiselvanathan wants to merge 1 commit into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:reserved_mem_correct_qn
Open

[qcom-next] WORKAROUND: Use kernel device tree fixup for reserved memory regions#66
balajiselvanathan wants to merge 1 commit into
qualcomm-linux:qcom-nextfrom
balajiselvanathan:reserved_mem_correct_qn

Conversation

@balajiselvanathan
Copy link
Copy Markdown

The current approach of updating the EFI memory map does not work for FIT-based kernel images. Replace it with kernel device tree fixup in ft_board_setup() to handle reserved memory regions.

Reserved memory nodes from U-Boot device tree are now copied to the kernel device tree during boot, ensuring proper memory protection. Regions already present in the kernel device tree are skipped to avoid duplication.

This fixup applies only to Talos and Kodiak platforms.

@balajiselvanathan balajiselvanathan changed the title WORKAROUND: Use kernel device tree fixup for reserved memory regions [qcom-next] WORKAROUND: Use kernel device tree fixup for reserved memory regions May 19, 2026
Comment thread arch/arm/mach-snapdragon/of_fixup.c Outdated
if (fdt_node_check_compatible(gd->fdt_blob, 0, "qcom,talos-evk") != 0 &&
fdt_node_check_compatible(gd->fdt_blob, 0, "qcom,qcs615") != 0 &&
fdt_node_check_compatible(gd->fdt_blob, 0, "qcom,qcs6490-rb3gen2") != 0 &&
fdt_node_check_compatible(gd->fdt_blob, 0, "qcom,qcm6490") != 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather use APIs: of_* here, see usage above in this file. Ditto for all other places below.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Comment thread arch/arm/mach-snapdragon/of_fixup.c Outdated
@@ -283,5 +283,116 @@ EVENT_SPY_FULL(EVT_OF_LIVE_BUILT, qcom_of_fixup_nodes);

int ft_board_setup(void __maybe_unused *blob, struct bd_info __maybe_unused *bd)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can drop __maybe_unused for the blob here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Comment thread arch/arm/mach-snapdragon/of_fixup.c Outdated
if (uboot_parent < 0)
return 0;

/* Find or create kernel's reserved-memory node */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is a case of reserved-memory nodes not being present in kernel DT already. So we should just skip the create part here.

The idea is to keep these workaround patches minimal such that they are easy to carry forward.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

The current approach of updating the EFI memory map does not work
for FIT-based kernel images. Replace it with kernel device tree
fixup in ft_board_setup() to handle reserved memory regions.

Reserved memory nodes from U-Boot device tree are now copied to
the kernel device tree during boot, ensuring proper memory
protection. Regions already present in the kernel device tree are
skipped to avoid duplication.

This fixup applies only to Talos and Kodiak platforms.

Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
@balajiselvanathan balajiselvanathan force-pushed the reserved_mem_correct_qn branch from 1ed8754 to 6a1defe Compare May 25, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants