From 0a85f024c5e84ccaf3b908f0b1d381f5ecf89602 Mon Sep 17 00:00:00 2001 From: Matt Pelland Date: Tue, 27 Mar 2018 13:18:25 -0400 Subject: [PATCH 01/21] net: mvneta: support setting hardware address mvneta already supports setting the MAC address but this was only done internally when some other part of U-Boot tries to actually use the interface. This commit exposes this functionality to the ethernet core code so that the MAC addresses of all interfaces are configured correctly even if they are not used before loading Linux. Signed-off-by: Matt Pelland Reviewed-by: Stefan Roese Acked-by: Joe Hershberger --- drivers/net/mvneta.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) From 07763ac9282f8d72c0f1e7d6c863a107997cbc3e Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 28 Mar 2018 20:54:11 +0800 Subject: [PATCH 02/21] net: fec_mxc: Fix DM driver issue in recv When using ethernet DM driver, the recv interface has a change with non-DM interface, that driver needs to set the packet pointer and provide it to upper layer to process. In fec driver, the fecmxc_recv functions does not handle the packet pointer parameter. This may cause crash in upper layer processing because the packet pointer is not set. This patch allocates a buffer for the packet pointer and free it through free_pkt interface. Signed-off-by: Ye Li Reviewed-by: Peng Fan Acked-by: Joe Hershberger --- drivers/net/fec_mxc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 29af85c..450cc0b 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) @@ -1202,10 +1216,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, From 1bcabd79215ece91ee8f79e768c4886efae182ba Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 28 Mar 2018 20:54:12 +0800 Subject: [PATCH 03/21] net: fec_mxc: simplify fec_get_miibus No need to provide two prototype for this function. Use ulong for the first parameter, then this function could be shared for DM/non DM case. Signed-off-by: Peng Fan Acked-by: Joe Hershberger --- drivers/net/fec_mxc.c | 15 +++------------ include/netdev.h | 6 +----- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 450cc0b..74d36f4 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1012,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; @@ -1283,7 +1274,7 @@ 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); + bus = fec_get_miibus((ulong)priv->eth, dev_id); if (!bus) { ret = -ENOMEM; goto err_mii; 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; From 8b203863560465f4dde981ecaa876e256e211017 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 28 Mar 2018 20:54:13 +0800 Subject: [PATCH 04/21] net: fec: set dev->seq to priv->dev_id To platforms has two enet interface, using dev->seq could avoid conflict. i.MX6UL/ULL evk board net get the wrong MAC address from fuse, eth1 get MAC0 address, eth0 get MAC1 address from fuse. Set the priv->dev_id to device->seq as the real net interface alias id then .fec_get_hwaddr() read the related MAC address from fuse. Signed-off-by: Peng Fan Acked-by: Joe Hershberger --- drivers/net/fec_mxc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 74d36f4..1f752d7 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1251,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; @@ -1272,9 +1271,9 @@ static int fecmxc_probe(struct udevice *dev) } fec_reg_setup(priv); - priv->dev_id = (dev_id == -1) ? 0 : dev_id; - bus = fec_get_miibus((ulong)priv->eth, dev_id); + priv->dev_id = dev->seq; + bus = fec_get_miibus((ulong)priv->eth, dev->seq); if (!bus) { ret = -ENOMEM; goto err_mii; From fbada4855d97532514a2be55e355f4bb49f81766 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 28 Mar 2018 20:54:14 +0800 Subject: [PATCH 05/21] net: fec: sharing MDIO for two enet controllers On i.MX6SX, 6UL and 7D, there are two enet controllers each has a MDIO port. But Some boards share one MDIO port for the two enets. So introduce a configuration CONFIG_FEC_MXC_MDIO_BASE to indicate the MDIO port for sharing. In Kconfig, user needs enable CONFIG_FEC_MXC_SHARE_MDIO first to enter the CONFIG_FEC_MXC_MDIO_BASE. To i.MX28, adapt to use the new config Signed-off-by: Peng Fan Acked-by: Joe Hershberger Cc: Fabio Estevam --- drivers/net/Kconfig | 13 ++++++++++++- drivers/net/fec_mxc.c | 8 ++++++-- include/configs/mx28evk.h | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) 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 1f752d7..1de72da 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1146,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 @@ -1273,7 +1273,11 @@ static int fecmxc_probe(struct udevice *dev) fec_reg_setup(priv); 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; 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 From 979e0fc86275fc09c85892aa2cd7987fa6f97a54 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 28 Mar 2018 20:54:15 +0800 Subject: [PATCH 06/21] net: fex_mxc: add i.MX6UL/SX/SL compatible Add i.MX6UL/SX/SL compatible. Signed-off-by: Peng Fan Acked-by: Joe Hershberger --- drivers/net/fec_mxc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 1de72da..4296550 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1343,6 +1343,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" }, { } }; From 2087eac25709071e5e4f32706db91a257160ef36 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 28 Mar 2018 20:54:16 +0800 Subject: [PATCH 07/21] net: fec: Fix issue in DM probe timeout Since the probe function has changed to reset FEC controller prior than setup PHY. If reset FEC controller timeout, the priv->phydev is not initialized, so can't free it. Signed-off-by: Ye Li Acked-by: Joe Hershberger --- drivers/net/fec_mxc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 4296550..0076d63 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1292,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; } From 69065e8ff455e470b04c439e93650e39b005535a Mon Sep 17 00:00:00 2001 From: Siva Durga Prasad Paladugu Date: Thu, 12 Apr 2018 12:22:17 +0200 Subject: [PATCH 08/21] net: zynq_gem: Use max-speed property from dt Add support to use max-speed property from dt for determining the supported speed. Use 1000Mbps as default. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek Acked-by: Joe Hershberger --- drivers/net/zynq_gem.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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"); From b107fd5bab5d80b08f175990e902ac934719a8e2 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 12 Apr 2018 21:54:37 +0200 Subject: [PATCH 09/21] net: sh_eth: Add remaining Gen2 DT compatible Add compatible strings for R8A7790, R8A7793 and R8A7794, since the contemporary DTs use those don't have a generic match value. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Joe Hershberger Acked-by: Joe Hershberger --- drivers/net/sh_eth.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index e3416f3..cb3970e 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -906,7 +906,10 @@ int sh_ether_ofdata_to_platdata(struct udevice *dev) } static const struct udevice_id sh_ether_ids[] = { + { .compatible = "renesas,ether-r8a7790" }, { .compatible = "renesas,ether-r8a7791" }, + { .compatible = "renesas,ether-r8a7793" }, + { .compatible = "renesas,ether-r8a7794" }, { } }; From d7a45eafda633edf14a8fe6fe430174889de0c4e Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:30 -0500 Subject: [PATCH 10/21] net: Make CMD_NET a menuconfig Previously, CMD_NET was an alias for 2 commands (bootp and tftpboot) and they we not able to be disabled. Separate out those 2 commands and move CMD_NET up to the menu level, which more accurately represents the code. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham Reviewed-by: Duncan Hare --- cmd/Kconfig | 25 +++++++++++++++++-------- cmd/net.c | 4 ++++ net/Kconfig | 19 +++++++++---------- net/Makefile | 4 ++-- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index d440675..fb74227 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1021,25 +1021,35 @@ 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_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 @@ -1050,13 +1060,12 @@ config CMD_RARP config CMD_DHCP bool "dhcp" - depends on CMD_NET + depends on CMD_BOOTP 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 @@ -1107,7 +1116,7 @@ config CMD_ETHSW endif -endmenu +endif menu "Misc commands" 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/net/Kconfig b/net/Kconfig index 143c441..d421a34 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -24,7 +24,7 @@ config NETCONSOLE config NET_TFTP_VARS bool "Control TFTP timeout and count through environment" - depends on CMD_NET + depends on CMD_TFTPBOOT default y help If set, allows controlling the TFTP timeout through the @@ -35,39 +35,38 @@ config NET_TFTP_VARS config BOOTP_BOOTPATH bool "Enable BOOTP BOOTPATH" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_DNS bool "Enable bootp DNS" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_GATEWAY bool "Enable BOOTP gateway" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_HOSTNAME bool "Enable BOOTP hostname" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_PXE bool "Enable BOOTP PXE" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_SUBNETMASK bool "Enable BOOTP subnetmask" - depends on CMD_NET - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_PXE_CLIENTARCH hex - depends on CMD_NET + depends on CMD_BOOTP default 0x16 if ARM64 default 0x15 if ARM default 0 if X86 config BOOTP_VCI_STRING string - depends on CMD_NET + 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 diff --git a/net/Makefile b/net/Makefile index ae54eee..ed102ec 100644 --- a/net/Makefile +++ b/net/Makefile @@ -9,7 +9,7 @@ obj-y += checksum.o obj-$(CONFIG_CMD_NET) += arp.o -obj-$(CONFIG_CMD_NET) += bootp.o +obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o ifdef CONFIG_DM_ETH @@ -24,7 +24,7 @@ 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) From ba6288557d8a1bd845b841b9287b9752a470faa9 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:31 -0500 Subject: [PATCH 11/21] net: Fix distro default dependencies PING requires CMD_NET, not NET. Also, CMD_NET already depends on NET, so no need to directly depend on it. Signed-off-by: Joe Hershberger --- Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 6670913..f319750 100644 --- a/Kconfig +++ b/Kconfig @@ -69,14 +69,14 @@ 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_DHCP if CMD_NET + select CMD_PING if CMD_NET select CMD_PXE if NET && CMD_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 From 92fa44d58f4e5433eeb5fe6a56f2b6faf5e84c20 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:32 -0500 Subject: [PATCH 12/21] net: Move net command options to the cmd menu Options that controlled the tftp and bootp commands depended on their commands, but lived in the net menu. Move them so they are in a consistent location. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham --- cmd/Kconfig | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------- net/Kconfig | 50 ----------------------------------------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index fb74227..7f47819 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1035,6 +1035,45 @@ config CMD_BOOTP help bootp - boot image via network using BOOTP/TFTP protocol +config BOOTP_BOOTPATH + bool "Enable BOOTP BOOTPATH" + depends on CMD_BOOTP + +config BOOTP_DNS + bool "Enable bootp DNS" + depends on CMD_BOOTP + +config BOOTP_GATEWAY + bool "Enable BOOTP gateway" + depends on CMD_BOOTP + +config BOOTP_HOSTNAME + bool "Enable BOOTP hostname" + depends on CMD_BOOTP + +config BOOTP_SUBNETMASK + bool "Enable BOOTP subnetmask" + depends on CMD_BOOTP + +config BOOTP_PXE + bool "Enable BOOTP PXE" + depends on CMD_BOOTP + +config BOOTP_PXE_CLIENTARCH + hex + depends on CMD_BOOTP + 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 @@ -1053,6 +1092,17 @@ config CMD_TFTPSRV 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 @@ -1064,12 +1114,6 @@ config CMD_DHCP help Boot image via network using DHCP/TFTP protocol -config CMD_PXE - bool "pxe" - select MENU - help - Boot image via network using PXE protocol - config CMD_NFS bool "nfs" default y @@ -1106,6 +1150,8 @@ config CMD_LINK_LOCAL help Acquire a network IP address using the link-local protocol +endif + config CMD_ETHSW bool "ethsw" help @@ -1114,7 +1160,11 @@ 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 endif diff --git a/net/Kconfig b/net/Kconfig index d421a34..f2363e5 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -22,54 +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_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 BOOTP_BOOTPATH - bool "Enable BOOTP BOOTPATH" - depends on CMD_BOOTP - -config BOOTP_DNS - bool "Enable bootp DNS" - depends on CMD_BOOTP - -config BOOTP_GATEWAY - bool "Enable BOOTP gateway" - depends on CMD_BOOTP - -config BOOTP_HOSTNAME - bool "Enable BOOTP hostname" - depends on CMD_BOOTP - -config BOOTP_PXE - bool "Enable BOOTP PXE" - depends on CMD_BOOTP - -config BOOTP_SUBNETMASK - bool "Enable BOOTP subnetmask" - depends on CMD_BOOTP - -config BOOTP_PXE_CLIENTARCH - hex - depends on CMD_BOOTP - 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" - endif # if NET From e88b2563ddab6fcee8bf0be40811c8bc6b1ccadb Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:33 -0500 Subject: [PATCH 13/21] net: Move the DHCP command below the BOOTP command Move DHCP to directly follow BOOTP so that Kconfig can show the dependency as a hierarchy. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham Reviewed-by: Duncan Hare --- cmd/Kconfig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 7f47819..a89d5ac 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1035,6 +1035,12 @@ config CMD_BOOTP help 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 "Enable BOOTP BOOTPATH" depends on CMD_BOOTP @@ -1108,12 +1114,6 @@ config CMD_RARP help Boot image via network using RARP/TFTP protocol -config CMD_DHCP - bool "dhcp" - depends on CMD_BOOTP - help - Boot image via network using DHCP/TFTP protocol - config CMD_NFS bool "nfs" default y From 8df69d9063bd897ffda906c919a7138bf3ce5a58 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:34 -0500 Subject: [PATCH 14/21] net: Improve menu options and help for BOOTP options The options were pretty unhelpful, so improve them some. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham --- cmd/Kconfig | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index a89d5ac..6664379 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1042,23 +1042,32 @@ config CMD_DHCP Boot image via network using DHCP/TFTP protocol config BOOTP_BOOTPATH - bool "Enable BOOTP BOOTPATH" + bool "Request & store 'rootpath' from BOOTP/DHCP server" 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 "Enable bootp DNS" + bool "Request & store 'dnsip' from BOOTP/DHCP server" 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_GATEWAY - bool "Enable BOOTP gateway" + bool "Request & store 'gatewayip' from BOOTP/DHCP server" depends on CMD_BOOTP config BOOTP_HOSTNAME - bool "Enable BOOTP hostname" + bool "Request & store 'hostname' from BOOTP/DHCP server" depends on CMD_BOOTP + help + The name may or may not be qualified with the local domain name. config BOOTP_SUBNETMASK - bool "Enable BOOTP subnetmask" + bool "Request & store 'netmask' from BOOTP/DHCP server" depends on CMD_BOOTP config BOOTP_PXE From 80449c032c595707c9eb4e3517e79e43546b9c78 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:35 -0500 Subject: [PATCH 15/21] net: Add the BOOTP_DNS2 option to Kconfig Commit 3b3ea2c56ec4bc5 ("Kconfig: cmd: Make networking command dependent on NET") removed the help documentation from the README but didn't add it back to Kconfig. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham Reviewed-by: Duncan Hare --- cmd/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 6664379..43efe7d 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1056,6 +1056,17 @@ config BOOTP_DNS 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" depends on CMD_BOOTP From 2b9f486bf58b52fc6b2c53245c6a3a509b48524f Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:36 -0500 Subject: [PATCH 16/21] net: Improve BOOTP PXE config option Improve the documentation and correct the listed dependencies. Signed-off-by: Joe Hershberger Reviewed-by: Duncan Hare --- cmd/Kconfig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 43efe7d..0d077bd 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1082,12 +1082,14 @@ config BOOTP_SUBNETMASK depends on CMD_BOOTP config BOOTP_PXE - bool "Enable BOOTP PXE" - depends on CMD_BOOTP + bool "Send PXE client arch to BOOTP/DHCP server" + depends on CMD_BOOTP && CMD_PXE + help + Supported for ARM, ARM64, and x86 for now. config BOOTP_PXE_CLIENTARCH hex - depends on CMD_BOOTP + depends on BOOTP_PXE default 0x16 if ARM64 default 0x15 if ARM default 0 if X86 From 3dfbc53bd6310ccc860cf1ad0e9413d8dbbaf4f1 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:37 -0500 Subject: [PATCH 17/21] net: Make the BOOTP options default The BOOTP options used to be and should still be default for all boards with CMD_NET enabled. One should not be forced to use DISTRO_DEFAULTS to get them. Signed-off-by: Joe Hershberger Reviewed-by: Duncan Hare --- Kconfig | 6 ------ cmd/Kconfig | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kconfig b/Kconfig index f319750..0b73006 100644 --- a/Kconfig +++ b/Kconfig @@ -79,12 +79,6 @@ config DISTRO_DEFAULTS imply CMD_MII 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 0d077bd..bc1d2f3 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1043,6 +1043,7 @@ config CMD_DHCP 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 @@ -1050,6 +1051,7 @@ config BOOTP_BOOTPATH 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 @@ -1069,20 +1071,24 @@ config BOOTP_DNS2 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. From 5f967c049309c00fa62dab14e039e2a72a2f2aa6 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:38 -0500 Subject: [PATCH 18/21] net: Make core net code depend on NET instead of CMD_NET No commands are necessary to have a network stack. Signed-off-by: Joe Hershberger Reviewed-by: Duncan Hare --- net/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/Makefile b/net/Makefile index ed102ec..ce6e5ad 100644 --- a/net/Makefile +++ b/net/Makefile @@ -8,18 +8,18 @@ #ccflags-y += -DDEBUG obj-y += checksum.o -obj-$(CONFIG_CMD_NET) += arp.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 From 092f2f35b58467d97c34c84f76ad8be872caa535 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:39 -0500 Subject: [PATCH 19/21] Revert "Kconfig: cmd: Make networking command dependent on NET" This reverts the parts of commit 3b3ea2c56ec4bc5588281fd103c744e608f8b25c where it changed the EFI dependency on NET. Signed-off-by: Joe Hershberger Reviewed-by: Duncan Hare --- Kconfig | 2 +- cmd/bootefi.c | 4 ++-- lib/efi_loader/Makefile | 2 +- lib/efi_loader/efi_device_path.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index 0b73006..081be6c 100644 --- a/Kconfig +++ b/Kconfig @@ -71,7 +71,7 @@ config DISTRO_DEFAULTS select CMD_BOOTI if ARM64 select CMD_DHCP if CMD_NET select CMD_PING if CMD_NET - select CMD_PXE if NET && CMD_NET + select CMD_PXE if NET select CMD_EXT2 select CMD_EXT4 select CMD_FAT 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/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 From 86271b3f29903437a1f1de7625963b1878601c39 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 13 Apr 2018 15:26:40 -0500 Subject: [PATCH 20/21] xilinx: Only enable dist boot pxe when DHCP is enabled Otherwise, we see this: In file included from include/configs/zynq-common.h:183:0, from include/config.h:5, from include/common.h:21, from env/common.c:11: include/config_distro_bootcmd.h:319:2: error: expected ?}? before ?BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE? BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE ^ include/config_distro_bootcmd.h:319:2: note: in definition of macro ?BOOTENV_DEV_NAME_PXE? Signed-off-by: Joe Hershberger --- include/configs/socfpga_common.h | 2 +- include/configs/xilinx_zynqmp.h | 2 +- include/configs/zynq-common.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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) From 16879cd25a4089cde2f3393fb09567df53402679 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Fri, 30 Mar 2018 11:52:16 -0500 Subject: [PATCH 21/21] net: phy: Don't limit phy addresses by default Some boards expect to find more than one phy while other boards are old and need to be limited to a specific phy address. Only limit the phy address for boards that opt in. Signed-off-by: Joe Hershberger Tested-by: Bin Meng Acked-by: Neil Armstrong Reviewed-by: Philipp Tomsich --- configs/am335x_baltos_defconfig | 1 + configs/am335x_shc_defconfig | 1 + configs/am335x_shc_ict_defconfig | 1 + configs/am335x_shc_netboot_defconfig | 1 + configs/am335x_shc_prompt_defconfig | 1 + configs/am335x_shc_sdboot_defconfig | 1 + configs/am335x_shc_sdboot_prompt_defconfig | 1 + configs/devkit3250_defconfig | 1 + configs/ds414_defconfig | 1 + configs/khadas-vim_defconfig | 1 + configs/libretech-cc_defconfig | 1 + configs/p212_defconfig | 1 + configs/pepper_defconfig | 1 + configs/work_92105_defconfig | 1 + configs/x600_defconfig | 1 + drivers/net/phy/Kconfig | 8 ++++++++ 16 files changed, 23 insertions(+) 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/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."