[PATCH 11/35] common: Move reset_phy() to net.h

Simon Glass sjg at chromium.org
Thu Dec 12 01:47:30 CET 2019


This is a network function so let's move it into that header.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/arm/mach-omap2/emif-common.c               | 1 +
 board/LaCie/edminiv2/edminiv2.c                 | 1 +
 board/LaCie/net2big_v2/net2big_v2.c             | 1 +
 board/LaCie/netspace_v2/netspace_v2.c           | 1 +
 board/Marvell/db-88f6281-bp/db-88f6281-bp.c     | 1 +
 board/Marvell/dreamplug/dreamplug.c             | 1 +
 board/Marvell/guruplug/guruplug.c               | 1 +
 board/Marvell/openrd/openrd.c                   | 1 +
 board/Marvell/sheevaplug/sheevaplug.c           | 1 +
 board/Seagate/dockstar/dockstar.c               | 1 +
 board/Seagate/goflexhome/goflexhome.c           | 1 +
 board/Seagate/nas220/nas220.c                   | 1 +
 board/Synology/ds109/ds109.c                    | 1 +
 board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c     | 1 +
 board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c | 1 +
 board/atmel/at91sam9260ek/at91sam9260ek.c       | 1 +
 board/atmel/at91sam9263ek/at91sam9263ek.c       | 1 +
 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 1 +
 board/cloudengines/pogo_e02/pogo_e02.c          | 1 +
 board/d-link/dns325/dns325.c                    | 1 +
 board/freescale/ls1012afrdm/eth.c               | 1 +
 board/freescale/ls1012ardb/eth.c                | 1 +
 board/freescale/ls1088a/eth_ls1088aqds.c        | 1 +
 board/freescale/ls1088a/eth_ls1088ardb.c        | 1 +
 board/freescale/ls2080a/ls2080a.c               | 1 +
 board/freescale/ls2080aqds/eth.c                | 1 +
 board/freescale/ls2080ardb/eth_ls2080rdb.c      | 1 +
 board/freescale/lx2160a/eth_lx2160aqds.c        | 1 +
 board/freescale/lx2160a/eth_lx2160ardb.c        | 1 +
 board/keymile/km_arm/km_arm.c                   | 1 +
 board/zyxel/nsa310s/nsa310s.c                   | 1 +
 common/board_r.c                                | 1 +
 include/common.h                                | 3 ---
 include/net.h                                   | 8 ++++++++
 34 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/emif-common.c b/arch/arm/mach-omap2/emif-common.c
index 290f9dcdb0..c900f28af2 100644
--- a/arch/arm/mach-omap2/emif-common.c
+++ b/arch/arm/mach-omap2/emif-common.c
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <net.h>
 #include <asm/emif.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
diff --git a/board/LaCie/edminiv2/edminiv2.c b/board/LaCie/edminiv2/edminiv2.c
index b68e18e034..b5ffe8162f 100644
--- a/board/LaCie/edminiv2/edminiv2.c
+++ b/board/LaCie/edminiv2/edminiv2.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/orion5x.h>
 #include "../common/common.h"
 #include <spl.h>
diff --git a/board/LaCie/net2big_v2/net2big_v2.c b/board/LaCie/net2big_v2/net2big_v2.c
index 686608d25a..50305656e8 100644
--- a/board/LaCie/net2big_v2/net2big_v2.c
+++ b/board/LaCie/net2big_v2/net2big_v2.c
@@ -12,6 +12,7 @@
 #include <command.h>
 #include <env.h>
 #include <i2c.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c
