Lines Matching +full:clock +full:- +full:phase
1 // SPDX-License-Identifier: GPL-2.0+
9 /* Tx clock selectors */
19 /* Clock delay selectors */
20 #define LAN969X_RGMII_CLK_DELAY_SEL_1_0_NS 2 /* Phase shift 45deg */
21 #define LAN969X_RGMII_CLK_DELAY_SEL_1_7_NS 3 /* Phase shift 77deg */
22 #define LAN969X_RGMII_CLK_DELAY_SEL_2_0_NS 4 /* Phase shift 90deg */
23 #define LAN969X_RGMII_CLK_DELAY_SEL_2_5_NS 5 /* Phase shift 112deg */
24 #define LAN969X_RGMII_CLK_DELAY_SEL_3_0_NS 6 /* Phase shift 135deg */
25 #define LAN969X_RGMII_CLK_DELAY_SEL_3_3_NS 7 /* Phase shift 147deg */
32 #define RGMII_PORT_IDX(port) ((port)->portno - LAN969X_RGMII_PORT_START_IDX)
34 /* Get the tx clock selector based on the port speed. */
50 /* Get the clock delay selector based on the clock delay in picoseconds. */
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()
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()
146 * We use the rx-internal-delay-ps" and "tx-internal-delay-ps" properties to
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()
206 spx5_wr(HSIO_WRAP_XMII_CFG_GPIO_XMII_CFG_SET(1), port->sparx5, in lan969x_rgmii_gpio_config()