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 <yangshiji66@qq.com>
This commit is contained in:
Shiji Yang 2023-12-12 04:58:29 +00:00 committed by Hauke Mehrtens
parent f45fa6b45a
commit ee82d9606f
3 changed files with 2 additions and 15 deletions

View File

@ -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);

View File

@ -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)
{

View File

@ -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,