[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c2dc4cb-57aa-476a-8668-c0b358f0ee0c@lunn.ch>
Date: Wed, 28 May 2025 15:44:31 +0200
From: Andrew Lunn <andrew@...n.ch>
To: weishangjuan@...incomputing.com
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
mcoquelin.stm32@...il.com, alexandre.torgue@...s.st.com,
vladimir.oltean@....com, rmk+kernel@...linux.org.uk,
yong.liang.choong@...ux.intel.com,
prabhakar.mahadev-lad.rj@...renesas.com, inochiama@...il.com,
jan.petrous@....nxp.com, jszhang@...nel.org, p.zabel@...gutronix.de,
0x1207@...il.com, boon.khai.ng@...era.com,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, ningyu@...incomputing.com,
linmin@...incomputing.com, lizhi2@...incomputing.com
Subject: Re: [PATCH v2 2/2] ethernet: eswin: Add eic7700 ethernet driver
> +/* PHY default addr in mdio*/
> +#define PHY_ADDR -1
PHY addresses are 0 to 31. How can -1 be a default?
> +static struct clk *dwc_eth_find_clk(struct plat_stmmacenet_data *plat_dat,
> + const char *name)
> +{
> + for (int i = 0; i < plat_dat->num_clks; i++)
> + if (strcmp(plat_dat->clks[i].id, name) == 0)
> + return plat_dat->clks[i].clk;
> +
> + return NULL;
> +}
Please look at the cleanup work Russell King has been doing the last
couple of months. Is this still needed?
> +static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
> + struct plat_stmmacenet_data *plat_dat)
> +{
> + struct device *dev = &pdev->dev;
> + u32 burst_map = 0;
> + u32 bit_index = 0;
> + u32 a_index = 0;
> +
> + if (!plat_dat->axi) {
> + plat_dat->axi = devm_kzalloc(&pdev->dev, sizeof(struct stmmac_axi), GFP_KERNEL);
> +
> + if (!plat_dat->axi)
> + return -ENOMEM;
> + }
> +
> + plat_dat->axi->axi_lpi_en = device_property_read_bool(dev,
> + "snps,en-lpi");
> + if (device_property_read_u32(dev, "snps,write-requests",
> + &plat_dat->axi->axi_wr_osr_lmt)) {
> + /**
> + * Since the register has a reset value of 1, if property
> + * is missing, default to 1.
> + */
Is that described in the binding? Please fully describe all the DT
properties, including what happens when they are not present.
> + ret = of_property_read_u32_index(pdev->dev.of_node, "eswin,phyaddr", 0,
> + &dwc_priv->phyaddr);
> + if (ret)
> + dev_warn(&pdev->dev, "can't get phyaddr (%d)\n", ret);
Are we talking about the Ethernet PHY here or a generic PHY? You
should not need any vendor properties for an Ethernet phy, phy-handle
points to the PHY on an MDIO bus.
> + ret = of_property_read_variable_u32_array(pdev->dev.of_node, "dly-param-1000m",
> + &dwc_priv->dly_param_1000m[0], 3, 0);
> + if (ret != 3) {
> + dev_err(&pdev->dev, "can't get delay param for 1Gbps mode (%d)\n", ret);
> + return ret;
> + }
> +
> + ret = of_property_read_variable_u32_array(pdev->dev.of_node, "dly-param-100m",
> + &dwc_priv->dly_param_100m[0], 3, 0);
> + if (ret != 3) {
> + dev_err(&pdev->dev, "can't get delay param for 100Mbps mode (%d)\n", ret);
> + return ret;
> + }
> +
> + ret = of_property_read_variable_u32_array(pdev->dev.of_node, "dly-param-10m",
> + &dwc_priv->dly_param_10m[0], 3, 0);
> + if (ret != 3) {
> + dev_err(&pdev->dev, "can't get delay param for 10Mbps mode (%d)\n", ret);
> + return ret;
> + }
rx-internal-delay-ps:
description:
RGMII Receive Clock Delay defined in pico seconds. This is used for
controllers that have configurable RX internal delays. If this
property is present then the MAC applies the RX delay.
tx-internal-delay-ps:
description:
RGMII Transmit Clock Delay defined in pico seconds. This is used for
controllers that have configurable TX internal delays. If this
property is present then the MAC applies the TX delay.
The RGMII standard only talks about 2ns delay. There is no delay per
link speed. This is something specific to your hardware. Please figure
out how you can map these standard properties to what you need for
100Mbps and 10Mbps.
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists