Skip to content

net: stmmac: qcom-ethqos: Add Shikra EMAC v4.0.1 support#1317

Open
ayaan-anwar wants to merge 2 commits into
qualcomm-linux:early/hwe/shikra/driversfrom
ayaan-anwar:shikra_ethernet
Open

net: stmmac: qcom-ethqos: Add Shikra EMAC v4.0.1 support#1317
ayaan-anwar wants to merge 2 commits into
qualcomm-linux:early/hwe/shikra/driversfrom
ayaan-anwar:shikra_ethernet

Conversation

@ayaan-anwar

Copy link
Copy Markdown
Contributor

This series adds support for the Qualcomm Shikra SoC EMAC v4.0.1 controllers to the dwmac-qcom-ethqos driver along with the required DT binding updates.


Summary of changes

DT bindings

  • Add new compatible: qcom,shikra-ethqos
  • Extend clock-names schema to support a 7-clock configuration:
    • Additional clocks:
      • axi
      • axi-noc
      • pcie-tile-axi-noc
  • Note: axi appears twice (stmmaceth and axi) to satisfy both stmmac core and driver bulk clock usage. This is safe due to CCF reference counting.

Driver support (EMAC v4.0.1)

Introduce a new emac_v4_0_1_data configuration and register it via OF match.

Key differences compared to EMAC v4.0.0:

  1. NOC clock handling

    • Support three additional clocks required by Shikra
    • Introduce:
      • ethqos_noc_clk_cfg
      • noc_clk_cfg / num_noc_clks in driver data
    • Extend ethqos_clks_config() to handle these clocks along with existing ones
  2. RGMII configuration changes

    • DLL lock bit moved to BIT(0) in SDC4_STATUS
    • Add SDC4_STATUS_SHIKRA_DLL_LOCK
    • Introduce ethqos_configure_rgmii_shikra()
    • Use a per-compatible configure_rgmii callback to override the generic path
  3. MAC-managed RGMII delays

    • Hardware applies internal TX/RX delays
    • When DT specifies "rgmii-id", driver downgrades to "rgmii" to avoid double delay application

Result

  • Enables full ETHQOS support for Shikra EMAC v4.0.1 instances
  • Clean extension via per-compatible data structures
  • No impact to existing platforms

The Shikra SoC contains two EMAC (v4.0.1) instances that are compatible
with the existing Qualcomm ETHQOS driver.  These controllers require
three additional clocks beyond the standard four: an AXI bus clock, an
AXI system-NOC clock, and a PCIe-tile AXI NOC clock that must be
explicitly managed by the driver.

Add the qcom,shikra-ethqos compatible string and extend the clock-names
schema with a oneOf variant that covers this seven-clock configuration.
The AXI clock is intentionally listed twice (as both "stmmaceth" and
"axi"): the stmmac core framework consumes the first entry while the
driver's NOC bulk-clock array consumes the second; CCF reference
counting makes this safe.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
The Shikra SoC integrates two EMAC v4.0.1 instances that differ from
the existing v4.0.0 (SA8775P) in three ways:

1. NOC clocks: Three additional clocks (axi, axi-noc, pcie-tile-axi-noc)
   must be explicitly enabled by the driver.  Introduce
   ethqos_noc_clk_cfg and the corresponding noc_clk_cfg/num_noc_clks
   fields in the driver-data struct so each compatible can declare its
   own set with per-clock rates.  The clocks are enabled/disabled
   alongside the existing link clock in ethqos_clks_config().

2. RGMII tuning: The DLL lock status bit has moved to BIT(0) in the
   SDC4_STATUS register (SDC4_STATUS_SHIKRA_DLL_LOCK).  The IOMACRO
   sequence also differs; introduce ethqos_configure_rgmii_shikra() and
   wire it up via a configure_rgmii callback in the driver-data struct
   so it short-circuits the generic POR-restore path.

3. MAC-managed RGMII delay: The MAC adds internal TX/RX delays, so when
   the DT specifies "rgmii-id" the driver downgrades the PHY interface
   to plain "rgmii" to prevent double-application of the delay.

Register qcom,shikra-ethqos in the OF match table backed by the new
emac_v4_0_1_data descriptor.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
@ayaan-anwar

Copy link
Copy Markdown
Contributor Author

qli-2.0 GA Critical Fix

@ayaan-anwar ayaan-anwar requested a review from Komal-Bajaj June 8, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant