mach-snapdragon: support parsing memory info from external FDT
authorSam Day <me@samcday.com>
Thu, 23 Jan 2025 12:12:14 +0000 (12:12 +0000)
committerCaleb Connolly <caleb.connolly@linaro.org>
Mon, 17 Mar 2025 13:38:18 +0000 (13:38 +0000)
commit11ff5a57e2fb82c8a8cef3aa8d2727452c282815
treef329353a49f1b73f7c66693c3f48a99d40c63f65
parent2babb61428dcb55067a81f88bbc2124924807345
mach-snapdragon: support parsing memory info from external FDT

qcom_parse_memory is updated to return a -ENODATA error if the passed
FDT does not contain a /memory node, or that node is incomplete (size=0)

board_fdt_blob_setup first tries to call qcom_parse_memory with the
internal FDT (if present+valid). If that fails, it tries again with the
external FDT (again, if present+valid).

When booting with an internal FDT from upstream, it's likely that this
change results in a slight performance hit, since virtually all upstream
qcom DTs lack a fully specified memory node. The impact should be
negligible, though.

qcom_parse_memory was given a detailed docstring adapted from Caleb's
original commit message that introduced the function.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250123-qcom-parse-memory-updates-v3-1-c5332b81ea9f@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
arch/arm/mach-snapdragon/board.c