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

Marek Vasut marex at denx.de
Sat Sep 21 15:53:58 CEST 2024


On 9/20/24 9:02 AM, tien.fong.chee at intel.com wrote:
> 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);
env_set_ulong()


More information about the U-Boot mailing list