Commit 7cb87365 authored by Adam Wujek's avatar Adam Wujek

sw/patches/uboot: add modeboot, uimage_source and reset_reason to FDT

Under /chosen
Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 6a66a20b
From 830814154f26ec938d9a11ed39fd2c423fddf688 Mon Sep 17 00:00:00 2001
From: Adam Wujek <dev_public@wujek.eu>
Date: Wed, 6 Apr 2022 00:24:33 +0200
Subject: [PATCH] fdt_support: add modeboot, uimage_source and reset_reason to
FDT
Under /chosen
modeboot and reset_reason are filled by a uboot automatically.
Signed-off-by: Adam Wujek <dev_public@wujek.eu>
---
common/fdt_support.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 3440e42a25..2b3f811bbd 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -299,6 +299,39 @@ int fdt_chosen(void *fdt)
}
}
+ str = env_get("modeboot");
+ if (str) {
+ err = fdt_setprop(fdt, nodeoffset, "modeboot", str,
+ strlen(str) + 1);
+ if (err < 0) {
+ printf("WARNING: could not set modeboot %s.\n",
+ fdt_strerror(err));
+ return err;
+ }
+ }
+
+ str = env_get("uimage_source");
+ if (str) {
+ err = fdt_setprop(fdt, nodeoffset, "uimage_source", str,
+ strlen(str) + 1);
+ if (err < 0) {
+ printf("WARNING: could not set uimage_source %s.\n",
+ fdt_strerror(err));
+ return err;
+ }
+ }
+
+ str = env_get("reset_reason");
+ if (str) {
+ err = fdt_setprop(fdt, nodeoffset, "reset_reason", str,
+ strlen(str) + 1);
+ if (err < 0) {
+ printf("WARNING: could not set reset_reason %s.\n",
+ fdt_strerror(err));
+ return err;
+ }
+ }
+
return fdt_fixup_stdout(fdt, nodeoffset);
}
--
2.17.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment