Lines Matching full:channel

37 	struct r8a779f0_eth_serdes_channel channel[R8A779F0_ETH_SERDES_NUM];  member
60 r8a779f0_eth_serdes_reg_wait(struct r8a779f0_eth_serdes_channel *channel, in r8a779f0_eth_serdes_reg_wait() argument
66 iowrite32(bank, channel->addr + R8A779F0_ETH_SERDES_BANK_SELECT); in r8a779f0_eth_serdes_reg_wait()
68 ret = readl_poll_timeout_atomic(channel->addr + offs, val, in r8a779f0_eth_serdes_reg_wait()
72 dev_dbg(&channel->phy->dev, in r8a779f0_eth_serdes_reg_wait()
74 __func__, channel->index, offs, bank, mask, expected); in r8a779f0_eth_serdes_reg_wait()
82 struct r8a779f0_eth_serdes_channel *channel; in r8a779f0_eth_serdes_common_init_ram() local
86 channel = &dd->channel[i]; in r8a779f0_eth_serdes_common_init_ram()
87 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x026c, 0x180, BIT(0), 0x01); in r8a779f0_eth_serdes_common_init_ram()
98 r8a779f0_eth_serdes_common_setting(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_common_setting() argument
100 struct r8a779f0_eth_serdes_drv_data *dd = channel->dd; in r8a779f0_eth_serdes_common_setting()
117 r8a779f0_eth_serdes_chan_setting(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_chan_setting() argument
121 switch (channel->phy_interface) { in r8a779f0_eth_serdes_chan_setting()
123 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2000); in r8a779f0_eth_serdes_chan_setting()
124 r8a779f0_eth_serdes_write32(channel->addr, 0x01c0, 0x180, 0x0011); in r8a779f0_eth_serdes_chan_setting()
125 r8a779f0_eth_serdes_write32(channel->addr, 0x0248, 0x180, 0x0540); in r8a779f0_eth_serdes_chan_setting()
126 r8a779f0_eth_serdes_write32(channel->addr, 0x0258, 0x180, 0x0015); in r8a779f0_eth_serdes_chan_setting()
127 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x0100); in r8a779f0_eth_serdes_chan_setting()
128 r8a779f0_eth_serdes_write32(channel->addr, 0x01a0, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
129 r8a779f0_eth_serdes_write32(channel->addr, 0x00d0, 0x180, 0x0002); in r8a779f0_eth_serdes_chan_setting()
130 r8a779f0_eth_serdes_write32(channel->addr, 0x0150, 0x180, 0x0003); in r8a779f0_eth_serdes_chan_setting()
131 r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0100); in r8a779f0_eth_serdes_chan_setting()
132 r8a779f0_eth_serdes_write32(channel->addr, 0x0148, 0x180, 0x0100); in r8a779f0_eth_serdes_chan_setting()
133 r8a779f0_eth_serdes_write32(channel->addr, 0x0174, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
134 r8a779f0_eth_serdes_write32(channel->addr, 0x0160, 0x180, 0x0007); in r8a779f0_eth_serdes_chan_setting()
135 r8a779f0_eth_serdes_write32(channel->addr, 0x01ac, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
136 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x0310); in r8a779f0_eth_serdes_chan_setting()
137 r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0101); in r8a779f0_eth_serdes_chan_setting()
138 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x00c8, 0x0180, BIT(0), 0); in r8a779f0_eth_serdes_chan_setting()
142 r8a779f0_eth_serdes_write32(channel->addr, 0x0148, 0x180, 0x0101); in r8a779f0_eth_serdes_chan_setting()
143 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0148, 0x0180, BIT(0), 0); in r8a779f0_eth_serdes_chan_setting()
147 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x1310); in r8a779f0_eth_serdes_chan_setting()
148 r8a779f0_eth_serdes_write32(channel->addr, 0x00d8, 0x180, 0x1800); in r8a779f0_eth_serdes_chan_setting()
149 r8a779f0_eth_serdes_write32(channel->addr, 0x00dc, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
150 r8a779f0_eth_serdes_write32(channel->addr, 0x001c, 0x300, 0x0001); in r8a779f0_eth_serdes_chan_setting()
151 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2100); in r8a779f0_eth_serdes_chan_setting()
152 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0000, 0x0380, BIT(8), 0); in r8a779f0_eth_serdes_chan_setting()
156 if (channel->speed == 1000) in r8a779f0_eth_serdes_chan_setting()
157 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x0140); in r8a779f0_eth_serdes_chan_setting()
158 else if (channel->speed == 100) in r8a779f0_eth_serdes_chan_setting()
159 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x2100); in r8a779f0_eth_serdes_chan_setting()
162 r8a779f0_eth_serdes_write32(channel->addr, 0x0004, 0x1f80, 0x0005); in r8a779f0_eth_serdes_chan_setting()
163 r8a779f0_eth_serdes_write32(channel->addr, 0x0028, 0x1f80, 0x07a1); in r8a779f0_eth_serdes_chan_setting()
164 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f80, 0x0208); in r8a779f0_eth_serdes_chan_setting()
168 r8a779f0_eth_serdes_write32(channel->addr, 0x001c, 0x300, 0x0000); in r8a779f0_eth_serdes_chan_setting()
169 r8a779f0_eth_serdes_write32(channel->addr, 0x0014, 0x380, 0x0050); in r8a779f0_eth_serdes_chan_setting()
170 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2200); in r8a779f0_eth_serdes_chan_setting()
171 r8a779f0_eth_serdes_write32(channel->addr, 0x001c, 0x380, 0x0400); in r8a779f0_eth_serdes_chan_setting()
172 r8a779f0_eth_serdes_write32(channel->addr, 0x01c0, 0x180, 0x0001); in r8a779f0_eth_serdes_chan_setting()
173 r8a779f0_eth_serdes_write32(channel->addr, 0x0248, 0x180, 0x056a); in r8a779f0_eth_serdes_chan_setting()
174 r8a779f0_eth_serdes_write32(channel->addr, 0x0258, 0x180, 0x0015); in r8a779f0_eth_serdes_chan_setting()
175 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x1100); in r8a779f0_eth_serdes_chan_setting()
176 r8a779f0_eth_serdes_write32(channel->addr, 0x01a0, 0x180, 0x0001); in r8a779f0_eth_serdes_chan_setting()
177 r8a779f0_eth_serdes_write32(channel->addr, 0x00d0, 0x180, 0x0001); in r8a779f0_eth_serdes_chan_setting()
178 r8a779f0_eth_serdes_write32(channel->addr, 0x0150, 0x180, 0x0001); in r8a779f0_eth_serdes_chan_setting()
179 r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0300); in r8a779f0_eth_serdes_chan_setting()
180 r8a779f0_eth_serdes_write32(channel->addr, 0x0148, 0x180, 0x0300); in r8a779f0_eth_serdes_chan_setting()
181 r8a779f0_eth_serdes_write32(channel->addr, 0x0174, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
182 r8a779f0_eth_serdes_write32(channel->addr, 0x0160, 0x180, 0x0004); in r8a779f0_eth_serdes_chan_setting()
183 r8a779f0_eth_serdes_write32(channel->addr, 0x01ac, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
184 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x0310); in r8a779f0_eth_serdes_chan_setting()
185 r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0301); in r8a779f0_eth_serdes_chan_setting()
186 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x00c8, 0x180, BIT(0), 0); in r8a779f0_eth_serdes_chan_setting()
189 r8a779f0_eth_serdes_write32(channel->addr, 0x0148, 0x180, 0x0301); in r8a779f0_eth_serdes_chan_setting()
190 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0148, 0x180, BIT(0), 0); in r8a779f0_eth_serdes_chan_setting()
193 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x1310); in r8a779f0_eth_serdes_chan_setting()
194 r8a779f0_eth_serdes_write32(channel->addr, 0x00d8, 0x180, 0x1800); in r8a779f0_eth_serdes_chan_setting()
195 r8a779f0_eth_serdes_write32(channel->addr, 0x00dc, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
196 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2300); in r8a779f0_eth_serdes_chan_setting()
197 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0000, 0x380, BIT(8), 0); in r8a779f0_eth_serdes_chan_setting()
210 r8a779f0_eth_serdes_chan_speed(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_chan_speed() argument
214 switch (channel->phy_interface) { in r8a779f0_eth_serdes_chan_speed()
217 if (channel->speed == 1000) in r8a779f0_eth_serdes_chan_speed()
218 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x1140); in r8a779f0_eth_serdes_chan_speed()
219 else if (channel->speed == 100) in r8a779f0_eth_serdes_chan_speed()
220 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x3100); in r8a779f0_eth_serdes_chan_speed()
221 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0008, 0x1f80, BIT(0), 1); in r8a779f0_eth_serdes_chan_speed()
224 r8a779f0_eth_serdes_write32(channel->addr, 0x0008, 0x1f80, 0x0000); in r8a779f0_eth_serdes_chan_speed()
227 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x0120); in r8a779f0_eth_serdes_chan_speed()
229 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2600); in r8a779f0_eth_serdes_chan_speed()
230 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0000, 0x380, BIT(10), 0); in r8a779f0_eth_serdes_chan_speed()
242 static int r8a779f0_eth_serdes_monitor_linkup(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_monitor_linkup() argument
247 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0004, 0x300, in r8a779f0_eth_serdes_monitor_linkup()
253 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x0100); in r8a779f0_eth_serdes_monitor_linkup()
255 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x0000); in r8a779f0_eth_serdes_monitor_linkup()
261 static int r8a779f0_eth_serdes_hw_init(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_hw_init() argument
263 struct r8a779f0_eth_serdes_drv_data *dd = channel->dd; in r8a779f0_eth_serdes_hw_init()
278 ret = r8a779f0_eth_serdes_reg_wait(&dd->channel[i], 0x0000, in r8a779f0_eth_serdes_hw_init()
285 r8a779f0_eth_serdes_write32(dd->channel[i].addr, 0x03d4, 0x380, 0x0443); in r8a779f0_eth_serdes_hw_init()
287 ret = r8a779f0_eth_serdes_common_setting(channel); in r8a779f0_eth_serdes_hw_init()
292 r8a779f0_eth_serdes_write32(dd->channel[i].addr, 0x03d0, 0x380, 0x0001); in r8a779f0_eth_serdes_hw_init()
301 return r8a779f0_eth_serdes_reg_wait(&dd->channel[0], 0x0000, 0x380, BIT(15), 0); in r8a779f0_eth_serdes_hw_init()
306 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_init() local
309 ret = r8a779f0_eth_serdes_hw_init(channel); in r8a779f0_eth_serdes_init()
311 channel->dd->initialized = true; in r8a779f0_eth_serdes_init()
318 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_exit() local
320 channel->dd->initialized = false; in r8a779f0_eth_serdes_exit()
326 *channel) in r8a779f0_eth_serdes_hw_init_late()
331 ret = r8a779f0_eth_serdes_chan_setting(channel); in r8a779f0_eth_serdes_hw_init_late()
335 ret = r8a779f0_eth_serdes_chan_speed(channel); in r8a779f0_eth_serdes_hw_init_late()
339 r8a779f0_eth_serdes_write32(channel->addr, 0x03c0, 0x380, 0x0000); in r8a779f0_eth_serdes_hw_init_late()
341 r8a779f0_eth_serdes_write32(channel->addr, 0x03d0, 0x380, 0x0000); in r8a779f0_eth_serdes_hw_init_late()
343 val = r8a779f0_eth_serdes_read32(channel->addr, 0x00c0, 0x180); in r8a779f0_eth_serdes_hw_init_late()
344 r8a779f0_eth_serdes_write32(channel->addr, 0x00c0, 0x180, val | BIT(8)); in r8a779f0_eth_serdes_hw_init_late()
345 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0100, 0x180, BIT(0), 1); in r8a779f0_eth_serdes_hw_init_late()
348 r8a779f0_eth_serdes_write32(channel->addr, 0x00c0, 0x180, val & ~BIT(8)); in r8a779f0_eth_serdes_hw_init_late()
349 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0100, 0x180, BIT(0), 0); in r8a779f0_eth_serdes_hw_init_late()
353 val = r8a779f0_eth_serdes_read32(channel->addr, 0x0144, 0x180); in r8a779f0_eth_serdes_hw_init_late()
354 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, val | BIT(4)); in r8a779f0_eth_serdes_hw_init_late()
355 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0180, 0x180, BIT(0), 1); in r8a779f0_eth_serdes_hw_init_late()
358 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, val & ~BIT(4)); in r8a779f0_eth_serdes_hw_init_late()
359 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0180, 0x180, BIT(0), 0); in r8a779f0_eth_serdes_hw_init_late()
363 return r8a779f0_eth_serdes_monitor_linkup(channel); in r8a779f0_eth_serdes_hw_init_late()
368 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_power_on() local
370 return r8a779f0_eth_serdes_hw_init_late(channel); in r8a779f0_eth_serdes_power_on()
376 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_set_mode() local
385 channel->phy_interface = submode; in r8a779f0_eth_serdes_set_mode()
394 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_set_speed() local
396 channel->speed = speed; in r8a779f0_eth_serdes_set_speed()
417 return dd->channel[args->args[0]].phy; in r8a779f0_eth_serdes_xlate()
447 struct r8a779f0_eth_serdes_channel *channel = &dd->channel[i]; in r8a779f0_eth_serdes_probe() local
449 channel->phy = devm_phy_create(&pdev->dev, NULL, in r8a779f0_eth_serdes_probe()
451 if (IS_ERR(channel->phy)) in r8a779f0_eth_serdes_probe()
452 return PTR_ERR(channel->phy); in r8a779f0_eth_serdes_probe()
453 channel->addr = dd->addr + R8A779F0_ETH_SERDES_OFFSET * i; in r8a779f0_eth_serdes_probe()
454 channel->dd = dd; in r8a779f0_eth_serdes_probe()
455 channel->index = i; in r8a779f0_eth_serdes_probe()
456 phy_set_drvdata(channel->phy, channel); in r8a779f0_eth_serdes_probe()