Skip to content

Commit 5bed8d5

Browse files
author
Paolo Abeni
committed
Merge branch 'add-wed-support-for-mt7988-chipset'
Lorenzo Bianconi says: ==================== Add WED support for MT7988 chipset Similar to MT7622 and MT7986, introduce Wireless Ethernet Dispatcher (WED) support for MT7988 chipset in order to offload to the hw packet engine traffic received from LAN/WAN device to WLAN nic (MT7996E). Add WED RX support in order to offload traffic received by WLAN nic to the wired interfaces (LAN/WAN). ==================== Link: https://lore.kernel.org/r/cover.1695032290.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents fa17a6d + 1543b8f commit 5bed8d5

16 files changed

Lines changed: 2109 additions & 328 deletions

File tree

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ properties:
2222
- mediatek,mt7622-wed
2323
- mediatek,mt7981-wed
2424
- mediatek,mt7986-wed
25+
- mediatek,mt7988-wed
2526
- const: syscon
2627

2728
reg:

Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ccif.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ properties:
2020
items:
2121
- enum:
2222
- mediatek,mt7986-wo-ccif
23+
- mediatek,mt7988-wo-ccif
2324
- const: syscon
2425

2526
reg:

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static const struct mtk_reg_map mt7988_reg_map = {
197197
.wdma_base = {
198198
[0] = 0x4800,
199199
[1] = 0x4c00,
200+
[2] = 0x5000,
200201
},
201202
.pse_iq_sta = 0x0180,
202203
.pse_oq_sta = 0x01a0,

drivers/net/ethernet/mediatek/mtk_eth_soc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ struct mtk_reg_map {
11321132
u32 gdm1_cnt;
11331133
u32 gdma_to_ppe;
11341134
u32 ppe_base;
1135-
u32 wdma_base[2];
1135+
u32 wdma_base[3];
11361136
u32 pse_iq_sta;
11371137
u32 pse_oq_sta;
11381138
};

drivers/net/ethernet/mediatek/mtk_ppe.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry,
425425
}
426426

427427
int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
428-
int wdma_idx, int txq, int bss, int wcid)
428+
int wdma_idx, int txq, int bss, int wcid,
429+
bool amsdu_en)
429430
{
430431
struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry);
431432
u32 *ib2 = mtk_foe_entry_ib2(eth, entry);
@@ -437,6 +438,7 @@ int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
437438
MTK_FOE_IB2_WDMA_WINFO_V2;
438439
l2->w3info = FIELD_PREP(MTK_FOE_WINFO_WCID_V3, wcid) |
439440
FIELD_PREP(MTK_FOE_WINFO_BSS_V3, bss);
441+
l2->amsdu = FIELD_PREP(MTK_FOE_WINFO_AMSDU_EN, amsdu_en);
440442
break;
441443
case 2:
442444
*ib2 &= ~MTK_FOE_IB2_PORT_MG_V2;

drivers/net/ethernet/mediatek/mtk_ppe.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ enum {
8888
#define MTK_FOE_WINFO_BSS_V3 GENMASK(23, 16)
8989
#define MTK_FOE_WINFO_WCID_V3 GENMASK(15, 0)
9090

91-
#define MTK_FOE_WINFO_PAO_USR_INFO GENMASK(15, 0)
92-
#define MTK_FOE_WINFO_PAO_TID GENMASK(19, 16)
93-
#define MTK_FOE_WINFO_PAO_IS_FIXEDRATE BIT(20)
94-
#define MTK_FOE_WINFO_PAO_IS_PRIOR BIT(21)
95-
#define MTK_FOE_WINFO_PAO_IS_SP BIT(22)
96-
#define MTK_FOE_WINFO_PAO_HF BIT(23)
97-
#define MTK_FOE_WINFO_PAO_AMSDU_EN BIT(24)
91+
#define MTK_FOE_WINFO_AMSDU_USR_INFO GENMASK(15, 0)
92+
#define MTK_FOE_WINFO_AMSDU_TID GENMASK(19, 16)
93+
#define MTK_FOE_WINFO_AMSDU_IS_FIXEDRATE BIT(20)
94+
#define MTK_FOE_WINFO_AMSDU_IS_PRIOR BIT(21)
95+
#define MTK_FOE_WINFO_AMSDU_IS_SP BIT(22)
96+
#define MTK_FOE_WINFO_AMSDU_HF BIT(23)
97+
#define MTK_FOE_WINFO_AMSDU_EN BIT(24)
9898

9999
enum {
100100
MTK_FOE_STATE_INVALID,
@@ -123,7 +123,7 @@ struct mtk_foe_mac_info {
123123

124124
/* netsys_v3 */
125125
u32 w3info;
126-
u32 wpao;
126+
u32 amsdu;
127127
};
128128

129129
/* software-only entry type */
@@ -392,7 +392,8 @@ int mtk_foe_entry_set_vlan(struct mtk_eth *eth, struct mtk_foe_entry *entry,
392392
int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry,
393393
int sid);
394394
int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
395-
int wdma_idx, int txq, int bss, int wcid);
395+
int wdma_idx, int txq, int bss, int wcid,
396+
bool amsdu_en);
396397
int mtk_foe_entry_set_queue(struct mtk_eth *eth, struct mtk_foe_entry *entry,
397398
unsigned int queue);
398399
int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);

drivers/net/ethernet/mediatek/mtk_ppe_offload.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ mtk_flow_get_wdma_info(struct net_device *dev, const u8 *addr, struct mtk_wdma_i
111111
info->queue = path->mtk_wdma.queue;
112112
info->bss = path->mtk_wdma.bss;
113113
info->wcid = path->mtk_wdma.wcid;
114+
info->amsdu = path->mtk_wdma.amsdu;
114115

115116
return 0;
116117
}
@@ -192,7 +193,7 @@ mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe,
192193

193194
if (mtk_flow_get_wdma_info(dev, dest_mac, &info) == 0) {
194195
mtk_foe_entry_set_wdma(eth, foe, info.wdma_idx, info.queue,
195-
info.bss, info.wcid);
196+
info.bss, info.wcid, info.amsdu);
196197
if (mtk_is_netsys_v2_or_greater(eth)) {
197198
switch (info.wdma_idx) {
198199
case 0:
@@ -201,6 +202,9 @@ mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe,
201202
case 1:
202203
pse_port = PSE_WDMA1_PORT;
203204
break;
205+
case 2:
206+
pse_port = PSE_WDMA2_PORT;
207+
break;
204208
default:
205209
return -EINVAL;
206210
}

0 commit comments

Comments
 (0)