@@ -87,6 +87,43 @@ static const struct mtk_reg_map mt7628_reg_map = {
8787 },
8888};
8989
90+ static const struct mtk_reg_map mt7986_reg_map = {
91+ .tx_irq_mask = 0x461c ,
92+ .tx_irq_status = 0x4618 ,
93+ .pdma = {
94+ .rx_ptr = 0x6100 ,
95+ .rx_cnt_cfg = 0x6104 ,
96+ .pcrx_ptr = 0x6108 ,
97+ .glo_cfg = 0x6204 ,
98+ .rst_idx = 0x6208 ,
99+ .delay_irq = 0x620c ,
100+ .irq_status = 0x6220 ,
101+ .irq_mask = 0x6228 ,
102+ .int_grp = 0x6250 ,
103+ },
104+ .qdma = {
105+ .qtx_cfg = 0x4400 ,
106+ .rx_ptr = 0x4500 ,
107+ .rx_cnt_cfg = 0x4504 ,
108+ .qcrx_ptr = 0x4508 ,
109+ .glo_cfg = 0x4604 ,
110+ .rst_idx = 0x4608 ,
111+ .delay_irq = 0x460c ,
112+ .fc_th = 0x4610 ,
113+ .int_grp = 0x4620 ,
114+ .hred = 0x4644 ,
115+ .ctx_ptr = 0x4700 ,
116+ .dtx_ptr = 0x4704 ,
117+ .crx_ptr = 0x4710 ,
118+ .drx_ptr = 0x4714 ,
119+ .fq_head = 0x4720 ,
120+ .fq_tail = 0x4724 ,
121+ .fq_count = 0x4728 ,
122+ .fq_blen = 0x472c ,
123+ },
124+ .gdm1_cnt = 0x1c00 ,
125+ };
126+
90127/* strings used by ethtool */
91128static const struct mtk_ethtool_stats {
92129 char str [ETH_GSTRING_LEN ];
@@ -110,7 +147,7 @@ static const char * const mtk_clks_source_name[] = {
110147 "ethif" , "sgmiitop" , "esw" , "gp0" , "gp1" , "gp2" , "fe" , "trgpll" ,
111148 "sgmii_tx250m" , "sgmii_rx250m" , "sgmii_cdr_ref" , "sgmii_cdr_fb" ,
112149 "sgmii2_tx250m" , "sgmii2_rx250m" , "sgmii2_cdr_ref" , "sgmii2_cdr_fb" ,
113- "sgmii_ck" , "eth2pll" ,
150+ "sgmii_ck" , "eth2pll" , "wocpu0" , "wocpu1" , "netsys0" , "netsys1"
114151};
115152
116153void mtk_w32 (struct mtk_eth * eth , u32 val , unsigned reg )
@@ -3694,6 +3731,21 @@ static const struct mtk_soc_data mt7629_data = {
36943731 },
36953732};
36963733
3734+ static const struct mtk_soc_data mt7986_data = {
3735+ .reg_map = & mt7986_reg_map ,
3736+ .ana_rgc3 = 0x128 ,
3737+ .caps = MT7986_CAPS ,
3738+ .required_clks = MT7986_CLKS_BITMAP ,
3739+ .required_pctl = false,
3740+ .txrx = {
3741+ .txd_size = sizeof (struct mtk_tx_dma_v2 ),
3742+ .rxd_size = sizeof (struct mtk_rx_dma_v2 ),
3743+ .rx_irq_done_mask = MTK_RX_DONE_INT_V2 ,
3744+ .dma_max_len = MTK_TX_DMA_BUF_LEN_V2 ,
3745+ .dma_len_offset = 8 ,
3746+ },
3747+ };
3748+
36973749static const struct mtk_soc_data rt5350_data = {
36983750 .reg_map = & mt7628_reg_map ,
36993751 .caps = MT7628_CAPS ,
@@ -3716,6 +3768,7 @@ const struct of_device_id of_mtk_match[] = {
37163768 { .compatible = "mediatek,mt7622-eth" , .data = & mt7622_data },
37173769 { .compatible = "mediatek,mt7623-eth" , .data = & mt7623_data },
37183770 { .compatible = "mediatek,mt7629-eth" , .data = & mt7629_data },
3771+ { .compatible = "mediatek,mt7986-eth" , .data = & mt7986_data },
37193772 { .compatible = "ralink,rt5350-eth" , .data = & rt5350_data },
37203773 {},
37213774};
0 commit comments