Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stmmac: add arguments so jl2xx1 can be loaded #13

Merged
merged 1 commit into from Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/Kconfig
Expand Up @@ -29,6 +29,16 @@ config STMMAC_PLATFORM

if STMMAC_PLATFORM

config STMMAC_JL2XX1
bool "Allow STMMAC delay for JL2XX1/JL2101 Gigabit Ethernet PHY"
default n
depends on STMMAC_PLATFORM
---help---
This allows the STMMAC driver to be delayed for 1.5 seconds
if the PHY JL2XX1/JL2101 is found so they can be properly
initialized. This is only applied to the specific PHY IDs
so other PHY won't be affected.

config DWMAC_GENERIC
tristate "Generic driver for DWMAC"
default STMMAC_PLATFORM
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Expand Up @@ -136,6 +136,12 @@ static void stmmac_exit_fs(struct net_device *dev);
#define TX_MONITOR
#endif

/* PHY ID for JL2XX1 and JL2101, these are used for special initialization modifications for them */
#ifdef CONFIG_STMMAC_JL2XX1
#define JL2XX1_PHY_ID 0x937c4030
#define JL2101_PHY_ID 0x937c4032
#endif

#ifdef TX_MONITOR
static struct workqueue_struct *moniter_tx_wq;
static struct delayed_work moniter_tx_worker;
Expand Down Expand Up @@ -1658,6 +1664,11 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE))
atds = 1;

#ifdef CONFIG_STMMAC_JL2XX1
if (priv->phydev->phy_id == JL2XX1_PHY_ID || priv->phydev->phy_id == JL2101_PHY_ID)
msleep(1500);
#endif

ret = priv->hw->dma->reset(priv->ioaddr);
if (ret) {
dev_err(priv->device, "Failed to reset the dma\n");
Expand Down