blob: a9c0203b81a4c565057ec1944cf088af0ef9b39c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +00002/*
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>
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +00007 */
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02008
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +00009#ifndef _EEPROM_
10#define _EEPROM_
Nikita Kiryanov61f82b72015-09-06 11:48:37 +030011#include <errno.h>
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000012
Ilya Ledvich00af7772014-04-16 13:48:26 +030013#ifdef CONFIG_SYS_I2C
Nikita Kiryanovb2c55472015-01-14 10:42:43 +020014int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
Nikita Kiryanov7fa68352015-09-06 11:48:35 +030015u32 cl_eeprom_get_board_rev(uint eeprom_bus);
Nikita Kiryanov61f82b72015-09-06 11:48:37 +030016int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus);
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000017#else
Nikita Kiryanovb2c55472015-01-14 10:42:43 +020018static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000019{
20 return 1;
21}
Nikita Kiryanov7fa68352015-09-06 11:48:35 +030022static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
Nikita Kiryanovcc935c62012-05-24 04:01:24 +000023{
24 return 0;
25}
Nikita Kiryanov61f82b72015-09-06 11:48:37 +030026static inline int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus)
27{
28 return -ENOSYS;
29}
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000030#endif
31
32#endif