Lines Matching refs:emac

108 static void icssg_config_mii_init(struct prueth_emac *emac)  in icssg_config_mii_init()  argument
111 struct prueth *prueth = emac->prueth; in icssg_config_mii_init()
112 int slice = prueth_emac_slice(emac); in icssg_config_mii_init()
133 if (emac->phy_if == PHY_INTERFACE_MODE_MII && slice == ICSS_MII0) in icssg_config_mii_init()
135 else if (emac->phy_if != PHY_INTERFACE_MODE_MII && slice == ICSS_MII1) in icssg_config_mii_init()
201 void icssg_config_ipg(struct prueth_emac *emac) in icssg_config_ipg() argument
203 struct prueth *prueth = emac->prueth; in icssg_config_ipg()
204 int slice = prueth_emac_slice(emac); in icssg_config_ipg()
206 switch (emac->speed) { in icssg_config_ipg()
219 netdev_err(emac->ndev, "Unsupported link speed\n"); in icssg_config_ipg()
224 static void emac_r30_cmd_init(struct prueth_emac *emac) in emac_r30_cmd_init() argument
229 p = emac->dram.va + MGR_R30_CMD_OFFSET; in emac_r30_cmd_init()
235 static int emac_r30_is_done(struct prueth_emac *emac) in emac_r30_is_done() argument
241 p = emac->dram.va + MGR_R30_CMD_OFFSET; in emac_r30_is_done()
252 static int prueth_emac_buffer_setup(struct prueth_emac *emac) in prueth_emac_buffer_setup() argument
256 struct prueth *prueth = emac->prueth; in prueth_emac_buffer_setup()
257 int slice = prueth_emac_slice(emac); in prueth_emac_buffer_setup()
274 bpool_cfg = emac->dram.va + BUFFER_POOL_0_ADDR_OFFSET; in prueth_emac_buffer_setup()
293 rxq_ctx = emac->dram.va + HOST_RX_Q_PRE_CONTEXT_OFFSET; in prueth_emac_buffer_setup()
301 rxq_ctx = emac->dram.va + HOST_RX_Q_EXP_CONTEXT_OFFSET; in prueth_emac_buffer_setup()
328 int icssg_config(struct prueth *prueth, struct prueth_emac *emac, int slice) in icssg_config() argument
330 void __iomem *config = emac->dram.va + ICSSG_CONFIG_OFFSET; in icssg_config()
339 emac->speed = SPEED_1000; in icssg_config()
340 emac->duplex = DUPLEX_FULL; in icssg_config()
341 if (!phy_interface_mode_is_rgmii(emac->phy_if)) { in icssg_config()
342 emac->speed = SPEED_100; in icssg_config()
343 emac->duplex = DUPLEX_FULL; in icssg_config()
347 icssg_miig_set_interface_mode(prueth->miig_rt, slice, emac->phy_if); in icssg_config()
348 icssg_config_mii_init(emac); in icssg_config()
349 icssg_config_ipg(emac); in icssg_config()
350 icssg_update_rgmii_cfg(prueth->miig_rt, emac); in icssg_config()
366 writew(emac->rx_flow_id_base, &flow_cfg->rx_base_flow); in icssg_config()
371 ret = prueth_emac_buffer_setup(emac); in icssg_config()
375 emac_r30_cmd_init(emac); in icssg_config()
403 int emac_set_port_state(struct prueth_emac *emac, in emac_set_port_state() argument
411 p = emac->dram.va + MGR_R30_CMD_OFFSET; in emac_set_port_state()
414 netdev_err(emac->ndev, "invalid port command\n"); in emac_set_port_state()
419 mutex_lock(&emac->cmd_lock); in emac_set_port_state()
426 1000, 10000, false, emac); in emac_set_port_state()
429 netdev_err(emac->ndev, "timeout waiting for command done\n"); in emac_set_port_state()
431 mutex_unlock(&emac->cmd_lock); in emac_set_port_state()
436 void icssg_config_set_speed(struct prueth_emac *emac) in icssg_config_set_speed() argument
440 switch (emac->speed) { in icssg_config_set_speed()
452 netdev_err(emac->ndev, "Unsupported link speed\n"); in icssg_config_set_speed()
456 writeb(fw_speed, emac->dram.va + PORT_LINK_SPEED_OFFSET); in icssg_config_set_speed()