Re: [PATCH net-next 1/2] net: axienet: use device_property and fwnode APIs for probe-time config

From: Sagi Maimon

Date: Mon Sep 28 2026 - 03:09:44 EST


On Sun, Sep 27, 2026 at 8:55 PM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> > - lp->switch_x_sgmii = of_property_read_bool(pdev->dev.of_node,
> > - "xlnx,switch-x-sgmii");
> > + lp->switch_x_sgmii = device_property_read_bool(&pdev->dev,
> > + "xlnx,switch-x-sgmii");
>
> What version of the core is being used:
>
> 6c8f06bb2e5147b2c25bdd726365df8416c13987
> Author: Robert Hancock <robert.hancock@xxxxxxxxxx>
> Date: Fri Feb 12 18:23:56 2021 -0600
>
> net: axienet: Support dynamic switching between 1000BaseX and SGMII
>
> Newer versions of the Xilinx AXI Ethernet core (specifically version 7.2 or
> later) allow the core to be configured with a PHY interface mode of "Both",
> allowing either 1000BaseX or SGMII modes to be selected at runtime. Add
> support for this in the driver to allow better support for applications
> which can use both fiber and copper SFP modules.
>
> If this property is not needed, please leave it as OF only.
>

It is not needed here. The X2's MAC is wired to the FPGA fabric over a
fixed link in "internal" mode, so there is no SGMII/1000BASE-X switching
to do.

> >
> > /* Start with the proprietary, and broken phy_type */
> > - ret = of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &value);
> > + ret = device_property_read_u32(&pdev->dev, "xlnx,phy-type", &value);
>
> xlnx,phy-type:
> description:
> Do not use, but still accepted in preference to phy-mode.
> deprecated: true
>
> This property is deprecated. So it should remain an OF property and
> not get expanded in scope.
>
Agreed. v2 converts only what the software node provides: xlnx,rxmem,
phy-mode, the MAC address and the PHY connection, for the fixed-link.
xlnx,switch-x-sgmii and xlnx,phy-type stay OF only, and so do
xlnx,txcsum, xlnx,rxcsum and the "dmas" test, which the X2 does not use
either.

Thanks,
Sagi

> Andrew