diff mbox series

[01/30] net: eepro100: Remove EEPRO100_SROM_WRITE

Message ID 20200523163837.407592-1-marek.vasut+renesas@gmail.com
State New
Headers show
Series [01/30] net: eepro100: Remove EEPRO100_SROM_WRITE | expand

Commit Message

Marek Vasut May 23, 2020, 4:38 p.m. UTC
This code is never enabled, last board that used it was ELPPC which
was removed some 5 years ago, so just remove this code altogether.

Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
---
 README                       |  2 -
 drivers/net/eepro100.c       | 87 ------------------------------------
 scripts/config_whitelist.txt |  1 -
 3 files changed, 90 deletions(-)

Comments

Ramon Fried May 23, 2020, 5:11 p.m. UTC | #1
On Sat, May 23, 2020 at 7:39 PM Marek Vasut <marek.vasut at gmail.com> wrote:
>
> This code is never enabled, last board that used it was ELPPC which
> was removed some 5 years ago, so just remove this code altogether.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> ---
>  README                       |  2 -
>  drivers/net/eepro100.c       | 87 ------------------------------------
>  scripts/config_whitelist.txt |  1 -
>  3 files changed, 90 deletions(-)
>
> diff --git a/README b/README
> index be9e6391d6..c4bb6f3e7b 100644
> --- a/README
> +++ b/README
> @@ -891,8 +891,6 @@ The following options need to be configured:
>
>                 CONFIG_EEPRO100
>                 Support for Intel 82557/82559/82559ER chips.
> -               Optional CONFIG_EEPRO100_SROM_WRITE enables EEPROM
> -               write routine for first time initialisation.
>
>                 CONFIG_TULIP
>                 Support for Digital 2114x chips.
> diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
> index e186ab4e5f..62a0dc7522 100644
> --- a/drivers/net/eepro100.c
> +++ b/drivers/net/eepro100.c
> @@ -781,93 +781,6 @@ static int read_eeprom (struct eth_device *dev, int location, int addr_len)
>         return retval;
>  }
>
> -#ifdef CONFIG_EEPRO100_SROM_WRITE
> -int eepro100_write_eeprom (struct eth_device* dev, int location, int addr_len, unsigned short data)
> -{
> -    unsigned short dataval;
> -    int enable_cmd = 0x3f | EE_EWENB_CMD;
> -    int write_cmd  = location | EE_WRITE_CMD;
> -    int i;
> -    unsigned long datalong, tmplong;
> -
> -    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
> -    udelay(1);
> -    OUTW(dev, EE_ENB, SCBeeprom);
> -
> -    /* Shift the enable command bits out. */
> -    for (i = (addr_len+EE_CMD_BITS-1); i >= 0; i--)
> -    {
> -       dataval = (enable_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
> -       OUTW(dev, EE_ENB | dataval, SCBeeprom);
> -       udelay(1);
> -       OUTW(dev, EE_ENB | dataval | EE_SHIFT_CLK, SCBeeprom);
> -       udelay(1);
> -    }
> -
> -    OUTW(dev, EE_ENB, SCBeeprom);
> -    udelay(1);
> -    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
> -    udelay(1);
> -    OUTW(dev, EE_ENB, SCBeeprom);
> -
> -
> -    /* Shift the write command bits out. */
> -    for (i = (addr_len+EE_CMD_BITS-1); i >= 0; i--)
> -    {
> -       dataval = (write_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
> -       OUTW(dev, EE_ENB | dataval, SCBeeprom);
> -       udelay(1);
> -       OUTW(dev, EE_ENB | dataval | EE_SHIFT_CLK, SCBeeprom);
> -       udelay(1);
> -    }
> -
> -    /* Write the data */
> -    datalong= (unsigned long) ((((data) & 0x00ff) << 8) | ( (data) >> 8));
> -
> -    for (i = 0; i< EE_DATA_BITS; i++)
> -    {
> -    /* Extract and move data bit to bit DI */
> -    dataval = ((datalong & 0x8000)>>13) ? EE_DATA_WRITE : 0;
> -
> -    OUTW(dev, EE_ENB | dataval, SCBeeprom);
> -    udelay(1);
> -    OUTW(dev, EE_ENB | dataval | EE_SHIFT_CLK, SCBeeprom);
> -    udelay(1);
> -    OUTW(dev, EE_ENB | dataval, SCBeeprom);
> -    udelay(1);
> -
> -    datalong = datalong << 1;  /* Adjust significant data bit*/
> -    }
> -
> -    /* Finish up command  (toggle CS) */
> -    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
> -    udelay(1);                 /* delay for more than 250 ns */
> -    OUTW(dev, EE_ENB, SCBeeprom);
> -
> -    /* Wait for programming ready (D0 = 1) */
> -    tmplong = 10;
> -    do
> -    {
> -       dataval = INW(dev, SCBeeprom);
> -       if (dataval & EE_DATA_READ)
> -           break;
> -       udelay(10000);
> -    }
> -    while (-- tmplong);
> -
> -    if (tmplong == 0)
> -    {
> -       printf ("Write i82559 eeprom timed out (100 ms waiting for data ready.\n");
> -       return -1;
> -    }
> -
> -    /* Terminate the EEPROM access. */
> -    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
> -
> -    return 0;
> -}
> -#endif
> -
>  static void init_rx_ring (struct eth_device *dev)
>  {
>         int i;
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index 3f5e6504e1..2dee446dde 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -401,7 +401,6 @@ CONFIG_EDB93XX_SDCS1
>  CONFIG_EDB93XX_SDCS2
>  CONFIG_EDB93XX_SDCS3
>  CONFIG_EEPRO100
> -CONFIG_EEPRO100_SROM_WRITE
>  CONFIG_EFLASH_PROTSECTORS
>  CONFIG_EHCI_DESC_BIG_ENDIAN
>  CONFIG_EHCI_HCD_INIT_AFTER_RESET
> --
> 2.25.1
>
Reviewed-By: Ramon Fried <rfried.dev at gmail.com
diff mbox series

Patch

diff --git a/README b/README
index be9e6391d6..c4bb6f3e7b 100644
--- a/README
+++ b/README
@@ -891,8 +891,6 @@  The following options need to be configured:
 
 		CONFIG_EEPRO100
 		Support for Intel 82557/82559/82559ER chips.
-		Optional CONFIG_EEPRO100_SROM_WRITE enables EEPROM
-		write routine for first time initialisation.
 
 		CONFIG_TULIP
 		Support for Digital 2114x chips.
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index e186ab4e5f..62a0dc7522 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -781,93 +781,6 @@  static int read_eeprom (struct eth_device *dev, int location, int addr_len)
 	return retval;
 }
 
-#ifdef CONFIG_EEPRO100_SROM_WRITE
-int eepro100_write_eeprom (struct eth_device* dev, int location, int addr_len, unsigned short data)
-{
-    unsigned short dataval;
-    int enable_cmd = 0x3f | EE_EWENB_CMD;
-    int write_cmd  = location | EE_WRITE_CMD;
-    int i;
-    unsigned long datalong, tmplong;
-
-    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
-    udelay(1);
-    OUTW(dev, EE_ENB, SCBeeprom);
-
-    /* Shift the enable command bits out. */
-    for (i = (addr_len+EE_CMD_BITS-1); i >= 0; i--)
-    {
-	dataval = (enable_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
-	OUTW(dev, EE_ENB | dataval, SCBeeprom);
-	udelay(1);
-	OUTW(dev, EE_ENB | dataval | EE_SHIFT_CLK, SCBeeprom);
-	udelay(1);
-    }
-
-    OUTW(dev, EE_ENB, SCBeeprom);
-    udelay(1);
-    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
-    udelay(1);
-    OUTW(dev, EE_ENB, SCBeeprom);
-
-
-    /* Shift the write command bits out. */
-    for (i = (addr_len+EE_CMD_BITS-1); i >= 0; i--)
-    {
-	dataval = (write_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
-	OUTW(dev, EE_ENB | dataval, SCBeeprom);
-	udelay(1);
-	OUTW(dev, EE_ENB | dataval | EE_SHIFT_CLK, SCBeeprom);
-	udelay(1);
-    }
-
-    /* Write the data */
-    datalong= (unsigned long) ((((data) & 0x00ff) << 8) | ( (data) >> 8));
-
-    for (i = 0; i< EE_DATA_BITS; i++)
-    {
-    /* Extract and move data bit to bit DI */
-    dataval = ((datalong & 0x8000)>>13) ? EE_DATA_WRITE : 0;
-
-    OUTW(dev, EE_ENB | dataval, SCBeeprom);
-    udelay(1);
-    OUTW(dev, EE_ENB | dataval | EE_SHIFT_CLK, SCBeeprom);
-    udelay(1);
-    OUTW(dev, EE_ENB | dataval, SCBeeprom);
-    udelay(1);
-
-    datalong = datalong << 1;	/* Adjust significant data bit*/
-    }
-
-    /* Finish up command  (toggle CS) */
-    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
-    udelay(1);			/* delay for more than 250 ns */
-    OUTW(dev, EE_ENB, SCBeeprom);
-
-    /* Wait for programming ready (D0 = 1) */
-    tmplong = 10;
-    do
-    {
-	dataval = INW(dev, SCBeeprom);
-	if (dataval & EE_DATA_READ)
-	    break;
-	udelay(10000);
-    }
-    while (-- tmplong);
-
-    if (tmplong == 0)
-    {
-	printf ("Write i82559 eeprom timed out (100 ms waiting for data ready.\n");
-	return -1;
-    }
-
-    /* Terminate the EEPROM access. */
-    OUTW(dev, EE_ENB & ~EE_CS, SCBeeprom);
-
-    return 0;
-}
-#endif
-
 static void init_rx_ring (struct eth_device *dev)
 {
 	int i;
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 3f5e6504e1..2dee446dde 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -401,7 +401,6 @@  CONFIG_EDB93XX_SDCS1
 CONFIG_EDB93XX_SDCS2
 CONFIG_EDB93XX_SDCS3
 CONFIG_EEPRO100
-CONFIG_EEPRO100_SROM_WRITE
 CONFIG_EFLASH_PROTSECTORS
 CONFIG_EHCI_DESC_BIG_ENDIAN
 CONFIG_EHCI_HCD_INIT_AFTER_RESET