1
2
3
4
5
6
7#ifndef __EEPROM_LEGACY_H
8#define __EEPROM_LEGACY_H
9
10#if defined(CONFIG_CMD_EEPROM) || defined(CONFIG_ENV_IS_IN_EEPROM)
11void eeprom_init(int bus);
12int eeprom_read(uint dev_addr, uint offset, uchar *buffer, uint cnt);
13int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt);
14#else
15
16
17
18
19#define eeprom_init(bus)
20#define eeprom_read(dev_addr, offset, buffer, cnt) (-ENOSYS)
21#define eeprom_write(dev_addr, offset, buffer, cnt) (-ENOSYS)
22#endif
23
24#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR)
25# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR
26#endif
27
28#endif
29