aboutsummaryrefslogtreecommitdiff
path: root/common/image-fdt.c
diff options
context:
space:
mode:
authorWasim Khan2021-02-04 15:44:04 +0100
committerTom Rini2021-02-24 16:51:48 -0500
commit402558b1fe604baaa4aa4b3e1c72a65692861f2a (patch)
tree274954f80edcac86e001639e865623199d9e347e /common/image-fdt.c
parent220fa478fb1a84e51235b92506ff5d48415f0a8e (diff)
cmd: fdt: skip board specific fixup using env variable
Sometimes it is useful to boot OS with already fixed-up device tree. Check for env variable 'skip_board_fixup' before calling ft_board_setup(). Current behaviour is unchanged, additionally user can set skip_board_fixup to 1 to skip the fixup. Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Diffstat (limited to 'common/image-fdt.c')
-rw-r--r--common/image-fdt.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 61ce6e5779f..a287b663925 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -576,11 +576,18 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
fdt_fixup_pstore(blob);
#endif
if (IMAGE_OF_BOARD_SETUP) {
- fdt_ret = ft_board_setup(blob, gd->bd);
- if (fdt_ret) {
- printf("ERROR: board-specific fdt fixup failed: %s\n",
- fdt_strerror(fdt_ret));
- goto err;
+ const char *skip_board_fixup;
+
+ skip_board_fixup = env_get("skip_board_fixup");
+ if (skip_board_fixup && ((int)simple_strtol(skip_board_fixup, NULL, 10) == 1)) {
+ printf("skip board fdt fixup\n");
+ } else {
+ fdt_ret = ft_board_setup(blob, gd->bd);
+ if (fdt_ret) {
+ printf("ERROR: board-specific fdt fixup failed: %s\n",
+ fdt_strerror(fdt_ret));
+ goto err;
+ }
}
}
if (IMAGE_OF_SYSTEM_SETUP) {