summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-08-08 12:20:31 -0600
committerTom Rini <trini@konsulko.com>2021-09-04 12:51:47 -0400
commit9f6649209f09adcdcec4f194cbca9bdcf9c43bef (patch)
treebc6e51a4c759f59065d86c25ab0bb110addd28aa
parent5ed16a9511d735feea74d6b4ea940f5e6b5dd8fc (diff)
downloadu-boot-WIP/2021-09-04-makefile-cleanups-part-b.tar.gz
net: Move network rules to drivers/netWIP/2021-09-04-makefile-cleanups-part-b
The code under drivers/net is related to ethernet networking drivers, in some fashion or another. Drop these from the top-level Makefile and also move the phy rule into drivers/net/Makefile which is where it belongs. Make the new rule for drivers/net check for the build-stage relevant ETH symbol. Fix up some Kconfig dependencies while we're here to mirror how the Makefile logic now works. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Introduce ETH, Kconfig dependency changes, am43xx fix] Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--Makefile3
-rw-r--r--common/spl/Kconfig2
-rw-r--r--drivers/Makefile4
-rw-r--r--drivers/net/Kconfig3
-rw-r--r--drivers/net/Makefile3
-rw-r--r--include/configs/am43xx_evm.h2
-rw-r--r--net/eth_common.c2
7 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 9465e228fa..72cfa5c2d5 100644
--- a/Makefile
+++ b/Makefile
@@ -813,9 +813,6 @@ libs-y += fs/
libs-y += net/
libs-y += disk/
libs-y += drivers/
-libs-y += drivers/net/
-libs-y += drivers/net/phy/
-libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
libs-$(CONFIG_$(SPL_)ALTERA_SDRAM) += drivers/ddr/altera/
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c43df88e4a..34e8a12036 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -585,6 +585,7 @@ config SPL_SAVEENV
config SPL_ETH
bool "Support Ethernet"
depends on SPL_ENV_SUPPORT
+ depends on SPL_NET
help
Enable access to the network subsystem and associated Ethernet
drivers in SPL. This permits SPL to load U-Boot over an Ethernet
@@ -1216,6 +1217,7 @@ if SPL_USB_GADGET
config SPL_USB_ETHER
bool "Support USB Ethernet drivers"
+ depends on SPL_NET
help
Enable access to the USB network subsystem and associated
drivers in SPL. This permits SPL to load U-Boot over a
diff --git a/drivers/Makefile b/drivers/Makefile
index 1283b88ea1..4cbc40787d 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_$(SPL_TPL_)LED) += led/
obj-$(CONFIG_$(SPL_TPL_)MMC) += mmc/
obj-y += mtd/
obj-$(CONFIG_$(SPL_)MULTIPLEXER) += mux/
+obj-$(CONFIG_$(SPL_TPL_)ETH) += net/
obj-$(CONFIG_$(SPL_TPL_)PCH) += pch/
obj-$(CONFIG_$(SPL_TPL_)PCI) += pci/
obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/
@@ -48,9 +49,6 @@ obj-$(CONFIG_$(SPL_)ALTERA_SDRAM) += ddr/altera/
obj-$(CONFIG_ARCH_IMX8M) += ddr/imx/imx8m/
obj-$(CONFIG_IMX8ULP_DRAM) += ddr/imx/imx8ulp/
obj-$(CONFIG_SPL_DM_RESET) += reset/
-obj-$(CONFIG_SPL_ETH) += net/
-obj-$(CONFIG_SPL_ETH) += net/phy/
-obj-$(CONFIG_SPL_USB_ETHER) += net/phy/
obj-$(CONFIG_SPL_MUSB_NEW) += usb/musb-new/
obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0b906db5c1..8b1add19e8 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2,6 +2,9 @@ source "drivers/net/phy/Kconfig"
source "drivers/net/pfe_eth/Kconfig"
source "drivers/net/fsl-mc/Kconfig"
+config ETH
+ def_bool y
+
config DM_ETH
bool "Enable Driver Model for Ethernet drivers"
depends on DM
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index b94ccea100..96c061aafd 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -3,6 +3,8 @@
# (C) Copyright 2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+obj-y += phy/
+
obj-$(CONFIG_ALTERA_TSE) += altera_tse.o
obj-$(CONFIG_AG7XXX) += ag7xxx.o
obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
@@ -33,6 +35,7 @@ obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
obj-$(CONFIG_EP93XX) += ep93xx_eth.o
obj-$(CONFIG_ETHOC) += ethoc.o
obj-$(CONFIG_FEC_MXC) += fec_mxc.o
+obj-$(CONFIG_FMAN_ENET) += fm/
obj-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
obj-$(CONFIG_FTGMAC100) += ftgmac100.o
obj-$(CONFIG_FTMAC110) += ftmac110.o
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index d4d463d24e..ff1949e7e0 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -59,7 +59,7 @@
#define CONFIG_AM437X_USB2PHY2_HOST
#endif
-#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_USB_ETHER)
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_USB_GADGET)
#undef CONFIG_USB_DWC3_PHY_OMAP
#undef CONFIG_USB_DWC3_OMAP
#undef CONFIG_USB_DWC3
diff --git a/net/eth_common.c b/net/eth_common.c
index 58f899a024..82d527abba 100644
--- a/net/eth_common.c
+++ b/net/eth_common.c
@@ -32,6 +32,7 @@ int eth_env_set_enetaddr_by_index(const char *base_name, int index,
void eth_common_init(void)
{
bootstage_mark(BOOTSTAGE_ID_NET_ETH_START);
+#if CONFIG_IS_ENABLED(ETH)
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
miiphy_init();
#endif
@@ -39,6 +40,7 @@ void eth_common_init(void)
#ifdef CONFIG_PHYLIB
phy_init();
#endif
+#endif
}
int eth_mac_skip(int index)