Sfoglia il codice sorgente

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 <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass 4 anni fa
parent
commit
cb3ef6810a

+ 1 - 0
board/atmel/common/mac_eeprom.c

@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <eeprom.h>
 #include <env.h>
 #include <i2c_eeprom.h>
 #include <netdev.h>

+ 1 - 0
board/compulab/common/eeprom.c

@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <eeprom.h>
 #include <i2c.h>
 #include <eeprom_layout.h>
 #include <eeprom_field.h>

+ 1 - 0
board/corscience/tricorder/tricorder-eeprom.c

@@ -5,6 +5,7 @@
  * Andreas Bießmann <andreas.biessmann@corscience.de>
  */
 #include <common.h>
+#include <eeprom.h>
 #include <i2c.h>
 #include <u-boot/crc.h>
 

+ 1 - 0
board/dhelectronics/dh_imx6/dh_imx6.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <eeprom.h>
 #include <init.h>
 #include <dm/device-internal.h>
 #include <asm/arch/clock.h>

+ 1 - 0
board/freescale/mpc8323erdb/mpc8323erdb.c

@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <eeprom.h>
 #include <env.h>
 #include <init.h>
 #include <ioports.h>

+ 1 - 0
board/kosagi/novena/novena.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <eeprom.h>
 #include <init.h>
 #include <dm/device-internal.h>
 #include <ahci.h>

+ 1 - 0
board/phytec/phycore_rk3288/phycore-rk3288.c

@@ -4,6 +4,7 @@
  * Author: Wadim Egorov <w.egorov@phytec.de>
  */
 
+#include <eeprom.h>
 #include <init.h>
 #include <asm/io.h>
 #include <common.h>

+ 1 - 0
board/rockchip/tinker_rk3288/tinker-rk3288.c

@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <eeprom.h>
 #include <env.h>
 #include <i2c_eeprom.h>
 #include <init.h>

+ 1 - 0
board/softing/vining_fpga/socfpga.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <eeprom.h>
 #include <env.h>
 #include <init.h>
 #include <status_led.h>

+ 1 - 0
board/ti/am43xx/board.c

@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <eeprom.h>
 #include <env.h>
 #include <i2c.h>
 #include <init.h>

+ 1 - 0
board/ti/common/board_detect.c

@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <eeprom.h>
 #include <asm/arch/hardware.h>
 #include <asm/omap_common.h>
 #include <dm/uclass.h>

+ 1 - 0
board/ti/ks2_evm/board_k2g.c

@@ -6,6 +6,7 @@
  *     Texas Instruments Incorporated, <www.ti.com>
  */
 #include <common.h>
+#include <eeprom.h>
 #include <env.h>
 #include <init.h>
 #include <asm/arch/clock.h>

+ 1 - 0
cmd/eeprom.c

@@ -22,6 +22,7 @@
 #include <common.h>
 #include <config.h>
 #include <command.h>
+#include <eeprom.h>
 #include <i2c.h>
 #include <eeprom_layout.h>
 

+ 1 - 0
drivers/misc/i2c_eeprom.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <eeprom.h>
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <dm.h>

+ 1 - 0
drivers/mtd/mw_eeprom.c

@@ -1,6 +1,7 @@
 /* Three-wire (MicroWire) serial eeprom driver (for 93C46 and compatibles) */
 
 #include <common.h>
+#include <eeprom.h>
 #include <asm/ic/ssi.h>
 
 /*

+ 1 - 0
drivers/rtc/rv3029.c

@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <dm.h>
+#include <eeprom.h>
 #include <i2c.h>
 #include <rtc.h>
 

+ 1 - 0
env/eeprom.c

@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <eeprom.h>
 #include <env.h>
 #include <env_internal.h>
 #include <linux/stddef.h>

+ 0 - 15
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

+ 24 - 0
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