Skip to content

Commit 071a2ef

Browse files
committed
Merge branch 'expose-refclk-for-rmii-and-enable-rmii'
Ryan Wanner says: ==================== Expose REFCLK for RMII and enable RMII This set allows the REFCLK property to be exposed as a dt-property to properly reflect the correct RMII layout. RMII can take an external or internal provided REFCLK, since this is not SoC dependent but board dependent this must be exposed as a DT property for the macb driver. This set also enables RMII mode for the SAMA7 SoCs gigabit mac. v1: https://lore.kernel.org/[email protected] ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 27b0286 + db40006 commit 071a2ef

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Documentation/devicetree/bindings/net/cdns,macb.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ properties:
115115
power-domains:
116116
maxItems: 1
117117

118+
cdns,refclk-ext:
119+
type: boolean
120+
description:
121+
This selects if the REFCLK for RMII is provided by an external source.
122+
For RGMII mode this selects if the 125MHz REF clock is provided by an external
123+
source.
124+
118125
cdns,rx-watermark:
119126
$ref: /schemas/types.yaml#/definitions/uint32
120127
description:

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4109,8 +4109,12 @@ static const struct net_device_ops macb_netdev_ops = {
41094109
static void macb_configure_caps(struct macb *bp,
41104110
const struct macb_config *dt_conf)
41114111
{
4112+
struct device_node *np = bp->pdev->dev.of_node;
4113+
bool refclk_ext;
41124114
u32 dcfg;
41134115

4116+
refclk_ext = of_property_read_bool(np, "cdns,refclk-ext");
4117+
41144118
if (dt_conf)
41154119
bp->caps = dt_conf->caps;
41164120

@@ -4141,6 +4145,9 @@ static void macb_configure_caps(struct macb *bp,
41414145
}
41424146
}
41434147

4148+
if (refclk_ext)
4149+
bp->caps |= MACB_CAPS_USRIO_HAS_CLKEN;
4150+
41444151
dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps);
41454152
}
41464153

@@ -5096,6 +5103,7 @@ static const struct macb_config mpfs_config = {
50965103

50975104
static const struct macb_config sama7g5_gem_config = {
50985105
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
5106+
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
50995107
MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
51005108
.dma_burst_length = 16,
51015109
.clk_init = macb_clk_init,
@@ -5105,8 +5113,7 @@ static const struct macb_config sama7g5_gem_config = {
51055113

51065114
static const struct macb_config sama7g5_emac_config = {
51075115
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
5108-
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII |
5109-
MACB_CAPS_GEM_HAS_PTP,
5116+
MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP,
51105117
.dma_burst_length = 16,
51115118
.clk_init = macb_clk_init,
51125119
.init = macb_init,

0 commit comments

Comments
 (0)