Skip to content

Commit

Permalink
mediatek: mtk_eth_soc: enable admav2 for mt7986 only
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwckf committed Jan 26, 2024
1 parent dabfebc commit 1ee9a8b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ config MEDIATEK_NETSYS_V2
---help---
This options enable MTK Ethernet NETSYS V2 support

config MEDIATEK_NETSYS_RX_V2
tristate "MediaTek Ethernet NETSYS RX V2 support"
depends on ARCH_MEDIATEK && NET_MEDIATEK_SOC
---help---
This options enable MTK Ethernet NETSYS RX V2 support

config NET_MEDIATEK_HNAT
tristate "MediaTek HW NAT support"
depends on NET_MEDIATEK_SOC && NF_CONNTRACK && IP_NF_NAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ enum mkt_eth_capabilities {

#define MT7986_CAPS (MTK_GMAC1_SGMII | MTK_GMAC2_SGMII | \
MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA | \
MTK_NETSYS_V2)
MTK_NETSYS_V2 | MTK_NETSYS_RX_V2)

#define MT7981_CAPS (MTK_GMAC1_SGMII | MTK_GMAC2_SGMII | MTK_GMAC2_GEPHY | \
MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA | \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,16 +737,17 @@ enum FoeIpAct {
/* If user wants to change default FOE entry number, both DEF_ETRY_NUM and
* DEF_ETRY_NUM_CFG need to be modified.
*/
#define DEF_ETRY_NUM 16384

#if defined(CONFIG_MEDIATEK_NETSYS_RX_V2)
#define DEF_ETRY_NUM 32768
/* feasible values : 32768, 16384, 8192, 4096, 2048, 1024 */
#define DEF_ETRY_NUM_CFG TABLE_16K
#define DEF_ETRY_NUM_CFG TABLE_32K
/* corresponding values : TABLE_32K, TABLE_16K, TABLE_8K, TABLE_4K, TABLE_2K,
* TABLE_1K
*/
#if !defined(CONFIG_MEDIATEK_NETSYS_RX_V2)
#if (DEF_ETRY_NUM > 16384) || (DEF_ETRY_NUM_CFG == TABLE_32K)
#error "ppe entry num cfg error"
#endif
#else
#define DEF_ETRY_NUM 16384
#define DEF_ETRY_NUM_CFG TABLE_16K
#endif

/*PPE_FLOW_CFG*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2179,8 +2179,10 @@ static unsigned int mtk_hnat_nf_post_routing(
if (!IS_LAN(out) && !IS_WAN(out) && !IS_EXT(out))
return 0;

//if (!IS_WHNAT(out) && IS_EXT(out) && FROM_WED(skb))
// return 0;
#if defined(CONFIG_MEDIATEK_NETSYS_RX_V2)
if (!IS_WHNAT(out) && IS_EXT(out) && FROM_WED(skb))
return 0;
#endif

trace_printk("[%s] case hit, %x-->%s, reason=%x\n", __func__,
skb_hnat_iface(skb), out->name, skb_hnat_reason(skb));
Expand Down
1 change: 1 addition & 0 deletions target/linux/mediatek/mt7981/config-5.4
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ CONFIG_MDIO_DEVICE=y
# CONFIG_MEDIATEK_GE_PHY is not set
CONFIG_MEDIATEK_MT6577_AUXADC=y
CONFIG_MEDIATEK_NETSYS_V2=y
# CONFIG_MEDIATEK_NETSYS_RX_V2 is not set
CONFIG_MEDIATEK_WATCHDOG=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEMFD_CREATE=y
Expand Down
1 change: 1 addition & 0 deletions target/linux/mediatek/mt7986/config-5.4
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ CONFIG_MDIO_DEVICE=y
# CONFIG_MEDIATEK_GE_PHY is not set
CONFIG_MEDIATEK_MT6577_AUXADC=y
CONFIG_MEDIATEK_NETSYS_V2=y
CONFIG_MEDIATEK_NETSYS_RX_V2=y
CONFIG_MEDIATEK_WATCHDOG=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEMFD_CREATE=y
Expand Down

0 comments on commit 1ee9a8b

Please sign in to comment.