Skip to content

Commit a65d3a1

Browse files
LorenzoBianconiopsiff
authored andcommitted
net: airoha: Disable GDM2 forwarding before configuring GDM2 loopback
[ Upstream commit 985d4a55e64e43bd86eeb896b81ceba453301989 ] Hw design requires to disable GDM2 forwarding before configuring GDM2 loopback in airoha_set_gdm2_loopback routine. Fixes: 9cd451d ("net: airoha: Add loopback support for GDM2") Tested-by: Madhur Agrawal <madhur.agrawal@airoha.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20260520-airoha-disable-gdm2-fwd-v1-1-1eeea5dffc2f@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit d1d76bbb6d7af470fa57bf4888d4912109c72bd2) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 3e80233 commit a65d3a1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/net/ethernet/airoha/airoha_eth.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,11 +1800,8 @@ static int airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
18001800
u32 val, pse_port, chan;
18011801
int src_port;
18021802

1803-
/* Forward the traffic to the proper GDM port */
1804-
pse_port = port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
1805-
: FE_PSE_PORT_GDM4;
18061803
airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
1807-
pse_port);
1804+
FE_PSE_PORT_DROP);
18081805
airoha_fe_clear(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
18091806
GDM_STRIP_CRC_MASK);
18101807

@@ -1822,6 +1819,11 @@ static int airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
18221819
GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
18231820
FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |
18241821
FIELD_PREP(GDM_LONG_LEN_MASK, AIROHA_MAX_MTU));
1822+
/* Forward the traffic to the proper GDM port */
1823+
pse_port = port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
1824+
: FE_PSE_PORT_GDM4;
1825+
airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
1826+
pse_port);
18251827

18261828
/* Disable VIP and IFC for GDM2 */
18271829
airoha_fe_clear(eth, REG_FE_VIP_PORT_EN, BIT(AIROHA_GDM2_IDX));

0 commit comments

Comments
 (0)