[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3454ad9-1874-4301-b1b1-4f76886802fb@lunn.ch>
Date: Sun, 20 Aug 2023 21:04:53 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Keguang Zhang <keguang.zhang@...il.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
Lee Jones <lee@...nel.org>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Serge Semin <Sergey.Semin@...kalelectronics.ru>
Subject: Re: [PATCH v2 3/4] net: stmmac: Add glue layer for Loongson-1 SoC
> +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.
> + 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
Powered by blists - more mailing lists