/* The Bluetooth MAC address serves as the board serial number.  */
void get_board_serial(struct tag_serialnr *serialnr)
/* The Bluetooth MAC address serves as the board serial number.  */
void get_board_serial(struct tag_serialnr *serialnr)
{
	u32 offset;
	u8 buf[6];
	if (!board_rev)
		board_rev = get_board_rev();
	offset = (board_rev == 3) ? EEPROM_REV_OFFSET : EEPROM_MAC_OFFSET;
	if (i2c_read(EEPROM_I2C_ADDR, offset, 2, buf, 6)) {
		printf("\nBoard serial read failed!\n");
	} else {
		u8 *nr;
		nr = (u8 *)&serialnr->low;
		nr[0] = buf[5];
		nr[1] = buf[4];
		nr[2] = buf[3];
		nr[3] = buf[2];
		nr = (u8 *)&serialnr->high;
		nr[0] = buf[1];
		nr[1] = buf[0];
		nr[2] = 0;
		nr[3] = 0;
	}
}