History log of /u-boot/net/Kconfig
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 93a0138a 03-Jan-2024 Tom Rini <trini@konsulko.com>

Merge tag 'v2024.01-rc6' into next

Prepare v2024.01-rc6


# b5712acb 18-Dec-2023 Baruch Siach <baruch@tkos.co.il>

net: fix NetConsole documentation reference

Fixes: d0253f7e5ca1 ("doc: move README.NetConsole to HTML documentation")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# f4449038 08-Nov-2023 Tom Rini <trini@konsulko.com>

net: Make NET imply NETDEVICES

Normally, when NET is enabled, CMD_NET will then be enabled and in turn
NETDEVICES will (likely) be enabled via imply. However, if we disable
CMDLINE in a defconfig we now no longer get CMD_NET enabling NETDEVICES
for us. This suggestion (as an imply is) really isn't about the network
commands but network itself and is a legacy of how intertwined
NET/CMD_NET were historically. Move this over to the NET entry instead
where it is a more logical fit.

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 54f80dd2 02-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_HOSTNAME et al to Kconfig

This converts the following to Kconfig:
CONFIG_GATEWAYIP
CONFIG_HOSTNAME
CONFIG_IPADDR
CONFIG_NETMASK
CONFIG_ROOTPATH
CONFIG_SERVERIP
CONFIG_UBOOTPATH

To do this, we introduce a CONFIG_USE_ form of each of the above and
change include/env_default.h to test for that to be set before setting a
value. Further, we don't want to stringify the IP address related values
as they are now properly strings via Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 3cc04a3a 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Add IPv6 build options

Add options to Makefile and Kconfig file to build IPv6

Series-changes: 3
- Added help for IPv6 support

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# a3bf193b 07-Nov-2022 Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>

net: Add TCP protocol

Currently file transfers are done using tftp or NFS both
over udp. This requires a request to be sent from client
(u-boot) to the boot server.

The current standard is TCP with selective acknowledgment.

Signed-off-by: Duncan Hare <DH@Synoia.com>
Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# 5e6e41b3 28-Jan-2022 Andre Kalb <svc.sw.rte.linux@sma.de>

net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# b5712acb 18-Dec-2023 Baruch Siach <baruch@tkos.co.il>

net: fix NetConsole documentation reference

Fixes: d0253f7e5ca1 ("doc: move README.NetConsole to HTML documentation")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# 54f80dd2 02-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_HOSTNAME et al to Kconfig

This converts the following to Kconfig:
CONFIG_GATEWAYIP
CONFIG_HOSTNAME
CONFIG_IPADDR
CONFIG_NETMASK
CONFIG_ROOTPATH
CONFIG_SERVERIP
CONFIG_UBOOTPATH

To do this, we introduce a CONFIG_USE_ form of each of the above and
change include/env_default.h to test for that to be set before setting a
value. Further, we don't want to stringify the IP address related values
as they are now properly strings via Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 3cc04a3a 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Add IPv6 build options

Add options to Makefile and Kconfig file to build IPv6

Series-changes: 3
- Added help for IPv6 support

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# a3bf193b 07-Nov-2022 Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>

net: Add TCP protocol

Currently file transfers are done using tftp or NFS both
over udp. This requires a request to be sent from client
(u-boot) to the boot server.

The current standard is TCP with selective acknowledgment.

Signed-off-by: Duncan Hare <DH@Synoia.com>
Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# 5e6e41b3 28-Jan-2022 Andre Kalb <svc.sw.rte.linux@sma.de>

net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <masahiroy@kernel.org>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 54f80dd2 02-Dec-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_HOSTNAME et al to Kconfig

This converts the following to Kconfig:
CONFIG_GATEWAYIP
CONFIG_HOSTNAME
CONFIG_IPADDR
CONFIG_NETMASK
CONFIG_ROOTPATH
CONFIG_SERVERIP
CONFIG_UBOOTPATH

To do this, we introduce a CONFIG_USE_ form of each of the above and
change include/env_default.h to test for that to be set before setting a
value. Further, we don't want to stringify the IP address related values
as they are now properly strings via Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 3cc04a3a 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Add IPv6 build options

Add options to Makefile and Kconfig file to build IPv6

Series-changes: 3
- Added help for IPv6 support

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# a3bf193b 07-Nov-2022 Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>

net: Add TCP protocol

