From: Shiji Yang Date: Tue, 12 Dec 2023 04:58:29 +0000 (+0000) Subject: ramips: reset mt7620 frame engine via reset controller X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ee82d9606fd5cd38778604aabefccd61d4028733;p=openwrt%2Fstaging%2Fthess.git ramips: reset mt7620 frame engine via reset controller Use reset controller to reset mt7620 frame engine instead of directly writing system control registers. Tested on HiWiFi HC5861. Signed-off-by: Shiji Yang --- diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index dab8a173f7..9c11e9cc89 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -141,7 +141,7 @@ void fe_reset(u32 reset_bits) usleep_range(10, 20); } -void fe_reset_fe(struct fe_priv *priv) +static void fe_reset_fe(struct fe_priv *priv) { if (!priv->resets) return; @@ -1366,10 +1366,7 @@ static int __init fe_init(struct net_device *dev) struct device_node *port; int err; - if (priv->soc->reset_fe) - priv->soc->reset_fe(priv); - else - fe_reset_fe(priv); + fe_reset_fe(priv); if (priv->soc->switch_init) { err = priv->soc->switch_init(priv); diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h index 892ffb2126..619319d18e 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h @@ -157,8 +157,6 @@ enum fe_work_flag { #define MT7620A_FE_GDMA1_MAC_ADRL (MT7620A_GDMA_OFFSET + 0x0C) #define MT7620A_FE_GDMA1_MAC_ADRH (MT7620A_GDMA_OFFSET + 0x10) -#define MT7620A_RESET_FE BIT(21) -#define MT7620A_RESET_ESW BIT(23) #define MT7620A_RESET_EPHY BIT(24) #define RT5350_TX_BASE_PTR0 (RT5350_PDMA_OFFSET + 0x00) @@ -382,7 +380,6 @@ struct fe_soc_data { const u16 *reg_table; void (*init_data)(struct fe_soc_data *data, struct net_device *netdev); - void (*reset_fe)(struct fe_priv *priv); void (*set_mac)(struct fe_priv *priv, unsigned char *mac); int (*fwd_config)(struct fe_priv *priv); void (*tx_dma)(struct fe_tx_dma *txd); @@ -517,7 +514,6 @@ void fe_reg_w32(u32 val, enum fe_reg reg); u32 fe_reg_r32(enum fe_reg reg); void fe_reset(u32 reset_bits); -void fe_reset_fe(struct fe_priv *priv); static inline void *priv_netdev(struct fe_priv *priv) { diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c index a4b2908d59..172dda11b7 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c @@ -286,11 +286,6 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np) } } -static void mt7620_fe_reset(struct fe_priv *priv) -{ - fe_reset(MT7620A_RESET_FE | MT7620A_RESET_ESW); -} - static void mt7620_rxcsum_config(bool enable) { if (enable) @@ -348,7 +343,6 @@ static void mt7620_init_data(struct fe_soc_data *data, static struct fe_soc_data mt7620_data = { .init_data = mt7620_init_data, - .reset_fe = mt7620_fe_reset, .set_mac = mt7620_set_mac, .fwd_config = mt7620_fwd_config, .tx_dma = mt7620_tx_dma,