- Jun 13, 2018
-
-
Mario Six authored
On devices that have their first network interface provided by a FPGA, the initialization of further interfaces will fail if the FPGA is not yet programmed. This leads to problems during factory setup when the data is supposed to be loaded over secondary netowork interfaces. To avoid this, use the uclass_{first,next}_device_check functions to initialize as many ethernet devices as possible. Signed-off-by:
Mario Six <mario.six@gdsys.cc> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- May 07, 2018
-
-
Tom Rini authored
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Mar 22, 2018
-
-
Alexander Graf authored
In the efi_loader main loop we call eth_rx() occasionally. This rx function might end up calling into devices that haven't been initialized yet, potentially resulting in a lot of transfer timeouts. Instead, let's make sure the ethernet device is actually initialized before reading from or writing to it. Signed-off-by:
Alexander Graf <agraf@suse.de> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Aug 16, 2017
-
-
Simon Glass authored
Rename this function for consistency with env_get(). Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by:
Wolfgang Denk <wd@denx.de> Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Rename this function for consistency with env_set(). Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jun 02, 2017
-
-
xypron.glpk@gmx.de authored
Checking if dev is NULL after dereferencing it does not make sense. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Feb 07, 2017
-
-
oliver@schinagl.nl authored
Currently, we print that the MAC from the SROM does not match. It can be many forms of ROM, so lets drop the S. Signed-off-by:
Olliver Schinagl <oliver@schinagl.nl> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
oliver@schinagl.nl authored
Commit 674bb249 ("net: cosmetic: Replace magic numbers in arp.c with constants") introduced a nice define to replace the magic value 6 for the ethernet hardware address. Replace more hardcoded instances of 6 which really reference the ARP_HLEN (iow the MAC/Hardware/Ethernet address). Signed-off-by:
Olliver Schinagl <oliver@schinagl.nl> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Nov 07, 2016
-
-
Siva Durga Prasad Paladugu authored
Use random ethernet address if the ethernet address found is invalid, not zero and config for random address is defined. Signed-off-by:
Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by:
Michal Simek <michal.simek@xilinx.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Oct 13, 2016
-
-
Hannes Schmelzer authored
If mac-address is changed using "setenv ethaddr ...." command the new mac-adress also must be written into the responsible ethernet driver. Signed-off-by:
Hannes Schmelzer <oe5hpm@oevsv.at> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Feb 06, 2016
-
-
Simon Glass authored
This fixes the following error when building microblaze-generic: net/eth-uclass.c: In function 'eth_post_probe': net/eth-uclass.c:466:18: error: 'gd' undeclared (first use in this function) ops->start += gd->reloc_off; Fixes: db9391e1 ("net: Move driver-model code into its own file") Signed-off-by:
Simon Glass <sjg@chromium.org> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Jan 28, 2016
-
-
Simon Glass authored
Every other uclass is in its own file. Create a new eth-uclass.c file and move the driver-model code into it, so that networking is consistent. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Simon Glass authored
Move eth_current_changed(), eth_set_current(), eth_mac_skip() and eth_get_name() into the common file. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Simon Glass authored
Move the functions which set ethernet environment variables to the common file. Signed-off-by:
Simon Glass <sjg@chromium.org> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Simon Glass authored
Only half of the init is actually common. Move that part into a new common file and call it from driver-model and legacy code. More common functions will be added in future patches. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Simon Glass authored
We should avoid weak functions with driver model. Existing boards that use driver model don't need them, so let's kill them off. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Jan 08, 2016
-
-
Andre Przywara authored
In many parts of the computing world having a unique MAC address sitting in some on-NIC storage is considered the normal case. Remove the warning to not scare the user unnecessarily. This applies to Highbank/Midway and ARM's Juno, for instance. Besides that this fixes the formatting on Midway, for instance, which currently looks like: ... Net: xgmac0 Warning: xgmac0 using MAC address from net device , xgmac1 Warning: xgmac1 using MAC address from net device ... Signed-off-by:
Andre Przywara <andre.przywara@arm.com>
-
- Jan 07, 2016
-
-
Bin Meng authored
When 'ethrotate' variable is set to 'no' and 'ethact' variable is already set to an ethernet device, we should stick to 'ethact'. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org> Tested-by:
Simon Glass <sjg@chromium.org>
-
Bin Meng authored
In eth_current_changed(), the call to eth_get_dev() below has a side effect of rotating ethernet device if uc_priv->current == NULL. This is not what we want when 'ethrotate' variable is 'no'. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org> Tested-by:
Simon Glass <sjg@chromium.org>
-
- Dec 18, 2015
-
-
Michal Simek authored
All ethernet operation needs to be updated for architectures which requires MANUAL_RELOC. Signed-off-by:
Michal Simek <michal.simek@xilinx.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Oct 29, 2015
-
-
Bin Meng authored
eth_get_dev() can return NULL which means device_probe() fails for that ethernet device. Add return value check in various places or U-Boot will crash due to NULL pointer access. With this commit, 'dm_test_eth_act' test case passes. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Bin Meng authored
platdata->enetaddr was assigned to a value in dev_probe() last time. If we don't clear it, for dev_probe() at the second time, dm eth will end up treating it as a MAC address from ROM no matter where it came from originally (maybe env, ROM, or even random). Fix this by clearing platdata->enetaddr when removing an Ethernet device. Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Oct 28, 2015
-
-
Josh Wu authored
As we don't modify the 'name' parameter, so change it to const. Signed-off-by:
Josh Wu <josh.wu@atmel.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Gong Qianyu authored
The loop should check all ethenet devices, not only the first device, to set each specified ethaddr, or it'll cause failure when we use other devices. Signed-off-by:
Gong Qianyu <Qianyu.Gong@freescale.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Sep 30, 2015
-
-
Bernhard Nortmann authored
The previous eth_device struct returned by eth_get_dev() allowed code to directly query the state member field. However, with CONFIG_DM_ETH this data gets encapsulated (i.e. private), and eth_get_dev() returns a udevice struct 'abstraction' instead. This breaks legacy code relying on the former behaviour - e.g. netconsole. (see http://lists.denx.de/pipermail/u-boot/2015-June/216528.html ) The patch introduces a method to retrieve the ethernet device state in a 'clean' and uniform way, supporting both legacy code and driver model. The new function eth_is_active() accepts a device struct pointer and tests it for ETH_STATE_ACTIVE. Signed-off-by:
Bernhard Nortmann <bernhard.nortmann@web.de> Reviewed-by:
Simon Glass <sjg@chromium.org> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Sep 09, 2015
-
-
Bin Meng authored
When given a device name string, we should test to see if it is really an alias like "eth#". Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Bin Meng authored
With driver model, board_eth_init() or cpu_eth_init() is not a must. Thus we don't need print a misleading "Net Initialization Skipped". Signed-off-by:
Bin Meng <bmeng.cn@gmail.com> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- Jul 21, 2015
-
-
Simon Glass authored
Some drivers may want to implement this method for some of their devices but not for others. So it is not possible to just leave the operation out of the table. Drivers could get around this by masquerading as two separate drivers but that seems unpleasant. Allow the driver to return an error when it does not want to process the write_hwaddr() method. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Some devices can take a long time to work out whether they have a new packet or now. For example the ASIX USB Ethernet dongle can take 5 seconds to do this, since it waits until it gets a new packet on the wire before allowing the USB bulk read packet to be submitted. At present with driver mode the Ethernet receive code reads 32 packets. This can take a very long time if we must wait for all 32 packets. The old code (before driver model) worked by reading a single set of packets from the USB device, then processing all the packets with in. It would be nice to use the same behaviour with driver model. Add a flag to the receive method which indicates that the driver should try to find a packet if available, by consulting the hardware. When the flag is not set, it should just return any packet data it has already received. If there is none, it should return -EAGAIN so that the loop will terminate. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- May 21, 2015
-
-
Joe Hershberger authored
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>
-
Joe Hershberger authored
The bootfile env var is already kept up to date by the callback in net.c so there is no need to poll it too. Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com>
-
- May 19, 2015
-
-
Joe Hershberger authored
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>
-
Joe Hershberger authored
When the ethaddr changes in the env, the hardware should also be updated so that MAC filtering will work properly without resetting U-Boot. Also remove the manual calls to set the hwaddr that was included in a few drivers as a result of the framework not doing it. Reported-by:
Michal Simek <michal.simek@xilinx.com> Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Tested-by:
Michal Simek <michal.simek@xilinx.com>
-
- Apr 18, 2015
-
-
Simon Glass authored
At present even with driver model is used there is still much manual init of related devices: PHY, environment and board init. Until these requirements are dealt with in another way we need to keep them around. Break out the init portion of the legacy eth_initialize() into a separate function and call it from both the legacy and driver model eth_initialize() functions. Signed-off-by:
Simon Glass <sjg@chromium.org> Acked-by:
Joe Hershberger <joe.hershberger@ni.com>
-
Joe Hershberger authored
Finish eliminating CamelCase from net.c and other failures Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
Joe Hershberger authored
There were still a few failures in net/eth.c, especially in the legacy part of the code. Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
Joe Hershberger authored
Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
Joe Hershberger authored
The variables around the bootfile were inconsistent and used CamelCase. Update them to make the code more readable. Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
Joe Hershberger authored
This patch is simply clean-up to make the IPv4 type that is used match what Linux uses. It also attempts to move all variables that are IP addresses use good naming instead of CamelCase. No functional change. Signed-off-by:
Joe Hershberger <joe.hershberger@ni.com> Acked-by:
Simon Glass <sjg@chromium.org>
-