aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c24
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h2
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c8
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c6
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c8
5 files changed, 23 insertions, 25 deletions
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 f0afb4877a..8a088bd5ce 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,6 +141,17 @@ void fe_reset(u32 reset_bits)
usleep_range(10, 20);
}
+void fe_reset_fe(struct fe_priv *priv)
+{
+ if (!priv->rst_fe)
+ return;
+
+ reset_control_assert(priv->rst_fe);
+ usleep_range(60, 120);
+ reset_control_deassert(priv->rst_fe);
+ usleep_range(60, 120);
+}
+
static inline void fe_int_disable(u32 mask)
{
fe_reg_w32(fe_reg_r32(FE_REG_FE_INT_ENABLE) & ~mask,
@@ -1360,7 +1371,10 @@ static int __init fe_init(struct net_device *dev)
const char *mac_addr;
int err;
- priv->soc->reset_fe(priv);
+ if (priv->soc->reset_fe)
+ priv->soc->reset_fe(priv);
+ else
+ fe_reset_fe(priv);
if (priv->soc->switch_init)
if (priv->soc->switch_init(priv)) {
@@ -1579,6 +1593,12 @@ static int fe_probe(struct platform_device *pdev)
goto err_free_dev;
}
+ priv = netdev_priv(netdev);
+ spin_lock_init(&priv->page_lock);
+ priv->rst_fe = devm_reset_control_get(&pdev->dev, "fe");
+ if (IS_ERR(priv->rst_fe))
+ priv->rst_fe = NULL;
+
if (soc->init_data)
soc->init_data(soc, netdev);
netdev->vlan_features = netdev->hw_features &
@@ -1593,8 +1613,6 @@ static int fe_probe(struct platform_device *pdev)
if (fe_reg_table[FE_REG_FE_DMA_VID_BASE])
netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
- priv = netdev_priv(netdev);
- spin_lock_init(&priv->page_lock);
if (fe_reg_table[FE_REG_FE_COUNTER_BASE]) {
priv->hw_stats = kzalloc(sizeof(*priv->hw_stats), GFP_KERNEL);
if (!priv->hw_stats) {
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 eb170986a8..968db366cf 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
@@ -498,6 +498,7 @@ struct fe_priv {
DECLARE_BITMAP(pending_flags, FE_FLAG_MAX);
struct reset_control *rst_ppe;
+ struct reset_control *rst_fe;
struct mtk_foe_entry *foe_table;
dma_addr_t foe_table_phys;
struct flow_offload __rcu **foe_flow_table;
@@ -517,6 +518,7 @@ 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_rt2880.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
index ab3ac1e4f3..f36904950d 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
@@ -19,8 +19,6 @@
#include "mtk_eth_soc.h"
#include "mdio_rt2880.h"
-#define RT2880_RESET_FE BIT(18)
-
static void rt2880_init_data(struct fe_soc_data *data,
struct net_device *netdev)
{
@@ -33,11 +31,6 @@ static void rt2880_init_data(struct fe_soc_data *data,
/* netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM; */
}
-void rt2880_fe_reset(struct fe_priv *priv)
-{
- fe_reset(RT2880_RESET_FE);
-}
-
static int rt2880_fwd_config(struct fe_priv *priv)
{
int ret;
@@ -55,7 +48,6 @@ static int rt2880_fwd_config(struct fe_priv *priv)
struct fe_soc_data rt2880_data = {
.init_data = rt2880_init_data,
- .reset_fe = rt2880_fe_reset,
.fwd_config = rt2880_fwd_config,
.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
.checksum_bit = RX_DMA_L4VALID,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
index cdc27e056b..6aedf0265a 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
@@ -69,11 +69,6 @@ static int rt3050_fwd_config(struct fe_priv *priv)
return 0;
}
-static void rt305x_fe_reset(struct fe_priv *priv)
-{
- fe_reset(RT305X_RESET_FE);
-}
-
static void rt5350_init_data(struct fe_soc_data *data,
struct net_device *netdev)
{
@@ -127,7 +122,6 @@ static void rt5350_fe_reset(struct fe_priv *priv)
static struct fe_soc_data rt3050_data = {
.init_data = rt305x_init_data,
- .reset_fe = rt305x_fe_reset,
.fwd_config = rt3050_fwd_config,
.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
.checksum_bit = RX_DMA_L4VALID,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
index afcc3da4e4..7b61e9c407 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
@@ -19,13 +19,6 @@
#include "mtk_eth_soc.h"
#include "mdio_rt2880.h"
-#define RT3883_RSTCTRL_FE BIT(21)
-
-static void rt3883_fe_reset(struct fe_priv *priv)
-{
- fe_reset(RT3883_RSTCTRL_FE);
-}
-
static int rt3883_fwd_config(struct fe_priv *priv)
{
int ret;
@@ -54,7 +47,6 @@ static void rt3883_init_data(struct fe_soc_data *data,
static struct fe_soc_data rt3883_data = {
.init_data = rt3883_init_data,
- .reset_fe = rt3883_fe_reset,
.fwd_config = rt3883_fwd_config,
.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
.rx_int = FE_RX_DONE_INT,