Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/cover.1750346271.git.Ryan.Wanner@microchip.com
====================

Link: https://patch.msgid.link/cover.1752510727.git.Ryan.Wanner@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+16 -2
+7
Documentation/devicetree/bindings/net/cdns,macb.yaml
··· 115 115 power-domains: 116 116 maxItems: 1 117 117 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 + 118 125 cdns,rx-watermark: 119 126 $ref: /schemas/types.yaml#/definitions/uint32 120 127 description:
+9 -2
drivers/net/ethernet/cadence/macb_main.c
··· 4109 4109 static void macb_configure_caps(struct macb *bp, 4110 4110 const struct macb_config *dt_conf) 4111 4111 { 4112 + struct device_node *np = bp->pdev->dev.of_node; 4113 + bool refclk_ext; 4112 4114 u32 dcfg; 4115 + 4116 + refclk_ext = of_property_read_bool(np, "cdns,refclk-ext"); 4113 4117 4114 4118 if (dt_conf) 4115 4119 bp->caps = dt_conf->caps; ··· 4144 4140 } 4145 4141 } 4146 4142 } 4143 + 4144 + if (refclk_ext) 4145 + bp->caps |= MACB_CAPS_USRIO_HAS_CLKEN; 4147 4146 4148 4147 dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps); 4149 4148 } ··· 5103 5096 5104 5097 static const struct macb_config sama7g5_gem_config = { 5105 5098 .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | 5099 + MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | 5106 5100 MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP, 5107 5101 .dma_burst_length = 16, 5108 5102 .clk_init = macb_clk_init, ··· 5113 5105 5114 5106 static const struct macb_config sama7g5_emac_config = { 5115 5107 .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | 5116 - MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII | 5117 - MACB_CAPS_GEM_HAS_PTP, 5108 + MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP, 5118 5109 .dma_burst_length = 16, 5119 5110 .clk_init = macb_clk_init, 5120 5111 .init = macb_init,