[U-Boot] [PATCH v2 24/29] riscv: store device tree passed by prior boot stage in environment

Lukas Auer lukas.auer at aisec.fraunhofer.de
Tue Oct 30 12:55:47 UTC 2018


The device tree passed by the prior boot stage can be used to boot
Linux. Store it as environment variable "prior_stage_dtb", so that it
can be used as part of the boot command.

Signed-off-by: Lukas Auer <lukas.auer at aisec.fraunhofer.de>
---

Changes in v2:
- New patch

 arch/Kconfig                          | 1 +
 arch/riscv/cpu/cpu.c                  | 7 +++++++
 arch/riscv/include/asm/u-boot-riscv.h | 1 +
 3 files changed, 9 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 9fdd2f7e66..883e4a9308 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -74,6 +74,7 @@ config RISCV
 	imply MTD
 	imply TIMER
 	imply CMD_DM
+	imply ARCH_MISC_INIT
 
 config SANDBOX
 	bool "Sandbox"
diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
index d9f820c44c..e06a8c6bab 100644
--- a/arch/riscv/cpu/cpu.c
+++ b/arch/riscv/cpu/cpu.c
@@ -53,3 +53,10 @@ int print_cpuinfo(void)
 
 	return 0;
 }
+
+int arch_misc_init(void)
+{
+	env_set_hex("prior_stage_dtb", prior_stage_fdt_address);
+
+	return 0;
+}
diff --git a/arch/riscv/include/asm/u-boot-riscv.h b/arch/riscv/include/asm/u-boot-riscv.h
index 49febd5881..937b2682dc 100644
--- a/arch/riscv/include/asm/u-boot-riscv.h
+++ b/arch/riscv/include/asm/u-boot-riscv.h
@@ -13,6 +13,7 @@
 
 /* cpu/.../cpu.c */
 int cleanup_before_linux(void);
+int arch_misc_init(void);
 
 /* board/.../... */
 int board_init(void);
-- 
2.17.2



More information about the U-Boot mailing list