Skip to contentSkip to conversation

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

PATCH New Jit Loon Lim 1 participant 1 message Dec 11, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Export Board ID as U-boot Environment Variable

From: Yau Wai Gan <[email protected]>

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

---
 arch/arm/mach-socfpga/misc_soc64.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-socfpga/misc_soc64.c +7 -0
index 49b241b7b8..d092268fea 100644
@@ -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
Signature · 1 line
2.26.2