blob: c0b4739ea2351362276458fe85147e713eea1f73 [file] [log] [blame]
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +00001/*
2 * (C) Copyright 2011 CompuLab, Ltd. <www.compulab.co.il>
3 *
4 * Authors: Nikita Kiryanov <nikita@compulab.co.il>
5 * Igor Grinberg <grinberg@compulab.co.il>
6 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +00008 */
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02009
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000010#ifndef _EEPROM_
11#define _EEPROM_
Nikita Kiryanov61f82b72015-09-06 11:48:37 +030012#include <errno.h>
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000013
Ilya Ledvich00af7772014-04-16 13:48:26 +030014#ifdef CONFIG_SYS_I2C
Nikita Kiryanovb2c55472015-01-14 10:42:43 +020015int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
Nikita Kiryanov7fa68352015-09-06 11:48:35 +030016u32 cl_eeprom_get_board_rev(uint eeprom_bus);
Nikita Kiryanov61f82b72015-09-06 11:48:37 +030017int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus);
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000018#else
Nikita Kiryanovb2c55472015-01-14 10:42:43 +020019static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000020{
21 return 1;
22}
Nikita Kiryanov7fa68352015-09-06 11:48:35 +030023static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
Nikita Kiryanovcc935c62012-05-24 04:01:24 +000024{
25 return 0;
26}
Nikita Kiryanov61f82b72015-09-06 11:48:37 +030027static inline int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus)
28{
29 return -ENOSYS;
30}
Nikita Kiryanovf1ef8692012-01-12 03:28:09 +000031#endif
32
33#endif