@@ -1152,7 +1152,8 @@ mt753x_cpu_port_enable(struct dsa_switch *ds, int port)
1152
1152
* the MT7988 SoC. Trapped frames will be forwarded to the CPU port that
1153
1153
* is affine to the inbound user port.
1154
1154
*/
1155
- if (priv -> id == ID_MT7531 || priv -> id == ID_MT7988 )
1155
+ if (priv -> id == ID_MT7531 || priv -> id == ID_MT7988 ||
1156
+ priv -> id == ID_EN7581 )
1156
1157
mt7530_set (priv , MT7531_CFC , MT7531_CPU_PMAP (BIT (port )));
1157
1158
1158
1159
/* CPU port gets connected to all user ports of
@@ -2207,7 +2208,7 @@ mt7530_setup_irq(struct mt7530_priv *priv)
2207
2208
return priv -> irq ? : - EINVAL ;
2208
2209
}
2209
2210
2210
- if (priv -> id == ID_MT7988 )
2211
+ if (priv -> id == ID_MT7988 || priv -> id == ID_EN7581 )
2211
2212
priv -> irq_domain = irq_domain_add_linear (np , MT7530_NUM_PHYS ,
2212
2213
& mt7988_irq_domain_ops ,
2213
2214
priv );
@@ -2438,8 +2439,10 @@ mt7530_setup(struct dsa_switch *ds)
2438
2439
/* Clear link settings and enable force mode to force link down
2439
2440
* on all ports until they're enabled later.
2440
2441
*/
2441
- mt7530_rmw (priv , MT753X_PMCR_P (i ), PMCR_LINK_SETTINGS_MASK |
2442
- MT7530_FORCE_MODE , MT7530_FORCE_MODE );
2442
+ mt7530_rmw (priv , MT753X_PMCR_P (i ),
2443
+ PMCR_LINK_SETTINGS_MASK |
2444
+ MT753X_FORCE_MODE (priv -> id ),
2445
+ MT753X_FORCE_MODE (priv -> id ));
2443
2446
2444
2447
/* Disable forwarding by default on all ports */
2445
2448
mt7530_rmw (priv , MT7530_PCR_P (i ), PCR_MATRIX_MASK ,
@@ -2550,8 +2553,10 @@ mt7531_setup_common(struct dsa_switch *ds)
2550
2553
/* Clear link settings and enable force mode to force link down
2551
2554
* on all ports until they're enabled later.
2552
2555
*/
2553
- mt7530_rmw (priv , MT753X_PMCR_P (i ), PMCR_LINK_SETTINGS_MASK |
2554
- MT7531_FORCE_MODE_MASK , MT7531_FORCE_MODE_MASK );
2556
+ mt7530_rmw (priv , MT753X_PMCR_P (i ),
2557
+ PMCR_LINK_SETTINGS_MASK |
2558
+ MT753X_FORCE_MODE (priv -> id ),
2559
+ MT753X_FORCE_MODE (priv -> id ));
2555
2560
2556
2561
/* Disable forwarding by default on all ports */
2557
2562
mt7530_rmw (priv , MT7530_PCR_P (i ), PCR_MATRIX_MASK ,
@@ -2783,6 +2788,28 @@ static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port,
2783
2788
}
2784
2789
}
2785
2790
2791
+ static void en7581_mac_port_get_caps (struct dsa_switch * ds , int port ,
2792
+ struct phylink_config * config )
2793
+ {
2794
+ switch (port ) {
2795
+ /* Ports which are connected to switch PHYs. There is no MII pinout. */
2796
+ case 0 ... 4 :
2797
+ __set_bit (PHY_INTERFACE_MODE_INTERNAL ,
2798
+ config -> supported_interfaces );
2799
+
2800
+ config -> mac_capabilities |= MAC_10 | MAC_100 | MAC_1000FD ;
2801
+ break ;
2802
+
2803
+ /* Port 6 is connected to SoC's XGMII MAC. There is no MII pinout. */
2804
+ case 6 :
2805
+ __set_bit (PHY_INTERFACE_MODE_INTERNAL ,
2806
+ config -> supported_interfaces );
2807
+
2808
+ config -> mac_capabilities |= MAC_10000FD ;
2809
+ break ;
2810
+ }
2811
+ }
2812
+
2786
2813
static void
2787
2814
mt7530_mac_config (struct dsa_switch * ds , int port , unsigned int mode ,
2788
2815
phy_interface_t interface )
@@ -3220,6 +3247,16 @@ const struct mt753x_info mt753x_table[] = {
3220
3247
.phy_write_c45 = mt7531_ind_c45_phy_write ,
3221
3248
.mac_port_get_caps = mt7988_mac_port_get_caps ,
3222
3249
},
3250
+ [ID_EN7581 ] = {
3251
+ .id = ID_EN7581 ,
3252
+ .pcs_ops = & mt7530_pcs_ops ,
3253
+ .sw_setup = mt7988_setup ,
3254
+ .phy_read_c22 = mt7531_ind_c22_phy_read ,
3255
+ .phy_write_c22 = mt7531_ind_c22_phy_write ,
3256
+ .phy_read_c45 = mt7531_ind_c45_phy_read ,
3257
+ .phy_write_c45 = mt7531_ind_c45_phy_write ,
3258
+ .mac_port_get_caps = en7581_mac_port_get_caps ,
3259
+ },
3223
3260
};
3224
3261
EXPORT_SYMBOL_GPL (mt753x_table );
3225
3262
0 commit comments