8bc0f856577cd42c6365fa3d7b9546c403da32ad
[openwrt/staging/xback.git] /
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
5 airoha_dev_init()
6
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
11 on EN7581 SoC.
12
13 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
14 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
15 ---
16 drivers/net/ethernet/airoha/airoha_eth.c | 14 ++++----------
17 1 file changed, 4 insertions(+), 10 deletions(-)
18
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(
22
23 static int airoha_set_gdm_port(struct airoha_eth *eth, int port, bool enable)
24 {
25 - u32 val = enable ? FE_PSE_PORT_PPE1 : FE_PSE_PORT_DROP;
26 - u32 vip_port, cfg_addr;
27 + u32 vip_port;
28
29 switch (port) {
30 case XSI_PCIE0_PORT:
31 vip_port = XSI_PCIE0_VIP_PORT_MASK;
32 - cfg_addr = REG_GDM_FWD_CFG(3);
33 break;
34 case XSI_PCIE1_PORT:
35 vip_port = XSI_PCIE1_VIP_PORT_MASK;
36 - cfg_addr = REG_GDM_FWD_CFG(3);
37 break;
38 case XSI_USB_PORT:
39 vip_port = XSI_USB_VIP_PORT_MASK;
40 - cfg_addr = REG_GDM_FWD_CFG(4);
41 break;
42 case XSI_ETH_PORT:
43 vip_port = XSI_ETH_VIP_PORT_MASK;
44 - cfg_addr = REG_GDM_FWD_CFG(4);
45 break;
46 default:
47 return -EINVAL;
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);
50 }
51
52 - airoha_set_gdm_port_fwd_cfg(eth, cfg_addr, val);
53 -
54 return 0;
55 }
56
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 |
60 GDM_DROP_CRC_ERR);
61 - airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(p),
62 - FE_PSE_PORT_CDM1);
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)
68 {
69 struct airoha_gdm_port *port = netdev_priv(dev);
70 + struct airoha_eth *eth = port->qdma->eth;
71
72 airoha_set_macaddr(port, dev->dev_addr);
73 + airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(port->id),
74 + FE_PSE_PORT_PPE1);
75
76 return 0;
77 }