drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c- Extension
.c- Size
- 8055 bytes
- Lines
- 288
- 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/platform_device.hlinux/mfd/syscon.hlinux/pm_runtime.hlinux/stmmac.hlinux/regmap.hlinux/of.hstmmac_platform.h
Detected Declarations
struct eic7700_qos_privfunction eic7700_clks_configfunction eic7700_dwmac_initfunction eic7700_dwmac_exitfunction eic7700_dwmac_suspendfunction eic7700_dwmac_resumefunction eic7700_dwmac_probe
Annotated Snippet
struct eic7700_qos_priv {
struct plat_stmmacenet_data *plat_dat;
struct regmap *eic7700_hsp_regmap;
u32 eth_axi_lp_ctrl_offset;
u32 eth_phy_ctrl_offset;
u32 eth_clk_offset;
u32 eth_txd_offset;
u32 eth_rxd_offset;
u32 eth_clk_dly_param;
bool has_txd_offset;
bool has_rxd_offset;
};
static int eic7700_clks_config(void *priv, bool enabled)
{
struct eic7700_qos_priv *dwc = (struct eic7700_qos_priv *)priv;
struct plat_stmmacenet_data *plat = dwc->plat_dat;
int ret = 0;
if (enabled)
ret = clk_bulk_prepare_enable(plat->num_clks, plat->clks);
else
clk_bulk_disable_unprepare(plat->num_clks, plat->clks);
return ret;
}
static int eic7700_dwmac_init(struct device *dev, void *priv)
{
struct eic7700_qos_priv *dwc = priv;
int ret;
ret = eic7700_clks_config(dwc, true);
if (ret)
return ret;
ret = regmap_set_bits(dwc->eic7700_hsp_regmap,
dwc->eth_phy_ctrl_offset,
EIC7700_ETH_TX_CLK_SEL |
EIC7700_ETH_PHY_INTF_SELI);
if (ret) {
eic7700_clks_config(dwc, false);
return ret;
}
regmap_write(dwc->eic7700_hsp_regmap, dwc->eth_axi_lp_ctrl_offset,
EIC7700_ETH_CSYSREQ_VAL);
if (dwc->has_txd_offset)
regmap_write(dwc->eic7700_hsp_regmap, dwc->eth_txd_offset, 0);
if (dwc->has_rxd_offset)
regmap_write(dwc->eic7700_hsp_regmap, dwc->eth_rxd_offset, 0);
regmap_write(dwc->eic7700_hsp_regmap, dwc->eth_clk_offset,
dwc->eth_clk_dly_param);
return 0;
}
static void eic7700_dwmac_exit(struct device *dev, void *priv)
{
struct eic7700_qos_priv *dwc = priv;
eic7700_clks_config(dwc, false);
}
static int eic7700_dwmac_suspend(struct device *dev, void *priv)
{
return pm_runtime_force_suspend(dev);
}
static int eic7700_dwmac_resume(struct device *dev, void *priv)
{
int ret;
ret = pm_runtime_force_resume(dev);
if (ret)
dev_err(dev, "%s failed: %d\n", __func__, ret);
return ret;
}
static int eic7700_dwmac_probe(struct platform_device *pdev)
{
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
struct eic7700_qos_priv *dwc_priv;
u32 delay_ps, val;
int i, ret;
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/mfd/syscon.h`, `linux/pm_runtime.h`, `linux/stmmac.h`, `linux/regmap.h`, `linux/of.h`, `stmmac_platform.h`.
- Detected declarations: `struct eic7700_qos_priv`, `function eic7700_clks_config`, `function eic7700_dwmac_init`, `function eic7700_dwmac_exit`, `function eic7700_dwmac_suspend`, `function eic7700_dwmac_resume`, `function eic7700_dwmac_probe`.
- 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.