Currently file transfers are done using tftp or NFS both
over udp. This requires a request to be sent from client
(u-boot) to the boot server.

The current standard is TCP with selective acknowledgment.

Signed-off-by: Duncan Hare <DH@Synoia.com>
Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# 5e6e41b3 28-Jan-2022 Andre Kalb <svc.sw.rte.linux@sma.de>

net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 3cc04a3a 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Add IPv6 build options

Add options to Makefile and Kconfig file to build IPv6

Series-changes: 3
- Added help for IPv6 support

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# a3bf193b 07-Nov-2022 Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>

net: Add TCP protocol

Currently file transfers are done using tftp or NFS both
over udp. This requires a request to be sent from client
(u-boot) to the boot server.

The current standard is TCP with selective acknowledgment.

Signed-off-by: Duncan Hare <DH@Synoia.com>
Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# 5e6e41b3 28-Jan-2022 Andre Kalb <svc.sw.rte.linux@sma.de>

net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# a3bf193b 07-Nov-2022 Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>

net: Add TCP protocol

Currently file transfers are done using tftp or NFS both
over udp. This requires a request to be sent from client
(u-boot) to the boot server.

The current standard is TCP with selective acknowledgment.

Signed-off-by: Duncan Hare <DH@Synoia.com>
Signed-off-by: Duncan Hare <DuncanCHare@yahoo.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

# 5e6e41b3 28-Jan-2022 Andre Kalb <svc.sw.rte.linux@sma.de>

net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 5e6e41b3 28-Jan-2022 Andre Kalb <svc.sw.rte.linux@sma.de>

net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

Signed-off-by: Andre Kalb <andre.kalb@sma.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Guard extern so that !CONFIG_NET platforms will build]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 3c07d639 01-May-2022 Marek Vasut <marex@denx.de>

net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: 4b37fd146bb ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 4fd8d077 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@amd.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@amd.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@amd.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@amd.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 0b956e39 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_RX_ETH_BUFFER to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_RX_ETH_BUFFER

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5842c810 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_TFTP_PORT to Kconfig

This converts the following to Kconfig:
CONFIG_TFTP_PORT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 1d5686ac 18-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_SYS_FAULT_ECHO_LINK_DOWN to Kconfig

This converts the following to Kconfig:
CONFIG_SYS_FAULT_ECHO_LINK_DOWN

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 01d1b99c 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 5d4e863b 11-Mar-2022 Tom Rini <trini@konsulko.com>

Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@xilinx.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marex@denx.de>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# d3877fba 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_BOOTP_SERVERIP to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SERVERIP

Signed-off-by: Simon Glass <sjg@chromium.org>

# d6b318de 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_TIMESTAMP to Kconfig

This converts the following to Kconfig:
CONFIG_TIMESTAMP

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4b37fd14 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_UDP_CHECKSUM to Kconfig

This converts the following to Kconfig:
CONFIG_UDP_CHECKSUM

Signed-off-by: Simon Glass <sjg@chromium.org>

# 3df6cd4d 18-Dec-2021 Simon Glass <sjg@chromium.org>

Convert CONFIG_KEEP_SERVERADDR to Kconfig

This converts the following to Kconfig:
CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@xilinx.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 381e6e54 11-Jan-2022 Michal Simek <michal.simek@xilinx.com>

net: uclass: Save generated ethernet MAC addresses to the environment

