1 From 6864e50946bf92f96b8452d1e47765230a276bb0 Mon Sep 17 00:00:00 2001
2 From: Vladimir Oltean <vladimir.oltean@nxp.com>
3 Date: Mon, 6 Jan 2020 14:30:58 +0200
4 Subject: [PATCH] Revert "net: mscc: ocelot: do not force Felix MACs at lower
7 This reverts commit f3ebad1269aad8a04710e84dc1cd5de485e5fec4.
9 Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
11 drivers/net/dsa/ocelot/felix.c | 1 -
12 drivers/net/dsa/ocelot/felix.h | 1 -
13 drivers/net/dsa/ocelot/felix_vsc9959.c | 1 -
14 drivers/net/ethernet/mscc/ocelot.c | 32 ++++++++++++++------------------
15 include/soc/mscc/ocelot.h | 7 -------
16 5 files changed, 14 insertions(+), 28 deletions(-)
18 --- a/drivers/net/dsa/ocelot/felix.c
19 +++ b/drivers/net/dsa/ocelot/felix.c
20 @@ -249,7 +249,6 @@ static int felix_init_structs(struct fel
21 ocelot->num_stats = felix->info->num_stats;
22 ocelot->shared_queue_sz = felix->info->shared_queue_sz;
23 ocelot->ops = felix->info->ops;
24 - ocelot->quirks = felix->info->quirks;
26 base = pci_resource_start(felix->pdev, felix->info->pci_bar);
28 --- a/drivers/net/dsa/ocelot/felix.h
29 +++ b/drivers/net/dsa/ocelot/felix.h
30 @@ -18,7 +18,6 @@ struct felix_info {
31 unsigned int num_stats;
34 - unsigned long quirks;
37 extern struct felix_info felix_info_vsc9959;
38 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c
39 +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
40 @@ -584,5 +584,4 @@ struct felix_info felix_info_vsc9959 = {
41 .shared_queue_sz = 128 * 1024,
44 - .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION,
46 --- a/drivers/net/ethernet/mscc/ocelot.c
47 +++ b/drivers/net/ethernet/mscc/ocelot.c
48 @@ -409,32 +409,27 @@ static u16 ocelot_wm_enc(u16 value)
49 void ocelot_adjust_link(struct ocelot *ocelot, int port,
50 struct phy_device *phydev)
52 - int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA;
53 struct ocelot_port *ocelot_port = ocelot->ports[port];
54 + int speed, mode = 0;
56 - if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION)
59 - speed = phydev->speed;
62 + switch (phydev->speed) {
64 - mac_speed = OCELOT_SPEED_10;
65 + speed = OCELOT_SPEED_10;
68 - mac_speed = OCELOT_SPEED_100;
69 + speed = OCELOT_SPEED_100;
72 - mac_speed = OCELOT_SPEED_1000;
73 - mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
74 + speed = OCELOT_SPEED_1000;
75 + mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
78 - mac_speed = OCELOT_SPEED_2500;
79 - mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
80 + speed = OCELOT_SPEED_2500;
81 + mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA;
84 dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n",
86 + port, phydev->speed);
90 @@ -444,7 +439,8 @@ void ocelot_adjust_link(struct ocelot *o
93 /* Only full duplex supported for now */
94 - ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG);
95 + ocelot_port_writel(ocelot_port, DEV_MAC_MODE_CFG_FDX_ENA |
96 + mode, DEV_MAC_MODE_CFG);
98 if (ocelot->ops->pcs_init)
99 ocelot->ops->pcs_init(ocelot, port);
100 @@ -455,11 +451,11 @@ void ocelot_adjust_link(struct ocelot *o
102 /* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of
104 - ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(mac_speed),
105 + ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed),
109 - ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(mac_speed),
110 + ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(speed),
111 ANA_PFC_PFC_CFG, port);
113 /* Core: Enable port for frame transfer */
114 @@ -473,7 +469,7 @@ void ocelot_adjust_link(struct ocelot *o
115 SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA |
116 SYS_MAC_FC_CFG_ZERO_PAUSE_ENA |
117 SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) |
118 - SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed),
119 + SYS_MAC_FC_CFG_FC_LINK_SPEED(speed),
120 SYS_MAC_FC_CFG, port);
121 ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port);
123 --- a/include/soc/mscc/ocelot.h
124 +++ b/include/soc/mscc/ocelot.h
125 @@ -404,11 +404,6 @@ enum ocelot_tag_prefix {
126 OCELOT_TAG_PREFIX_LONG,
129 -/* Hardware quirks (differences between switch instantiations) */
131 - OCELOT_PCS_PERFORMS_RATE_ADAPTATION = BIT(0),
137 @@ -469,8 +464,6 @@ struct ocelot {
138 struct delayed_work stats_work;
139 struct workqueue_struct *stats_queue;
141 - unsigned long quirks;
144 struct ptp_clock *ptp_clock;
145 struct ptp_clock_info ptp_info;