mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
There are six variants of the cpsw driver, sharing various parts of
the code: davinci-emac, cpsw, cpsw-switchdev, netcp, netcp_ethss and
am65-cpsw-nuss.
I noticed that this means some files can be linked into more than
one loadable module, or even part of vmlinux but also linked into
a loadable module, both of which mess up assumptions of the build
system, and causes warnings:
scripts/Makefile.build:279: cpsw_ale.o is added to multiple modules: ti-am65-cpsw-nuss ti_cpsw ti_cpsw_new
scripts/Makefile.build:279: cpsw_priv.o is added to multiple modules: ti_cpsw ti_cpsw_new
scripts/Makefile.build:279: cpsw_sl.o is added to multiple modules: ti-am65-cpsw-nuss ti_cpsw ti_cpsw_new
scripts/Makefile.build:279: cpsw_ethtool.o is added to multiple modules: ti_cpsw ti_cpsw_new
scripts/Makefile.build:279: davinci_cpdma.o is added to multiple modules: ti_cpsw ti_cpsw_new ti_davinci_emac
Change this back to having separate modules for each portion that
can be linked standalone, exporting symbols as needed:
- ti-cpsw-common.ko now contains both cpsw-common.o and
davinci_cpdma.o as they are always used together
- ti-cpsw-priv.ko contains cpsw_priv.o, cpsw_sl.o and cpsw_ethtool.o,
which are the core of the cpsw and cpsw-new drivers.
- ti-cpsw-sl.ko contains the cpsw-sl.o object and is used on
ti-am65-cpsw-nuss.ko in addition to the two other cpsw variants.
- ti-cpsw-ale.o is the one standalone module that is used by all
except davinci_emac.
Each of these will be built-in if any of its users are built-in, otherwise
it's a loadable module if there is at least one module using it. I did
not bring back the separate Kconfig symbols for this, but just handle
it using Makefile logic.
Note: ideally this is something that Kbuild complains about, but usually
we just notice when something using THIS_MODULE misbehaves in a way that
a user notices.
Fixes: 99f6297182 ("net: ethernet: ti: cpsw: drop TI_DAVINCI_CPDMA config option")
Link: https://lore.kernel.org/lkml/20240417084400.3034104-1-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260402184726.3746487-2-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
52 lines
1.9 KiB
Makefile
52 lines
1.9 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the TI network device drivers.
|
|
#
|
|
|
|
obj-$(CONFIG_TI_PRUETH) += icssm-prueth.o
|
|
icssm-prueth-y := icssm/icssm_prueth.o icssm/icssm_prueth_switch.o icssm/icssm_switchdev.o
|
|
|
|
ti-cpsw-common-y += cpsw-common.o davinci_cpdma.o
|
|
ti-cpsw-priv-y += cpsw_priv.o cpsw_ethtool.o
|
|
ti-cpsw-ale-y += cpsw_ale.o
|
|
ti-cpsw-sl-y += cpsw_sl.o
|
|
|
|
obj-$(CONFIG_TLAN) += tlan.o
|
|
obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o ti-cpsw-common.o
|
|
obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
|
|
obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
|
|
obj-$(CONFIG_TI_CPTS) += cpts.o
|
|
obj-$(CONFIG_TI_CPSW) += ti_cpsw.o ti-cpsw-common.o ti-cpsw-priv.o ti-cpsw-ale.o ti-cpsw-sl.o
|
|
ti_cpsw-y := cpsw.o
|
|
obj-$(CONFIG_TI_CPSW_SWITCHDEV) += ti_cpsw_new.o ti-cpsw-common.o ti-cpsw-priv.o ti-cpsw-ale.o ti-cpsw-sl.o
|
|
ti_cpsw_new-y := cpsw_switchdev.o cpsw_new.o
|
|
|
|
obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o ti-cpsw-ale.o
|
|
keystone_netcp-y := netcp_core.o
|
|
obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o ti-cpsw-ale.o
|
|
keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o
|
|
|
|
obj-$(CONFIG_TI_K3_CPPI_DESC_POOL) += k3-cppi-desc-pool.o
|
|
|
|
obj-$(CONFIG_TI_K3_AM65_CPSW_NUSS) += ti-am65-cpsw-nuss.o ti-cpsw-sl.o ti-cpsw-ale.o
|
|
ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o am65-cpsw-ethtool.o
|
|
ti-am65-cpsw-nuss-$(CONFIG_TI_AM65_CPSW_QOS) += am65-cpsw-qos.o
|
|
ti-am65-cpsw-nuss-$(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV) += am65-cpsw-switchdev.o
|
|
obj-$(CONFIG_TI_K3_AM65_CPTS) += am65-cpts.o
|
|
|
|
obj-$(CONFIG_TI_ICSSG_PRUETH) += icssg-prueth.o icssg.o
|
|
icssg-prueth-y := icssg/icssg_prueth.o icssg/icssg_switchdev.o
|
|
|
|
obj-$(CONFIG_TI_ICSSG_PRUETH_SR1) += icssg-prueth-sr1.o icssg.o
|
|
icssg-prueth-sr1-y := icssg/icssg_prueth_sr1.o
|
|
|
|
icssg-y := icssg/icssg_common.o \
|
|
icssg/icssg_classifier.o \
|
|
icssg/icssg_queues.o \
|
|
icssg/icssg_config.o \
|
|
icssg/icssg_mii_cfg.o \
|
|
icssg/icssg_stats.o \
|
|
icssg/icssg_ethtool.o
|
|
|
|
obj-$(CONFIG_TI_ICSS_IEP) += icssg/icss_iep.o
|