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