[PATCH] arm: socfpga: Export Board ID as U-boot Environment Variable

Jit Loon Lim jit.loon.lim at intel.com
Sun Dec 11 15:17:31 CET 2022


From: Yau Wai Gan <yau.wai.gan at intel.com>

Board ID is exported as environment variable for use to boot Linux FIT
configuration.

Signed-off-by: Yau Wai Gan <yau.wai.gan at intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim at intel.com>
---
 arch/arm/mach-socfpga/misc_soc64.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-socfpga/misc_soc64.c b/arch/arm/mach-socfpga/misc_soc64.c
index 49b241b7b8..d092268fea 100644
--- a/arch/arm/mach-socfpga/misc_soc64.c
+++ b/arch/arm/mach-socfpga/misc_soc64.c
@@ -20,6 +20,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+u8 socfpga_get_board_id(void);
+
 /*
  * FPGA programming support for SoC FPGA Stratix 10
  */
@@ -57,10 +59,15 @@ int print_cpuinfo(void)
 int arch_misc_init(void)
 {
 	char qspi_string[13];
+	char id[3];
 
 	sprintf(qspi_string, "<0x%08x>", cm_get_qspi_controller_clk_hz());
 	env_set("qspi_clock", qspi_string);
 
+	/* Export board_id as environment variable */
+	sprintf(id, "%u", socfpga_get_board_id());
+	env_set("board_id", id);
+
 	return 0;
 }
 #endif
-- 
2.26.2



More information about the U-Boot mailing list