Lines Matching full:dwmac

3  * T-HEAD DWMAC platform driver
59 struct thead_dwmac *dwmac = plat->bsp_priv; in thead_dwmac_set_phy_if() local
73 dev_err(dwmac->dev, "unsupported phy interface %d\n", in thead_dwmac_set_phy_if()
78 writel(phyif, dwmac->apb_base + GMAC_INTF_CTRL); in thead_dwmac_set_phy_if()
84 struct thead_dwmac *dwmac = plat->bsp_priv; in thead_dwmac_set_txclk_dir() local
98 dev_err(dwmac->dev, "unsupported phy interface %d\n", in thead_dwmac_set_txclk_dir()
103 writel(txclk_dir, dwmac->apb_base + GMAC_TXCLK_OEN); in thead_dwmac_set_txclk_dir()
110 struct thead_dwmac *dwmac = priv; in thead_dwmac_fix_speed() local
114 plat = dwmac->plat; in thead_dwmac_fix_speed()
128 dev_err(dwmac->dev, "invalid gmac rate %ld\n", rate); in thead_dwmac_fix_speed()
132 writel(0, dwmac->apb_base + GMAC_PLLCLK_DIV); in thead_dwmac_fix_speed()
145 dev_err(dwmac->dev, "invalid speed %u\n", speed); in thead_dwmac_fix_speed()
151 writel(reg, dwmac->apb_base + GMAC_PLLCLK_DIV); in thead_dwmac_fix_speed()
154 dev_err(dwmac->dev, "unsupported phy interface %d\n", in thead_dwmac_fix_speed()
162 struct thead_dwmac *dwmac = plat->bsp_priv; in thead_dwmac_enable_clk() local
175 writel(GMAC_GTXCLK_SEL_PLL, dwmac->apb_base + GMAC_GTXCLK_SEL); in thead_dwmac_enable_clk()
181 dev_err(dwmac->dev, "unsupported phy interface %d\n", in thead_dwmac_enable_clk()
186 writel(reg, dwmac->apb_base + GMAC_CLK_EN); in thead_dwmac_enable_clk()
192 struct thead_dwmac *dwmac = priv; in thead_dwmac_init() local
196 ret = thead_dwmac_set_phy_if(dwmac->plat); in thead_dwmac_init()
200 ret = thead_dwmac_set_txclk_dir(dwmac->plat); in thead_dwmac_init()
204 reg = readl(dwmac->apb_base + GMAC_RXCLK_DELAY_CTRL); in thead_dwmac_init()
207 writel(reg, dwmac->apb_base + GMAC_RXCLK_DELAY_CTRL); in thead_dwmac_init()
209 reg = readl(dwmac->apb_base + GMAC_TXCLK_DELAY_CTRL); in thead_dwmac_init()
212 writel(reg, dwmac->apb_base + GMAC_TXCLK_DELAY_CTRL); in thead_dwmac_init()
214 return thead_dwmac_enable_clk(dwmac->plat); in thead_dwmac_init()
221 struct thead_dwmac *dwmac; in thead_dwmac_probe() local
235 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); in thead_dwmac_probe()
236 if (!dwmac) in thead_dwmac_probe()
244 dwmac->dev = &pdev->dev; in thead_dwmac_probe()
245 dwmac->plat = plat; in thead_dwmac_probe()
246 dwmac->apb_base = apb; in thead_dwmac_probe()
247 plat->bsp_priv = dwmac; in thead_dwmac_probe()
263 .name = "thead-dwmac",
272 MODULE_DESCRIPTION("T-HEAD DWMAC platform driver");