index bd7ab22948..b7ae58c645 100644
--- a/board/LaCie/netspace_v2/netspace_v2.c
+++ b/board/LaCie/netspace_v2/netspace_v2.c
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/Marvell/db-88f6281-bp/db-88f6281-bp.c b/board/Marvell/db-88f6281-bp/db-88f6281-bp.c
index b68f2f3c89..729516d9e1 100644
--- a/board/Marvell/db-88f6281-bp/db-88f6281-bp.c
+++ b/board/Marvell/db-88f6281-bp/db-88f6281-bp.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include <common.h>
+#include <net.h>
 #include <linux/io.h>
 #include <miiphy.h>
 #include <netdev.h>
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c
index ede168c9ec..887dd1ed74 100644
--- a/board/Marvell/dreamplug/dreamplug.c
+++ b/board/Marvell/dreamplug/dreamplug.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
diff --git a/board/Marvell/guruplug/guruplug.c b/board/Marvell/guruplug/guruplug.c
index 466f85eb08..71bee76bdc 100644
--- a/board/Marvell/guruplug/guruplug.c
+++ b/board/Marvell/guruplug/guruplug.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c
index a4923ce971..ae9202895d 100644
--- a/board/Marvell/openrd/openrd.c
+++ b/board/Marvell/openrd/openrd.c
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/Marvell/sheevaplug/sheevaplug.c b/board/Marvell/sheevaplug/sheevaplug.c
index 79999c7d30..6c6106c23c 100644
--- a/board/Marvell/sheevaplug/sheevaplug.c
+++ b/board/Marvell/sheevaplug/sheevaplug.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/Seagate/dockstar/dockstar.c b/board/Seagate/dockstar/dockstar.c
index 40e5dc7034..5a8c6e282b 100644
--- a/board/Seagate/dockstar/dockstar.c
+++ b/board/Seagate/dockstar/dockstar.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/cpu.h>
diff --git a/board/Seagate/goflexhome/goflexhome.c b/board/Seagate/goflexhome/goflexhome.c
index 42b51eb29a..1e4477aa5f 100644
--- a/board/Seagate/goflexhome/goflexhome.c
+++ b/board/Seagate/goflexhome/goflexhome.c
@@ -13,6 +13,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
diff --git a/board/Seagate/nas220/nas220.c b/board/Seagate/nas220/nas220.c
index 1e6c43b1fa..99462052f0 100644
--- a/board/Seagate/nas220/nas220.c
+++ b/board/Seagate/nas220/nas220.c
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
diff --git a/board/Synology/ds109/ds109.c b/board/Synology/ds109/ds109.c
index 1f2fce989c..f2031ef3bb 100644
--- a/board/Synology/ds109/ds109.c
+++ b/board/Synology/ds109/ds109.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/setup.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
index 0eac10d911..1f3f293bd9 100644
--- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
+++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <net.h>
 #include <linux/io.h>
 #include <miiphy.h>
 #include <netdev.h>
diff --git a/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c b/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c
index c584fc0e98..889ce70d75 100644
--- a/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c
+++ b/board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <netdev.h>
 #include <led.h>
 #include <linux/io.h>
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c
index 9dcbfc450b..d1e78dabf2 100644
--- a/board/atmel/at91sam9260ek/at91sam9260ek.c
+++ b/board/atmel/at91sam9260ek/at91sam9260ek.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <net.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9260_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c
index 31bb72c0cd..fc941d447f 100644
--- a/board/atmel/at91sam9263ek/at91sam9263ek.c
+++ b/board/atmel/at91sam9263ek/at91sam9263ek.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <net.h>
 #include <vsprintf.h>
 #include <linux/sizes.h>
 #include <asm/arch/at91sam9263.h>
diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
index 85004310b1..6df915fcf1 100644
--- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
+++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <net.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/arch/clk.h>
diff --git a/board/cloudengines/pogo_e02/pogo_e02.c b/board/cloudengines/pogo_e02/pogo_e02.c
index ffbd099c4e..835c3279be 100644
--- a/board/cloudengines/pogo_e02/pogo_e02.c
+++ b/board/cloudengines/pogo_e02/pogo_e02.c
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
diff --git a/board/d-link/dns325/dns325.c b/board/d-link/dns325/dns325.c
index a1d987beda..dfdc683683 100644
--- a/board/d-link/dns325/dns325.c
+++ b/board/d-link/dns325/dns325.c
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
diff --git a/board/freescale/ls1012afrdm/eth.c b/board/freescale/ls1012afrdm/eth.c
index 421e2fe38c..bd1df092f9 100644
--- a/board/freescale/ls1012afrdm/eth.c
+++ b/board/freescale/ls1012afrdm/eth.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <net.h>
 #include <asm/io.h>
 #include <netdev.h>
 #include <fm_eth.h>
diff --git a/board/freescale/ls1012ardb/eth.c b/board/freescale/ls1012ardb/eth.c
index b35d5343e4..3cc0a65cb9 100644
--- a/board/freescale/ls1012ardb/eth.c
+++ b/board/freescale/ls1012ardb/eth.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <net.h>
 #include <asm/io.h>
 #include <netdev.h>
 #include <fm_eth.h>
