eeprom.h 725 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  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. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef _EEPROM_
  10. #define _EEPROM_
  11. #include <errno.h>
  12. #ifdef CONFIG_SYS_I2C
  13. int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
  14. u32 cl_eeprom_get_board_rev(uint eeprom_bus);
  15. int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus);
  16. #else
  17. static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
  18. {
  19. return 1;
  20. }
  21. static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
  22. {
  23. return 0;
  24. }
  25. static inline int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus)
  26. {
  27. return -ENOSYS;
  28. }
  29. #endif
  30. #endif