[][Refactor mtk eth QDMA/PDMA global config setting]

[Description]
Refactor mtk eth QDMA/PDMA global config setting

[Release-log]
N/A

Change-Id: Ia8ac33e56cf07d256fc125f6c64c2446741ca570
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/4753781
diff --git a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 3155324..6527d0f 100755
--- a/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/target/linux/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2449,9 +2449,10 @@
 	}
 
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
+		val = mtk_r32(eth, MTK_QDMA_GLO_CFG);
 		if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
 			mtk_w32(eth,
-				MTK_TX_DMA_EN | MTK_RX_DMA_EN |
+				val | MTK_TX_DMA_EN | MTK_RX_DMA_EN |
 				MTK_DMA_SIZE_32DWORDS | MTK_TX_WB_DDONE |
 				MTK_NDP_CO_PRO | MTK_MUTLI_CNT |
 				MTK_RESV_BUF | MTK_WCOMP_EN |
@@ -2459,14 +2460,15 @@
 				MTK_RX_2B_OFFSET, MTK_QDMA_GLO_CFG);
 		else
 			mtk_w32(eth,
-				MTK_TX_DMA_EN |
+				val | MTK_TX_DMA_EN |
 				MTK_DMA_SIZE_32DWORDS | MTK_NDP_CO_PRO |
 				MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
 				MTK_RX_BT_32DWORDS,
 				MTK_QDMA_GLO_CFG);
 
+		val = mtk_r32(eth, MTK_PDMA_GLO_CFG);
 		mtk_w32(eth,
-			MTK_RX_DMA_EN | rx_2b_offset |
+			val | MTK_RX_DMA_EN | rx_2b_offset |
 			MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
 			MTK_PDMA_GLO_CFG);
 	} else {