[PATCH v1 13/20] arm: socfpga: Export board ID as U-Boot environment variable

tien.fong.chee at intel.com tien.fong.chee at intel.com
Fri Sep 20 09:02:35 CEST 2024


From: Tien Fong Chee <tien.fong.chee at intel.com>

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

Signed-off-by: Tien Fong Chee <tien.fong.chee at intel.com>
---
 arch/arm/mach-socfpga/include/mach/misc.h | 1 +
 arch/arm/mach-socfpga/misc_soc64.c        | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-socfpga/include/mach/misc.h b/arch/arm/mach-socfpga/include/mach/misc.h
index 8460acb00d9..e62bea017b0 100644
--- a/arch/arm/mach-socfpga/include/mach/misc.h
+++ b/arch/arm/mach-socfpga/include/mach/misc.h
@@ -52,5 +52,6 @@ void set_regular_boot(unsigned int status);
 void socfpga_pl310_clear(void);
 void socfpga_get_managers_addr(void);
 int qspi_flash_software_reset(void);
+u8 socfpga_get_board_id(void);
 
 #endif /* _SOCFPGA_MISC_H_ */
diff --git a/arch/arm/mach-socfpga/misc_soc64.c b/arch/arm/mach-socfpga/misc_soc64.c
index 95e1c07e39f..e34c54518a3 100644
--- a/arch/arm/mach-socfpga/misc_soc64.c
+++ b/arch/arm/mach-socfpga/misc_soc64.c
@@ -60,10 +60,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.25.1



More information about the U-Boot mailing list