1 From 67fde5d58cd43d129a979e918ec9cd5d2e2fbcfb Mon Sep 17 00:00:00 2001
2 From: Lorenzo Bianconi <lorenzo@kernel.org>
3 Date: Fri, 28 Feb 2025 11:54:16 +0100
4 Subject: [PATCH 08/15] net: airoha: Move REG_GDM_FWD_CFG() initialization in
7 Move REG_GDM_FWD_CFG() register initialization in airoha_dev_init
8 routine. Moreover, always send traffic PPE module in order to be
9 processed by hw accelerator.
10 This is a preliminary patch to enable netfilter flowtable hw offloading
13 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
14 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
16 drivers/net/ethernet/airoha/airoha_eth.c | 14 ++++----------
17 1 file changed, 4 insertions(+), 10 deletions(-)
19 --- a/drivers/net/ethernet/airoha/airoha_eth.c
20 +++ b/drivers/net/ethernet/airoha/airoha_eth.c
21 @@ -107,25 +107,20 @@ static void airoha_set_gdm_port_fwd_cfg(
23 static int airoha_set_gdm_port(struct airoha_eth *eth, int port, bool enable)
25 - u32 val = enable ? FE_PSE_PORT_PPE1 : FE_PSE_PORT_DROP;
26 - u32 vip_port, cfg_addr;
31 vip_port = XSI_PCIE0_VIP_PORT_MASK;
32 - cfg_addr = REG_GDM_FWD_CFG(3);
35 vip_port = XSI_PCIE1_VIP_PORT_MASK;
36 - cfg_addr = REG_GDM_FWD_CFG(3);
39 vip_port = XSI_USB_VIP_PORT_MASK;
40 - cfg_addr = REG_GDM_FWD_CFG(4);
43 vip_port = XSI_ETH_VIP_PORT_MASK;
44 - cfg_addr = REG_GDM_FWD_CFG(4);
48 @@ -139,8 +134,6 @@ static int airoha_set_gdm_port(struct ai
49 airoha_fe_clear(eth, REG_FE_IFC_PORT_EN, vip_port);
52 - airoha_set_gdm_port_fwd_cfg(eth, cfg_addr, val);
57 @@ -177,8 +170,6 @@ static void airoha_fe_maccr_init(struct
58 airoha_fe_set(eth, REG_GDM_FWD_CFG(p),
59 GDM_TCP_CKSUM | GDM_UDP_CKSUM | GDM_IP4_CKSUM |
61 - airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(p),
63 airoha_fe_rmw(eth, REG_GDM_LEN_CFG(p),
64 GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
65 FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |
66 @@ -1615,8 +1606,11 @@ static int airoha_dev_set_macaddr(struct
67 static int airoha_dev_init(struct net_device *dev)
69 struct airoha_gdm_port *port = netdev_priv(dev);
70 + struct airoha_eth *eth = port->qdma->eth;
72 airoha_set_macaddr(port, dev->dev_addr);
73 + airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(port->id),