Skip to content

Commit dce32ec

Browse files
ryan-wannerkuba-moo
authored andcommitted
net: cadence: macb: Expose REFCLK as a device tree property
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 <[email protected]> Link: https://patch.msgid.link/7f9b65896d6b7b48275bc527b72a16347f8ce10a.1752510727.git.Ryan.Wanner@microchip.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1b7531c commit dce32ec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 7 additions & 0 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

0 commit comments

Comments
 (0)