Lines Matching refs:dwmac
54 struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv; in socfpga_dwmac_fix_mac_speed() local
55 void __iomem *splitter_base = dwmac->splitter_base; in socfpga_dwmac_fix_mac_speed()
81 static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *dev) in socfpga_dwmac_parse_data() argument
90 dwmac->stmmac_rst = devm_reset_control_get(dev, in socfpga_dwmac_parse_data()
92 if (IS_ERR(dwmac->stmmac_rst)) { in socfpga_dwmac_parse_data()
94 if (PTR_ERR(dwmac->stmmac_rst) == -EPROBE_DEFER) in socfpga_dwmac_parse_data()
96 dwmac->stmmac_rst = NULL; in socfpga_dwmac_parse_data()
99 dwmac->interface = of_get_phy_mode(np); in socfpga_dwmac_parse_data()
126 dwmac->splitter_base = devm_ioremap_resource(dev, &res_splitter); in socfpga_dwmac_parse_data()
127 if (IS_ERR(dwmac->splitter_base)) { in socfpga_dwmac_parse_data()
129 return PTR_ERR(dwmac->splitter_base); in socfpga_dwmac_parse_data()
133 dwmac->reg_offset = reg_offset; in socfpga_dwmac_parse_data()
134 dwmac->reg_shift = reg_shift; in socfpga_dwmac_parse_data()
135 dwmac->sys_mgr_base_addr = sys_mgr_base_addr; in socfpga_dwmac_parse_data()
136 dwmac->dev = dev; in socfpga_dwmac_parse_data()
141 static int socfpga_dwmac_setup(struct socfpga_dwmac *dwmac) in socfpga_dwmac_setup() argument
143 struct regmap *sys_mgr_base_addr = dwmac->sys_mgr_base_addr; in socfpga_dwmac_setup()
144 int phymode = dwmac->interface; in socfpga_dwmac_setup()
145 u32 reg_offset = dwmac->reg_offset; in socfpga_dwmac_setup()
146 u32 reg_shift = dwmac->reg_shift; in socfpga_dwmac_setup()
159 dev_err(dwmac->dev, "bad phy mode %d\n", phymode); in socfpga_dwmac_setup()
167 if (dwmac->splitter_base) in socfpga_dwmac_setup()
182 struct socfpga_dwmac *dwmac; in socfpga_dwmac_probe() local
184 dwmac = devm_kzalloc(dev, sizeof(*dwmac), GFP_KERNEL); in socfpga_dwmac_probe()
185 if (!dwmac) in socfpga_dwmac_probe()
188 ret = socfpga_dwmac_parse_data(dwmac, dev); in socfpga_dwmac_probe()
194 ret = socfpga_dwmac_setup(dwmac); in socfpga_dwmac_probe()
200 return dwmac; in socfpga_dwmac_probe()
205 struct socfpga_dwmac *dwmac = priv; in socfpga_dwmac_exit() local
210 if (dwmac->stmmac_rst) in socfpga_dwmac_exit()
211 reset_control_assert(dwmac->stmmac_rst); in socfpga_dwmac_exit()
216 struct socfpga_dwmac *dwmac = priv; in socfpga_dwmac_init() local
225 if (dwmac->stmmac_rst) in socfpga_dwmac_init()
226 reset_control_assert(dwmac->stmmac_rst); in socfpga_dwmac_init()
231 ret = socfpga_dwmac_setup(dwmac); in socfpga_dwmac_init()
236 if (dwmac->stmmac_rst) in socfpga_dwmac_init()
237 reset_control_deassert(dwmac->stmmac_rst); in socfpga_dwmac_init()