Commit d60bc62d authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: seville: build as separate module

Seville does not need to depend on PCI or on the ENETC MDIO controller.
There will also be other compile-time differences in the future.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2ac7c6c5
...@@ -10,11 +10,17 @@ config NET_DSA_MSCC_FELIX ...@@ -10,11 +10,17 @@ config NET_DSA_MSCC_FELIX
select FSL_ENETC_MDIO select FSL_ENETC_MDIO
select PCS_LYNX select PCS_LYNX
help help
This driver supports network switches from the Vitesse / This driver supports the VSC9959 (Felix) switch, which is embedded as
Microsemi / Microchip Ocelot family of switching cores that are a PCIe function of the NXP LS1028A ENETC RCiEP.
connected to their host CPU via Ethernet.
The following switches are supported: config NET_DSA_MSCC_SEVILLE
- VSC9959 (Felix): embedded as a PCIe function of the NXP LS1028A tristate "Ocelot / Seville Ethernet switch support"
ENETC integrated endpoint. depends on NET_DSA
- VSC9953 (Seville): embedded as a platform device on the depends on NET_VENDOR_MICROSEMI
NXP T1040 SoC. depends on HAS_IOMEM
select MSCC_OCELOT_SWITCH_LIB
select NET_DSA_TAG_OCELOT
select PCS_LYNX
help
This driver supports the VSC9953 (Seville) switch, which is embedded
as a platform device on the NXP T1040 SoC.
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o
mscc_felix-objs := \ mscc_felix-objs := \
felix.o \ felix.o \
felix_vsc9959.o \ felix_vsc9959.o
mscc_seville-objs := \
felix.o \
seville_vsc9953.o seville_vsc9953.o
...@@ -782,29 +782,3 @@ const struct dsa_switch_ops felix_switch_ops = { ...@@ -782,29 +782,3 @@ const struct dsa_switch_ops felix_switch_ops = {
.cls_flower_stats = felix_cls_flower_stats, .cls_flower_stats = felix_cls_flower_stats,
.port_setup_tc = felix_port_setup_tc, .port_setup_tc = felix_port_setup_tc,
}; };
static int __init felix_init(void)
{
int err;
err = pci_register_driver(&felix_vsc9959_pci_driver);
if (err)
return err;
err = platform_driver_register(&seville_vsc9953_driver);
if (err)
return err;
return 0;
}
module_init(felix_init);
static void __exit felix_exit(void)
{
pci_unregister_driver(&felix_vsc9959_pci_driver);
platform_driver_unregister(&seville_vsc9953_driver);
}
module_exit(felix_exit);
MODULE_DESCRIPTION("Felix Switch driver");
MODULE_LICENSE("GPL v2");
...@@ -42,8 +42,6 @@ struct felix_info { ...@@ -42,8 +42,6 @@ struct felix_info {
}; };
extern const struct dsa_switch_ops felix_switch_ops; extern const struct dsa_switch_ops felix_switch_ops;
extern struct pci_driver felix_vsc9959_pci_driver;
extern struct platform_driver seville_vsc9953_driver;
/* DSA glue / front-end for struct ocelot */ /* DSA glue / front-end for struct ocelot */
struct felix { struct felix {
......
...@@ -1328,9 +1328,13 @@ static struct pci_device_id felix_ids[] = { ...@@ -1328,9 +1328,13 @@ static struct pci_device_id felix_ids[] = {
}; };
MODULE_DEVICE_TABLE(pci, felix_ids); MODULE_DEVICE_TABLE(pci, felix_ids);
struct pci_driver felix_vsc9959_pci_driver = { static struct pci_driver felix_vsc9959_pci_driver = {
.name = "mscc_felix", .name = "mscc_felix",
.id_table = felix_ids, .id_table = felix_ids,
.probe = felix_pci_probe, .probe = felix_pci_probe,
.remove = felix_pci_remove, .remove = felix_pci_remove,
}; };
module_pci_driver(felix_vsc9959_pci_driver);
MODULE_DESCRIPTION("Felix Switch driver");
MODULE_LICENSE("GPL v2");
...@@ -1110,7 +1110,7 @@ static const struct of_device_id seville_of_match[] = { ...@@ -1110,7 +1110,7 @@ static const struct of_device_id seville_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, seville_of_match); MODULE_DEVICE_TABLE(of, seville_of_match);
struct platform_driver seville_vsc9953_driver = { static struct platform_driver seville_vsc9953_driver = {
.probe = seville_probe, .probe = seville_probe,
.remove = seville_remove, .remove = seville_remove,
.driver = { .driver = {
...@@ -1118,3 +1118,7 @@ struct platform_driver seville_vsc9953_driver = { ...@@ -1118,3 +1118,7 @@ struct platform_driver seville_vsc9953_driver = {
.of_match_table = of_match_ptr(seville_of_match), .of_match_table = of_match_ptr(seville_of_match),
}, },
}; };
module_platform_driver(seville_vsc9953_driver);
MODULE_DESCRIPTION("Seville Switch driver");
MODULE_LICENSE("GPL v2");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment