* [PATCHv2 1/5] net: dsa: Support internal phy on 'cpu' port
2018-01-15 12:15 [PATCHv2 0/5] GEHC Bx50 Switch Support Sebastian Reichel
@ 2018-01-15 12:15 ` Sebastian Reichel
[not found] ` <20180115121508.14544-2-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2018-01-15 12:15 ` [PATCHv2 2/5] ARM: dts: imx6q-bx50v3: Add internal switch Sebastian Reichel
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Sebastian Reichel @ 2018-01-15 12:15 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Shawn Guo,
Sascha Hauer, Fabio Estevam
Cc: Ian Ray, Nandor Han, Rob Herring, David S. Miller, netdev,
devicetree, linux-kernel, Sebastian Reichel
This adds support for enabling the internal PHY for a 'cpu' port.
It has been tested on GE B850v3, B650v3 and B450v3, which have a
built-in MV88E6240 switch connected to a PCIe based network card.
Without this patch the link does not come up and no traffic can be
routed through the switch.
The PHY interface, that is being used on the above test systems is
part of the MV88E6240 and since mv88e6xxx driver resets the chip
during probe, it is definitely disabled without this patch.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
net/dsa/port.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/net/dsa/port.c b/net/dsa/port.c
index bb4be2679904..33ea0d73350d 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -282,6 +282,10 @@ int dsa_port_fixed_link_register_of(struct dsa_port *dp)
int mode;
int err;
+ mode = of_get_phy_mode(dn);
+ if (mode < 0)
+ mode = PHY_INTERFACE_MODE_NA;
+
if (of_phy_is_fixed_link(dn)) {
err = of_phy_register_fixed_link(dn);
if (err) {
@@ -292,10 +296,6 @@ int dsa_port_fixed_link_register_of(struct dsa_port *dp)
}
phydev = of_phy_find_device(dn);
-
- mode = of_get_phy_mode(dn);
- if (mode < 0)
- mode = PHY_INTERFACE_MODE_NA;
phydev->interface = mode;
genphy_config_init(phydev);
@@ -305,6 +305,21 @@ int dsa_port_fixed_link_register_of(struct dsa_port *dp)
ds->ops->adjust_link(ds, port, phydev);
put_device(&phydev->mdio.dev);
+ } else if (mode == PHY_INTERFACE_MODE_INTERNAL) {
+ phydev = mdiobus_get_phy(ds->slave_mii_bus, port);
+ if (!phydev) {
+ dev_err(ds->dev, "port %d has no internal phy!", port);
+ return -ENODEV;
+ }
+
+ genphy_config_init(phydev);
+ genphy_resume(phydev);
+ genphy_read_status(phydev);
+
+ if (ds->ops->adjust_link)
+ ds->ops->adjust_link(ds, port, phydev);
+
+ dev_dbg(ds->dev, "enabled port's phy: %s", phydev_name(phydev));
}
return 0;
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv2 2/5] ARM: dts: imx6q-bx50v3: Add internal switch
2018-01-15 12:15 [PATCHv2 0/5] GEHC Bx50 Switch Support Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 1/5] net: dsa: Support internal phy on 'cpu' port Sebastian Reichel
@ 2018-01-15 12:15 ` Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 3/5] ARM: dts: imx6q-b850v3: Add switch port configuration Sebastian Reichel
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Sebastian Reichel @ 2018-01-15 12:15 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Shawn Guo,
Sascha Hauer, Fabio Estevam
Cc: Ian Ray, Nandor Han, Rob Herring, David S. Miller, netdev,
devicetree, linux-kernel, Sebastian Reichel
B850v3, B650v3 and B450v3 all have a GPIO bit banged MDIO bus to
communicate with a Marvell switch. On all devices the switch is
connected to a PCI based network card, which needs to be referenced
by DT, so this also adds the common PCI root node.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
arch/arm/boot/dts/imx6q-bx50v3.dtsi | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm/boot/dts/imx6q-bx50v3.dtsi b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
index b915837bbb5f..aefce581c0c3 100644
--- a/arch/arm/boot/dts/imx6q-bx50v3.dtsi
+++ b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
@@ -92,6 +92,31 @@
mux-int-port = <1>;
mux-ext-port = <4>;
};
+
+ aliases {
+ mdio-gpio0 = &mdio0;
+ };
+
+ mdio0: mdio-gpio {
+ compatible = "virtual,mdio-gpio";
+ gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>, /* mdc */
+ <&gpio2 7 GPIO_ACTIVE_HIGH>; /* mdio */
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ switch@0 {
+ compatible = "marvell,mv88e6085"; /* 88e6240*/
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ switch_ports: ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+ };
};
&ecspi5 {
@@ -326,3 +351,15 @@
tcxo-clock-frequency = <26000000>;
};
};
+
+&pcie {
+ /* Synopsys, Inc. Device */
+ pci_root: root@0,0 {
+ compatible = "pci16c3,abcd";
+ reg = <0x00000000 0 0 0 0>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+ };
+};
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv2 3/5] ARM: dts: imx6q-b850v3: Add switch port configuration
2018-01-15 12:15 [PATCHv2 0/5] GEHC Bx50 Switch Support Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 1/5] net: dsa: Support internal phy on 'cpu' port Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 2/5] ARM: dts: imx6q-bx50v3: Add internal switch Sebastian Reichel
@ 2018-01-15 12:15 ` Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 4/5] ARM: dts: imx6q-b650v3: " Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 5/5] ARM: dts: imx6q-b450v3: " Sebastian Reichel
4 siblings, 0 replies; 7+ messages in thread
From: Sebastian Reichel @ 2018-01-15 12:15 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Shawn Guo,
Sascha Hauer, Fabio Estevam
Cc: Ian Ray, Nandor Han, Rob Herring, David S. Miller, netdev,
devicetree, linux-kernel, Sebastian Reichel
This adds support for the Marvell switch and names the network
ports according to the labels, that can be found next to the
connectors ("ID", "IX", "ePort 1", "ePort 2"). The switch is
connected to the host system using a PCI based network card.
The PCI bus configuration has been written using the following
information:
root@b850v3# lspci -tv
-[0000:00]---00.0-[01]----00.0-[02-05]--+-01.0-[03]----00.0 Intel Corporation I210 Gigabit Network Connection
+-02.0-[04]----00.0 Intel Corporation I210 Gigabit Network Connection
\-03.0-[05]--
root@b850v3# lspci -nn
00:00.0 PCI bridge [0604]: Synopsys, Inc. Device [16c3:abcd] (rev 01)
01:00.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev ab)
02:01.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev ab)
02:02.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev ab)
02:03.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev ab)
03:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:1533] (rev 03)
04:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:1533] (rev 03)
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
arch/arm/boot/dts/imx6q-b850v3.dts | 71 ++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/arch/arm/boot/dts/imx6q-b850v3.dts b/arch/arm/boot/dts/imx6q-b850v3.dts
index 46bdc6722715..c3a9d73a7b78 100644
--- a/arch/arm/boot/dts/imx6q-b850v3.dts
+++ b/arch/arm/boot/dts/imx6q-b850v3.dts
@@ -212,3 +212,74 @@
};
};
};
+
+&pci_root {
+ /* PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch */
+ bridge@1,0 {
+ compatible = "pci10b5,8605";
+ reg = <0x00010000 0 0 0 0>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+
+ bridge@2,1 {
+ compatible = "pci10b5,8605";
+ reg = <0x00020800 0 0 0 0>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+
+ /* Intel Corporation I210 Gigabit Network Connection */
+ ethernet@3,0 {
+ compatible = "pci8086,1533";
+ reg = <0x00030000 0 0 0 0>;
+ };
+ };
+
+ bridge@2,2 {
+ compatible = "pci10b5,8605";
+ reg = <0x00021000 0 0 0 0>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+
+ /* Intel Corporation I210 Gigabit Network Connection */
+ switch_nic: ethernet@4,0 {
+ compatible = "pci8086,1533";
+ reg = <0x00040000 0 0 0 0>;
+ };
+ };
+ };
+};
+
+&switch_ports {
+ port@0 {
+ reg = <0>;
+ label = "eneport1";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "eneport2";
+ };
+
+ port@2 {
+ reg = <2>;
+ label = "enix";
+ };
+
+ port@3 {
+ reg = <3>;
+ label = "enid";
+ };
+
+ port@4 {
+ reg = <4>;
+ label = "cpu";
+ phy-mode = "internal";
+ ethernet = <&switch_nic>;
+ };
+};
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv2 4/5] ARM: dts: imx6q-b650v3: Add switch port configuration
2018-01-15 12:15 [PATCHv2 0/5] GEHC Bx50 Switch Support Sebastian Reichel
` (2 preceding siblings ...)
2018-01-15 12:15 ` [PATCHv2 3/5] ARM: dts: imx6q-b850v3: Add switch port configuration Sebastian Reichel
@ 2018-01-15 12:15 ` Sebastian Reichel
2018-01-15 12:15 ` [PATCHv2 5/5] ARM: dts: imx6q-b450v3: " Sebastian Reichel
4 siblings, 0 replies; 7+ messages in thread
From: Sebastian Reichel @ 2018-01-15 12:15 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Shawn Guo,
Sascha Hauer, Fabio Estevam
Cc: Ian Ray, Nandor Han, Rob Herring, David S. Miller, netdev,
devicetree, linux-kernel, Sebastian Reichel
This adds support for the Marvell switch and names the network
ports according to the labels, that can be found next to the
connectors. The switch is connected to the host system using a
PCI based network card.
The PCI bus configuration has been written using the following
information:
root@b650v3# lspci -tv
-[0000:00]---00.0-[01]----00.0 Intel Corporation I210 Gigabit Network Connection
root@b650v3# lspci -nn
00:00.0 PCI bridge [0604]: Synopsys, Inc. Device [16c3:abcd] (rev 01)
01:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:1533] (rev 03)
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
arch/arm/boot/dts/imx6q-b650v3.dts | 48 ++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/arch/arm/boot/dts/imx6q-b650v3.dts b/arch/arm/boot/dts/imx6q-b650v3.dts
index 7f9f176901d4..91b5b5157655 100644
--- a/arch/arm/boot/dts/imx6q-b650v3.dts
+++ b/arch/arm/boot/dts/imx6q-b650v3.dts
@@ -111,3 +111,51 @@
fsl,tx-cal-45-dp-ohms = <55>;
fsl,tx-d-cal = <100>;
};
+
+&pci_root {
+ /* Intel Corporation I210 Gigabit Network Connection */
+ switch_nic: ethernet@3,0 {
+ compatible = "pci8086,1533";
+ reg = <0x00010000 0 0 0 0>;
+ };
+};
+
+&switch_ports {
+ port@0 {
+ reg = <0>;
+ label = "enacq";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "eneport1";
+ };
+
+ port@2 {
+ reg = <2>;
+ label = "enix";
+ };
+
+ port@3 {
+ reg = <3>;
+ label = "enid";
+ };
+
+ port@4 {
+ reg = <4>;
+ label = "cpu";
+ phy-mode = "internal";
+ ethernet = <&switch_nic>;
+ };
+
+ port@5 {
+ reg = <5>;
+ label = "enembc";
+
+ /* connected to Ethernet MAC of AT91RM9200 in MII mode */
+ fixed-link {
+ speed = <100>;
+ full-duplex;
+ };
+ };
+};
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv2 5/5] ARM: dts: imx6q-b450v3: Add switch port configuration
2018-01-15 12:15 [PATCHv2 0/5] GEHC Bx50 Switch Support Sebastian Reichel
` (3 preceding siblings ...)
2018-01-15 12:15 ` [PATCHv2 4/5] ARM: dts: imx6q-b650v3: " Sebastian Reichel
@ 2018-01-15 12:15 ` Sebastian Reichel
4 siblings, 0 replies; 7+ messages in thread
From: Sebastian Reichel @ 2018-01-15 12:15 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Shawn Guo,
Sascha Hauer, Fabio Estevam
Cc: Ian Ray, Nandor Han, Rob Herring, David S. Miller, netdev,
devicetree, linux-kernel, Sebastian Reichel
This adds support for the Marvell switch and names the network
ports according to the labels, that can be found next to the
connectors. The switch is connected to the host system using a
PCI based network card.
The PCI bus configuration has been written using the following
information:
root@b450v3# lspci -tv
-[0000:00]---00.0-[01]----00.0 Intel Corporation I210 Gigabit Network Connection
root@b450v3# lspci -nn
00:00.0 PCI bridge [0604]: Synopsys, Inc. Device [16c3:abcd] (rev 01)
01:00.0 Ethernet controller [0200]: Intel Corporation I210 Gigabit Network Connection [8086:1533] (rev 03)
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
arch/arm/boot/dts/imx6q-b450v3.dts | 48 ++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/arch/arm/boot/dts/imx6q-b450v3.dts b/arch/arm/boot/dts/imx6q-b450v3.dts
index 404a93d9596b..e0bb646e2de7 100644
--- a/arch/arm/boot/dts/imx6q-b450v3.dts
+++ b/arch/arm/boot/dts/imx6q-b450v3.dts
@@ -112,3 +112,51 @@
line-name = "PCA9539-P07";
};
};
+
+&pci_root {
+ /* Intel Corporation I210 Gigabit Network Connection */
+ switch_nic: ethernet@3,0 {
+ compatible = "pci8086,1533";
+ reg = <0x00010000 0 0 0 0>;
+ };
+};
+
+&switch_ports {
+ port@0 {
+ reg = <0>;
+ label = "enacq";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "eneport1";
+ };
+
+ port@2 {
+ reg = <2>;
+ label = "enix";
+ };
+
+ port@3 {
+ reg = <3>;
+ label = "enid";
+ };
+
+ port@4 {
+ reg = <4>;
+ label = "cpu";
+ phy-mode = "internal";
+ ethernet = <&switch_nic>;
+ };
+
+ port@5 {
+ reg = <5>;
+ label = "enembc";
+
+ /* connected to Ethernet MAC of AT91RM9200 in MII mode */
+ fixed-link {
+ speed = <100>;
+ full-duplex;
+ };
+ };
+};
--
2.15.1
^ permalink raw reply related [flat|nested] 7+ messages in thread