/* Routine: cl_eeprom_get_board_rev Description: read system revision from eeprom  */
u32 cl_eeprom_get_board_rev(uint eeprom_bus)
/* Routine: cl_eeprom_get_board_rev Description: read system revision from eeprom  */
u32 cl_eeprom_get_board_rev(uint eeprom_bus)
{
	char str[5];
	uint offset = BOARD_REV_OFFSET_LEGACY;
	if (board_rev)
		return board_rev;
	if (cl_eeprom_setup(eeprom_bus))
		return 0;
	if (cl_eeprom_layout != LAYOUT_LEGACY)
		offset = BOARD_REV_OFFSET;
	if (cl_eeprom_read(offset, (uchar *)&board_rev, BOARD_REV_SIZE))
		return 0;
	if (cl_eeprom_layout == LAYOUT_LEGACY) {
		sprintf(str, "%x", board_rev);
		board_rev = simple_strtoul(str, NULL, 10);
	}
	return board_rev;
}