When a MAC address is randomly generated we currently only update the
appropriate data structure. For consistency and to re-align with
historic usage, it should be also saved to the appropriate environment
variable as well.

Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
[trini: Update Kconfig, handle legacy networking case as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/1a2518e3cc19c14a41875ef64c5acc1f16edc813.1641893287.git.michal.simek@xilinx.com

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# b4c2c151 27-Aug-2021 Michal Simek <michal.simek@xilinx.com>

Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 2509493c 12-May-2021 Tero Kristo <kristo@kernel.org>

net: convert TFTP_TSIZE to proper Kconfig option

TFTP transfer size can be used to re-size the TFTP progress bar on
single line based on the server reported file size. The support for
this has been around from 2019, but it was never converted to proper
Kconfig.

While adding this new Kconfig, enable it by default for OMAP2+ and K3
devices also.

Signed-off-by: Tero Kristo <kristo@kernel.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# c8e251f8 05-Aug-2019 Lyle Franklin <lylejfranklin@gmail.com>

Adds basic support for ProxyDHCP

- ProxyDHCP allows a second DHCP server to exist alongside your main
DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
respond with a normal response containing the new client IP address
while simultaneously the ProxyDHCP server will respond with a blank
client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
(default 100) which tells u-boot to wait additional time after
receiving the main DHCP response to give the ProxyDHCP response time
to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
added here as diagramed on page 16:
http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@foss.st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# b43ea1bf 18-Sep-2020 Philippe Reynes <philippe.reynes@softathome.com>

net: add a generic udp protocol

This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# cc6b87ec 18-Jul-2020 Ramon Fried <rfried.dev@gmail.com>

net: tftp: Add client support for RFC 7440

Add support for RFC 7440: "TFTP Windowsize Option".

This optional feature allows the client and server
to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema.

windowsize can be defined statically during compilation by
setting CONFIG_TFTP_WINDOWSIZE, or defined in runtime by
setting an environment variable: "tftpwindowsize"
If not defined, the windowsize is set to 1, meaning that it
behaves as it was never defined.

Choosing the appropriate windowsize depends on the specific
network topology, underlying NIC.
You should test various windowsize scenarios and see which
best work for you.

Setting a windowsize too big can actually decreases performance.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 3275f26b 03-Jul-2020 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_SEND_HOSTNAME to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_SEND_HOSTNAME

Signed-off-by: Adam Ford <aford173@gmail.com>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 421de7fe 22-Apr-2020 Patrick Delaunay <patrick.delaunay@st.com>

net: tftp: Add help for CONFIG_TFTP_BLOCKSIZE

Add help message for the CONFIG_TFTP_BLOCKSIZE default value,
as explain in tftp.c before migration in commit b618b3707633
("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 215df01d 07-Feb-2020 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

net: convert NET_MAXDEFRAG to Kconfig

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@csgraf.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 16cdc2da 23-Nov-2019 Andre Przywara <andre.przywara@arm.com>

net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@suse.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@suse.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@suse.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# b618b370 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig

Convert CONFIG_TFTP_BLOCKSIZE to Kconfig, update defconfigs,
headers and whitelist.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 3f6bcdf6 10-Jun-2019 Marek Vasut <marek.vasut@gmail.com>

net: Convert CONFIG_IP_DEFRAG to Kconfig

Convert CONFIG_IP_DEFRAG to Kconfig, update defconfigs, headers
and whitelist. This patch is a follow-up on a patch by Christian
Gmeiner with the added config/header/whitelist updates.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>

# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>

# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 210be5c4 06-May-2016 Alexander Graf <agraf@suse.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# fa96f37e 06-May-2016 Alexander Graf <agraf@suse.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>

# 0dac6b4e 06-May-2016 Alexander Graf <agraf@suse.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.

# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

# 92fa44d5 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>


# d7a45eaf 13-Apr-2018 Joe Hershberger <joe.hershberger@ni.com>

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 <joe.hershberger@ni.com>

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Duncan Hare <dh@synoia.com>


# 3b3ea2c5 26-Feb-2018 Michal Simek <michal.simek@xilinx.com>

Kconfig: cmd: Make networking command dependent on NET

Enable networking command only when NET is enabled.
And remove selecting NET for CMD_NET

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# d021e942 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG_BOOTP_BOOTPATH et al to Kconfig

This converts the following to Kconfig:
CONFIG_BOOTP_BOOTPATH
CONFIG_BOOTP_DNS
CONFIG_BOOTP_GATEWAY
CONFIG_BOOTP_HOSTNAME
CONFIG_BOOTP_PXE
CONFIG_BOOTP_SUBNETMASK
CONFIG_CMDLINE_EDITING
CONFIG_AUTO_COMPLETE
CONFIG_SYS_LONGHELP
CONFIG_SUPPORT_RAW_INITRD
CONFIG_ENV_VARS_UBOOT_CONFIG

Signed-off-by: Adam Ford <aford173@gmail.com>
[trini: Re-run the migration]
Signed-off-by: Tom Rini <trini@konsulko.com>


# a5a37567 06-Feb-2018 Adam Ford <aford173@gmail.com>

Convert CONFIG LIB_HW_RAND to Kconfig

config_fallbacks.h had some logic to automatically select
LIB_RAND if RANDOM_UUID or CMD_UUID were set if LIB_HW_RAND wasn't
already selected. By migrating LIB_HW_RAND to Kconfig, we can
remove this check from config_fallbacks.h and put it into Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
[trini: Turn into a choice, add NET_RANDOM_ETHADDR]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 11bde1cd 13-Sep-2016 Simon Glass <sjg@chromium.org>

Kconfig: spl: Add SPL support options to Kconfig

There are a lot of SPL options in U-Boot to enable various features and
drivers. Currently these do not use Kconfig. Add them to Kconfig along
with suitable help, and drop them from the README.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 210be5c4 06-May-2016 Alexander Graf <agraf@suse.de>

net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig

This patch also adds the SPL time VCI string into Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>


# fa96f37e 06-May-2016 Alexander Graf <agraf@suse.de>

net: Fix client identifiers for ARM

There are client identifiers specifically reserved for ARM U-Boot
according to http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml#processor-architecture.

So let's actually make use of them rather than the bogus 0x100 that
we emitted so far.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Drop the Xilinx define to 0x100 as it's not the correct value to
use].
Signed-off-by: Tom Rini <trini@konsulko.com>


# 0dac6b4e 06-May-2016 Alexander Graf <agraf@suse.de>

net: Move the VCI and client arch values to Kconfig

We have a bunch of boards that define their vendor class identifier and
client archs in the board files or in the distro config. Move everything
to the generic Kconfig options.

We're missing the distinction between i386 and x86_64, as I couldn't find
any config variable that would tell us the difference. Is that really important
to people? I guess not, so I left it out.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>


# f5fb7346 11-Oct-2015 Albert ARIBAUD \(3ADEV\) <albert.aribaud@3adev.fr>

net: TFTP: variables cleanup and addition

TFTP source and destination port variable names are
'tftpsrcp' and 'tftpdstp' in the code, but 'tftpsrcport'
and 'tftpdstport' in the README file. Fix the README.

Add environment variable 'tftptimeoutcountmax'. As per the
comments about the global variable tftp_timeout_count_max,
make sure tftptimeoutcountmax is nonnegative.

Introduce configuration option CONFIG_NET_TFTP_VARS,
which controls whether environment variables tftpblocksize,
tftptimeout, and tftptimoueoutcountmax are read by the TFTP
client code. CONFIG_NET_TFTP_VARS defaults to y but can be
set to n by targets with to tight size contraints.

Make bf527-ezkit set CONFIG_NET_TFTP_VARS to n to keep the
target size below limit.


# 26660748 14-Sep-2015 Bernhard Nortmann <bernhard.nortmann@web.de>

net: support NETCONSOLE option via Kconfig

This patch introduces CONFIG_NETCONSOLE as an option to the
Kconfig system.

Joe Hershberger pointed out that it may not be entirely free of
problems, as many boards predating the driver model define this
symbol directly via include files. In case they're not properly
migrated, their NetConsole might 'vanish' if they start to use
CONFIG_NET or CONFIG_NETDEVICES.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>


# f7848d90 22-Jun-2015 Joe Hershberger <joe.hershberger@ni.com>

Allow CONFIG_REGEX to be disabled when CONFIG_NET

Instead of selecting REGEX when NET is enabled, make it the default, but
allow boards that are tiny to disable it and lose functionality on all
but the first Ethernet adapter.

cm-bf548, bf538f-ezkit, and bf533-stamp need this. None appear to have
more than one Ethernet interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 9ba9e85f 25-May-2015 Michal Simek <michal.simek@xilinx.com>

net: Fix NET_RANDOM_ETHADDR dependencies

NET_RANDOM_ETHADDR depends on lib/rand.c. This patch adds dependency to
Kconfig to ensure that library is also compiled.

Remove the definitions from Blackfin boards' include/configs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>


# 6e0d26c0 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Handle ethaddr changes as an env callback

When the ethaddr is changed in the env, update the device pdata at the
same time (only if it is probed for the DM case; only if registered for
the non-DM case). Again this gets us closer to completely non-polled
env needed to simplify the net_loop.

This requires that the NET feature select the REGEX feature.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# bef1014b 04-May-2015 Joe Hershberger <joe.hershberger@ni.com>

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# ed36323f 16-Sep-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kconfig: add blank Kconfig files

This would be useful to start moving various config options.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>