From: <Ryan.Wanner@microchip.com>
To: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<nicolas.ferre@microchip.com>, <claudiu.beznea@tuxon.dev>
Cc: <netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Ryan Wanner <Ryan.Wanner@microchip.com>
Subject: [PATCH 2/3] net: cadence: macb: Expose REFCLK as a device tree property
Date: Thu, 19 Jun 2025 10:04:14 -0700 [thread overview]
Message-ID: <c5de54b31ed4a206827dfaf359b0bb9042aaca74.1750346271.git.Ryan.Wanner@microchip.com> (raw)
In-Reply-To: <cover.1750346271.git.Ryan.Wanner@microchip.com>
From: Ryan Wanner <Ryan.Wanner@microchip.com>
The RMII and RGMII can both support internal or external provided
REFCLKs 50MHz and 125MHz respectively. Since this is dependent on
the board that the SoC is on this needs to be set via the device tree.
This property flag is checked in the MACB DT node so the REFCLK cap is
configured the correct way for the RMII or RGMII is configured on the
board.
Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
---
drivers/net/ethernet/cadence/macb_main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index d1f1ae5ea161..146e532543a1 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4109,6 +4109,8 @@ static const struct net_device_ops macb_netdev_ops = {
static void macb_configure_caps(struct macb *bp,
const struct macb_config *dt_conf)
{
+ struct device_node *np = bp->pdev->dev.of_node;
+ bool refclk_ext = of_property_present(np, "cdns,refclk-ext");
u32 dcfg;
if (dt_conf)
@@ -4141,6 +4143,9 @@ static void macb_configure_caps(struct macb *bp,
}
}
+ if (refclk_ext)
+ bp->caps |= MACB_CAPS_USRIO_HAS_CLKEN;
+
dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps);
}
--
2.43.0
next prev parent reply other threads:[~2025-06-19 17:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 17:04 [PATCH 0/3] Expose REFCLK for RMII and enable RMII Ryan.Wanner
2025-06-19 17:04 ` [PATCH 1/3] dt-bindings: net: cdns,macb: Add external REFCLK property Ryan.Wanner
2025-06-20 14:22 ` Conor Dooley
2025-06-19 17:04 ` Ryan.Wanner [this message]
2025-06-20 10:25 ` [PATCH 2/3] net: cadence: macb: Expose REFCLK as a device tree property Simon Horman
2025-06-19 17:04 ` [PATCH 3/3] net: cadence: macb: Enable RMII for SAMA7 gem Ryan.Wanner
2025-06-21 7:24 ` [PATCH 0/3] Expose REFCLK for RMII and enable RMII Andrew Lunn
2025-06-23 16:16 ` Ryan Wanner
2025-06-23 17:47 ` Andrew Lunn
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=c5de54b31ed4a206827dfaf359b0bb9042aaca74.1750346271.git.Ryan.Wanner@microchip.com \
--to=ryan.wanner@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/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
all inboxes | Powered by JetHome®