Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Sagi Maimon <maimon.sagi@gmail.com>
Cc: netdev@vger.kernel.org, radhey.shyam.pandey@amd.com,
	michal.simek@amd.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux@armlinux.org.uk,
	vadim.fedorenko@linux.dev, richardcochran@gmail.com
Subject: Re: [PATCH net-next v2 1/2] net: axienet: use device_property and fwnode APIs for probe-time config
Date: Mon, 28 Sep 2026 19:19:18 +0200	[thread overview]
Message-ID: <f89024c3-0c71-4976-893d-656e154858d8@lunn.ch> (raw)
In-Reply-To: <20260928074256.462345-2-maimon.sagi@gmail.com>

On Mon, Sep 28, 2026 at 10:42:55AM +0300, Sagi Maimon wrote:
> axienet_probe() reads its configuration exclusively through the of_*
> API, so the driver can only be instantiated from a device tree node.
> 
> The ADVA TimeCard X2 is a PCIe timing card, driven by ptp_ocp, whose
> FPGA contains an AXI Ethernet MAC with an AXI DMA engine.  ptp_ocp is
> going to register the MAC as a child platform device described by a
> software node, so that this driver runs it rather than a copy in
> ptp_ocp.  That needs the probe-time configuration to be readable from a
> software node.
> 
> Convert only the lookups such a caller needs: "xlnx,rxmem", which probe
> requires; "phy-mode"; the MAC address; and the PHY connection, which is
> where phylink finds a "fixed-link" child.  On a device tree this is a
> no-op: device_property_read_u32() dispatches to the of_* implementation
> when dev->fwnode is an OF node, phylink_of_phy_connect() is a wrapper
> around phylink_fwnode_phy_connect(), and device_get_phy_mode() and
> device_get_mac_address() are thin fwnode wrappers around the same
> lookups.  device_get_mac_address() also keeps the "mac-address" nvmem
> cell fallback that of_get_mac_address() has.
> 
> Note that device_get_phy_mode() returns the mode as a positive value
> rather than through an out parameter, so the error test changes from
> "if (ret)" to "if (ret < 0)".
> 
> Everything else stays on the OF API.  "xlnx,txcsum", "xlnx,rxcsum" and
> "xlnx,switch-x-sgmii" are optional, and "xlnx,phy-type" is deprecated in
> favour of "phy-mode".  Without an OF node each of those lookups finds
> nothing, exactly as for a device tree node that leaves them out: no
> checksum offload, no runtime SGMII/1000BASE-X switching and a
> fall-through to "phy-mode".  The "dmas" test likewise selects the
> built-in AXI DMA engine.  The "axistream-connected", "pcs-handle" and
> "phy-handle" phandle lookups stay too: a caller without an OF node takes
> neither branch, getting its DMA registers from its own platform
> resources, and it cannot use the SGMII and 1000BASE-X modes, which need
> a PCS.
> 
> No functional change intended.
> 
> Tested on the X2 with a local ptp_ocp change, with CONFIG_OF disabled
> and enabled: the interface probes with its configuration read from the
> software node and passes traffic.  No device tree board was available,
> so the claim that this is a no-op for device tree users rests on the
> dispatch described above.
> 
> Assisted-by: LLM sparse
> Signed-off-by: Sagi Maimon <maimon.sagi@gmail.com>

Lets see what the AI reviewer says about this, but it looks O.K. to me:

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


  reply	other threads:[~2026-09-28 17:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  7:42 [PATCH net-next v2 0/2] net: axienet: allow instantiation without a device tree Sagi Maimon
2026-09-28  7:42 ` [PATCH net-next v2 1/2] net: axienet: use device_property and fwnode APIs for probe-time config Sagi Maimon
2026-09-28 17:19   ` Andrew Lunn [this message]
2026-09-30 10:24     ` Gupta, Suraj
2026-09-28  7:42 ` [PATCH net-next v2 2/2] net: axienet: add a MODULE_ALIAS for platform instantiation Sagi Maimon
2026-10-01  9:30 ` [PATCH net-next v2 0/2] net: axienet: allow instantiation without a device tree patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f89024c3-0c71-4976-893d-656e154858d8@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maimon.sagi@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox