25 Jan, 2019

2 commits

  • No mainline board enables CONFIG_MCAST_TFTP and there have been
    compilation issues with the code for some time. Additionally, it has a
    potential buffer underrun issue (reported as a side note in
    CVE-2018-18439).

    Remove the multicast TFTP code but keep the driver API for the future
    addition of IPv6.

    Cc: Simon Goldschmidt
    Signed-off-by: Chris Packham
    Acked-by: Joe Hershberger

    Chris Packham
     
  • ether_crc was added to the core net code in commit 53a5c424bf86
    ("multicast tftp: RFC2090") so that other drivers could use it. However
    the only current user of it is tsec.c so move it there.

    Signed-off-by: Chris Packham
    Acked-by: Joe Hershberger

    Chris Packham
     

11 Oct, 2018

4 commits

  • Make it possible to add TCP versions of the same, while reusing
    IP portions. This patch should not change any behavior.

    Signed-off-by: Duncan Hare
    Acked-by: Joe Hershberger

    Duncan Hare
     
  • Peter originally sent a fix, but it breaks a number of other things.
    This addresses the original reported issue in a different way.

    That report was:

    > U-Boot has 1 common buffer to send Ethernet frames, pointed to by
    > net_tx_packet. When sending to an IP address without knowing the MAC
    > address, U-Boot makes an ARP request (using the arp_tx_packet buffer)
    > to find out the MAC address of the IP addressr. When a matching ARP
    > reply is received, U-Boot continues sending the frame stored in the
    > net_tx_packet buffer.
    >
    > However, in the mean time, if U-Boot needs to send out any network
    > packets (e.g. replying ping packets or ARP requests for its own IP
    > address etc.), it will use the net_tx_packet buffer to prepare the
    > new packet. Thus this buffer is no longer the original packet meant
    > to be transmitted after the ARP reply. The original packet will be
    > lost.

    This instead uses the ARP tx buffer to send async replies in the case
    where we are actively waiting for an ARP reply.

    Signed-off-by: Joe Hershberger

    Reported-by: Tran Tien Dat
    Reviewed-by: Simon Glass
    Reviewed-by: Bin Meng
    Tested-by: Bin Meng

    Joe Hershberger
     
  • This single-sources the state of the ARP.

    Signed-off-by: Joe Hershberger
    Reviewed-by: Simon Glass
    Reviewed-by: Bin Meng

    Joe Hershberger
     
  • There are plenty of existing drivers that have macros like ETH_ALEN
    defined in their own source files. Now that we imported the kernel's
    if_ether.h to U-Boot we can reduce some duplication.

    Signed-off-by: Bin Meng
    Acked-by: Joe Hershberger

    Bin Meng
     

08 Aug, 2018

1 commit

  • The 16 char ethernet name size is inadequate to hold the name of ethernet
    name "DPMAC17@rgmii-id", which is a valid name in LX2160AQDS/LX2160ARDB.

    Therefore, increase the name string size to 20 chars.

    Reported-by: Ioana Ciornei
    Suggested-by: Ioana Ciocoi Radulescu
    Signed-off-by: Pankaj Bansal
    Reviewed-by: York Sun

    Pankaj Bansal
     

27 Jul, 2018

2 commits


03 Jul, 2018

2 commits

  • We can call commands like dhcp and bootp without arguments or with
    explicit command line arguments that really should tell the code where
    to look for files instead.

    Unfortunately, the current code simply overwrites command line arguments
    in the dhcp case with dhcp values.

    This patch allows the code to preserve the command line values if they
    were set on the command line. That way the semantics are slightly more
    intuitive.

    The reason this patch does that by introducing a new variable is that we
    can not rely on net_boot_file_name[0] being unset, as today it's
    completely legal to call "dhcp" and afterwards run "tftp" and expect the
    latter to repeat the same query as before. I would prefer not to break
    that behavior in case anyone relies on it.

    Signed-off-by: Alexander Graf
    Acked-by: Joe Hershberger

    Alexander Graf
     
  • Add a new command 'wol': Wait for an incoming Wake-on-LAN packet or
    time out if no WoL packed is received.
    If the WoL packet contains a password, it is saved in the environment
    variable 'wolpassword' using the etherwake format (dot or colon
    separated decimals).

    Intended use case: a networked device should boot an alternate image.
    It's attached to a network on a client site, modifying the DHCP server
    configuration or setup of a tftp server is not allowed.
    After power on the device waits a few seconds for a WoL packet. If a
    packet is received, the device boots the alternate image. Otherwise
    it boots the default image.

    This method is a simple way to interact with a system via network even
    if only the MAC address is known. Tools to send WoL packets are
    available on all common platforms.

    Some Ethernet drivers seem to pad the incoming packet. The additional
    padding bytes might be recognized as Wake-on-LAN password bytes.

    By default enabled in pengwyn_defconfig.

    Signed-off-by: Lothar Felten
    Acked-by: Joe Hershberger

    Lothar Felten
     

30 May, 2018

1 commit

  • Merge UDP fastboot support from AOSP:

    https://android.googlesource.com/platform/external/u-boot/+/android-o-mr1-iot-preview-8

    Signed-off-by: Alex Kiernan
    Signed-off-by: Alex Deymo
    Signed-off-by: Jocelyn Bohr
    Reviewed-by: Simon Glass

    Alex Kiernan
     

11 May, 2018

1 commit

  • As part of the main conversion a few files were missed. These files had
    additional whitespace after the '*' and before the SPDX tag and my
    previous regex was too strict. This time I did a grep for all SPDX tags
    and then filtered out anything that matched the correct styles.

    Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
    Reported-by: Heinrich Schuchardt
    Signed-off-by: Tom Rini

    Tom Rini
     

09 Apr, 2018

1 commit

  • In order that we can use eth_env_* even when CONFIG_NET isn't set, move
    these functions to environment code from net code.

    This fixes failures such as:

    board/ti/am335x/built-in.o: In function `board_late_init':
    board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
    u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

    which caters for use cases such as:

    commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
    variable")

    when Ethernet is required in Linux, but not U-Boot.

    Signed-off-by: Alex Kiernan

    Alex Kiernan
     

07 Apr, 2018

1 commit


16 Aug, 2017

3 commits


08 Aug, 2017

1 commit

  • PXE boot is broken with GCC 7.1 due option '-fstore-merging' enabled
    by default for '-O2':

    BOOTP broadcast 1
    data abort
    pc : [] lr : []
    reloc pc : [] lr : []
    sp : 8f558bc0 ip : 00000000 fp : 8ffef5a4
    r10: 8ffed248 r9 : 8f558ee0 r8 : 8ffef594
    r7 : 0000000e r6 : 8ffed700 r5 : 00000000 r4 : 8ffed74e
    r3 : 00060101 r2 : 8ffed230 r1 : 8ffed706 r0 : 00000ddd
    Flags: nzcv IRQs off FIQs off Mode SVC_32
    Resetting CPU ...

    Core reason is usage of structures for network headers without packed
    attribute.

    Reviewed-by: Yauheni Kaliuta
    Signed-off-by: Denis Pynkin
    Acked-by: Joe Hershberger

    Denis Pynkin
     

12 Jun, 2017

1 commit

  • There was for long time no activity in the 8xx area.
    We need to go further and convert to Kconfig, but it
    turned out, nobody is interested anymore in 8xx,
    so remove it (with a heavy heart, knowing that I remove
    here the root of U-Boot).

    Signed-off-by: Heiko Schocher

    Heiko Schocher
     

08 Feb, 2017

3 commits


10 Jan, 2017

1 commit


16 Jul, 2016

1 commit

  • Fix a number of typos, including:

    * "compatble" -> "compatible"
    * "eanbeld" -> "enabled"
    * "envrionment" -> "environment"
    * "FTD" -> "FDT" (for "flattened device tree")
    * "ommitted" -> "omitted"
    * "overriden" -> "overridden"
    * "partiton" -> "partition"
    * "propogate" -> "propagate"
    * "resourse" -> "resource"
    * "rest in piece" -> "rest in peace"
    * "suport" -> "support"
    * "varible" -> "variable"

    Signed-off-by: Robert P. J. Day

    Robert P. J. Day
     

27 May, 2016

1 commit

  • We can now successfully boot EFI applications from disk, but users
    may want to also run them from a PXE setup.

    This patch implements rudimentary network support, allowing a payload
    to send and receive network packets.

    With this patch, I was able to successfully run grub2 with network
    access inside of QEMU's -M xlnx-ep108.

    Signed-off-by: Alexander Graf

    Alexander Graf
     

04 May, 2016

1 commit

  • Ethernet packages with IEEE 802.1Q VLAN support may be up to 1522
    bytes long. Increase the default size used to allocate packet
    storage by 4 bytes. While at it, let git care about history and
    rewrite the comment to represent the situation today only.

    Signed-off-by: Stefan Agner
    Reviewed-by: Tom Rini
    Acked-by: Joe Hershberger

    Stefan Agner
     

04 Apr, 2016

1 commit

  • This patch adds support for the mvpp2 ethernet controller which is integrated
    in the Marvell Armada 375 SoC. This port is based on the Linux driver (v4.4),
    which has been stripped of the in U-Boot unused portions.

    Tested on the Marvell Armada 375 eval board db-88f6720.

    Signed-off-by: Stefan Roese
    Cc: Luka Perkov
    Acked-by: Joe Hershberger

    Stefan Roese
     

27 Mar, 2016

1 commit


29 Jan, 2016

2 commits


22 Dec, 2015

1 commit


30 Oct, 2015

1 commit

  • The net_boot_file_name buffer is used as storage for the bootfilename
    command line argument to network boot commands such as tftp and nfs.

    Increase the size of this buffer to 1024 bytes as the current size of
    128 bytes is restrictive for arbitrary paths on the server.

    Signed-off-by: Jacob Stiffler
    Acked-by: Joe Hershberger

    Jacob Stiffler
     

29 Oct, 2015

1 commit


30 Sep, 2015

1 commit

  • 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
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger

    Bernhard Nortmann
     

07 Sep, 2015

1 commit

  • This code allows using DFU defined mediums for storing data received via
    TFTP protocol.

    It reuses and preserves functionality of legacy code at common/update.c.

    The update_tftp() function now accepts parameters - namely medium device
    name and its number (e.g. mmc 1).

    Without this information passed old behavior is preserved.

    Signed-off-by: Lukasz Majewski
    Acked-by: Joe Hershberger

    Lukasz Majewski
     

22 Jul, 2015

2 commits

  • 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

    Simon Glass
     
  • 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

    Simon Glass
     

19 Apr, 2015

2 commits