Commit 985d4a55 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jakub Kicinski
Browse files

net: airoha: Disable GDM2 forwarding before configuring GDM2 loopback



Hw design requires to disable GDM2 forwarding before configuring GDM2
loopback in airoha_set_gdm2_loopback routine.

Fixes: 9cd451d4 ("net: airoha: Add loopback support for GDM2")
Tested-by: default avatarMadhur Agrawal <madhur.agrawal@airoha.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260520-airoha-disable-gdm2-fwd-v1-1-1eeea5dffc2f@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e46e6bc9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1793,11 +1793,8 @@ static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
	u32 val, pse_port, chan;
	int i, src_port;

	/* Forward the traffic to the proper GDM port */
	pse_port = port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
					       : FE_PSE_PORT_GDM4;
	airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
				    pse_port);
				    FE_PSE_PORT_DROP);
	airoha_fe_clear(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
			GDM_STRIP_CRC_MASK);

@@ -1815,6 +1812,11 @@ static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
		      GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
		      FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |
		      FIELD_PREP(GDM_LONG_LEN_MASK, AIROHA_MAX_MTU));
	/* Forward the traffic to the proper GDM port */
	pse_port = port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
					       : FE_PSE_PORT_GDM4;
	airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(AIROHA_GDM2_IDX),
				    pse_port);

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