Skip to content
Unverified Commit 86eb5d83 authored by Volodymyr Babchuk's avatar Volodymyr Babchuk Committed by Caleb Connolly
Browse files

qcom: board: validate fdt before trying to use it



There are cases when previous bootloader stage leaves some seemingly
valid value in r0, which in fact does not point to valid FDT
blob. This behavior was encountered when trying to boot U-Boot as
"hyp" loader on SA8155P-ADP.

To be sure that we really got the pointer to a device tree we need to
validate it with fdt_check_header() function.

Note: This approach is not 100% fool-proof, as get_prev_bl_fdt_addr()
theoretically can return a pointer to a region that is not physically
mapped and we will get data abort exception when fdt_check_header()
will try to access it. But at this early boot stage we don't know
where RAM is anyways so there is little we can do.

Signed-off-by: default avatarVolodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: default avatarSumit Garg <sumit.garg@linaro.org>
Reviewed-by: default avatarCaleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: default avatarCaleb Connolly <caleb.connolly@linaro.org>
parent b621dcd1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment