
Salutations Simon,
On Thursday, 23 January 2025 at 15:37, Simon Glass sjg@chromium.org wrote:
Hi Sam,
On Wed, 22 Jan 2025 at 03:27, Sam Day me@samcday.com wrote:
commit fc37a73e6679 ("fdt: Swap the signature for board_fdt_blob_setup()") introduced a subtle change to the Snapdragon implementation, removing the assignment to gd->fdt_blob partway through the function.
This breaks qcom_parse_memory() which was also called during board_fdt_blob_setup().
The underlying issue here is that qcom_parse_memory is using the of_ api to traverse a devicetree, which relies on the fdt_blob in global data.
Rather than relying on this subtle behaviour, explicitly pass the FDT that should be consulted for a /memory node.
Using the OF API is typically preferable because it's easier to read, but using the lower level fdt_ methods instead here doesn't add too much complexity, I think.
Finally, a minor tweak was made to board_fdt_blob_setup to use the passed fdt blob pointer instead of gd->fdt_blob, which removes the last of the references to global data in this area.
Fixes: fc37a73e6679 (fdt: Swap the signature for board_fdt_blob_setup()) Reviewed-by: Caleb Connolly caleb.connolly@linaro.org Signed-off-by: Sam Day me@samcday.com
arch/arm/mach-snapdragon/board.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
But I'm looking forward to some form of Caleb's patch landing too[1].
Hm, this patch was intended to be a replacement for the one you linked. It's already been pulled into upstream/master. Was there something specific in that patch that you still want to see land?
I saw your comments there today and AFAICT this patch already addressed the desire to stop mutating gd->fdt_blob from board_fdt_blob_setup. That was necessary in Caleb's patch because qcom_parse_memory was using of_ API methods to scoop out /memory node info. This patch opted instead to use fdt_ and operate on the provided *fdtp directly.
Regards, -Sam
Regards, SImon
[1] https://patchwork.ozlabs.org/project/uboot/patch/20250117102734.3725009-2-ca...