Re: [PATCH v2 3/4] net: stmmac: Add glue layer for Loongson-1 SoC

From: Keguang Zhang
Date: Tue Aug 22 2023 - 05:49:25 EST


On Tue, Aug 22, 2023 at 5:47 PM Keguang Zhang <keguang.zhang@xxxxxxxxx> wrote:
>
> On Mon, Aug 21, 2023 at 3:04 AM Andrew Lunn <andrew@xxxxxxx> wrote:
> >
> > > +static int ls1b_dwmac_syscon_init(struct plat_stmmacenet_data *plat)
> > > +{
> > > + struct ls1x_dwmac *dwmac = plat->bsp_priv;
> > > + struct regmap_field **regmap_fields = dwmac->regmap_fields;
> > > +
> > > + if (plat->bus_id) {
> > > + regmap_field_write(regmap_fields[GMAC1_USE_UART1], 1);
> > > + regmap_field_write(regmap_fields[GMAC1_USE_UART0], 1);
> > > +
> > > + switch (plat->phy_interface) {
> > > + case PHY_INTERFACE_MODE_RGMII:
> > > + regmap_field_write(regmap_fields[GMAC1_USE_TXCLK], 0);
> > > + regmap_field_write(regmap_fields[GMAC1_USE_PWM23], 0);
> > > + break;
> >
> > What about the other three RGMII modes? Plain rgmii is pretty unusual,
> > rgmii-id is the most used.
> >
> According to the LS1B datasheet, only RGMII and MII are supported.
> And I can confirm that MII mode does work for LS1B.
>
Sorry! The RGMII mode does work for LS1B.

> > > + case PHY_INTERFACE_MODE_MII:
> > > + regmap_field_write(regmap_fields[GMAC1_USE_TXCLK], 1);
> > > + regmap_field_write(regmap_fields[GMAC1_USE_PWM23], 1);
> > > + break;
> > > + default:
> > > + dev_err(dwmac->dev, "Unsupported PHY mode %u\n",
> > > + plat->phy_interface);
> > > + return -EOPNOTSUPP;
> > > + }
> > > +
> > > + regmap_field_write(regmap_fields[GMAC1_SHUT], 0);
> > > + } else {
> > > + switch (plat->phy_interface) {
> > > + case PHY_INTERFACE_MODE_RGMII:
> > > + regmap_field_write(regmap_fields[GMAC0_USE_TXCLK], 0);
> > > + regmap_field_write(regmap_fields[GMAC0_USE_PWM01], 0);
> > > + break;
> >
> > same here.
> >
> > Andrew
>
>
>
> --
> Best regards,
>
> Keguang Zhang



--
Best regards,

Keguang Zhang