layerscape: add patches-5.4
[openwrt/staging/wigyori.git] / target / linux / layerscape / patches-5.4 / 701-net-0376-Revert-mii-Add-helpers-for-parsing-SGMII-auto-negoti.patch
1 From c6f9fb78b7534392d3be307e566d10c8525c7c9a Mon Sep 17 00:00:00 2001
2 From: Vladimir Oltean <vladimir.oltean@nxp.com>
3 Date: Mon, 6 Jan 2020 14:32:06 +0200
4 Subject: [PATCH] Revert "mii: Add helpers for parsing SGMII auto-negotiation"
5
6 This reverts commit de81e3c1ccbf27eda7584e23c713705a221a57da.
7
8 Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
9 ---
10 include/linux/mii.h | 50 ------------------------------------------------
11 include/uapi/linux/mii.h | 10 ----------
12 2 files changed, 60 deletions(-)
13
14 --- a/include/linux/mii.h
15 +++ b/include/linux/mii.h
16 @@ -373,56 +373,6 @@ static inline u32 mii_lpa_to_ethtool_lpa
17 }
18
19 /**
20 - * mii_lpa_mod_linkmode_adv_sgmii
21 - * @lp_advertising: pointer to destination link mode.
22 - * @lpa: value of the MII_LPA register
23 - *
24 - * A small helper function that translates MII_LPA bits to
25 - * linkmode advertisement settings for SGMII.
26 - * Leaves other bits unchanged.
27 - */
28 -static inline void
29 -mii_lpa_mod_linkmode_lpa_sgmii(unsigned long *lp_advertising, u32 lpa)
30 -{
31 - u32 speed_duplex = lpa & LPA_SGMII_DPX_SPD_MASK;
32 -
33 - linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, lp_advertising,
34 - speed_duplex == LPA_SGMII_1000HALF);
35 -
36 - linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, lp_advertising,
37 - speed_duplex == LPA_SGMII_1000FULL);
38 -
39 - linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, lp_advertising,
40 - speed_duplex == LPA_SGMII_100HALF);
41 -
42 - linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, lp_advertising,
43 - speed_duplex == LPA_SGMII_100FULL);
44 -
45 - linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, lp_advertising,
46 - speed_duplex == LPA_SGMII_10HALF);
47 -
48 - linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, lp_advertising,
49 - speed_duplex == LPA_SGMII_10FULL);
50 -}
51 -
52 -/**
53 - * mii_lpa_to_linkmode_adv_sgmii
54 - * @advertising: pointer to destination link mode.
55 - * @lpa: value of the MII_LPA register
56 - *
57 - * A small helper function that translates MII_ADVERTISE bits
58 - * to linkmode advertisement settings when in SGMII mode.
59 - * Clears the old value of advertising.
60 - */
61 -static inline void mii_lpa_to_linkmode_lpa_sgmii(unsigned long *lp_advertising,
62 - u32 lpa)
63 -{
64 - linkmode_zero(lp_advertising);
65 -
66 - mii_lpa_mod_linkmode_lpa_sgmii(lp_advertising, lpa);
67 -}
68 -
69 -/**
70 * mii_adv_mod_linkmode_adv_t
71 * @advertising:pointer to destination link mode.
72 * @adv: value of the MII_ADVERTISE register
73 --- a/include/uapi/linux/mii.h
74 +++ b/include/uapi/linux/mii.h
75 @@ -71,7 +71,6 @@
76 /* Advertisement control register. */
77 #define ADVERTISE_SLCT 0x001f /* Selector bits */
78 #define ADVERTISE_CSMA 0x0001 /* Only selector supported */
79 -#define ADVERTISE_SGMII 0x0001 /* Can do SGMII */
80 #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
81 #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
82 #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
83 @@ -95,7 +94,6 @@
84
85 /* Link partner ability register. */
86 #define LPA_SLCT 0x001f /* Same as advertise selector */
87 -#define LPA_SGMII 0x0001 /* Can do SGMII */
88 #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
89 #define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
90 #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
91 @@ -106,19 +104,11 @@
92 #define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
93 #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
94 #define LPA_PAUSE_CAP 0x0400 /* Can pause */
95 -#define LPA_SGMII_DPX_SPD_MASK 0x1C00 /* SGMII duplex and speed bits */
96 -#define LPA_SGMII_10HALF 0x0000 /* Can do SGMII 10mbps half-duplex */
97 -#define LPA_SGMII_10FULL 0x1000 /* Can do SGMII 10mbps full-duplex */
98 -#define LPA_SGMII_100HALF 0x0400 /* Can do SGMII 100mbps half-duplex */
99 -#define LPA_SGMII_100FULL 0x1400 /* Can do SGMII 100mbps full-duplex */
100 #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
101 -#define LPA_SGMII_1000HALF 0x0800 /* Can do SGMII 1000mbps half-duplex */
102 -#define LPA_SGMII_1000FULL 0x1800 /* Can do SGMII 1000mbps full-duplex */
103 #define LPA_RESV 0x1000 /* Unused... */
104 #define LPA_RFAULT 0x2000 /* Link partner faulted */
105 #define LPA_LPACK 0x4000 /* Link partner acked us */
106 #define LPA_NPAGE 0x8000 /* Next page bit */
107 -#define LPA_SGMII_LINK 0x8000 /* Link partner has link */
108
109 #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
110 #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)