xref: /openbmc/u-boot/board/compulab/common/eeprom.h (revision 8a23fc9c)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2011 CompuLab, Ltd. <www.compulab.co.il>
4  *
5  * Authors: Nikita Kiryanov <nikita@compulab.co.il>
6  *	    Igor Grinberg <grinberg@compulab.co.il>
7  */
8 
9 #ifndef _EEPROM_
10 #define _EEPROM_
11 #include <errno.h>
12 
13 #ifdef CONFIG_SYS_I2C
14 int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
15 u32 cl_eeprom_get_board_rev(uint eeprom_bus);
16 int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus);
17 #else
18 static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
19 {
20 	return 1;
21 }
22 static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
23 {
24 	return 0;
25 }
26 static inline int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus)
27 {
28 	return -ENOSYS;
29 }
30 #endif
31 
32 #endif
33