diff --git a/board/freescale/ls1088a/eth_ls1088aqds.c b/board/freescale/ls1088a/eth_ls1088aqds.c
index 237088a537..54ef75347f 100644
--- a/board/freescale/ls1088a/eth_ls1088aqds.c
+++ b/board/freescale/ls1088a/eth_ls1088aqds.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
diff --git a/board/freescale/ls1088a/eth_ls1088ardb.c b/board/freescale/ls1088a/eth_ls1088ardb.c
index a2b52a879b..01f56db0a1 100644
--- a/board/freescale/ls1088a/eth_ls1088ardb.c
+++ b/board/freescale/ls1088a/eth_ls1088ardb.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
diff --git a/board/freescale/ls2080a/ls2080a.c b/board/freescale/ls2080a/ls2080a.c
index 413a698511..949b57c24e 100644
--- a/board/freescale/ls2080a/ls2080a.c
+++ b/board/freescale/ls2080a/ls2080a.c
@@ -5,6 +5,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <errno.h>
+#include <net.h>
 #include <netdev.h>
 #include <fsl_ifc.h>
 #include <fsl_ddr.h>
diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c
index 6a8788c312..bbb70a859a 100644
--- a/board/freescale/ls2080aqds/eth.c
+++ b/board/freescale/ls2080aqds/eth.c
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
diff --git a/board/freescale/ls2080ardb/eth_ls2080rdb.c b/board/freescale/ls2080ardb/eth_ls2080rdb.c
index 62c7a7a315..b0f276e839 100644
--- a/board/freescale/ls2080ardb/eth_ls2080rdb.c
+++ b/board/freescale/ls2080ardb/eth_ls2080rdb.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
diff --git a/board/freescale/lx2160a/eth_lx2160aqds.c b/board/freescale/lx2160a/eth_lx2160aqds.c
index 55e8a427e6..6500649d7b 100644
--- a/board/freescale/lx2160a/eth_lx2160aqds.c
+++ b/board/freescale/lx2160a/eth_lx2160aqds.c
@@ -8,6 +8,7 @@
 #include <env.h>
 #include <hwconfig.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
diff --git a/board/freescale/lx2160a/eth_lx2160ardb.c b/board/freescale/lx2160a/eth_lx2160ardb.c
index 365ff73cef..aeb989a638 100644
--- a/board/freescale/lx2160a/eth_lx2160ardb.c
+++ b/board/freescale/lx2160a/eth_lx2160ardb.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 7f83ec180e..b21e170fdd 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -16,6 +16,7 @@
 #include <i2c.h>
 #include <init.h>
 #include <nand.h>
+#include <net.h>
 #include <netdev.h>
 #include <miiphy.h>
 #include <spi.h>
diff --git a/board/zyxel/nsa310s/nsa310s.c b/board/zyxel/nsa310s/nsa310s.c
index e7cb6be616..82a3feee69 100644
--- a/board/zyxel/nsa310s/nsa310s.c
+++ b/board/zyxel/nsa310s/nsa310s.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
diff --git a/common/board_r.c b/common/board_r.c
index 4910a5da34..c560f2e1cf 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -14,6 +14,7 @@
 #include <cpu_func.h>
 #include <exports.h>
 #include <irq_func.h>
+#include <net.h>
 #include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
diff --git a/include/common.h b/include/common.h
index 4494cac1af..f3adf06a37 100644
--- a/include/common.h
+++ b/include/common.h
@@ -88,9 +88,6 @@ const char *symbol_lookup(unsigned long addr, unsigned long *caddr);
 long	get_ram_size  (long *, long);
 phys_size_t get_effective_memsize(void);
 
-/* $(BOARD)/$(BOARD).c */
-void	reset_phy     (void);
-
 #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/net.h b/include/net.h
index a8ee08150f..8a02c923a4 100644
--- a/include/net.h
+++ b/include/net.h
@@ -917,4 +917,12 @@ static inline struct in_addr env_get_ip(char *var)
 {
 	return string_to_ip(env_get(var));
 }
+
+/**
+ * reset_phy() - Reset the Ethernet PHY
+ *
+ * This should be implemented by boards if CONFIG_RESET_PHY_R is enabled
+ */
+void reset_phy(void);
+
 #endif /* __NET_H__ */
-- 
2.24.0.525.g8f36a354ae-goog



More information about the U-Boot mailing list