@@ -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,
.control_padconf_mode = 0x4AE0C5A0,
.control_xtal_oscillator = 0x4AE0C5A4,
.control_i2c_2 = 0x4AE0C5A8,
@@ -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;
@@ -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;
}