[U-Boot] [PATCH 0/6] net: Move e1000 driver to driver model and Kconfig

This little series updates the e1000 Ethernet driver to support driver model. It also moves the configuration to Kconfig and adjusts all boards using Masahiro's excellent moveconfig tool.
Simon Glass (6): dm: core: Add a way to set a device name dm: core: Fix a typo in the uclass_get_device_by_name() comment net: e1000: Move #include of common.h to the C files net: e1000: Prepare for driver model conversion net: e1000: Convert to driver model net: Move CONFIG_E1000 options to Kconfig
README | 19 -- configs/CSQ_CS908_defconfig | 2 +- configs/Mele_A1000G_quad_defconfig | 2 +- configs/Mini-X_defconfig | 4 +- configs/UTOO_P66_defconfig | 1 - configs/am43xx_evm_defconfig | 2 +- configs/ba10_tv_box_defconfig | 4 +- configs/db-88f6820-gp_defconfig | 2 +- configs/ls1021aqds_qspi_defconfig | 4 +- configs/ls1021atwr_qspi_defconfig | 4 +- configs/sandbox_defconfig | 20 +- configs/stv0991_defconfig | 2 +- configs/xilinx_zynqmp_ep_defconfig | 2 +- drivers/core/device.c | 10 + drivers/net/Kconfig | 39 +++ drivers/net/e1000.c | 599 ++++++++++++++++++++++++------------ drivers/net/e1000.h | 6 +- drivers/net/e1000_spi.c | 1 + include/configs/B4860QDS.h | 1 - include/configs/BSC9132QDS.h | 1 - include/configs/C29XPCIE.h | 1 - include/configs/MPC8536DS.h | 1 - include/configs/MPC8544DS.h | 1 - include/configs/MPC8548CDS.h | 1 - include/configs/MPC8569MDS.h | 1 - include/configs/MPC8572DS.h | 1 - include/configs/P1010RDB.h | 1 - include/configs/P1022DS.h | 1 - include/configs/P1023RDB.h | 1 - include/configs/P2041RDB.h | 1 - include/configs/T102xQDS.h | 1 - include/configs/T102xRDB.h | 1 - include/configs/T1040QDS.h | 1 - include/configs/T104xRDB.h | 1 - include/configs/T208xQDS.h | 1 - include/configs/T208xRDB.h | 1 - include/configs/T4240RDB.h | 1 - include/configs/UCP1020.h | 1 - include/configs/apalis_t30.h | 2 - include/configs/corenet_ds.h | 1 - include/configs/crownbay.h | 1 - include/configs/gw_ventana.h | 1 - include/configs/km/kmp204x-common.h | 1 - include/configs/ls1021aqds.h | 1 - include/configs/ls1021atwr.h | 1 - include/configs/ls2085aqds.h | 1 - include/configs/ls2085ardb.h | 1 - include/configs/p1_p2_rdb_pc.h | 1 - include/configs/p1_twr.h | 1 - include/configs/qemu-ppce500.h | 1 - include/configs/qemu-x86.h | 1 - include/configs/t4qds.h | 1 - include/configs/vme8349.h | 1 - include/dm/device.h | 15 + include/dm/uclass.h | 2 +- 55 files changed, 494 insertions(+), 282 deletions(-)

Some devices are bound entirely by probing and do not have the benefit of a device tree to give them a name. This is very common with PCI and USB. In most cases this is fine, but we should add an official way to set a device name. This should be called in the device's bind() method.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/core/device.c | 10 ++++++++++ include/dm/device.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+)
diff --git a/drivers/core/device.c b/drivers/core/device.c index caaf231..bbe7a94 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -603,3 +603,13 @@ bool device_is_last_sibling(struct udevice *dev) return false; return list_is_last(&dev->sibling_node, &parent->child_head); } + +int device_set_name(struct udevice *dev, const char *name) +{ + name = strdup(name); + if (!name) + return -ENOMEM; + dev->name = name; + + return 0; +} diff --git a/include/dm/device.h b/include/dm/device.h index 38e23f8..5a04379 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -468,6 +468,21 @@ bool device_has_active_children(struct udevice *dev); */ bool device_is_last_sibling(struct udevice *dev);
+/** + * device_set_name() - set the name of a device + * + * This must be called in the device's bind() method and no later. Normally + * this is unnecessary but for probed devices which don't get a useful name + * this function can be helpful. + * + * @dev: Device to update + * @name: New name (this string is allocated new memory and attached to + * the device) + * @return 0 if OK, -ENOMEM if there is not enough memory to allocate the + * string + */ +int device_set_name(struct udevice *dev, const char *name); + /* device resource management */ typedef void (*dr_release_t)(struct udevice *dev, void *res); typedef int (*dr_match_t)(struct udevice *dev, void *res, void *match_data);

On Fri, Jul 31, 2015 at 3:40 AM, Simon Glass sjg@chromium.org wrote:
Some devices are bound entirely by probing and do not have the benefit of a device tree to give them a name. This is very common with PCI and USB. In most cases this is fine, but we should add an official way to set a device name. This should be called in the device's bind() method.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/core/device.c | 10 ++++++++++ include/dm/device.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+)
diff --git a/drivers/core/device.c b/drivers/core/device.c index caaf231..bbe7a94 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -603,3 +603,13 @@ bool device_is_last_sibling(struct udevice *dev) return false; return list_is_last(&dev->sibling_node, &parent->child_head); }
+int device_set_name(struct udevice *dev, const char *name) +{
name = strdup(name);
if (!name)
return -ENOMEM;
dev->name = name;
return 0;
+} diff --git a/include/dm/device.h b/include/dm/device.h index 38e23f8..5a04379 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -468,6 +468,21 @@ bool device_has_active_children(struct udevice *dev); */ bool device_is_last_sibling(struct udevice *dev);
+/**
- device_set_name() - set the name of a device
- This must be called in the device's bind() method and no later. Normally
- this is unnecessary but for probed devices which don't get a useful name
- this function can be helpful.
- @dev: Device to update
- @name: New name (this string is allocated new memory and attached to
the device)
- @return 0 if OK, -ENOMEM if there is not enough memory to allocate the
- string
- */
+int device_set_name(struct udevice *dev, const char *name);
/* device resource management */ typedef void (*dr_release_t)(struct udevice *dev, void *res); typedef int (*dr_match_t)(struct udevice *dev, void *res, void *match_data); --
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On 31 July 2015 at 03:08, Bin Meng bmeng.cn@gmail.com wrote:
On Fri, Jul 31, 2015 at 3:40 AM, Simon Glass sjg@chromium.org wrote:
Some devices are bound entirely by probing and do not have the benefit of a device tree to give them a name. This is very common with PCI and USB. In most cases this is fine, but we should add an official way to set a device name. This should be called in the device's bind() method.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/core/device.c | 10 ++++++++++ include/dm/device.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+)
diff --git a/drivers/core/device.c b/drivers/core/device.c index caaf231..bbe7a94 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -603,3 +603,13 @@ bool device_is_last_sibling(struct udevice *dev) return false; return list_is_last(&dev->sibling_node, &parent->child_head); }
+int device_set_name(struct udevice *dev, const char *name) +{
name = strdup(name);
if (!name)
return -ENOMEM;
dev->name = name;
return 0;
+} diff --git a/include/dm/device.h b/include/dm/device.h index 38e23f8..5a04379 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -468,6 +468,21 @@ bool device_has_active_children(struct udevice *dev); */ bool device_is_last_sibling(struct udevice *dev);
+/**
- device_set_name() - set the name of a device
- This must be called in the device's bind() method and no later. Normally
- this is unnecessary but for probed devices which don't get a useful name
- this function can be helpful.
- @dev: Device to update
- @name: New name (this string is allocated new memory and attached to
the device)
- @return 0 if OK, -ENOMEM if there is not enough memory to allocate the
- string
- */
+int device_set_name(struct udevice *dev, const char *name);
/* device resource management */ typedef void (*dr_release_t)(struct udevice *dev, void *res); typedef int (*dr_match_t)(struct udevice *dev, void *res, void *match_data); --
Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot-dm.

This function comment has a typo. Fix it.
Signed-off-by: Simon Glass sjg@chromium.org ---
include/dm/uclass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 3fe1739..d56877c 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -130,7 +130,7 @@ int uclass_get(enum uclass_id key, struct uclass **ucp); int uclass_get_device(enum uclass_id id, int index, struct udevice **devp);
/** - * uclass_get_device_by_name() - Get a uclass device by it's name + * uclass_get_device_by_name() - Get a uclass device by its name * * This searches the devices in the uclass for one with the exactly given name. *

On Fri, Jul 31, 2015 at 3:40 AM, Simon Glass sjg@chromium.org wrote:
This function comment has a typo. Fix it.
Signed-off-by: Simon Glass sjg@chromium.org
include/dm/uclass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 3fe1739..d56877c 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -130,7 +130,7 @@ int uclass_get(enum uclass_id key, struct uclass **ucp); int uclass_get_device(enum uclass_id id, int index, struct udevice **devp);
/**
- uclass_get_device_by_name() - Get a uclass device by it's name
- uclass_get_device_by_name() - Get a uclass device by its name
- This searches the devices in the uclass for one with the exactly given name.
--
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On 31 July 2015 at 03:08, Bin Meng bmeng.cn@gmail.com wrote:
On Fri, Jul 31, 2015 at 3:40 AM, Simon Glass sjg@chromium.org wrote:
This function comment has a typo. Fix it.
Signed-off-by: Simon Glass sjg@chromium.org
include/dm/uclass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 3fe1739..d56877c 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -130,7 +130,7 @@ int uclass_get(enum uclass_id key, struct uclass **ucp); int uclass_get_device(enum uclass_id id, int index, struct udevice **devp);
/**
- uclass_get_device_by_name() - Get a uclass device by it's name
- uclass_get_device_by_name() - Get a uclass device by its name
- This searches the devices in the uclass for one with the exactly given name.
--
Reviewed-by: Bin Meng bmeng.cn@gmail.com
Applied to u-boot-dm.

We cannot currently include any header files in the C files since common.h needs to be included first, and it is in the header file. Move it.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/net/e1000.c | 1 + drivers/net/e1000.h | 1 - drivers/net/e1000_spi.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 96e6bb0..e39515d 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -29,6 +29,7 @@ tested on both gig copper and gig fiber boards * Copyright 2011 Freescale Semiconductor, Inc. */
+#include <common.h> #include "e1000.h"
#define TOUT_LOOP 100000 diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h index f3b77b1..efe7814 100644 --- a/drivers/net/e1000.h +++ b/drivers/net/e1000.h @@ -19,7 +19,6 @@ #ifndef _E1000_HW_H_ #define _E1000_HW_H_
-#include <common.h> #include <linux/list.h> #include <malloc.h> #include <net.h> diff --git a/drivers/net/e1000_spi.c b/drivers/net/e1000_spi.c index 93043a1..e7f6826 100644 --- a/drivers/net/e1000_spi.c +++ b/drivers/net/e1000_spi.c @@ -1,3 +1,4 @@ +#include <common.h> #include "e1000.h" #include <linux/compiler.h>

