die_id[0] = die_id[1] = die_id[2] = die_id[3] = 0;
}
-void __weak usb_fake_mac_from_die_id(u32 *id)
+void omap_die_id_serial(void)
{
- uint8_t device_mac[6];
+ unsigned int die_id[4] = { 0 };
+ char serial_string[17] = { 0 };
- if (!getenv("usbethaddr")) {
- /*
- * create a fake MAC address from the processor ID code.
- * first byte is 0x02 to signify locally administered.
- */
- device_mac[0] = 0x02;
- device_mac[1] = id[3] & 0xff;
- device_mac[2] = id[2] & 0xff;
- device_mac[3] = id[1] & 0xff;
- device_mac[4] = id[0] & 0xff;
- device_mac[5] = (id[0] >> 8) & 0xff;
+ omap_die_id((unsigned int *)&die_id);
- eth_setenv_enetaddr("usbethaddr", device_mac);
+ if (!getenv("serial#")) {
+ snprintf(serial_string, sizeof(serial_string),
+ "%08x%08x", die_id[0], die_id[3]);
+
+ setenv("serial#", serial_string);
}
}
-void __weak usb_set_serial_num_from_die_id(u32 *id)
+void omap_die_id_usbethaddr(void)
{
- char serialno[72];
- uint32_t serialno_lo, serialno_hi;
+ unsigned int die_id[4] = { 0 };
+ unsigned char mac[6] = { 0 };
- if (!getenv("serial#")) {
- serialno_hi = id[0];
- serialno_lo = id[1];
- sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
- setenv("serial#", serialno);
+ omap_die_id((unsigned int *)&die_id);
+
+ if (!getenv("usbethaddr")) {
+ /*
+ * Create a fake MAC address from the processor ID code.
+ * First byte is 0x02 to signify locally administered.
+ */
+ mac[0] = 0x02;
+ mac[1] = die_id[3] & 0xff;
+ mac[2] = die_id[2] & 0xff;
+ mac[3] = die_id[1] & 0xff;
+ mac[4] = die_id[0] & 0xff;
+ mac[5] = (die_id[0] >> 8) & 0xff;
+
+ eth_setenv_enetaddr("usbethaddr", mac);
}
}
u32 txdone, u32 txdone_mask, u32 opp);
s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb);
-void usb_fake_mac_from_die_id(u32 *id);
-void usb_set_serial_num_from_die_id(u32 *id);
+void omap_die_id_serial(void);
+void omap_die_id_usbethaddr(void);
+
void recalibrate_iodelay(void);
void omap_smc1(u32 service, u32 val);
int misc_init_r(void)
{
unsigned char keypad_matrix[64] = { 0 };
- unsigned int die_id[4] = { 0 };
- char serial_string[17] = { 0 };
char reboot_mode[2] = { 0 };
unsigned char keys[3];
unsigned char data = 0;
/* Serial number */
- omap_die_id(die_id);
-
- if (!getenv("serial#")) {
- snprintf(serial_string, sizeof(serial_string),
- "%08x%08x", die_id[0], die_id[3]);
-
- setenv("serial#", serial_string);
- }
+ omap_die_id_serial();
/* MUSB */
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- unsigned int die_id[4] = { 0 };
-
if (omap_revision() == DRA722_ES1_0)
setenv("board_name", "dra72x");
else
setenv("board_name", "dra7xx");
- omap_die_id(die_id);
- usb_set_serial_num_from_die_id(die_id);
+ omap_die_id_serial();
#endif
return 0;
}