[U-Boot] [PATCH v3 3/4] ARM: DRA7: Set serial number environment variable

Nishanth Menon nm at ti.com
Sat Mar 7 08:00:02 CET 2015


On 03/03/2015 05:10 AM, Dileep Katta wrote:
> Adds the registers to get the serial number of dra7xx boards.
> Serial# environment variable will be set if not done already.
> This will be useful to show correct information in
> "fastboot devices" commands.
> 
> Signed-off-by: Angela Stegmaier <angelabaker at ti.com>
> Signed-off-by: Dileep Katta <dileep.katta at linaro.org>
> ---
>  arch/arm/cpu/armv7/omap5/prcm-regs.c |  2 ++
>  arch/arm/include/asm/omap_common.h   |  2 ++
>  board/ti/dra7xx/evm.c                | 11 +++++++++++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c b/arch/arm/cpu/armv7/omap5/prcm-regs.c
> index 0745d42..020a964 100644
> --- a/arch/arm/cpu/armv7/omap5/prcm-regs.c
> +++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c
> @@ -440,6 +440,8 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = {
>  	.control_emif1_sdram_config_ext		= 0x4AE0C144,
>  	.control_emif2_sdram_config_ext		= 0x4AE0C148,
>  	.control_wkup_ldovbb_mpu_voltage_ctrl	= 0x4AE0C158,
> +	.control_std_fuse_die_id_3		= 0x4AE0C210,
> +	.control_std_fuse_prod_id_0		= 0x4AE0C214,

Are these serial numbers of dra7 "boards"? they dont match up with
commit message.

http://www.ti.com/lit/ug/spruhz6/spruhz6.pdf
See section "AM572x Device Identification" on page 357
you would rather want to use CTRL_WKUP_STD_FUSE_DIE_ID_0,1,2,3


Is'nt better to unify with existing requirements such as
arch/arm/cpu/armv7/omap3/sys_info.c dieid_num_r() such that every
omap3,4,5,dra7 SoCs can use the same function in different ways
(example: usb_fake_mac_from_die_id in omap5_uevm and panda) ?

here we do fastboot_serial_from_die_id? Standardizing such information
allows us to just hook up the missing information for various SoCs and
reuse the common code.

>  	.control_padconf_mode			= 0x4AE0C5A0,
>  	.control_xtal_oscillator		= 0x4AE0C5A4,
>  	.control_i2c_2				= 0x4AE0C5A8,
> diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
> index 323952f..b329803 100644
> --- a/arch/arm/include/asm/omap_common.h
> +++ b/arch/arm/include/asm/omap_common.h
> @@ -362,6 +362,8 @@ struct omap_sys_ctrl_regs {
>  	u32 control_core_control_io1;
>  	u32 control_core_control_io2;
>  	u32 control_id_code;
> +	u32 control_std_fuse_die_id_3;
> +	u32 control_std_fuse_prod_id_0;
>  	u32 control_std_fuse_opp_bgap;
>  	u32 control_ldosram_iva_voltage_ctrl;
>  	u32 control_ldosram_mpu_voltage_ctrl;
> diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
> index 6522241..e20d950 100644
> --- a/board/ti/dra7xx/evm.c
> +++ b/board/ti/dra7xx/evm.c
> @@ -88,10 +88,21 @@ int board_init(void)
>  int board_late_init(void)
>  {
>  #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> +	char serialno[72];
> +	uint32_t serialno_lo, serialno_hi;
> +
>  	if (omap_revision() == DRA722_ES1_0)
>  		setenv("board_name", "dra72x");
>  	else
>  		setenv("board_name", "dra7xx");
> +
> +	if (!getenv("serial#")) {
> +		printf("serial# not set, setting...\n");
> +		serialno_lo = readl((*ctrl)->control_std_fuse_die_id_3);
> +		serialno_hi = readl((*ctrl)->control_std_fuse_prod_id_0);
> +		sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
> +		setenv("serial#", serialno);
> +	}
>  #endif
>  	return 0;
>  }
> 



More information about the U-Boot mailing list