Lines Matching +full:rgmii +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0+
27 #define LAN969X_RGMII_PORT_START_IDX 28 /* Index of the first RGMII port */
32 #define RGMII_PORT_IDX(port) ((port)->portno - LAN969X_RGMII_PORT_START_IDX)
78 dev_err(port->sparx5->dev, "Invalid RGMII delay: %u", delay_ps); in lan969x_rgmii_get_clk_delay_sel()
79 return -EINVAL; in lan969x_rgmii_get_clk_delay_sel()
85 /* Configure the RGMII tx clock frequency. */
89 u32 clk_sel = lan969x_rgmii_get_clk_sel(conf->speed); in lan969x_rgmii_tx_clk_config()
92 /* Take the RGMII clock domain out of reset and set tx clock in lan969x_rgmii_tx_clk_config()
101 port->sparx5, HSIO_WRAP_RGMII_CFG(idx)); in lan969x_rgmii_tx_clk_config()
104 /* Configure the RGMII port device. */
110 speed_sel = lan969x_rgmii_get_speed_sel(conf->speed); in lan969x_rgmii_port_device_config()
112 etype = (port->vlan_type == SPX5_VLAN_PORT_TYPE_S_CUSTOM ? in lan969x_rgmii_port_device_config()
113 port->custom_etype : in lan969x_rgmii_port_device_config()
114 port->vlan_type == SPX5_VLAN_PORT_TYPE_C ? in lan969x_rgmii_port_device_config()
117 dtag = port->max_vlan_tags == SPX5_PORT_MAX_TAGS_TWO; in lan969x_rgmii_port_device_config()
118 dotag = port->max_vlan_tags != SPX5_PORT_MAX_TAGS_NONE; in lan969x_rgmii_port_device_config()
123 port->sparx5, DEVRGMII_MAC_ENA_CFG(idx)); in lan969x_rgmii_port_device_config()
129 port->sparx5, DEVRGMII_MAC_IFG_CFG(idx)); in lan969x_rgmii_port_device_config()
133 port->sparx5, DEVRGMII_DEV_RST_CTRL(idx)); in lan969x_rgmii_port_device_config()
140 port->sparx5, in lan969x_rgmii_port_device_config()
144 /* Configure the RGMII delay lines in the MAC.
146 * We use the rx-internal-delay-ps" and "tx-internal-delay-ps" properties to
151 * (e.g. PHY_INTERFACE_MODE_RGMII_{ID, RXID, TXID}), and ignored by the MAC side
161 of_property_read_u32(port->of_node, "rx-internal-delay-ps", in lan969x_rgmii_delay_config()
164 of_property_read_u32(port->of_node, "tx-internal-delay-ps", in lan969x_rgmii_delay_config()
184 port->sparx5, HSIO_WRAP_DLL_CFG(idx, 0)); in lan969x_rgmii_delay_config()
195 port->sparx5, HSIO_WRAP_DLL_CFG(idx, 1)); in lan969x_rgmii_delay_config()
200 /* Configure GPIO's to be used as RGMII interface. */
205 /* Enable the RGMII on the GPIOs. */ in lan969x_rgmii_gpio_config()
206 spx5_wr(HSIO_WRAP_XMII_CFG_GPIO_XMII_CFG_SET(1), port->sparx5, in lan969x_rgmii_gpio_config()