ipq40xx: add PSGMII PHY mode to phylink_get_linkmodes()
[openwrt/openwrt.git] / target / linux / ipq40xx / patches-5.15 / 704-net-phy-define-PSGMII-PHY-interface-mode.patch
1 From 157ac9f52fd9b9a22cf12f7755a905fb34ef72f7 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <j4g8y7@gmail.com>
3 Date: Fri, 25 Dec 2020 08:02:47 +0100
4 Subject: [PATCH] net: phy: define PSGMII PHY interface mode
5
6 The PSGMII interface is similar to QSGMII. The main difference
7 is that the PSGMII interface combines five SGMII lines into a
8 single link while in QSGMII only four lines are combined.
9
10 Similarly to the QSGMII, this interface mode might also needs
11 special handling within the MAC driver.
12
13 Add definitions for the PHY layer to allow to express this type
14 of connection between the MAC and PHY.
15
16 Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
17 ---
18 Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
19 drivers/net/phy/phylink.c | 2 ++
20 include/linux/phy.h | 3 +++
21 3 files changed, 6 insertions(+)
22
23 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
24 +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
25 @@ -64,6 +64,7 @@ properties:
26 - mii
27 - gmii
28 - sgmii
29 + - psgmii
30 - qsgmii
31 - tbi
32 - rev-mii
33 --- a/drivers/net/phy/phylink.c
34 +++ b/drivers/net/phy/phylink.c
35 @@ -366,6 +366,7 @@ void phylink_get_linkmodes(unsigned long
36 case PHY_INTERFACE_MODE_RGMII_RXID:
37 case PHY_INTERFACE_MODE_RGMII_ID:
38 case PHY_INTERFACE_MODE_RGMII:
39 + case PHY_INTERFACE_MODE_PSGMII:
40 case PHY_INTERFACE_MODE_QSGMII:
41 case PHY_INTERFACE_MODE_SGMII:
42 case PHY_INTERFACE_MODE_GMII:
43 @@ -629,6 +630,7 @@ static int phylink_parse_mode(struct phy
44
45 switch (pl->link_config.interface) {
46 case PHY_INTERFACE_MODE_SGMII:
47 + case PHY_INTERFACE_MODE_PSGMII:
48 case PHY_INTERFACE_MODE_QSGMII:
49 phylink_set(pl->supported, 10baseT_Half);
50 phylink_set(pl->supported, 10baseT_Full);
51 --- a/include/linux/phy.h
52 +++ b/include/linux/phy.h
53 @@ -138,6 +138,7 @@ typedef enum {
54 PHY_INTERFACE_MODE_XGMII,
55 PHY_INTERFACE_MODE_XLGMII,
56 PHY_INTERFACE_MODE_MOCA,
57 + PHY_INTERFACE_MODE_PSGMII,
58 PHY_INTERFACE_MODE_QSGMII,
59 PHY_INTERFACE_MODE_TRGMII,
60 PHY_INTERFACE_MODE_100BASEX,
61 @@ -243,6 +244,8 @@ static inline const char *phy_modes(phy_
62 return "xlgmii";
63 case PHY_INTERFACE_MODE_MOCA:
64 return "moca";
65 + case PHY_INTERFACE_MODE_PSGMII:
66 + return "psgmii";
67 case PHY_INTERFACE_MODE_QSGMII:
68 return "qsgmii";
69 case PHY_INTERFACE_MODE_TRGMII: