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,
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)) {
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 &
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) {
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;
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)
{
#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)
{
/* 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;
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,
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)
{
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,
#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;
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,