efi/arm: Rewrite FDT param discovery routines
authorArd Biesheuvel <ardb@kernel.org>
Wed, 19 Feb 2020 14:29:06 +0000 (15:29 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:59:42 +0000 (21:59 +0100)
commite457ed516a67ea2087950960faaf89ebfb606f06
tree89921429ecd42a1d75269b6cac7652142694c670
parent3b2e4b4c634cc7dd4730ce3e1c75b8206dcc4b04
efi/arm: Rewrite FDT param discovery routines

The efi_get_fdt_params() routine uses the early OF device tree
traversal helpers, that iterate over each node in the DT and invoke
a caller provided callback that can inspect the node's contents and
look for the required data. This requires a special param struct to
be passed around, with pointers into param enumeration structs that
contain (and duplicate) property names and offsets into yet another
struct that carries the collected data.

Since we know the data we look for is either under /hypervisor/uefi
or under /chosen, it is much simpler to use the libfdt routines, and
just try to grab a reference to either node directly, and read each
property in sequence.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/fdtparams.c