Merge branch 'net-stmmac-dwc-qos-add-fsd-eqos-support'

Swathi says:

====================
net: stmmac: dwc-qos: Add FSD EQoS support

FSD platform has two instances of EQoS IP, one is in FSYS0 block and
another one is in PERIC block. This patch series add required DT binding
and platform driver specific changes for the same.
====================

Link: https://patch.msgid.link/20250305091246.106626-1-swathi.ks@samsung.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2025-03-06 15:30:36 -08:00
commit 2c2166e872
3 changed files with 128 additions and 3 deletions

View File

@ -102,6 +102,7 @@ properties:
- snps,dwxgmac-2.10
- starfive,jh7100-dwmac
- starfive,jh7110-dwmac
- tesla,fsd-ethqos
- thead,th1520-gmac
reg:
@ -126,7 +127,7 @@ properties:
clocks:
minItems: 1
maxItems: 8
maxItems: 10
additionalItems: true
items:
- description: GMAC main clock
@ -138,7 +139,7 @@ properties:
clock-names:
minItems: 1
maxItems: 8
maxItems: 10
additionalItems: true
contains:
enum:

View File

@ -0,0 +1,118 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/tesla,fsd-ethqos.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: FSD Ethernet Quality of Service
maintainers:
- Swathi K S <swathi.ks@samsung.com>
description:
Tesla ethernet devices based on dwmmac support Gigabit ethernet.
allOf:
- $ref: snps,dwmac.yaml#
properties:
compatible:
const: tesla,fsd-ethqos
reg:
maxItems: 1
interrupts:
maxItems: 1
interrupt-names:
items:
- const: macirq
clocks:
minItems: 5
items:
- description: PTP clock
- description: Master bus clock
- description: Slave bus clock
- description: MAC TX clock
- description: MAC RX clock
- description: Master2 bus clock
- description: Slave2 bus clock
- description: RX MUX clock
- description: PHY RX clock
- description: PERIC RGMII clock
clock-names:
minItems: 5
items:
- const: ptp_ref
- const: master_bus
- const: slave_bus
- const: tx
- const: rx
- const: master2_bus
- const: slave2_bus
- const: eqos_rxclk_mux
- const: eqos_phyrxclk
- const: dout_peric_rgmii_clk
iommus:
maxItems: 1
phy-mode:
enum:
- rgmii
- rgmii-id
- rgmii-rxid
- rgmii-txid
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- iommus
- phy-mode
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/fsd-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
ethernet1: ethernet@14300000 {
compatible = "tesla,fsd-ethqos";
reg = <0x0 0x14300000 0x0 0x10000>;
interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
clocks = <&clock_peric PERIC_EQOS_TOP_IPCLKPORT_CLK_PTP_REF_I>,
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_ACLK_I>,
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_HCLK_I>,
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_RGMII_CLK_I>,
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_CLK_RX_I>,
<&clock_peric PERIC_BUS_D_PERIC_IPCLKPORT_EQOSCLK>,
<&clock_peric PERIC_BUS_P_PERIC_IPCLKPORT_EQOSCLK>,
<&clock_peric PERIC_EQOS_PHYRXCLK_MUX>,
<&clock_peric PERIC_EQOS_PHYRXCLK>,
<&clock_peric PERIC_DOUT_RGMII_CLK>;
clock-names = "ptp_ref", "master_bus", "slave_bus","tx",
"rx", "master2_bus", "slave2_bus", "eqos_rxclk_mux",
"eqos_phyrxclk","dout_peric_rgmii_clk";
assigned-clocks = <&clock_peric PERIC_EQOS_PHYRXCLK_MUX>,
<&clock_peric PERIC_EQOS_PHYRXCLK>;
assigned-clock-parents = <&clock_peric PERIC_EQOS_PHYRXCLK>;
pinctrl-names = "default";
pinctrl-0 = <&eth1_tx_clk>, <&eth1_tx_data>, <&eth1_tx_ctrl>,
<&eth1_phy_intr>, <&eth1_rx_clk>, <&eth1_rx_data>,
<&eth1_rx_ctrl>, <&eth1_mdio>;
iommus = <&smmu_peric 0x0 0x1>;
phy-mode = "rgmii-id";
};
};
...

View File

@ -319,6 +319,10 @@ static const struct dwc_eth_dwmac_data tegra_eqos_data = {
.stmmac_clk_name = "slave_bus",
};
static const struct dwc_eth_dwmac_data fsd_eqos_data = {
.stmmac_clk_name = "slave_bus",
};
static int dwc_eth_dwmac_probe(struct platform_device *pdev)
{
const struct dwc_eth_dwmac_data *data;
@ -359,7 +363,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
plat_dat->stmmac_clk = dwc_eth_find_clk(plat_dat,
data->stmmac_clk_name);
ret = data->probe(pdev, plat_dat, &stmmac_res);
if (data->probe)
ret = data->probe(pdev, plat_dat, &stmmac_res);
if (ret < 0) {
dev_err_probe(&pdev->dev, ret, "failed to probe subdriver\n");
clk_bulk_disable_unprepare(plat_dat->num_clks, plat_dat->clks);
@ -400,6 +405,7 @@ static void dwc_eth_dwmac_remove(struct platform_device *pdev)
static const struct of_device_id dwc_eth_dwmac_match[] = {
{ .compatible = "snps,dwc-qos-ethernet-4.10", .data = &dwc_qos_data },
{ .compatible = "nvidia,tegra186-eqos", .data = &tegra_eqos_data },
{ .compatible = "tesla,fsd-ethqos", .data = &fsd_eqos_data },
{ }
};
MODULE_DEVICE_TABLE(of, dwc_eth_dwmac_match);