Skip to content

Commit 37c218d

Browse files
arinc9davem330
authored andcommitted
net: dsa: mt7530: fix corrupt frames using trgmii on 40 MHz XTAL MT7621
The multi-chip module MT7530 switch with a 40 MHz oscillator on the MT7621AT, MT7621DAT, and MT7621ST SoCs forwards corrupt frames using trgmii. This is caused by the assumption that MT7621 SoCs have got 150 MHz PLL, hence using the ncpo1 value, 0x0780. My testing shows this value works on Unielec U7621-06, Bartel's testing shows it won't work on Hi-Link HLK-MT7621A and Netgear WAC104. All devices tested have got 40 MHz oscillators. Using the value for 125 MHz PLL, 0x0640, works on all boards at hand. The definitions for 125 MHz PLL exist on the Banana Pi BPI-R2 BSP source code whilst 150 MHz PLL don't. Forwarding frames using trgmii on the MCM MT7530 switch with a 25 MHz oscillator on the said MT7621 SoCs works fine because the ncpo1 value defined for it is for 125 MHz PLL. Change the 150 MHz PLL comment to 125 MHz PLL, and use the 125 MHz PLL ncpo1 values for both oscillator frequencies. Link: https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/81d24bbce7d99524d0771a8bdb2d6663e4eb4faa/u-boot-mt/drivers/net/rt2880_eth.c#L2195 Fixes: 7ef6f6f ("net: dsa: mt7530: Add MT7621 TRGMII mode support") Tested-by: Bartel Eerdekens <bartel.eerdekens@constell8.be> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b9850ec commit 37c218d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,9 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
426426
else
427427
ssc_delta = 0x87;
428428
if (priv->id == ID_MT7621) {
429-
/* PLL frequency: 150MHz: 1.2GBit */
429+
/* PLL frequency: 125MHz: 1.0GBit */
430430
if (xtal == HWTRAP_XTAL_40MHZ)
431-
ncpo1 = 0x0780;
431+
ncpo1 = 0x0640;
432432
if (xtal == HWTRAP_XTAL_25MHZ)
433433
ncpo1 = 0x0a00;
434434
} else { /* PLL frequency: 250MHz: 2.0Gbit */

0 commit comments

Comments
 (0)