On Fri, Jul 31, 2015 at 3:40 AM, Simon Glass sjg@chromium.org wrote:
We cannot currently include any header files in the C files since common.h needs to be included first, and it is in the header file. Move it.
Signed-off-by: Simon Glass sjg@chromium.org
drivers/net/e1000.c | 1 + drivers/net/e1000.h | 1 - drivers/net/e1000_spi.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 96e6bb0..e39515d 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -29,6 +29,7 @@ tested on both gig copper and gig fiber boards
- Copyright 2011 Freescale Semiconductor, Inc.
*/
+#include <common.h> #include "e1000.h"
#define TOUT_LOOP 100000 diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h index f3b77b1..efe7814 100644 --- a/drivers/net/e1000.h +++ b/drivers/net/e1000.h @@ -19,7 +19,6 @@ #ifndef _E1000_HW_H_ #define _E1000_HW_H_
-#include <common.h> #include <linux/list.h> #include <malloc.h> #include <net.h> diff --git a/drivers/net/e1000_spi.c b/drivers/net/e1000_spi.c index 93043a1..e7f6826 100644 --- a/drivers/net/e1000_spi.c +++ b/drivers/net/e1000_spi.c @@ -1,3 +1,4 @@ +#include <common.h> #include "e1000.h" #include <linux/compiler.h>
--
Reviewed-by: Bin Meng bmeng.cn@gmail.com

