Lines Matching refs:channel

37 	struct r8a779f0_eth_serdes_channel channel[R8A779F0_ETH_SERDES_NUM];  member
53 r8a779f0_eth_serdes_reg_wait(struct r8a779f0_eth_serdes_channel *channel, in r8a779f0_eth_serdes_reg_wait() argument
59 iowrite32(bank, channel->addr + R8A779F0_ETH_SERDES_BANK_SELECT); in r8a779f0_eth_serdes_reg_wait()
61 ret = readl_poll_timeout_atomic(channel->addr + offs, val, in r8a779f0_eth_serdes_reg_wait()
65 dev_dbg(&channel->phy->dev, in r8a779f0_eth_serdes_reg_wait()
67 __func__, channel->index, offs, bank, mask, expected); in r8a779f0_eth_serdes_reg_wait()
75 struct r8a779f0_eth_serdes_channel *channel; in r8a779f0_eth_serdes_common_init_ram() local
79 channel = &dd->channel[i]; in r8a779f0_eth_serdes_common_init_ram()
80 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x026c, 0x180, BIT(0), 0x01); in r8a779f0_eth_serdes_common_init_ram()
91 r8a779f0_eth_serdes_common_setting(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_common_setting() argument
93 struct r8a779f0_eth_serdes_drv_data *dd = channel->dd; in r8a779f0_eth_serdes_common_setting()
95 switch (channel->phy_interface) { in r8a779f0_eth_serdes_common_setting()
109 r8a779f0_eth_serdes_chan_setting(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_chan_setting() argument
113 switch (channel->phy_interface) { in r8a779f0_eth_serdes_chan_setting()
115 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2000); in r8a779f0_eth_serdes_chan_setting()
116 r8a779f0_eth_serdes_write32(channel->addr, 0x01c0, 0x180, 0x0011); in r8a779f0_eth_serdes_chan_setting()
117 r8a779f0_eth_serdes_write32(channel->addr, 0x0248, 0x180, 0x0540); in r8a779f0_eth_serdes_chan_setting()
118 r8a779f0_eth_serdes_write32(channel->addr, 0x0258, 0x180, 0x0015); in r8a779f0_eth_serdes_chan_setting()
119 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x0100); in r8a779f0_eth_serdes_chan_setting()
120 r8a779f0_eth_serdes_write32(channel->addr, 0x01a0, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
121 r8a779f0_eth_serdes_write32(channel->addr, 0x00d0, 0x180, 0x0002); in r8a779f0_eth_serdes_chan_setting()
122 r8a779f0_eth_serdes_write32(channel->addr, 0x0150, 0x180, 0x0003); in r8a779f0_eth_serdes_chan_setting()
123 r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0100); in r8a779f0_eth_serdes_chan_setting()
124 r8a779f0_eth_serdes_write32(channel->addr, 0x0148, 0x180, 0x0100); in r8a779f0_eth_serdes_chan_setting()
125 r8a779f0_eth_serdes_write32(channel->addr, 0x0174, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
126 r8a779f0_eth_serdes_write32(channel->addr, 0x0160, 0x180, 0x0007); in r8a779f0_eth_serdes_chan_setting()
127 r8a779f0_eth_serdes_write32(channel->addr, 0x01ac, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
128 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x0310); in r8a779f0_eth_serdes_chan_setting()
129 r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0101); in r8a779f0_eth_serdes_chan_setting()
130 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x00c8, 0x0180, BIT(0), 0); in r8a779f0_eth_serdes_chan_setting()
134 r8a779f0_eth_serdes_write32(channel->addr, 0x0148, 0x180, 0x0101); in r8a779f0_eth_serdes_chan_setting()
135 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0148, 0x0180, BIT(0), 0); in r8a779f0_eth_serdes_chan_setting()
139 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x1310); in r8a779f0_eth_serdes_chan_setting()
140 r8a779f0_eth_serdes_write32(channel->addr, 0x00d8, 0x180, 0x1800); in r8a779f0_eth_serdes_chan_setting()
141 r8a779f0_eth_serdes_write32(channel->addr, 0x00dc, 0x180, 0x0000); in r8a779f0_eth_serdes_chan_setting()
142 r8a779f0_eth_serdes_write32(channel->addr, 0x001c, 0x300, 0x0001); in r8a779f0_eth_serdes_chan_setting()
143 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x380, 0x2100); in r8a779f0_eth_serdes_chan_setting()
144 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0000, 0x0380, BIT(8), 0); in r8a779f0_eth_serdes_chan_setting()
148 if (channel->speed == 1000) in r8a779f0_eth_serdes_chan_setting()
149 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x0140); in r8a779f0_eth_serdes_chan_setting()
150 else if (channel->speed == 100) in r8a779f0_eth_serdes_chan_setting()
151 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x2100); in r8a779f0_eth_serdes_chan_setting()
154 r8a779f0_eth_serdes_write32(channel->addr, 0x0004, 0x1f80, 0x0005); in r8a779f0_eth_serdes_chan_setting()
155 r8a779f0_eth_serdes_write32(channel->addr, 0x0028, 0x1f80, 0x07a1); in r8a779f0_eth_serdes_chan_setting()
156 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f80, 0x0208); in r8a779f0_eth_serdes_chan_setting()
166 r8a779f0_eth_serdes_chan_speed(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_chan_speed() argument
170 switch (channel->phy_interface) { in r8a779f0_eth_serdes_chan_speed()
173 if (channel->speed == 1000) in r8a779f0_eth_serdes_chan_speed()
174 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x1140); in r8a779f0_eth_serdes_chan_speed()
175 else if (channel->speed == 100) in r8a779f0_eth_serdes_chan_speed()
176 r8a779f0_eth_serdes_write32(channel->addr, 0x0000, 0x1f00, 0x3100); in r8a779f0_eth_serdes_chan_speed()
177 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0008, 0x1f80, BIT(0), 1); in r8a779f0_eth_serdes_chan_speed()
180 r8a779f0_eth_serdes_write32(channel->addr, 0x0008, 0x1f80, 0x0000); in r8a779f0_eth_serdes_chan_speed()
190 static int r8a779f0_eth_serdes_monitor_linkup(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_monitor_linkup() argument
195 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x0004, 0x300, in r8a779f0_eth_serdes_monitor_linkup()
201 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x0100); in r8a779f0_eth_serdes_monitor_linkup()
203 r8a779f0_eth_serdes_write32(channel->addr, 0x0144, 0x180, 0x0000); in r8a779f0_eth_serdes_monitor_linkup()
209 static int r8a779f0_eth_serdes_hw_init(struct r8a779f0_eth_serdes_channel *channel) in r8a779f0_eth_serdes_hw_init() argument
211 struct r8a779f0_eth_serdes_drv_data *dd = channel->dd; in r8a779f0_eth_serdes_hw_init()
222 ret = r8a779f0_eth_serdes_reg_wait(&dd->channel[i], 0x0000, in r8a779f0_eth_serdes_hw_init()
229 r8a779f0_eth_serdes_write32(dd->channel[i].addr, 0x03d4, 0x380, 0x0443); in r8a779f0_eth_serdes_hw_init()
231 ret = r8a779f0_eth_serdes_common_setting(channel); in r8a779f0_eth_serdes_hw_init()
236 r8a779f0_eth_serdes_write32(dd->channel[i].addr, 0x03d0, 0x380, 0x0001); in r8a779f0_eth_serdes_hw_init()
245 return r8a779f0_eth_serdes_reg_wait(&dd->channel[0], 0x0000, 0x380, BIT(15), 0); in r8a779f0_eth_serdes_hw_init()
250 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_init() local
253 ret = r8a779f0_eth_serdes_hw_init(channel); in r8a779f0_eth_serdes_init()
255 channel->dd->initialized = true; in r8a779f0_eth_serdes_init()
261 *channel) in r8a779f0_eth_serdes_hw_init_late()
265 ret = r8a779f0_eth_serdes_chan_setting(channel); in r8a779f0_eth_serdes_hw_init_late()
269 ret = r8a779f0_eth_serdes_chan_speed(channel); in r8a779f0_eth_serdes_hw_init_late()
273 r8a779f0_eth_serdes_write32(channel->addr, 0x03c0, 0x380, 0x0000); in r8a779f0_eth_serdes_hw_init_late()
275 r8a779f0_eth_serdes_write32(channel->addr, 0x03d0, 0x380, 0x0000); in r8a779f0_eth_serdes_hw_init_late()
277 return r8a779f0_eth_serdes_monitor_linkup(channel); in r8a779f0_eth_serdes_hw_init_late()
282 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_power_on() local
284 return r8a779f0_eth_serdes_hw_init_late(channel); in r8a779f0_eth_serdes_power_on()
290 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_set_mode() local
299 channel->phy_interface = submode; in r8a779f0_eth_serdes_set_mode()
308 struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); in r8a779f0_eth_serdes_set_speed() local
310 channel->speed = speed; in r8a779f0_eth_serdes_set_speed()
330 return dd->channel[args->args[0]].phy; in r8a779f0_eth_serdes_xlate()
362 struct r8a779f0_eth_serdes_channel *channel = &dd->channel[i]; in r8a779f0_eth_serdes_probe() local
364 channel->phy = devm_phy_create(&pdev->dev, NULL, in r8a779f0_eth_serdes_probe()
366 if (IS_ERR(channel->phy)) in r8a779f0_eth_serdes_probe()
367 return PTR_ERR(channel->phy); in r8a779f0_eth_serdes_probe()
368 channel->addr = dd->addr + R8A779F0_ETH_SERDES_OFFSET * i; in r8a779f0_eth_serdes_probe()
369 channel->dd = dd; in r8a779f0_eth_serdes_probe()
370 channel->index = i; in r8a779f0_eth_serdes_probe()
371 phy_set_drvdata(channel->phy, channel); in r8a779f0_eth_serdes_probe()