Simon Glass | cb3ef68 | 2019-11-14 12:57:50 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * (C) Copyright 2000-2009 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 5 | */ |
| 6 | |
| 7 | #ifndef __EEPROM_LEGACY_H |
| 8 | #define __EEPROM_LEGACY_H |
| 9 | |
Rasmus Villemoes | 682fef9 | 2020-02-18 08:39:42 +0000 | [diff] [blame] | 10 | #if defined(CONFIG_CMD_EEPROM) || defined(CONFIG_ENV_IS_IN_EEPROM) |
Simon Glass | cb3ef68 | 2019-11-14 12:57:50 -0700 | [diff] [blame] | 11 | void eeprom_init(int bus); |
| 12 | int eeprom_read(uint dev_addr, uint offset, uchar *buffer, uint cnt); |
| 13 | int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt); |
| 14 | #else |
| 15 | /* |
| 16 | * Some EEPROM code is depecated because it used the legacy I2C interface. Add |
| 17 | * some macros here so we don't have to touch every one of those uses |
| 18 | */ |
| 19 | #define eeprom_init(bus) |
Rasmus Villemoes | 682fef9 | 2020-02-18 08:39:42 +0000 | [diff] [blame] | 20 | #define eeprom_read(dev_addr, offset, buffer, cnt) (-ENOSYS) |
| 21 | #define eeprom_write(dev_addr, offset, buffer, cnt) (-ENOSYS) |
Simon Glass | cb3ef68 | 2019-11-14 12:57:50 -0700 | [diff] [blame] | 22 | #endif |
| 23 | |
Simon Glass | 4ab18a0 | 2019-12-28 10:44:49 -0700 | [diff] [blame] | 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 | |
Simon Glass | cb3ef68 | 2019-11-14 12:57:50 -0700 | [diff] [blame] | 28 | #endif |