of: fdt: Add generic support for handling elf core headers property
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 11 Aug 2021 08:51:01 +0000 (10:51 +0200)
committerRob Herring <robh@kernel.org>
Tue, 24 Aug 2021 22:09:01 +0000 (17:09 -0500)
commitf7e7ce93aac13118281bcef8407b5df1a6b16822
tree66723780c2fd2311f690d79a26d45631b873fa3e
parent33709413014cd5b8e54d4d9efa07a30ba028e1db
of: fdt: Add generic support for handling elf core headers property

There are two methods to specify the location of the elf core headers:
using the "elfcorehdr=" kernel parameter, as handled by generic code in
kernel/crash_dump.c, or using the "linux,elfcorehdr" property under the
"/chosen" node in the Device Tree, as handled by architecture-specific
code in arch/arm64/mm/init.c.

Extend support for "linux,elfcorehdr" to all platforms supporting DT by
adding platform-agnostic handling for handling this property to the FDT
core code.  This can co-exist safely with the architecture-specific
handling, until the latter has been removed.

This requires moving the call to of_scan_flat_dt() up, as the code
scanning the "/chosen" node now needs to be aware of the values of
"#address-cells" and "#size-cells".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/c7e46e50aaf87ef49bdaa61358d25b122f32b7df.1628670468.git.geert+renesas@glider.be
Documentation/devicetree/bindings/chosen.txt
drivers/of/fdt.c