Since struct eth_device does not exist with CONFIG_DM_ETH defined, avoid using it in the driver unless necessary. Most of the time it is better to pass the private driver pointer anyway.
Also refactor the code so that code that the driver model implementation will share are available in functions that can be called. Add stubs where necessary.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/net/e1000.c | 461 +++++++++++++++++++++++++++++----------------------- drivers/net/e1000.h | 1 + 2 files changed, 262 insertions(+), 200 deletions(-)
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index e39515d..3a1d2ad 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -30,6 +30,8 @@ tested on both gig copper and gig fiber boards */
#include <common.h> +#include <errno.h> +#include <pci.h> #include "e1000.h"
#define TOUT_LOOP 100000 @@ -53,67 +55,84 @@ static int tx_tail; static int rx_tail, rx_last;
static struct pci_device_id e1000_supported[] = { - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82542}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82543GC_FIBER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82543GC_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544EI_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544EI_FIBER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544GC_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544GC_LOM}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545GM_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_FIBER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_FIBER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546GB_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM_LOM}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82541ER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82541GI_LF}, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82542) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82543GC_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82543GC_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544EI_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544EI_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544GC_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544GC_LOM) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545GM_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546GB_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM_LOM) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82541ER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82541GI_LF) }, /* E1000 PCIe card */ - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_FIBER }, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_SERDES }, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_QUAD_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571PT_QUAD_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_QUAD_FIBER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_QUAD_COPPER_LOWPROFILE}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_SERDES_DUAL}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_SERDES_QUAD}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI_FIBER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI_SERDES}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573E}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573E_IAMT}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573L}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82574L}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546GB_QUAD_COPPER_KSP3}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_DPT}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_DPT}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_SPT}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_SPT}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_UNPROGRAMMED}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I211_UNPROGRAMMED}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I211_COPPER}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_COPPER_FLASHLESS}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_SERDES}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_SERDES_FLASHLESS}, - {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_1000BASEKX}, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82571EB_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571EB_SERDES) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571EB_QUAD_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571PT_QUAD_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571EB_QUAD_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571EB_QUAD_COPPER_LOWPROFILE) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571EB_SERDES_DUAL) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82571EB_SERDES_QUAD) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI_FIBER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI_SERDES) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82572EI) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573E) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573E_IAMT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82573L) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82574L) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82546GB_QUAD_COPPER_KSP3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_DPT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL + PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_DPT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_80003ES2LAN_COPPER_SPT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_80003ES2LAN_SERDES_SPT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_I210_UNPROGRAMMED) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_I211_UNPROGRAMMED) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I211_COPPER) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_I210_COPPER_FLASHLESS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I210_SERDES) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_I210_SERDES_FLASHLESS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_I210_1000BASEKX) },
{} };
/* Function forward declarations */ -static int e1000_setup_link(struct eth_device *nic); -static int e1000_setup_fiber_link(struct eth_device *nic); -static int e1000_setup_copper_link(struct eth_device *nic); +static int e1000_setup_link(struct e1000_hw *hw); +static int e1000_setup_fiber_link(struct e1000_hw *hw); +static int e1000_setup_copper_link(struct e1000_hw *hw); static int e1000_phy_setup_autoneg(struct e1000_hw *hw); static void e1000_config_collision_dist(struct e1000_hw *hw); static int e1000_config_mac_to_phy(struct e1000_hw *hw); static int e1000_config_fc_after_link_up(struct e1000_hw *hw); -static int e1000_check_for_link(struct eth_device *nic); +static int e1000_check_for_link(struct e1000_hw *hw); static int e1000_wait_autoneg(struct e1000_hw *hw); static int e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex); @@ -902,13 +921,13 @@ static int e1000_validate_eeprom_checksum(struct e1000_hw *hw) /* Allocate a temporary buffer */ buf = malloc(sizeof(buf[0]) * (EEPROM_CHECKSUM_REG + 1)); if (!buf) { - E1000_ERR(hw->nic, "Unable to allocate EEPROM buffer!\n"); + E1000_ERR(hw, "Unable to allocate EEPROM buffer!\n"); return -E1000_ERR_EEPROM; }
/* Read the EEPROM */ if (e1000_read_eeprom(hw, 0, EEPROM_CHECKSUM_REG + 1, buf) < 0) { - E1000_ERR(hw->nic, "Unable to read EEPROM!\n"); + E1000_ERR(hw, "Unable to read EEPROM!\n"); return -E1000_ERR_EEPROM; }
@@ -924,9 +943,9 @@ static int e1000_validate_eeprom_checksum(struct e1000_hw *hw) return 0;
/* Hrm, verification failed, print an error */ - E1000_ERR(hw->nic, "EEPROM checksum is incorrect!\n"); - E1000_ERR(hw->nic, " ...register was 0x%04hx, calculated 0x%04hx\n", - checksum_reg, checksum); + E1000_ERR(hw, "EEPROM checksum is incorrect!\n"); + E1000_ERR(hw, " ...register was 0x%04hx, calculated 0x%04hx\n", + checksum_reg, checksum);
return -E1000_ERR_EEPROM; } @@ -1164,9 +1183,8 @@ static bool e1000_is_second_port(struct e1000_hw *hw) * nic - Struct containing variables accessed by shared code *****************************************************************************/ static int -e1000_read_mac_addr(struct eth_device *nic) +e1000_read_mac_addr(struct e1000_hw *hw, unsigned char enetaddr[6]) { - struct e1000_hw *hw = nic->priv; uint16_t offset; uint16_t eeprom_data; uint32_t reg_data = 0; @@ -1189,19 +1207,19 @@ e1000_read_mac_addr(struct eth_device *nic) DEBUGOUT("EEPROM Read Error\n"); return -E1000_ERR_EEPROM; } - nic->enetaddr[i] = eeprom_data & 0xff; - nic->enetaddr[i + 1] = (eeprom_data >> 8) & 0xff; + enetaddr[i] = eeprom_data & 0xff; + enetaddr[i + 1] = (eeprom_data >> 8) & 0xff; }
/* Invert the last bit if this is the second device */ if (e1000_is_second_port(hw)) - nic->enetaddr[5] ^= 1; + enetaddr[5] ^= 1;
#ifdef CONFIG_E1000_FALLBACK_MAC if (!is_valid_ethaddr(nic->enetaddr)) { unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
- memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE); + memcpy(enetaddr, fb_mac, NODE_ADDRESS_SIZE); } #endif return 0; @@ -1218,9 +1236,8 @@ e1000_read_mac_addr(struct eth_device *nic) * the receiver is in reset when the routine is called. *****************************************************************************/ static void -e1000_init_rx_addrs(struct eth_device *nic) +e1000_init_rx_addrs(struct e1000_hw *hw, unsigned char enetaddr[6]) { - struct e1000_hw *hw = nic->priv; uint32_t i; uint32_t addr_low; uint32_t addr_high; @@ -1229,11 +1246,11 @@ e1000_init_rx_addrs(struct eth_device *nic)
/* Setup the receive address. */ DEBUGOUT("Programming MAC Address into RAR[0]\n"); - addr_low = (nic->enetaddr[0] | - (nic->enetaddr[1] << 8) | - (nic->enetaddr[2] << 16) | (nic->enetaddr[3] << 24)); + addr_low = (enetaddr[0] | + (enetaddr[1] << 8) | + (enetaddr[2] << 16) | (enetaddr[3] << 24));
- addr_high = (nic->enetaddr[4] | (nic->enetaddr[5] << 8) | E1000_RAH_AV); + addr_high = (enetaddr[4] | (enetaddr[5] << 8) | E1000_RAH_AV);
E1000_WRITE_REG_ARRAY(hw, RA, 0, addr_low); E1000_WRITE_REG_ARRAY(hw, RA, 1, addr_high); @@ -1640,9 +1657,8 @@ e1000_initialize_hardware_bits(struct e1000_hw *hw) * the transmit and receive units disabled and uninitialized. *****************************************************************************/ static int -e1000_init_hw(struct eth_device *nic) +e1000_init_hw(struct e1000_hw *hw, unsigned char enetaddr[6]) { - struct e1000_hw *hw = nic->priv; uint32_t ctrl; uint32_t i; int32_t ret_val; @@ -1695,7 +1711,7 @@ e1000_init_hw(struct eth_device *nic) /* Setup the receive address. This involves initializing all of the Receive * Address Registers (RARs 0 - 15). */ - e1000_init_rx_addrs(nic); + e1000_init_rx_addrs(hw, enetaddr);
/* For 82542 (rev 2.0), take the receiver out of reset and enable MWI */ if (hw->mac_type == e1000_82542_rev2_0) { @@ -1764,7 +1780,7 @@ e1000_init_hw(struct eth_device *nic) mdelay(15);
/* Call a subroutine to configure the link and setup flow control. */ - ret_val = e1000_setup_link(nic); + ret_val = e1000_setup_link(hw);
/* Set the transmit descriptor write-back policy */ if (hw->mac_type > e1000_82544) { @@ -1864,9 +1880,8 @@ e1000_init_hw(struct eth_device *nic) * transmitter and receiver are not enabled. *****************************************************************************/ static int -e1000_setup_link(struct eth_device *nic) +e1000_setup_link(struct e1000_hw *hw) { - struct e1000_hw *hw = nic->priv; int32_t ret_val; #ifndef CONFIG_E1000_NO_NVM uint32_t ctrl_ext; @@ -1954,7 +1969,7 @@ e1000_setup_link(struct eth_device *nic)
/* Call the necessary subroutine to configure the link. */ ret_val = (hw->media_type == e1000_media_type_fiber) ? - e1000_setup_fiber_link(nic) : e1000_setup_copper_link(nic); + e1000_setup_fiber_link(hw) : e1000_setup_copper_link(hw); if (ret_val < 0) { return ret_val; } @@ -2011,9 +2026,8 @@ e1000_setup_link(struct eth_device *nic) * and receiver are not enabled. *****************************************************************************/ static int -e1000_setup_fiber_link(struct eth_device *nic) +e1000_setup_fiber_link(struct e1000_hw *hw) { - struct e1000_hw *hw = nic->priv; uint32_t ctrl; uint32_t status; uint32_t txcw = 0; @@ -2032,7 +2046,7 @@ e1000_setup_fiber_link(struct eth_device *nic) else signal = 0;
- printf("signal for %s is %x (ctrl %08x)!!!!\n", nic->name, signal, + printf("signal for %s is %x (ctrl %08x)!!!!\n", hw->name, signal, ctrl); /* Take the link out of reset */ ctrl &= ~(E1000_CTRL_LRST); @@ -2120,7 +2134,7 @@ e1000_setup_fiber_link(struct eth_device *nic) */ DEBUGOUT("Never got a valid link from auto-neg!!!\n"); hw->autoneg_failed = 1; - ret_val = e1000_check_for_link(nic); + ret_val = e1000_check_for_link(hw); if (ret_val < 0) { DEBUGOUT("Error while checking for link\n"); return ret_val; @@ -3037,9 +3051,8 @@ e1000_copper_link_postconfig(struct e1000_hw *hw) * hw - Struct containing variables accessed by shared code ******************************************************************************/ static int -e1000_setup_copper_link(struct eth_device *nic) +e1000_setup_copper_link(struct e1000_hw *hw) { - struct e1000_hw *hw = nic->priv; int32_t ret_val; uint16_t i; uint16_t phy_data; @@ -3662,9 +3675,8 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) * Called by any function that needs to check the link status of the adapter. *****************************************************************************/ static int -e1000_check_for_link(struct eth_device *nic) +e1000_check_for_link(struct e1000_hw *hw) { - struct e1000_hw *hw = nic->priv; uint32_t rxcw; uint32_t ctrl; uint32_t status; @@ -4858,9 +4870,8 @@ e1000_set_media_type(struct e1000_hw *hw) **/
static int -e1000_sw_init(struct eth_device *nic) +e1000_sw_init(struct e1000_hw *hw) { - struct e1000_hw *hw = (typeof(hw)) nic->priv; int result;
/* PCI config space info */ @@ -4876,7 +4887,7 @@ e1000_sw_init(struct eth_device *nic) /* identify the MAC */ result = e1000_set_mac_type(hw); if (result) { - E1000_ERR(hw->nic, "Unknown MAC Type\n"); + E1000_ERR(hw, "Unknown MAC Type\n"); return result; }
@@ -5136,9 +5147,8 @@ e1000_configure_rx(struct e1000_hw *hw) POLL - Wait for a frame ***************************************************************************/ static int -e1000_poll(struct eth_device *nic) +_e1000_poll(struct e1000_hw *hw) { - struct e1000_hw *hw = nic->priv; struct e1000_rx_desc *rd; unsigned long inval_start, inval_end; uint32_t len; @@ -5159,18 +5169,12 @@ e1000_poll(struct eth_device *nic) invalidate_dcache_range((unsigned long)packet, (unsigned long)packet + roundup(len, ARCH_DMA_MINALIGN)); - net_process_received_packet((uchar *)packet, len); - fill_rx(hw); - return 1; + return len; }
-/************************************************************************** -TRANSMIT - Transmit a frame -***************************************************************************/ -static int e1000_transmit(struct eth_device *nic, void *txpacket, int length) +static int _e1000_transmit(struct e1000_hw *hw, void *txpacket, int length) { void *nv_packet = (void *)txpacket; - struct e1000_hw *hw = nic->priv; struct e1000_tx_desc *txp; int i = 0; unsigned long flush_start, flush_end; @@ -5207,27 +5211,9 @@ static int e1000_transmit(struct eth_device *nic, void *txpacket, int length) return 1; }
-/*reset function*/ -static inline int -e1000_reset(struct eth_device *nic) -{ - struct e1000_hw *hw = nic->priv; - - e1000_reset_hw(hw); - if (hw->mac_type >= e1000_82544) { - E1000_WRITE_REG(hw, WUC, 0); - } - return e1000_init_hw(nic); -} - -/************************************************************************** -DISABLE - Turn off ethernet interface -***************************************************************************/ static void -e1000_disable(struct eth_device *nic) +_e1000_disable(struct e1000_hw *hw) { - struct e1000_hw *hw = nic->priv; - /* Turn off the ethernet interface */ E1000_WRITE_REG(hw, RCTL, 0); E1000_WRITE_REG(hw, TCTL, 0); @@ -5245,32 +5231,38 @@ e1000_disable(struct eth_device *nic) E1000_WRITE_REG(hw, CTRL, E1000_CTRL_RST); #endif mdelay(10); +}
+/*reset function*/ +static inline int +e1000_reset(struct e1000_hw *hw, unsigned char enetaddr[6]) +{ + e1000_reset_hw(hw); + if (hw->mac_type >= e1000_82544) + E1000_WRITE_REG(hw, WUC, 0); + + return e1000_init_hw(hw, enetaddr); }
-/************************************************************************** -INIT - set up ethernet interface(s) -***************************************************************************/ static int -e1000_init(struct eth_device *nic, bd_t * bis) +_e1000_init(struct e1000_hw *hw, unsigned char enetaddr[6]) { - struct e1000_hw *hw = nic->priv; int ret_val = 0;
- ret_val = e1000_reset(nic); + ret_val = e1000_reset(hw, enetaddr); if (ret_val < 0) { if ((ret_val == -E1000_ERR_NOLINK) || (ret_val == -E1000_ERR_TIMEOUT)) { - E1000_ERR(hw->nic, "Valid Link not detected\n"); + E1000_ERR(hw, "Valid Link not detected: %d\n", ret_val); } else { - E1000_ERR(hw->nic, "Hardware Initialization Failed\n"); + E1000_ERR(hw, "Hardware Initialization Failed\n"); } - return 0; + return ret_val; } e1000_configure_tx(hw); e1000_setup_rctl(hw); e1000_configure_rx(hw); - return 1; + return 0; }
/****************************************************************************** @@ -5307,6 +5299,138 @@ void e1000_get_bus_type(struct e1000_hw *hw) /* A list of all registered e1000 devices */ static LIST_HEAD(e1000_hw_list);
+static int e1000_init_one(struct e1000_hw *hw, int cardnum, pci_dev_t devno, + unsigned char enetaddr[6]) +{ + u32 val; + + /* Assign the passed-in values */ + hw->pdev = devno; + hw->cardnum = cardnum; + + /* Print a debug message with the IO base address */ + pci_read_config_dword(devno, PCI_BASE_ADDRESS_0, &val); + E1000_DBG(hw, "iobase 0x%08x\n", val & 0xfffffff0); + + /* Try to enable I/O accesses and bus-mastering */ + val = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; + pci_write_config_dword(devno, PCI_COMMAND, val); + + /* Make sure it worked */ + pci_read_config_dword(devno, PCI_COMMAND, &val); + if (!(val & PCI_COMMAND_MEMORY)) { + E1000_ERR(hw, "Can't enable I/O memory\n"); + return -ENOSPC; + } + if (!(val & PCI_COMMAND_MASTER)) { + E1000_ERR(hw, "Can't enable bus-mastering\n"); + return -EPERM; + } + + /* Are these variables needed? */ + hw->fc = e1000_fc_default; + hw->original_fc = e1000_fc_default; + hw->autoneg_failed = 0; + hw->autoneg = 1; + hw->get_link_status = true; +#ifndef CONFIG_E1000_NO_NVM + hw->eeprom_semaphore_present = true; +#endif + hw->hw_addr = pci_map_bar(devno, PCI_BASE_ADDRESS_0, + PCI_REGION_MEM); + hw->mac_type = e1000_undefined; + + /* MAC and Phy settings */ + if (e1000_sw_init(hw) < 0) { + E1000_ERR(hw, "Software init failed\n"); + return -EIO; + } + if (e1000_check_phy_reset_block(hw)) + E1000_ERR(hw, "PHY Reset is blocked!\n"); + + /* Basic init was OK, reset the hardware and allow SPI access */ + e1000_reset_hw(hw); + +#ifndef CONFIG_E1000_NO_NVM + /* Validate the EEPROM and get chipset information */ +#if !defined(CONFIG_MVBC_1G) + if (e1000_init_eeprom_params(hw)) { + E1000_ERR(hw, "EEPROM is invalid!\n"); + return -EINVAL; + } + if ((E1000_READ_REG(hw, I210_EECD) & E1000_EECD_FLUPD) && + e1000_validate_eeprom_checksum(hw)) + return -ENXIO; +#endif + e1000_read_mac_addr(hw, enetaddr); +#endif + e1000_get_bus_type(hw); + +#ifndef CONFIG_E1000_NO_NVM + printf("e1000: %02x:%02x:%02x:%02x:%02x:%02x\n ", + enetaddr[0], enetaddr[1], enetaddr[2], + enetaddr[3], enetaddr[4], enetaddr[5]); +#else + memset(enetaddr, 0, 6); + printf("e1000: no NVM\n"); +#endif + + return 0; +} + +/* Put the name of a device in a string */ +static void e1000_name(char *str, int cardnum) +{ + sprintf(str, "e1000#%u", cardnum); +} + +/************************************************************************** +TRANSMIT - Transmit a frame +***************************************************************************/ +static int e1000_transmit(struct eth_device *nic, void *txpacket, int length) +{ + struct e1000_hw *hw = nic->priv; + + return _e1000_transmit(hw, txpacket, length); +} + +/************************************************************************** +DISABLE - Turn off ethernet interface +***************************************************************************/ +static void +e1000_disable(struct eth_device *nic) +{ + struct e1000_hw *hw = nic->priv; + + _e1000_disable(hw); +} + +/************************************************************************** +INIT - set up ethernet interface(s) +***************************************************************************/ +static int +e1000_init(struct eth_device *nic, bd_t *bis) +{ + struct e1000_hw *hw = nic->priv; + + return _e1000_init(hw, nic->enetaddr); +} + +static int +e1000_poll(struct eth_device *nic) +{ + struct e1000_hw *hw = nic->priv; + int len; + + len = _e1000_poll(hw); + if (len) { + net_process_received_packet((uchar *)packet, len); + fill_rx(hw); + } + + return len ? 1 : 0; +} + /************************************************************************** PROBE - Look for an adapter, this routine's visible to the outside You should omit the last argument struct pci_device * for a non-PCI NIC @@ -5316,13 +5440,12 @@ e1000_initialize(bd_t * bis) { unsigned int i; pci_dev_t devno; + int ret;
DEBUGFUNC();
/* Find and probe all the matching PCI devices */ for (i = 0; (devno = pci_find_devices(e1000_supported, i)) >= 0; i++) { - u32 val; - /* * These will never get freed due to errors, this allows us to * perform SPI EEPROM programming from U-boot, for example. @@ -5339,83 +5462,18 @@ e1000_initialize(bd_t * bis) /* Make sure all of the fields are initially zeroed */ memset(nic, 0, sizeof(*nic)); memset(hw, 0, sizeof(*hw)); - - /* Assign the passed-in values */ - hw->cardnum = i; - hw->pdev = devno; - hw->nic = nic; nic->priv = hw;
/* Generate a card name */ - sprintf(nic->name, "e1000#%u", hw->cardnum); - - /* Print a debug message with the IO base address */ - pci_read_config_dword(devno, PCI_BASE_ADDRESS_0, &val); - E1000_DBG(nic, "iobase 0x%08x\n", val & 0xfffffff0); - - /* Try to enable I/O accesses and bus-mastering */ - val = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; - pci_write_config_dword(devno, PCI_COMMAND, val); - - /* Make sure it worked */ - pci_read_config_dword(devno, PCI_COMMAND, &val); - if (!(val & PCI_COMMAND_MEMORY)) { - E1000_ERR(nic, "Can't enable I/O memory\n"); - continue; - } - if (!(val & PCI_COMMAND_MASTER)) { - E1000_ERR(nic, "Can't enable bus-mastering\n"); - continue; - } + e1000_name(nic->name, i); + hw->name = nic->name;
- /* Are these variables needed? */ - hw->fc = e1000_fc_default; - hw->original_fc = e1000_fc_default; - hw->autoneg_failed = 0; - hw->autoneg = 1; - hw->get_link_status = true; -#ifndef CONFIG_E1000_NO_NVM - hw->eeprom_semaphore_present = true; -#endif - hw->hw_addr = pci_map_bar(devno, PCI_BASE_ADDRESS_0, - PCI_REGION_MEM); - hw->mac_type = e1000_undefined; - - /* MAC and Phy settings */ - if (e1000_sw_init(nic) < 0) { - E1000_ERR(nic, "Software init failed\n"); + ret = e1000_init_one(hw, i, devno, nic->enetaddr); + if (ret) continue; - } - if (e1000_check_phy_reset_block(hw)) - E1000_ERR(nic, "PHY Reset is blocked!\n"); - - /* Basic init was OK, reset the hardware and allow SPI access */ - e1000_reset_hw(hw); list_add_tail(&hw->list_node, &e1000_hw_list);
-#ifndef CONFIG_E1000_NO_NVM - /* Validate the EEPROM and get chipset information */ -#if !defined(CONFIG_MVBC_1G) - if (e1000_init_eeprom_params(hw)) { - E1000_ERR(nic, "EEPROM is invalid!\n"); - continue; - } - if ((E1000_READ_REG(hw, I210_EECD) & E1000_EECD_FLUPD) && - e1000_validate_eeprom_checksum(hw)) - continue; -#endif - e1000_read_mac_addr(nic); -#endif - e1000_get_bus_type(hw); - -#ifndef CONFIG_E1000_NO_NVM - printf("e1000: %02x:%02x:%02x:%02x:%02x:%02x\n ", - nic->enetaddr[0], nic->enetaddr[1], nic->enetaddr[2], - nic->enetaddr[3], nic->enetaddr[4], nic->enetaddr[5]); -#else - memset(nic->enetaddr, 0, 6); - printf("e1000: no NVM\n"); -#endif + hw->nic = nic;
/* Set up the function pointers and register the device */ nic->init = e1000_init; @@ -5443,6 +5501,7 @@ struct e1000_hw *e1000_find_card(unsigned int cardnum) static int do_e1000(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { + unsigned char *mac = NULL; struct e1000_hw *hw;
if (argc < 3) { @@ -5451,14 +5510,16 @@ static int do_e1000(cmd_tbl_t *cmdtp, int flag, }
/* Make sure we can find the requested e1000 card */ - hw = e1000_find_card(simple_strtoul(argv[1], NULL, 10)); - if (!hw) { + cardnum = simple_strtoul(argv[1], NULL, 10); + hw = e1000_find_card(cardnum); + if (hw) + mac = hw->nic->enetaddr; + if (!mac) { printf("e1000: ERROR: No such device: e1000#%s\n", argv[1]); return 1; }
if (!strcmp(argv[2], "print-mac-address")) { - unsigned char *mac = hw->nic->enetaddr; printf("%02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); return 0; diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h index efe7814..bfacd4e 100644 --- a/drivers/net/e1000.h +++ b/drivers/net/e1000.h @@ -1071,6 +1071,7 @@ typedef enum {
/* Structure containing variables used by the shared code (e1000_hw.c) */ struct e1000_hw { + const char *name; struct list_head list_node; struct eth_device *nic; #ifdef CONFIG_E1000_SPI

Update this driver to support driver model.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/net/e1000.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/e1000.h | 4 ++ 2 files changed, 141 insertions(+)
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 3a1d2ad..3db0f4e 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -30,6 +30,7 @@ tested on both gig copper and gig fiber boards */
#include <common.h> +#include <dm.h> #include <errno.h> #include <pci.h> #include "e1000.h" @@ -47,12 +48,21 @@ tested on both gig copper and gig fiber boards /* Intel i210 needs the DMA descriptor rings aligned to 128b */ #define E1000_BUFFER_ALIGN 128
+/* + * TODO(sjg@chromium.org): Even with driver model we share these buffers. + * Concurrent receiving on multiple active Ethernet devices will not work. + * Normally U-Boot does not support this anyway. To fix it in this driver, + * nove these buffers and the tx/rx pointers to struct e1000_hw. + */ DEFINE_ALIGN_BUFFER(struct e1000_tx_desc, tx_base, 16, E1000_BUFFER_ALIGN); DEFINE_ALIGN_BUFFER(struct e1000_rx_desc, rx_base, 16, E1000_BUFFER_ALIGN); DEFINE_ALIGN_BUFFER(unsigned char, packet, 4096, E1000_BUFFER_ALIGN);
static int tx_tail; static int rx_tail, rx_last; +#ifdef CONFIG_DM_ETH +static int num_cards; /* Number of E1000 devices seen so far */ +#endif
static struct pci_device_id e1000_supported[] = { { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82542) }, @@ -5296,8 +5306,10 @@ void e1000_get_bus_type(struct e1000_hw *hw) } }
+#ifndef CONFIG_DM_ETH /* A list of all registered e1000 devices */ static LIST_HEAD(e1000_hw_list); +#endif
static int e1000_init_one(struct e1000_hw *hw, int cardnum, pci_dev_t devno, unsigned char enetaddr[6]) @@ -5384,6 +5396,7 @@ static void e1000_name(char *str, int cardnum) sprintf(str, "e1000#%u", cardnum); }
+#ifndef CONFIG_DM_ETH /************************************************************************** TRANSMIT - Transmit a frame ***************************************************************************/ @@ -5496,13 +5509,22 @@ struct e1000_hw *e1000_find_card(unsigned int cardnum)
return NULL; } +#endif /* nCONFIG_DM_ETH */
#ifdef CONFIG_CMD_E1000 static int do_e1000(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned char *mac = NULL; +#ifdef CONFIG_DM_ETH + struct eth_pdata *plat; + struct udevice *dev; + char name[30]; + int ret; +#else struct e1000_hw *hw; +#endif + int cardnum;
if (argc < 3) { cmd_usage(cmdtp); @@ -5511,9 +5533,18 @@ static int do_e1000(cmd_tbl_t *cmdtp, int flag,
/* Make sure we can find the requested e1000 card */ cardnum = simple_strtoul(argv[1], NULL, 10); +#ifdef CONFIG_DM_ETH + e1000_name(name, cardnum); + ret = uclass_get_device_by_name(UCLASS_ETH, name, &dev); + if (!ret) { + plat = dev_get_platdata(dev); + mac = plat->enetaddr; + } +#else hw = e1000_find_card(cardnum); if (hw) mac = hw->nic->enetaddr; +#endif if (!mac) { printf("e1000: ERROR: No such device: e1000#%s\n", argv[1]); return 1; @@ -5548,3 +5579,109 @@ U_BOOT_CMD( " - Manage the Intel E1000 PCI device" ); #endif /* not CONFIG_CMD_E1000 */ + +#ifdef CONFIG_DM_ETH +static int e1000_eth_start(struct udevice *dev) +{ + struct eth_pdata *plat = dev_get_platdata(dev); + struct e1000_hw *hw = dev_get_priv(dev); + + return _e1000_init(hw, plat->enetaddr); +} + +static void e1000_eth_stop(struct udevice *dev) +{ + struct e1000_hw *hw = dev_get_priv(dev); + + _e1000_disable(hw); +} + +static int e1000_eth_send(struct udevice *dev, void *packet, int length) +{ + struct e1000_hw *hw = dev_get_priv(dev); + int ret; + + ret = _e1000_transmit(hw, packet, length); + + return ret ? 0 : -ETIMEDOUT; +} + +static int e1000_eth_recv(struct udevice *dev, int flags, uchar **packetp) +{ + struct e1000_hw *hw = dev_get_priv(dev); + int len; + + len = _e1000_poll(hw); + if (len) + *packetp = packet; + + return len ? len : -EAGAIN; +} + +static int e1000_free_pkt(struct udevice *dev, uchar *packet, int length) +{ + struct e1000_hw *hw = dev_get_priv(dev); + + fill_rx(hw); + + return 0; +} + +static int e1000_eth_probe(struct udevice *dev) +{ + struct eth_pdata *plat = dev_get_platdata(dev); + struct e1000_hw *hw = dev_get_priv(dev); + int ret; + + hw->name = dev->name; + ret = e1000_init_one(hw, trailing_strtol(dev->name), pci_get_bdf(dev), + plat->enetaddr); + if (ret < 0) { + printf(pr_fmt("failed to initialize card: %d\n"), ret); + return ret; + } + + return 0; +} + +static int e1000_eth_bind(struct udevice *dev) +{ + char name[20]; + + /* + * A simple way to number the devices. When device tree is used this + * is unnecessary, but when the device is just discovered on the PCI + * bus we need a name. We could instead have the uclass figure out + * which devices are different and number them. + */ + e1000_name(name, num_cards++); + + return device_set_name(dev, name); +} + +static const struct eth_ops e1000_eth_ops = { + .start = e1000_eth_start, + .send = e1000_eth_send, + .recv = e1000_eth_recv, + .stop = e1000_eth_stop, + .free_pkt = e1000_free_pkt, +}; + +static const struct udevice_id e1000_eth_ids[] = { + { .compatible = "realtek,e1000" }, + { } +}; + +U_BOOT_DRIVER(eth_e1000) = { + .name = "eth_e1000", + .id = UCLASS_ETH, + .of_match = e1000_eth_ids, + .bind = e1000_eth_bind, + .probe = e1000_eth_probe, + .ops = &e1000_eth_ops, + .priv_auto_alloc_size = sizeof(struct e1000_hw), + .platdata_auto_alloc_size = sizeof(struct eth_pdata), +}; + +U_BOOT_PCI_DEVICE(eth_e1000, e1000_supported); +#endif diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h index bfacd4e..543459d 100644 --- a/drivers/net/e1000.h +++ b/drivers/net/e1000.h @@ -22,7 +22,9 @@ #include <linux/list.h> #include <malloc.h> #include <net.h> +#ifndef CONFIG_DM_ETH #include <netdev.h> +#endif #include <asm/io.h> #include <pci.h>
@@ -1073,7 +1075,9 @@ typedef enum { struct e1000_hw { const char *name; struct list_head list_node; +#ifndef CONFIG_DM_ETH struct eth_device *nic; +#endif #ifdef CONFIG_E1000_SPI struct spi_slave spi; #endif

Move config for the E1000 Ethernet driver to Kconfig and tidy up affected boards.
Signed-off-by: Simon Glass sjg@chromium.org ---
README | 19 ------------------ configs/CSQ_CS908_defconfig | 2 +- configs/Mele_A1000G_quad_defconfig | 2 +- configs/Mini-X_defconfig | 4 ++-- configs/UTOO_P66_defconfig | 1 - configs/am43xx_evm_defconfig | 2 +- configs/ba10_tv_box_defconfig | 4 ++-- configs/db-88f6820-gp_defconfig | 2 +- configs/ls1021aqds_qspi_defconfig | 4 ++-- configs/ls1021atwr_qspi_defconfig | 4 ++-- configs/sandbox_defconfig | 20 +++++++++---------- configs/stv0991_defconfig | 2 +- configs/xilinx_zynqmp_ep_defconfig | 2 +- drivers/net/Kconfig | 39 +++++++++++++++++++++++++++++++++++++ include/configs/B4860QDS.h | 1 - include/configs/BSC9132QDS.h | 1 - include/configs/C29XPCIE.h | 1 - include/configs/MPC8536DS.h | 1 - include/configs/MPC8544DS.h | 1 - include/configs/MPC8548CDS.h | 1 - include/configs/MPC8569MDS.h | 1 - include/configs/MPC8572DS.h | 1 - include/configs/P1010RDB.h | 1 - include/configs/P1022DS.h | 1 - include/configs/P1023RDB.h | 1 - include/configs/P2041RDB.h | 1 - include/configs/T102xQDS.h | 1 - include/configs/T102xRDB.h | 1 - include/configs/T1040QDS.h | 1 - include/configs/T104xRDB.h | 1 - include/configs/T208xQDS.h | 1 - include/configs/T208xRDB.h | 1 - include/configs/T4240RDB.h | 1 - include/configs/UCP1020.h | 1 - include/configs/apalis_t30.h | 2 -- include/configs/corenet_ds.h | 1 - include/configs/crownbay.h | 1 - include/configs/gw_ventana.h | 1 - include/configs/km/kmp204x-common.h | 1 - include/configs/ls1021aqds.h | 1 - include/configs/ls1021atwr.h | 1 - include/configs/ls2085aqds.h | 1 - include/configs/ls2085ardb.h | 1 - include/configs/p1_p2_rdb_pc.h | 1 - include/configs/p1_twr.h | 1 - include/configs/qemu-ppce500.h | 1 - include/configs/qemu-x86.h | 1 - include/configs/t4qds.h | 1 - include/configs/vme8349.h | 1 - 49 files changed, 63 insertions(+), 80 deletions(-)
diff --git a/README b/README index 1bcb63c..6cb63ce 100644 --- a/README +++ b/README @@ -1365,25 +1365,6 @@ The following options need to be configured: SCSI devices found during the last scan.
- NETWORK Support (PCI): - CONFIG_E1000 - Support for Intel 8254x/8257x gigabit chips. - - CONFIG_E1000_SPI - Utility code for direct access to the SPI bus on Intel 8257x. - This does not do anything useful unless you set at least one - of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC. - - CONFIG_E1000_SPI_GENERIC - Allow generic access to the SPI bus on the Intel 8257x, for - example with the "sspi" command. - - CONFIG_CMD_E1000 - Management command for E1000 devices. When used on devices - with SPI support you can reprogram the EEPROM from U-Boot. - - CONFIG_E1000_FALLBACK_MAC - default MAC for empty EEPROM after production. - CONFIG_EEPRO100 Support for Intel 82557/82559/82559ER chips. Optional CONFIG_EEPRO100_SROM_WRITE enables EEPROM diff --git a/configs/CSQ_CS908_defconfig b/configs/CSQ_CS908_defconfig index fe88a7b..1d2aa6d 100644 --- a/configs/CSQ_CS908_defconfig +++ b/configs/CSQ_CS908_defconfig @@ -4,6 +4,7 @@ CONFIG_MACH_SUN6I=y CONFIG_DRAM_CLK=432 CONFIG_USB1_VBUS_PIN="" CONFIG_USB2_VBUS_PIN="" +CONFIG_USB_MUSB_SUNXI=y CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-cs908" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y @@ -15,4 +16,3 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_AXP221_DLDO1_VOLT=3300 CONFIG_AXP221_ALDO1_VOLT=3300 CONFIG_USB_EHCI_HCD=y -CONFIG_USB_MUSB_SUNXI=y diff --git a/configs/Mele_A1000G_quad_defconfig b/configs/Mele_A1000G_quad_defconfig index ffc8d9b..aa5f9fc 100644 --- a/configs/Mele_A1000G_quad_defconfig +++ b/configs/Mele_A1000G_quad_defconfig @@ -4,6 +4,7 @@ CONFIG_MACH_SUN6I=y CONFIG_DRAM_ZQ=120 CONFIG_USB1_VBUS_PIN="PC27" CONFIG_USB2_VBUS_PIN="" +CONFIG_USB_MUSB_SUNXI=y CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-mele-a1000g-quad" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y @@ -17,4 +18,3 @@ CONFIG_AXP221_DLDO1_VOLT=3300 CONFIG_AXP221_DLDO4_VOLT=3300 CONFIG_AXP221_ALDO1_VOLT=3300 CONFIG_USB_EHCI_HCD=y -CONFIG_USB_MUSB_SUNXI=y diff --git a/configs/Mini-X_defconfig b/configs/Mini-X_defconfig index c721c87..cf862dc 100644 --- a/configs/Mini-X_defconfig +++ b/configs/Mini-X_defconfig @@ -1,6 +1,8 @@ CONFIG_ARM=y CONFIG_ARCH_SUNXI=y CONFIG_MACH_SUN4I=y +CONFIG_USB0_VBUS_PIN="PB9" +CONFIG_USB_MUSB_SUNXI=y CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mini-xplus" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y @@ -9,5 +11,3 @@ CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER" # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set CONFIG_USB_EHCI_HCD=y -CONFIG_USB_MUSB_SUNXI=y -CONFIG_USB0_VBUS_PIN="PB9" diff --git a/configs/UTOO_P66_defconfig b/configs/UTOO_P66_defconfig index d59a044..59d5e4e 100644 --- a/configs/UTOO_P66_defconfig +++ b/configs/UTOO_P66_defconfig @@ -23,4 +23,3 @@ CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set -# CONFIG_REQUIRE_SERIAL_CONSOLE is not set diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig index 65efa9d..f84f57d 100644 --- a/configs/am43xx_evm_defconfig +++ b/configs/am43xx_evm_defconfig @@ -5,5 +5,5 @@ CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,NAND" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set -CONFIG_SPI_FLASH_BAR=y CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_BAR=y diff --git a/configs/ba10_tv_box_defconfig b/configs/ba10_tv_box_defconfig index ae302c5..a3816c1 100644 --- a/configs/ba10_tv_box_defconfig +++ b/configs/ba10_tv_box_defconfig @@ -3,7 +3,9 @@ CONFIG_ARCH_SUNXI=y CONFIG_MACH_SUN4I=y CONFIG_DRAM_CLK=384 CONFIG_DRAM_EMR1=4 +CONFIG_USB0_VBUS_PIN="PB9" CONFIG_USB2_VBUS_PIN="PH12" +CONFIG_USB_MUSB_SUNXI=y CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-ba10-tvbox" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y @@ -12,5 +14,3 @@ CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_EMAC" # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set CONFIG_USB_EHCI_HCD=y -CONFIG_USB_MUSB_SUNXI=y -CONFIG_USB0_VBUS_PIN="PB9" diff --git a/configs/db-88f6820-gp_defconfig b/configs/db-88f6820-gp_defconfig index 0ff6706..e22f5f7 100644 --- a/configs/db-88f6820-gp_defconfig +++ b/configs/db-88f6820-gp_defconfig @@ -1,6 +1,6 @@ -CONFIG_SPL=y CONFIG_ARM=y CONFIG_TARGET_DB_88F6820_GP=y +CONFIG_SPL=y # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set diff --git a/configs/ls1021aqds_qspi_defconfig b/configs/ls1021aqds_qspi_defconfig index 6a1f711..171c245 100644 --- a/configs/ls1021aqds_qspi_defconfig +++ b/configs/ls1021aqds_qspi_defconfig @@ -1,10 +1,10 @@ CONFIG_ARM=y CONFIG_TARGET_LS1021AQDS=y +CONFIG_DEFAULT_DEVICE_TREE="ls1021a-qds" CONFIG_SYS_EXTRA_OPTIONS="QSPI_BOOT" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_SETEXPR is not set -CONFIG_DEFAULT_DEVICE_TREE="ls1021a-qds" CONFIG_OF_CONTROL=y CONFIG_DM=y -CONFIG_DM_SPI=y CONFIG_SPI_FLASH=y +CONFIG_DM_SPI=y diff --git a/configs/ls1021atwr_qspi_defconfig b/configs/ls1021atwr_qspi_defconfig index 420cfe7..6c35918 100644 --- a/configs/ls1021atwr_qspi_defconfig +++ b/configs/ls1021atwr_qspi_defconfig @@ -1,10 +1,10 @@ CONFIG_ARM=y CONFIG_TARGET_LS1021ATWR=y +CONFIG_DEFAULT_DEVICE_TREE="ls1021a-twr" CONFIG_SYS_EXTRA_OPTIONS="QSPI_BOOT" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_SETEXPR is not set -CONFIG_DEFAULT_DEVICE_TREE="ls1021a-twr" CONFIG_OF_CONTROL=y CONFIG_DM=y -CONFIG_DM_SPI=y CONFIG_SPI_FLASH=y +CONFIG_DM_SPI=y diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index e6a4590..ef46006 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -13,16 +13,21 @@ CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y CONFIG_OF_HOSTFILE=y +CONFIG_CLK=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y CONFIG_DM_PCI=y CONFIG_PCI_SANDBOX=y -CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_SANDBOX=y +CONFIG_SPI_FLASH=y CONFIG_CMD_CROS_EC=y -CONFIG_CMD_DHRYSTONE=y CONFIG_CROS_EC=y CONFIG_CROS_EC_SANDBOX=y +CONFIG_RESET=y CONFIG_DM_ETH=y CONFIG_CROS_EC_KEYB=y +CONFIG_LED=y +CONFIG_LED_GPIO=y CONFIG_SANDBOX_SERIAL=y CONFIG_TPM_TIS_SANDBOX=y CONFIG_SYS_I2C_SANDBOX=y @@ -32,24 +37,19 @@ CONFIG_DM_PMIC=y CONFIG_DM_PMIC_SANDBOX=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_SANDBOX=y +CONFIG_RAM=y CONFIG_SOUND=y CONFIG_SOUND_SANDBOX=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_EMUL=y CONFIG_USB_STORAGE=y +CONFIG_DM_MMC=y CONFIG_DM_RTC=y CONFIG_SYS_VSNPRINTF=y +CONFIG_CMD_DHRYSTONE=y CONFIG_ERRNO_STR=y CONFIG_UNIT_TEST=y CONFIG_UT_TIME=y CONFIG_UT_DM=y CONFIG_UT_ENV=y -CONFIG_CLK=y -CONFIG_RESET=y -CONFIG_RAM=y -CONFIG_DM_MMC=y -CONFIG_LED=y -CONFIG_LED_GPIO=y -CONFIG_SYSCON=y -CONFIG_REGMAP=y diff --git a/configs/stv0991_defconfig b/configs/stv0991_defconfig index 3bdb1fc..fbc31f8 100644 --- a/configs/stv0991_defconfig +++ b/configs/stv0991_defconfig @@ -9,6 +9,6 @@ CONFIG_AUTOBOOT_STOP_STR=" " # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set +CONFIG_OF_CONTROL=y CONFIG_NETDEVICES=y CONFIG_ETH_DESIGNWARE=y -CONFIG_OF_CONTROL=y diff --git a/configs/xilinx_zynqmp_ep_defconfig b/configs/xilinx_zynqmp_ep_defconfig index fda44ea..9b2853f 100644 --- a/configs/xilinx_zynqmp_ep_defconfig +++ b/configs/xilinx_zynqmp_ep_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ZYNQMP=y +CONFIG_SYS_TEXT_BASE=0x8000000 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep" # CONFIG_CMD_CONSOLE is not set # CONFIG_CMD_IMLS is not set @@ -15,4 +16,3 @@ CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep" # CONFIG_CMD_NFS is not set CONFIG_CMD_TIME=y CONFIG_CMD_TIMER=y -CONFIG_SYS_TEXT_BASE=0x8000000 diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index ce76a02..6c70d19 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -20,6 +20,45 @@ menuconfig NETDEVICES
if NETDEVICES
+config E1000 + bool "Intel PRO/1000 Gigabit Ethernet support" + help + This driver supports Intel(R) PRO/1000 gigabit ethernet family of + adapters. For more information on how to identify your adapter, go + to the Adapter & Driver ID Guide at: + + http://support.intel.com/support/network/adapter/pro100/21397.htm + +config E1000_SPI_GENERIC + bool "Allow access to the Intel 8257x SPI bus" + depends on E1000 + help + Allow generic access to the SPI bus on the Intel 8257x, for + example with the "sspi" command. + +config E1000_SPI + bool "Enable SPI bus utility code" + depends on E1000 + help + Utility code for direct access to the SPI bus on Intel 8257x. + This does not do anything useful unless you set at least one + of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC. + +config E1000_FALLBACK_MAC + bool "Default MAC address for empty EEPROM after production" + depends on E1000 + help + Use this to define a fallback MAC address for when none is available + in the device EEPROM or U-Boot environment variables. + +config CMD_E1000 + bool "Enable the e1000 command" + depends on E1000 + help + This enables the 'e1000' management command for E1000 devices. When + used on devices with SPI support you can reprogram the EEPROM from + U-Boot. + config ETH_SANDBOX depends on DM_ETH && SANDBOX default y diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h index b396764..09dbbd1 100644 --- a/include/configs/B4860QDS.h +++ b/include/configs/B4860QDS.h @@ -719,7 +719,6 @@ unsigned long get_board_ddr_clk(void); #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h index e5cd267..f15bb7a 100644 --- a/include/configs/BSC9132QDS.h +++ b/include/configs/BSC9132QDS.h @@ -94,7 +94,6 @@
#define CONFIG_CMD_PCI
-#define CONFIG_E1000 /* E1000 pci Ethernet card*/
/* * PCI Windows diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h index 2357809..447620f 100644 --- a/include/configs/C29XPCIE.h +++ b/include/configs/C29XPCIE.h @@ -101,7 +101,6 @@
#define CONFIG_CMD_PCI
-#define CONFIG_E1000
/* * PCI Windows diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h index 6a90531..1312438 100644 --- a/include/configs/MPC8536DS.h +++ b/include/configs/MPC8536DS.h @@ -61,7 +61,6 @@ #define CONFIG_SYS_PCI_64BIT 1 /* enable 64-bit PCI resources */
#define CONFIG_FSL_LAW 1 /* Use common FSL init code */ -#define CONFIG_E1000 1 /* Defind e1000 pci Ethernet card*/
#define CONFIG_TSEC_ENET /* tsec ethernet support */ #define CONFIG_ENV_OVERWRITE diff --git a/include/configs/MPC8544DS.h b/include/configs/MPC8544DS.h index ef268a8..d7aa501 100644 --- a/include/configs/MPC8544DS.h +++ b/include/configs/MPC8544DS.h @@ -32,7 +32,6 @@ #define CONFIG_SYS_PCI_64BIT 1 /* enable 64-bit PCI resources */
#define CONFIG_FSL_LAW 1 /* Use common FSL init code */ -#define CONFIG_E1000 1 /* Defind e1000 pci Ethernet card*/
#define CONFIG_TSEC_ENET /* tsec ethernet support */ #define CONFIG_ENV_OVERWRITE diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h index a80221a..eef1b1e 100644 --- a/include/configs/MPC8548CDS.h +++ b/include/configs/MPC8548CDS.h @@ -423,7 +423,6 @@ extern unsigned long get_clock_freq(void);
#undef CONFIG_EEPRO100 #undef CONFIG_TULIP -#define CONFIG_E1000 /* Define e1000 pci Ethernet card */
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h index 78019b9..ad80829 100644 --- a/include/configs/MPC8569MDS.h +++ b/include/configs/MPC8569MDS.h @@ -441,7 +441,6 @@ extern unsigned long get_clock_freq(void);
#undef CONFIG_EEPRO100 #undef CONFIG_TULIP -#define CONFIG_E1000 /* Define e1000 pci Ethernet card */
#undef CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h index 71bd51b..f3334ad 100644 --- a/include/configs/MPC8572DS.h +++ b/include/configs/MPC8572DS.h @@ -505,7 +505,6 @@ #undef CONFIG_EEPRO100 #undef CONFIG_TULIP #undef CONFIG_RTL8139 -#define CONFIG_E1000 /* Define e1000 pci Ethernet card */
#ifndef CONFIG_PCI_PNP #define PCI_ENET0_IOADDR CONFIG_SYS_PCIE3_IO_BUS diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h index 4e3c05a..8ac7000 100644 --- a/include/configs/P1010RDB.h +++ b/include/configs/P1010RDB.h @@ -186,7 +186,6 @@
#define CONFIG_CMD_PCI
-#define CONFIG_E1000 /* E1000 pci Ethernet card*/
/* * PCI Windows diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h index 6ddf447..06b293f 100644 --- a/include/configs/P1022DS.h +++ b/include/configs/P1022DS.h @@ -554,7 +554,6 @@ #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ -#define CONFIG_E1000 /* Define e1000 pci Ethernet card */ #endif
/* SATA */ diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h index 8fff431..e61db18 100644 --- a/include/configs/P1023RDB.h +++ b/include/configs/P1023RDB.h @@ -250,7 +250,6 @@ extern unsigned long get_clock_freq(void); #define CONFIG_SYS_PCIE1_IO_SIZE 0x00010000 /* 64k */
#if defined(CONFIG_PCI) -#define CONFIG_E1000 /* Defind e1000 pci Ethernet card */ #define CONFIG_PCI_PNP /* do pci plug-and-play */ #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #endif /* CONFIG_PCI */ diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h index cc8700b..5468495 100644 --- a/include/configs/P2041RDB.h +++ b/include/configs/P2041RDB.h @@ -562,7 +562,6 @@ unsigned long get_board_sys_clk(unsigned long dummy); #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h index 0fa03cf..767d486 100644 --- a/include/configs/T102xQDS.h +++ b/include/configs/T102xQDS.h @@ -668,7 +668,6 @@ unsigned long get_board_ddr_clk(void); #endif
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000 #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION #endif /* CONFIG_PCI */ diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h index f99663a..e12e5ff 100644 --- a/include/configs/T102xRDB.h +++ b/include/configs/T102xRDB.h @@ -686,7 +686,6 @@ unsigned long get_board_ddr_clk(void); #endif
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000 #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION #endif /* CONFIG_PCI */ diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h index 0206e54..1f05975 100644 --- a/include/configs/T1040QDS.h +++ b/include/configs/T1040QDS.h @@ -548,7 +548,6 @@ unsigned long get_board_ddr_clk(void); #endif
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h index 16d2e0e..4f725c6 100644 --- a/include/configs/T104xRDB.h +++ b/include/configs/T104xRDB.h @@ -581,7 +581,6 @@ #endif
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h index b0ee0de..19f07f8 100644 --- a/include/configs/T208xQDS.h +++ b/include/configs/T208xQDS.h @@ -619,7 +619,6 @@ unsigned long get_board_ddr_clk(void); #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_FSL_PCIE_RESET /* need PCIe reset errata */ -#define CONFIG_E1000 #define CONFIG_PCI_PNP /* do pci plug-and-play */ #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h index 8c637c2..b0d8399 100644 --- a/include/configs/T208xRDB.h +++ b/include/configs/T208xRDB.h @@ -567,7 +567,6 @@ unsigned long get_board_ddr_clk(void); #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_FSL_PCIE_RESET /* need PCIe reset errata LSZ ADD */ -#define CONFIG_E1000 #define CONFIG_PCI_PNP /* do pci plug-and-play */ #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h index 8ed6bf7..edc03c3 100644 --- a/include/configs/T4240RDB.h +++ b/include/configs/T4240RDB.h @@ -278,7 +278,6 @@ #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/UCP1020.h b/include/configs/UCP1020.h index bdedef5..d8efcf8 100644 --- a/include/configs/UCP1020.h +++ b/include/configs/UCP1020.h @@ -420,7 +420,6 @@ #define CONFIG_SYS_PCIE1_IO_SIZE 0x00010000 /* 64k */
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000 /* Defind e1000 pci Ethernet card*/ #define CONFIG_CMD_PCI
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h index aba9ba6..8c66a2f 100644 --- a/include/configs/apalis_t30.h +++ b/include/configs/apalis_t30.h @@ -53,8 +53,6 @@ #define CONFIG_CMD_PCI_ENUM
/* PCI networking support */ -#define CONFIG_E1000 -#define CONFIG_E1000_NO_NVM
/* General networking support */ #define CONFIG_CMD_DHCP diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h index 88750e0..9f02e8a 100644 --- a/include/configs/corenet_ds.h +++ b/include/configs/corenet_ds.h @@ -566,7 +566,6 @@ #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/crownbay.h b/include/configs/crownbay.h index 6cf53a3..611950d 100644 --- a/include/configs/crownbay.h +++ b/include/configs/crownbay.h @@ -35,7 +35,6 @@ #define CONFIG_PCI_CONFIG_HOST_BRIDGE #define CONFIG_SYS_EARLY_PCI_INIT #define CONFIG_PCI_PNP -#define CONFIG_E1000
#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,vga,usbkbd\0" \ "stdout=serial,vga\0" \ diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h index 2cbd5e0..f3cdd8b 100644 --- a/include/configs/gw_ventana.h +++ b/include/configs/gw_ventana.h @@ -173,7 +173,6 @@
/* Ethernet support */ #define CONFIG_FEC_MXC -#define CONFIG_E1000 #define CONFIG_MII #define IMX_FEC_BASE ENET_BASE_ADDR #define CONFIG_FEC_XCV_TYPE RGMII diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h index a8cf3f7..7536cbd 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -375,7 +375,6 @@ int get_scl(void);
#define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index 13f9338..1e3dfa4 100644 --- a/include/configs/ls1021aqds.h +++ b/include/configs/ls1021aqds.h @@ -547,7 +547,6 @@ unsigned long get_board_ddr_clk(void);
#ifdef CONFIG_PCI #define CONFIG_PCI_PNP -#define CONFIG_E1000 #define CONFIG_PCI_SCAN_SHOW #define CONFIG_CMD_PCI #endif diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index cf2aaa3..3544c81 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -386,7 +386,6 @@
#ifdef CONFIG_PCI #define CONFIG_PCI_PNP -#define CONFIG_E1000 #define CONFIG_PCI_SCAN_SHOW #define CONFIG_CMD_PCI #endif diff --git a/include/configs/ls2085aqds.h b/include/configs/ls2085aqds.h index a6ef356..46f187a 100644 --- a/include/configs/ls2085aqds.h +++ b/include/configs/ls2085aqds.h @@ -313,7 +313,6 @@ unsigned long get_board_ddr_clk(void);
#ifdef CONFIG_PCI #define CONFIG_PCI_PNP -#define CONFIG_E1000 #define CONFIG_PCI_SCAN_SHOW #define CONFIG_CMD_PCI #endif diff --git a/include/configs/ls2085ardb.h b/include/configs/ls2085ardb.h index 41eb55b..6b9c375 100644 --- a/include/configs/ls2085ardb.h +++ b/include/configs/ls2085ardb.h @@ -277,7 +277,6 @@ unsigned long get_board_sys_clk(void);
#ifdef CONFIG_PCI #define CONFIG_PCI_PNP -#define CONFIG_E1000 #define CONFIG_PCI_SCAN_SHOW #define CONFIG_CMD_PCI #endif diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h index af3086d..af89e6b 100644 --- a/include/configs/p1_p2_rdb_pc.h +++ b/include/configs/p1_p2_rdb_pc.h @@ -767,7 +767,6 @@ #define CONFIG_SYS_PCIE1_IO_SIZE 0x00010000 /* 64k */
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000 /* Defind e1000 pci Ethernet card*/ #define CONFIG_CMD_PCI
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ diff --git a/include/configs/p1_twr.h b/include/configs/p1_twr.h index 8231eb4..e9cc274 100644 --- a/include/configs/p1_twr.h +++ b/include/configs/p1_twr.h @@ -303,7 +303,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_SYS_PCIE1_IO_SIZE 0x00010000 /* 64k */
#define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000 /* Defind e1000 pci Ethernet card*/ #define CONFIG_CMD_PCI
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ diff --git a/include/configs/qemu-ppce500.h b/include/configs/qemu-ppce500.h index be430ff..45f5e78 100644 --- a/include/configs/qemu-ppce500.h +++ b/include/configs/qemu-ppce500.h @@ -136,7 +136,6 @@ extern unsigned long long get_phys_ccsrbar_addr_early(void); #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h index 78c296f..11f049e 100644 --- a/include/configs/qemu-x86.h +++ b/include/configs/qemu-x86.h @@ -32,7 +32,6 @@
#define CONFIG_PCI_CONFIG_HOST_BRIDGE #define CONFIG_PCI_PNP -#define CONFIG_E1000
#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,vga\0" \ "stdout=serial,vga\0" \ diff --git a/include/configs/t4qds.h b/include/configs/t4qds.h index 658f8b2..356220e 100644 --- a/include/configs/t4qds.h +++ b/include/configs/t4qds.h @@ -233,7 +233,6 @@ #ifdef CONFIG_PCI #define CONFIG_PCI_INDIRECT_BRIDGE #define CONFIG_PCI_PNP /* do pci plug-and-play */ -#define CONFIG_E1000
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #define CONFIG_DOS_PARTITION diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h index 3998274..bc4a998 100644 --- a/include/configs/vme8349.h +++ b/include/configs/vme8349.h @@ -298,7 +298,6 @@ * TSEC configuration */ #ifdef VME_CADDY2 -#define CONFIG_E1000 #else #define CONFIG_TSEC_ENET /* TSEC ethernet support */ #endif

Hi Simon,
On Fri, Jul 31, 2015 at 3:40 AM, Simon Glass sjg@chromium.org wrote:
Move config for the E1000 Ethernet driver to Kconfig and tidy up affected boards.
Signed-off-by: Simon Glass sjg@chromium.org
README | 19 ------------------ configs/CSQ_CS908_defconfig | 2 +- configs/Mele_A1000G_quad_defconfig | 2 +- configs/Mini-X_defconfig | 4 ++-- configs/UTOO_P66_defconfig | 1 - configs/am43xx_evm_defconfig | 2 +- configs/ba10_tv_box_defconfig | 4 ++-- configs/db-88f6820-gp_defconfig | 2 +- configs/ls1021aqds_qspi_defconfig | 4 ++-- configs/ls1021atwr_qspi_defconfig | 4 ++-- configs/sandbox_defconfig | 20 +++++++++---------- configs/stv0991_defconfig | 2 +- configs/xilinx_zynqmp_ep_defconfig | 2 +- drivers/net/Kconfig | 39 +++++++++++++++++++++++++++++++++++++ include/configs/B4860QDS.h | 1 - include/configs/BSC9132QDS.h | 1 - include/configs/C29XPCIE.h | 1 - include/configs/MPC8536DS.h | 1 - include/configs/MPC8544DS.h | 1 - include/configs/MPC8548CDS.h | 1 - include/configs/MPC8569MDS.h | 1 - include/configs/MPC8572DS.h | 1 - include/configs/P1010RDB.h | 1 - include/configs/P1022DS.h | 1 - include/configs/P1023RDB.h | 1 - include/configs/P2041RDB.h | 1 - include/configs/T102xQDS.h | 1 - include/configs/T102xRDB.h | 1 - include/configs/T1040QDS.h | 1 - include/configs/T104xRDB.h | 1 - include/configs/T208xQDS.h | 1 - include/configs/T208xRDB.h | 1 - include/configs/T4240RDB.h | 1 - include/configs/UCP1020.h | 1 - include/configs/apalis_t30.h | 2 -- include/configs/corenet_ds.h | 1 - include/configs/crownbay.h | 1 - include/configs/gw_ventana.h | 1 - include/configs/km/kmp204x-common.h | 1 - include/configs/ls1021aqds.h | 1 - include/configs/ls1021atwr.h | 1 - include/configs/ls2085aqds.h | 1 - include/configs/ls2085ardb.h | 1 - include/configs/p1_p2_rdb_pc.h | 1 - include/configs/p1_twr.h | 1 - include/configs/qemu-ppce500.h | 1 - include/configs/qemu-x86.h | 1 - include/configs/t4qds.h | 1 - include/configs/vme8349.h | 1 - 49 files changed, 63 insertions(+), 80 deletions(-)
I see board config files are updated to remove CONFIG_E1000, but board defconfig files are not updated to add CONFIG_E1000=y.
diff --git a/README b/README index 1bcb63c..6cb63ce 100644 --- a/README +++ b/README @@ -1365,25 +1365,6 @@ The following options need to be configured: SCSI devices found during the last scan.
- NETWORK Support (PCI):
CONFIG_E1000
Support for Intel 8254x/8257x gigabit chips.
CONFIG_E1000_SPI
Utility code for direct access to the SPI bus on Intel 8257x.
This does not do anything useful unless you set at least one
of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC.
CONFIG_E1000_SPI_GENERIC
Allow generic access to the SPI bus on the Intel 8257x, for
example with the "sspi" command.
CONFIG_CMD_E1000
Management command for E1000 devices. When used on devices
with SPI support you can reprogram the EEPROM from U-Boot.
CONFIG_E1000_FALLBACK_MAC
default MAC for empty EEPROM after production.
CONFIG_EEPRO100 Support for Intel 82557/82559/82559ER chips. Optional CONFIG_EEPRO100_SROM_WRITE enables EEPROM
[snip]
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index ce76a02..6c70d19 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -20,6 +20,45 @@ menuconfig NETDEVICES
if NETDEVICES
+config E1000
bool "Intel PRO/1000 Gigabit Ethernet support"
Nits: bool is not indented correctly.
help
This driver supports Intel(R) PRO/1000 gigabit ethernet family of
adapters. For more information on how to identify your adapter, go
to the Adapter & Driver ID Guide at:
<http://support.intel.com/support/network/adapter/pro100/21397.htm>
+config E1000_SPI_GENERIC
bool "Allow access to the Intel 8257x SPI bus"
depends on E1000
help
Allow generic access to the SPI bus on the Intel 8257x, for
example with the "sspi" command.
+config E1000_SPI
bool "Enable SPI bus utility code"
depends on E1000
help
Utility code for direct access to the SPI bus on Intel 8257x.
This does not do anything useful unless you set at least one
of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC.
+config E1000_FALLBACK_MAC
bool "Default MAC address for empty EEPROM after production"
depends on E1000
help
Use this to define a fallback MAC address for when none is available
in the device EEPROM or U-Boot environment variables.
+config CMD_E1000
bool "Enable the e1000 command"
depends on E1000
help
This enables the 'e1000' management command for E1000 devices. When
used on devices with SPI support you can reprogram the EEPROM from
U-Boot.
config ETH_SANDBOX depends on DM_ETH && SANDBOX default y
[snip]
Regards, Bin
participants (2)
-
Bin Meng
-
Simon Glass