blob: 9bd7604a999c66f8848664ae453e276ead01843d [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
Tom Rini52b2e262021-08-18 23:12:24 -040013#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
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