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