aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-04-15 08:42:37 -0400
committerTom Rini <trini@konsulko.com>2018-04-15 08:42:37 -0400
commitdf13a44377b36f438d15de06b07ad4645b89cf4f (patch)
treec25c837a617fa82826f15237b8f8ff6b81723af0
parent6d0409f256127000a9b32f94d1b52a6ee83382bf (diff)
parent16879cd25a4089cde2f3393fb09567df53402679 (diff)
downloadu-boot-df13a44377b36f438d15de06b07ad4645b89cf4f.zip
u-boot-df13a44377b36f438d15de06b07ad4645b89cf4f.tar.gz
u-boot-df13a44377b36f438d15de06b07ad4645b89cf4f.tar.bz2
Merge git://git.denx.de/u-boot-net
-rw-r--r--Kconfig12
-rw-r--r--cmd/Kconfig127
-rw-r--r--cmd/bootefi.c4
-rw-r--r--cmd/net.c4
-rw-r--r--configs/am335x_baltos_defconfig1
-rw-r--r--configs/am335x_shc_defconfig1
-rw-r--r--configs/am335x_shc_ict_defconfig1
-rw-r--r--configs/am335x_shc_netboot_defconfig1
-rw-r--r--configs/am335x_shc_prompt_defconfig1
-rw-r--r--configs/am335x_shc_sdboot_defconfig1
-rw-r--r--configs/am335x_shc_sdboot_prompt_defconfig1
-rw-r--r--configs/devkit3250_defconfig1
-rw-r--r--configs/ds414_defconfig1
-rw-r--r--configs/khadas-vim_defconfig1
-rw-r--r--configs/libretech-cc_defconfig1
-rw-r--r--configs/p212_defconfig1
-rw-r--r--configs/pepper_defconfig1
-rw-r--r--configs/work_92105_defconfig1
-rw-r--r--configs/x600_defconfig1
-rw-r--r--drivers/net/Kconfig13
-rw-r--r--drivers/net/fec_mxc.c55
-rw-r--r--drivers/net/mvneta.c10
-rw-r--r--drivers/net/phy/Kconfig8
-rw-r--r--drivers/net/zynq_gem.c9
-rw-r--r--include/configs/mx28evk.h1
-rw-r--r--include/configs/socfpga_common.h2
-rw-r--r--include/configs/xilinx_zynqmp.h2
-rw-r--r--include/configs/zynq-common.h2
-rw-r--r--include/netdev.h6
-rw-r--r--lib/efi_loader/Makefile2
-rw-r--r--lib/efi_loader/efi_device_path.c2
-rw-r--r--net/Kconfig51
-rw-r--r--net/Makefile14
33 files changed, 221 insertions, 118 deletions
diff --git a/Kconfig b/Kconfig
index 67b8c50..7accdad 100644
--- a/Kconfig
+++ b/Kconfig
@@ -76,22 +76,16 @@ config DISTRO_DEFAULTS
imply USE_BOOTCOMMAND
select CMD_BOOTZ if ARM && !ARM64
select CMD_BOOTI if ARM64
- select CMD_DHCP if NET && CMD_NET
- select CMD_PXE if NET && CMD_NET
+ select CMD_DHCP if CMD_NET
+ select CMD_PING if CMD_NET
+ select CMD_PXE if NET
select CMD_EXT2
select CMD_EXT4
select CMD_FAT
select CMD_FS_GENERIC
imply CMD_MII if NET
- select CMD_PING if NET
select CMD_PART if PARTITIONS
select HUSH_PARSER
- select BOOTP_BOOTPATH if NET && CMD_NET
- select BOOTP_DNS if NET && CMD_NET
- select BOOTP_GATEWAY if NET && CMD_NET
- select BOOTP_HOSTNAME if NET && CMD_NET
- select BOOTP_PXE if NET && CMD_NET
- select BOOTP_SUBNETMASK if NET && CMD_NET
select CMDLINE_EDITING
select AUTO_COMPLETE
select SYS_LONGHELP
diff --git a/cmd/Kconfig b/cmd/Kconfig
index d440675..bc1d2f3 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1021,46 +1021,127 @@ config CMD_SETEXPR
endmenu
-menu "Network commands"
-
if NET
-config CMD_NET
- bool "bootp, tftpboot"
+menuconfig CMD_NET
+ bool "Network commands"
+ default y
+
+if CMD_NET
+
+config CMD_BOOTP
+ bool "bootp"
default y
help
- Network commands.
bootp - boot image via network using BOOTP/TFTP protocol
+
+config CMD_DHCP
+ bool "dhcp"
+ depends on CMD_BOOTP
+ help
+ Boot image via network using DHCP/TFTP protocol
+
+config BOOTP_BOOTPATH
+ bool "Request & store 'rootpath' from BOOTP/DHCP server"
+ default y
+ depends on CMD_BOOTP
+ help
+ Even though the config is called BOOTP_BOOTPATH, it stores the
+ path in the variable 'rootpath'.
+
+config BOOTP_DNS
+ bool "Request & store 'dnsip' from BOOTP/DHCP server"
+ default y
+ depends on CMD_BOOTP
+ help
+ The primary DNS server is stored as 'dnsip'. If two servers are
+ returned, you must set BOOTP_DNS2 to store that second server IP
+ also.
+
+config BOOTP_DNS2
+ bool "Store 'dnsip2' from BOOTP/DHCP server"
+ depends on BOOTP_DNS
+ help
+ If a DHCP client requests the DNS server IP from a DHCP server,
+ it is possible that more than one DNS serverip is offered to the
+ client. If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS
+ server IP will be stored in the additional environment
+ variable "dnsip2". The first DNS serverip is always
+ stored in the variable "dnsip", when BOOTP_DNS is defined.
+
+config BOOTP_GATEWAY
+ bool "Request & store 'gatewayip' from BOOTP/DHCP server"
+ default y
+ depends on CMD_BOOTP
+
+config BOOTP_HOSTNAME
+ bool "Request & store 'hostname' from BOOTP/DHCP server"
+ default y
+ depends on CMD_BOOTP
+ help
+ The name may or may not be qualified with the local domain name.
+
+config BOOTP_SUBNETMASK
+ bool "Request & store 'netmask' from BOOTP/DHCP server"
+ default y
+ depends on CMD_BOOTP
+
+config BOOTP_PXE
+ bool "Send PXE client arch to BOOTP/DHCP server"
+ default y
+ depends on CMD_BOOTP && CMD_PXE
+ help
+ Supported for ARM, ARM64, and x86 for now.
+
+config BOOTP_PXE_CLIENTARCH
+ hex
+ depends on BOOTP_PXE
+ default 0x16 if ARM64
+ default 0x15 if ARM
+ default 0 if X86
+
+config BOOTP_VCI_STRING
+ string
+ depends on CMD_BOOTP
+ default "U-Boot.armv7" if CPU_V7 || CPU_V7M
+ default "U-Boot.armv8" if ARM64
+ default "U-Boot.arm" if ARM
+ default "U-Boot"
+
+config CMD_TFTPBOOT
+ bool "tftpboot"
+ default y
+ help
tftpboot - boot image via network using TFTP protocol
config CMD_TFTPPUT
bool "tftp put"
+ depends on CMD_TFTPBOOT
help
TFTP put command, for uploading files to a server
config CMD_TFTPSRV
bool "tftpsrv"
+ depends on CMD_TFTPBOOT
help
Act as a TFTP server and boot the first received file
+config NET_TFTP_VARS
+ bool "Control TFTP timeout and count through environment"
+ depends on CMD_TFTPBOOT
+ default y
+ help
+ If set, allows controlling the TFTP timeout through the
+ environment variable tftptimeout, and the TFTP maximum
+ timeout count through the variable tftptimeoutcountmax.
+ If unset, timeout and maximum are hard-defined as 1 second
+ and 10 timouts per TFTP transfer.
+
config CMD_RARP
bool "rarpboot"
help
Boot image via network using RARP/TFTP protocol
-config CMD_DHCP
- bool "dhcp"
- depends on CMD_NET
- help
- Boot image via network using DHCP/TFTP protocol
-
-config CMD_PXE
- bool "pxe"
- depends on CMD_NET
- select MENU
- help
- Boot image via network using PXE protocol
-
config CMD_NFS
bool "nfs"
default y
@@ -1097,6 +1178,8 @@ config CMD_LINK_LOCAL
help
Acquire a network IP address using the link-local protocol
+endif
+
config CMD_ETHSW
bool "ethsw"
help
@@ -1105,9 +1188,13 @@ config CMD_ETHSW
operations such as enabling / disabling a port and
viewing/maintaining the filtering database (FDB)
-endif
+config CMD_PXE
+ bool "pxe"
+ select MENU
+ help
+ Boot image via network using PXE protocol
-endmenu
+endif
menu "Misc commands"
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 5a2a810..5498a5f 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -56,7 +56,7 @@ efi_status_t efi_init_obj_list(void)
if (ret != EFI_SUCCESS)
goto out;
#endif
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_NET
ret = efi_net_register();
if (ret != EFI_SUCCESS)
goto out;
@@ -511,7 +511,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
bootefi_device_path = efi_dp_from_part(desc, part);
} else {
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_NET
bootefi_device_path = efi_dp_from_eth();
#endif
}
diff --git a/cmd/net.c b/cmd/net.c
index d7c776a..67888d4 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -14,6 +14,7 @@
static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
+#ifdef CONFIG_CMD_BOOTP
static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
return netboot_common(BOOTP, cmdtp, argc, argv);
@@ -24,7 +25,9 @@ U_BOOT_CMD(
"boot image via network using BOOTP/TFTP protocol",
"[loadAddress] [[hostIPaddr:]bootfilename]"
);
+#endif
+#ifdef CONFIG_CMD_TFTPBOOT
int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int ret;
@@ -40,6 +43,7 @@ U_BOOT_CMD(
"boot image via network using TFTP protocol",
"[loadAddress] [[hostIPaddr:]bootfilename]"
);
+#endif
#ifdef CONFIG_CMD_TFTPPUT
static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 2ceb761..d72228b 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -44,6 +44,7 @@ CONFIG_SYS_OMAP24_I2C_SPEED=1000
CONFIG_MMC_OMAP_HS=y
CONFIG_NAND=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_USB=y
diff --git a/configs/am335x_shc_defconfig b/configs/am335x_shc_defconfig
index 3be3063..42196dd 100644
--- a/configs/am335x_shc_defconfig
+++ b/configs/am335x_shc_defconfig
@@ -38,6 +38,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_MMC_OMAP_HS=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_FAT_WRITE=y
diff --git a/configs/am335x_shc_ict_defconfig b/configs/am335x_shc_ict_defconfig
index 1fe5bf8..a32248e 100644
--- a/configs/am335x_shc_ict_defconfig
+++ b/configs/am335x_shc_ict_defconfig
@@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_MMC_OMAP_HS=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_FAT_WRITE=y
diff --git a/configs/am335x_shc_netboot_defconfig b/configs/am335x_shc_netboot_defconfig
index bd61102..3474f51 100644
--- a/configs/am335x_shc_netboot_defconfig
+++ b/configs/am335x_shc_netboot_defconfig
@@ -40,6 +40,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_MMC_OMAP_HS=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_FAT_WRITE=y
diff --git a/configs/am335x_shc_prompt_defconfig b/configs/am335x_shc_prompt_defconfig
index 9658fb9..de852cb 100644
--- a/configs/am335x_shc_prompt_defconfig
+++ b/configs/am335x_shc_prompt_defconfig
@@ -37,6 +37,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_MMC_OMAP_HS=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_FAT_WRITE=y
diff --git a/configs/am335x_shc_sdboot_defconfig b/configs/am335x_shc_sdboot_defconfig
index f8f88d3..346efad 100644
--- a/configs/am335x_shc_sdboot_defconfig
+++ b/configs/am335x_shc_sdboot_defconfig
@@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_MMC_OMAP_HS=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_FAT_WRITE=y
diff --git a/configs/am335x_shc_sdboot_prompt_defconfig b/configs/am335x_shc_sdboot_prompt_defconfig
index f8f88d3..346efad 100644
--- a/configs/am335x_shc_sdboot_prompt_defconfig
+++ b/configs/am335x_shc_sdboot_prompt_defconfig
@@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_MMC_OMAP_HS=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
CONFIG_FAT_WRITE=y
diff --git a/configs/devkit3250_defconfig b/configs/devkit3250_defconfig
index fa35748..a88cf1c 100644
--- a/configs/devkit3250_defconfig
+++ b/configs/devkit3250_defconfig
@@ -36,6 +36,7 @@ CONFIG_MTD_NOR_FLASH=y
CONFIG_NAND=y
CONFIG_SPL_NAND_SIMPLE=y
CONFIG_PHYLIB=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_ADDR=31
CONFIG_DM_SERIAL=y
CONFIG_SYS_NS16550=y
diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig
index d605ebf..9071859 100644
--- a/configs/ds414_defconfig
+++ b/configs/ds414_defconfig
@@ -41,6 +41,7 @@ CONFIG_SPL_OF_TRANSLATE=y
CONFIG_SPI_FLASH=y
CONFIG_SPI_FLASH_BAR=y
CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_GIGE=y
CONFIG_MVNETA=y
CONFIG_PCI=y
diff --git a/configs/khadas-vim_defconfig b/configs/khadas-vim_defconfig
index f4674ef..0bfb594 100644
--- a/configs/khadas-vim_defconfig
+++ b/configs/khadas-vim_defconfig
@@ -20,6 +20,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DM_GPIO=y
CONFIG_DM_MMC=y
CONFIG_MMC_MESON_GX=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_ADDR=8
CONFIG_PHY_MESON_GXL=y
CONFIG_DM_ETH=y
diff --git a/configs/libretech-cc_defconfig b/configs/libretech-cc_defconfig
index 18ddb45..931496c 100644
--- a/configs/libretech-cc_defconfig
+++ b/configs/libretech-cc_defconfig
@@ -20,6 +20,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DM_GPIO=y
CONFIG_DM_MMC=y
CONFIG_MMC_MESON_GX=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_ADDR=8
CONFIG_PHY_MESON_GXL=y
CONFIG_DM_ETH=y
diff --git a/configs/p212_defconfig b/configs/p212_defconfig
index b6923f3..44221fc 100644
--- a/configs/p212_defconfig
+++ b/configs/p212_defconfig
@@ -20,6 +20,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DM_GPIO=y
CONFIG_DM_MMC=y
CONFIG_MMC_MESON_GX=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_ADDR=8
CONFIG_PHY_MESON_GXL=y
CONFIG_DM_ETH=y
diff --git a/configs/pepper_defconfig b/configs/pepper_defconfig
index 91e9937..f3d048d 100644
--- a/configs/pepper_defconfig
+++ b/configs/pepper_defconfig
@@ -33,6 +33,7 @@ CONFIG_MMC_OMAP_HS=y
CONFIG_PHY_MICREL=y
CONFIG_PHY_MICREL_KSZ90X1=y
CONFIG_DRIVER_TI_CPSW=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_NETDEVICES=y
CONFIG_SYS_NS16550=y
CONFIG_OMAP3_SPI=y
diff --git a/configs/work_92105_defconfig b/configs/work_92105_defconfig
index 150fb07..677672d 100644
--- a/configs/work_92105_defconfig
+++ b/configs/work_92105_defconfig
@@ -36,6 +36,7 @@ CONFIG_SPL_DM=y
CONFIG_DM_GPIO=y
# CONFIG_MMC is not set
CONFIG_PHYLIB=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_DM_SERIAL=y
CONFIG_SYS_NS16550=y
CONFIG_LPC32XX_SSP=y
diff --git a/configs/x600_defconfig b/configs/x600_defconfig
index 1da4d8d..77f2b03 100644
--- a/configs/x600_defconfig
+++ b/configs/x600_defconfig
@@ -44,6 +44,7 @@ CONFIG_FPGA_SPARTAN3=y
CONFIG_SYS_I2C_DW=y
# CONFIG_MMC is not set
CONFIG_MTD_NOR_FLASH=y
+CONFIG_PHY_ADDR_ENABLE=y
CONFIG_PHY_MICREL=y
CONFIG_PHY_MICREL_KSZ90X1=y
CONFIG_NETDEVICES=y
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 98573cb..3a374d8 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -155,9 +155,20 @@ config ETHOC
help
This MAC is present in OpenRISC and Xtensa XTFPGA boards.
+config FEC_MXC_SHARE_MDIO
+ bool "Share the MDIO bus for FEC controller"
+ depends on FEC_MXC
+
+config FEC_MXC_MDIO_BASE
+ hex "MDIO base address for the FEC controller"
+ depends on FEC_MXC_SHARE_MDIO
+ help
+ This specifies the MDIO registers base address. It is used when
+ two FEC controllers share MDIO bus.
+
config FEC_MXC
bool "FEC Ethernet controller"
- depends on MX5 || MX6
+ depends on MX5 || MX6 || MX7
help
This driver supports the 10/100 Fast Ethernet controller for
NXP i.MX processors.
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 29af85c..0076d63 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -807,7 +807,16 @@ static int fec_recv(struct eth_device *dev)
uint16_t bd_status;
ulong addr, size, end;
int i;
+
+#ifdef CONFIG_DM_ETH
+ *packetp = memalign(ARCH_DMA_MINALIGN, FEC_MAX_PKT_SIZE);
+ if (*packetp == 0) {
+ printf("%s: error allocating packetp\n", __func__);
+ return -ENOMEM;
+ }
+#else
ALLOC_CACHE_ALIGN_BUFFER(uchar, buff, FEC_MAX_PKT_SIZE);
+#endif
/* Check if any critical events have happened */
ievent = readl(&fec->eth->ievent);
@@ -883,8 +892,13 @@ static int fec_recv(struct eth_device *dev)
#ifdef CONFIG_FEC_MXC_SWAP_PACKET
swap_packet((uint32_t *)addr, frame_length);
#endif
+
+#ifdef CONFIG_DM_ETH
+ memcpy(*packetp, (char *)addr, frame_length);
+#else
memcpy(buff, (char *)addr, frame_length);
net_process_received_packet(buff, frame_length);
+#endif
len = frame_length;
} else {
if (bd_status & FEC_RBD_ERR)
@@ -998,18 +1012,9 @@ static void fec_free_descs(struct fec_priv *fec)
free(fec->tbd_base);
}
-#ifdef CONFIG_DM_ETH
-struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id)
-#else
-struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id)
-#endif
+struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id)
{
-#ifdef CONFIG_DM_ETH
- struct fec_priv *priv = dev_get_priv(dev);
- struct ethernet_regs *eth = priv->eth;
-#else
- struct ethernet_regs *eth = (struct ethernet_regs *)(ulong)base_addr;
-#endif
+ struct ethernet_regs *eth = (struct ethernet_regs *)base_addr;
struct mii_dev *bus;
int ret;
@@ -1141,12 +1146,12 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
#endif
int ret;
-#ifdef CONFIG_MX28
+#ifdef CONFIG_FEC_MXC_MDIO_BASE
/*
* The i.MX28 has two ethernet interfaces, but they are not equal.
* Only the first one can access the MDIO bus.
*/
- base_mii = MXS_ENET0_BASE;
+ base_mii = CONFIG_FEC_MXC_MDIO_BASE;
#else
base_mii = addr;
#endif
@@ -1202,10 +1207,19 @@ static int fecmxc_read_rom_hwaddr(struct udevice *dev)
return fec_get_hwaddr(priv->dev_id, pdata->enetaddr);
}
+static int fecmxc_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+ if (packet)
+ free(packet);
+
+ return 0;
+}
+
static const struct eth_ops fecmxc_ops = {
.start = fecmxc_init,
.send = fecmxc_send,
.recv = fecmxc_recv,
+ .free_pkt = fecmxc_free_pkt,
.stop = fecmxc_halt,
.write_hwaddr = fecmxc_set_hwaddr,
.read_rom_hwaddr = fecmxc_read_rom_hwaddr,
@@ -1237,7 +1251,6 @@ static int fecmxc_probe(struct udevice *dev)
struct eth_pdata *pdata = dev_get_platdata(dev);
struct fec_priv *priv = dev_get_priv(dev);
struct mii_dev *bus = NULL;
- int dev_id = -1;
uint32_t start;
int ret;
@@ -1258,9 +1271,13 @@ static int fecmxc_probe(struct udevice *dev)
}
fec_reg_setup(priv);
- priv->dev_id = (dev_id == -1) ? 0 : dev_id;
- bus = fec_get_miibus(dev, dev_id);
+ priv->dev_id = dev->seq;
+#ifdef CONFIG_FEC_MXC_MDIO_BASE
+ bus = fec_get_miibus((ulong)CONFIG_FEC_MXC_MDIO_BASE, dev->seq);
+#else
+ bus = fec_get_miibus((ulong)priv->eth, dev->seq);
+#endif
if (!bus) {
ret = -ENOMEM;
goto err_mii;
@@ -1275,12 +1292,11 @@ static int fecmxc_probe(struct udevice *dev)
return 0;
-err_timeout:
- free(priv->phydev);
err_phy:
mdio_unregister(bus);
free(bus);
err_mii:
+err_timeout:
fec_free_descs(priv);
return ret;
}
@@ -1326,6 +1342,9 @@ static int fecmxc_ofdata_to_platdata(struct udevice *dev)
static const struct udevice_id fecmxc_ids[] = {
{ .compatible = "fsl,imx6q-fec" },
+ { .compatible = "fsl,imx6sl-fec" },
+ { .compatible = "fsl,imx6sx-fec" },
+ { .compatible = "fsl,imx6ul-fec" },
{ }
};
diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
index 83e3153..f2e9acf 100644
--- a/drivers/net/mvneta.c
+++ b/drivers/net/mvneta.c
@@ -890,6 +890,15 @@ static void mvneta_mac_addr_set(struct mvneta_port *pp, unsigned char *addr,
mvneta_set_ucast_addr(pp, addr[5], queue);
}
+static int mvneta_write_hwaddr(struct udevice *dev)
+{
+ mvneta_mac_addr_set(dev_get_priv(dev),
+ ((struct eth_pdata *)dev_get_platdata(dev))->enetaddr,
+ rxq_def);
+
+ return 0;
+}
+
/* Handle rx descriptor fill by setting buf_cookie and buf_phys_addr */
static void mvneta_rx_desc_fill(struct mvneta_rx_desc *rx_desc,
u32 phys_addr, u32 cookie)
@@ -1753,6 +1762,7 @@ static const struct eth_ops mvneta_ops = {
.send = mvneta_send,
.recv = mvneta_recv,
.stop = mvneta_stop,
+ .write_hwaddr = mvneta_write_hwaddr,
};
static int mvneta_ofdata_to_platdata(struct udevice *dev)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 179e041..f5821df 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -13,12 +13,20 @@ menuconfig PHYLIB
if PHYLIB
+config PHY_ADDR_ENABLE
+ bool "Limit phy address"
+ default y if ARCH_SUNXI
+ help
+ Select this if you want to control which phy address is used
+
+if PHY_ADDR_ENABLE
config PHY_ADDR
int "PHY address"
default 1 if ARCH_SUNXI
default 0
help
The address of PHY on MII bus. Usually in range of 0 to 31.
+endif
config B53_SWITCH
bool "Broadcom BCM53xx (RoboSwitch) Ethernet switch PHY support."
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 1390c36..dd36a8c 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -182,6 +182,7 @@ struct zynq_gem_priv {
int phy_of_handle;
struct mii_dev *bus;
struct clk clk;
+ u32 max_speed;
bool int_pcs;
};
@@ -341,6 +342,12 @@ static int zynq_phy_init(struct udevice *dev)
priv->phydev->supported &= supported | ADVERTISED_Pause |
ADVERTISED_Asym_Pause;
+ if (priv->max_speed) {
+ ret = phy_set_supported(priv->phydev, priv->max_speed);
+ if (ret)
+ return ret;
+ }
+
priv->phydev->advertising = priv->phydev->supported;
if (priv->phy_of_handle > 0)
@@ -704,6 +711,8 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
}
priv->interface = pdata->phy_interface;
+ priv->max_speed = fdtdec_get_uint(gd->fdt_blob, priv->phy_of_handle,
+ "max-speed", SPEED_1000);
priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, node,
"is-internal-pcspma");
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index bc58ca5..79d4c9b 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -65,6 +65,7 @@
/* FEC Ethernet on SoC */
#ifdef CONFIG_CMD_NET
#define CONFIG_FEC_MXC
+#define CONFIG_FEC_MXC_MDIO_BASE MXS_ENET0_BASE
#define CONFIG_MX28_FEC_MAC_IN_OCOTP
#endif
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 6580ffc..cf1f2b1 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -292,7 +292,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
#define BOOT_TARGET_DEVICES_DHCP(func)
#endif
-#ifdef CONFIG_CMD_PXE
+#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
#else
#define BOOT_TARGET_DEVICES_PXE(func)
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 56c8b0c..5827911 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -172,7 +172,7 @@
# define BOOT_TARGET_DEVICES_USB(func)
#endif
-#if defined(CONFIG_CMD_PXE)
+#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
#else
# define BOOT_TARGET_DEVICES_PXE(func)
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 6d99249..ae82a7a 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -162,7 +162,7 @@
#define BOOT_TARGET_DEVICES_USB(func)
#endif
-#if defined(CONFIG_CMD_PXE)
+#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
#define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
#else
#define BOOT_TARGET_DEVICES_PXE(func)
diff --git a/include/netdev.h b/include/netdev.h
index 86d28ad..68c6d49 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -117,11 +117,7 @@ static inline int pci_eth_init(bd_t *bis)
return num;
}
-#ifdef CONFIG_DM_ETH
-struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id);
-#else
-struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id);
-#endif
+struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id);
#ifdef CONFIG_PHYLIB
struct phy_device;
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index d2ce897..55c97c0 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -22,5 +22,5 @@ obj-y += efi_watchdog.o
obj-$(CONFIG_LCD) += efi_gop.o
obj-$(CONFIG_DM_VIDEO) += efi_gop.o
obj-$(CONFIG_PARTITIONS) += efi_disk.o
-obj-$(CONFIG_CMD_NET) += efi_net.o
+obj-$(CONFIG_NET) += efi_net.o
obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index ab28b2f..e965f1d 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -747,7 +747,7 @@ struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
return start;
}
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_NET
struct efi_device_path *efi_dp_from_eth(void)
{
#ifndef CONFIG_DM_ETH
diff --git a/net/Kconfig b/net/Kconfig
index 143c441..f2363e5 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -22,55 +22,4 @@ config NETCONSOLE
Support the 'nc' input/output device for networked console.
See README.NetConsole for details.
-config NET_TFTP_VARS
- bool "Control TFTP timeout and count through environment"
- depends on CMD_NET
- default y
- help
- If set, allows controlling the TFTP timeout through the
- environment variable tftptimeout, and the TFTP maximum
- timeout count through the variable tftptimeoutcountmax.
- If unset, timeout and maximum are hard-defined as 1 second
- and 10 timouts per TFTP transfer.
-
-config BOOTP_BOOTPATH
- bool "Enable BOOTP BOOTPATH"
- depends on CMD_NET
-
-config BOOTP_DNS
- bool "Enable bootp DNS"
- depends on CMD_NET
-
-config BOOTP_GATEWAY
- bool "Enable BOOTP gateway"
- depends on CMD_NET
-
-config BOOTP_HOSTNAME
- bool "Enable BOOTP hostname"
- depends on CMD_NET
-
-config BOOTP_PXE
- bool "Enable BOOTP PXE"
- depends on CMD_NET
-
-config BOOTP_SUBNETMASK
- bool "Enable BOOTP subnetmask"
- depends on CMD_NET
- depends on CMD_NET
-
-config BOOTP_PXE_CLIENTARCH
- hex
- depends on CMD_NET
- default 0x16 if ARM64
- default 0x15 if ARM
- default 0 if X86
-
-config BOOTP_VCI_STRING
- string
- depends on CMD_NET
- default "U-Boot.armv7" if CPU_V7 || CPU_V7M
- default "U-Boot.armv8" if ARM64
- default "U-Boot.arm" if ARM
- default "U-Boot"
-
endif # if NET
diff --git a/net/Makefile b/net/Makefile
index ae54eee..ce6e5ad 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -8,23 +8,23 @@
#ccflags-y += -DDEBUG
obj-y += checksum.o
-obj-$(CONFIG_CMD_NET) += arp.o
-obj-$(CONFIG_CMD_NET) += bootp.o
+obj-$(CONFIG_NET) += arp.o
+obj-$(CONFIG_CMD_BOOTP) += bootp.o
obj-$(CONFIG_CMD_CDP) += cdp.o
obj-$(CONFIG_CMD_DNS) += dns.o
ifdef CONFIG_DM_ETH
-obj-$(CONFIG_CMD_NET) += eth-uclass.o
+obj-$(CONFIG_NET) += eth-uclass.o
else
-obj-$(CONFIG_CMD_NET) += eth_legacy.o
+obj-$(CONFIG_NET) += eth_legacy.o
endif
-obj-$(CONFIG_CMD_NET) += eth_common.o
+obj-$(CONFIG_NET) += eth_common.o
obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
-obj-$(CONFIG_CMD_NET) += net.o
+obj-$(CONFIG_NET) += net.o
obj-$(CONFIG_CMD_NFS) += nfs.o
obj-$(CONFIG_CMD_PING) += ping.o
obj-$(CONFIG_CMD_RARP) += rarp.o
obj-$(CONFIG_CMD_SNTP) += sntp.o
-obj-$(CONFIG_CMD_NET) += tftp.o
+obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
# Disable this warning as it is triggered by:
# sprintf(buf, index ? "foo%d" : "foo", index)