From: Simon Glass Date: Thu, 14 Nov 2019 19:57:50 +0000 (-0700) Subject: common: Move old EEPROM functions into a new header X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=cb3ef6810a27c8ddf5db8694bcef9337f27d12ce;p=u-boot.git common: Move old EEPROM functions into a new header These functions do not use driver model but are still used. Move them to a new eeprom.h header file. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/board/atmel/common/mac_eeprom.c b/board/atmel/common/mac_eeprom.c index 83a7778e99..050aa51ee1 100644 --- a/board/atmel/common/mac_eeprom.c +++ b/board/atmel/common/mac_eeprom.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index 81f69d3850..5206cf5c0a 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/board/corscience/tricorder/tricorder-eeprom.c b/board/corscience/tricorder/tricorder-eeprom.c index b28189dafd..23c2ea9186 100644 --- a/board/corscience/tricorder/tricorder-eeprom.c +++ b/board/corscience/tricorder/tricorder-eeprom.c @@ -5,6 +5,7 @@ * Andreas Bießmann */ #include +#include #include #include diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c b/board/dhelectronics/dh_imx6/dh_imx6.c index 037be01f8b..33ce7e8ff1 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6.c +++ b/board/dhelectronics/dh_imx6/dh_imx6.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c index cbec8a44e4..6c47cb2b38 100644 --- a/board/freescale/mpc8323erdb/mpc8323erdb.c +++ b/board/freescale/mpc8323erdb/mpc8323erdb.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c index e4f0e81004..7eb833cf02 100644 --- a/board/kosagi/novena/novena.c +++ b/board/kosagi/novena/novena.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/board/phytec/phycore_rk3288/phycore-rk3288.c b/board/phytec/phycore_rk3288/phycore-rk3288.c index dac59cd55d..039ed0f1bc 100644 --- a/board/phytec/phycore_rk3288/phycore-rk3288.c +++ b/board/phytec/phycore_rk3288/phycore-rk3288.c @@ -4,6 +4,7 @@ * Author: Wadim Egorov */ +#include #include #include #include diff --git a/board/rockchip/tinker_rk3288/tinker-rk3288.c b/board/rockchip/tinker_rk3288/tinker-rk3288.c index 85a7059a03..7af39e10cd 100644 --- a/board/rockchip/tinker_rk3288/tinker-rk3288.c +++ b/board/rockchip/tinker_rk3288/tinker-rk3288.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/board/softing/vining_fpga/socfpga.c b/board/softing/vining_fpga/socfpga.c index d70c22f48f..5a88b6c8ad 100644 --- a/board/softing/vining_fpga/socfpga.c +++ b/board/softing/vining_fpga/socfpga.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 9353830969..d12f1ebfdf 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index bc89cc57bd..564d2f7046 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c index a0fd03a39f..920d0d3420 100644 --- a/board/ti/ks2_evm/board_k2g.c +++ b/board/ti/ks2_evm/board_k2g.c @@ -6,6 +6,7 @@ * Texas Instruments Incorporated, */ #include +#include #include #include #include diff --git a/cmd/eeprom.c b/cmd/eeprom.c index 19953df082..4a1569baf3 100644 --- a/cmd/eeprom.c +++ b/cmd/eeprom.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/drivers/misc/i2c_eeprom.c b/drivers/misc/i2c_eeprom.c index 8f2349ad5a..3755dbf74b 100644 --- a/drivers/misc/i2c_eeprom.c +++ b/drivers/misc/i2c_eeprom.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c index f7791b51a0..6a3a6f6751 100644 --- a/drivers/mtd/mw_eeprom.c +++ b/drivers/mtd/mw_eeprom.c @@ -1,6 +1,7 @@ /* Three-wire (MicroWire) serial eeprom driver (for 93C46 and compatibles) */ #include +#include #include /* diff --git a/drivers/rtc/rv3029.c b/drivers/rtc/rv3029.c index 38acb9c992..2367062777 100644 --- a/drivers/rtc/rv3029.c +++ b/drivers/rtc/rv3029.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/env/eeprom.c b/env/eeprom.c index f0bdf2a141..e8126cfe39 100644 --- a/env/eeprom.c +++ b/env/eeprom.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/include/common.h b/include/common.h index 64d0cf542e..8b37b58747 100644 --- a/include/common.h +++ b/include/common.h @@ -116,21 +116,6 @@ phys_size_t get_effective_memsize(void); void reset_phy (void); void fdc_hw_init (void); -/* $(BOARD)/eeprom.c */ -#ifdef CONFIG_CMD_EEPROM -void eeprom_init (int bus); -int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); -int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); -#else -/* - * Some EEPROM code is depecated because it used the legacy I2C interface. Add - * some macros here so we don't have to touch every one of those uses - */ -#define eeprom_init(bus) -#define eeprom_read(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) -#define eeprom_write(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) -#endif - #if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) # define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR #endif diff --git a/include/eeprom.h b/include/eeprom.h new file mode 100644 index 0000000000..61eb826a73 --- /dev/null +++ b/include/eeprom.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2000-2009 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#ifndef __EEPROM_LEGACY_H +#define __EEPROM_LEGACY_H + +#ifdef CONFIG_CMD_EEPROM +void eeprom_init(int bus); +int eeprom_read(uint dev_addr, uint offset, uchar *buffer, uint cnt); +int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt); +#else +/* + * Some EEPROM code is depecated because it used the legacy I2C interface. Add + * some macros here so we don't have to touch every one of those uses + */ +#define eeprom_init(bus) +#define eeprom_read(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) +#define eeprom_write(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) +#endif + +#endif