eeprom.h 732 B

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