drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c- Extension
.c- Size
- 9288 bytes
- Lines
- 375
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/clk-provider.hlinux/device.hlinux/gpio/consumer.hlinux/ethtool.hlinux/io.hlinux/iopoll.hlinux/ioport.hlinux/module.hlinux/of.hlinux/of_net.hlinux/mfd/syscon.hlinux/platform_device.hlinux/reset.hlinux/stmmac.hstmmac_platform.hdwmac4.h
Detected Declarations
struct tegra_eqosstruct dwc_eth_dwmac_datafunction dwc_eth_dwmac_config_dtfunction dwc_qos_probefunction tegra_eqos_fix_speedfunction tegra_eqos_probefunction tegra_eqos_removefunction dwc_eth_dwmac_probefunction dwc_eth_dwmac_remove
Annotated Snippet
struct tegra_eqos {
struct device *dev;
void __iomem *regs;
struct reset_control *rst;
struct gpio_desc *reset;
};
static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat_dat)
{
struct device *dev = &pdev->dev;
u32 burst_map = 0;
if (!plat_dat->axi) {
plat_dat->axi = devm_kzalloc(&pdev->dev,
sizeof(struct stmmac_axi),
GFP_KERNEL);
if (!plat_dat->axi)
return -ENOMEM;
}
plat_dat->axi->axi_lpi_en = device_property_read_bool(dev,
"snps,en-lpi");
if (device_property_read_u32(dev, "snps,write-requests",
&plat_dat->axi->axi_wr_osr_lmt)) {
/**
* Since the register has a reset value of 1, if property
* is missing, default to 1.
*/
plat_dat->axi->axi_wr_osr_lmt = 1;
} else {
/**
* If property exists, to keep the behavior from dwc_eth_qos,
* subtract one after parsing.
*/
plat_dat->axi->axi_wr_osr_lmt--;
}
if (device_property_read_u32(dev, "snps,read-requests",
&plat_dat->axi->axi_rd_osr_lmt)) {
/**
* Since the register has a reset value of 1, if property
* is missing, default to 1.
*/
plat_dat->axi->axi_rd_osr_lmt = 1;
} else {
/**
* If property exists, to keep the behavior from dwc_eth_qos,
* subtract one after parsing.
*/
plat_dat->axi->axi_rd_osr_lmt--;
}
device_property_read_u32(dev, "snps,burst-map", &burst_map);
plat_dat->axi->axi_blen_regval = FIELD_PREP(DMA_AXI_BLEN_MASK,
burst_map);
/* dwc-qos needs GMAC4, AAL, TSO and PMT */
plat_dat->core_type = DWMAC_CORE_GMAC4;
plat_dat->dma_cfg->aal = 1;
plat_dat->flags |= STMMAC_FLAG_TSO_EN;
plat_dat->pmt = true;
return 0;
}
static int dwc_qos_probe(struct platform_device *pdev,
struct plat_stmmacenet_data *plat_dat,
struct stmmac_resources *stmmac_res)
{
plat_dat->pclk = stmmac_pltfr_find_clk(plat_dat, "phy_ref_clk");
return 0;
}
#define SDMEMCOMPPADCTRL 0x8800
#define SDMEMCOMPPADCTRL_PAD_E_INPUT_OR_E_PWRD BIT(31)
#define AUTO_CAL_CONFIG 0x8804
#define AUTO_CAL_CONFIG_START BIT(31)
#define AUTO_CAL_CONFIG_ENABLE BIT(29)
#define AUTO_CAL_STATUS 0x880c
#define AUTO_CAL_STATUS_ACTIVE BIT(31)
static void tegra_eqos_fix_speed(void *bsp_priv, phy_interface_t interface,
int speed, unsigned int mode)
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/ethtool.h`, `linux/io.h`, `linux/iopoll.h`, `linux/ioport.h`.
- Detected declarations: `struct tegra_eqos`, `struct dwc_eth_dwmac_data`, `function dwc_eth_dwmac_config_dt`, `function dwc_qos_probe`, `function tegra_eqos_fix_speed`, `function tegra_eqos_probe`, `function tegra_eqos_remove`, `function dwc_eth_dwmac_probe`, `function dwc_eth_dwmac_remove`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.