[OpenWrt-Devel] [PATCH] ramips: ethernet: turn off flow control

Petr Štetiar ynezz at true.cz
Wed Jan 29 11:22:10 EST 2020


Rosen Penev <rosenp at gmail.com> [2020-01-25 15:04:03]:

Hi Bjørn and Rosen,

> On Thu, Jan 23, 2020 at 12:25 AM Bjørn Mork <bjorn at mork.no> wrote:
> > >
> > > -     if ((rt_sysc_r32(SYSC_REG_CHIP_REV_ID) & 0xFFFF) == 0x0101) {
> > > -             /* (GE1, Force 1000M/FD, FC ON, MAX_RX_LENGTH 1536) */
> > > +     if ((rt_sysc_r32(SYSC_REG_CHIP_REV_ID) & 0xFFFF) >= 0x0101) {
> > > +             /* (GE1, Force 1000M/FD, FC OFF, MAX_RX_LENGTH 1536) */
> > >               mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
> > >               mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
> > >       } else {
> >
> > If that's really helping then I believe it would be useful to add some
> > sort of chip_rev_id printk here.  Would be good to know who hits this
> > and why...

I just quickly skimmed through the code and it seems like we've that
information already in dmesg:

 SoC Type: MediaTek MT7688 ver:1 eco:2    = 0x0102
 SoC Type: MediaTek MT7628AN ver:1 eco:2  = 0x0102
 SoC Type: MediaTek MT7621 ver:1 eco:3    = 0x0103
 SoC Type: MediaTek MT7620A ver:2 eco:3   = 0x0203
 SoC Type: MediaTek MT7620N ver:2 eco:6   = 0x0206

> That's just cosmetic.

 current: == 0x0101
 new:     >= 0x0101

Doesn't look like a cosmetic change nor correct, see above list. What about
following?

  if (ralink_soc == MT762X_SOC_MT7621AT) {
       /* (GE1, Force 1000M/FD, FC OFF, MAX_RX_LENGTH 1536) */
       mtk_switch_w32(gsw, 0x2305e30b, GSW_REG_MAC_P0_MCR);
       mt7530_mdio_w32(gsw, 0x3600, 0x5e30b);
  } else {
       ...
  }

I just don't know which MediaTek SoC is 0x0101 (ver:1 eco:1), but I assume,
that this condition is just bogus from the beginning.

-- ynezz

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list