03 Jun, 2020

1 commit

  • DSA stands for Distributed Switch Architecture and it covers switches that
    are connected to the CPU through an Ethernet link and generally use frame
    tags to pass information about the source/destination ports to/from CPU.
    Front panel ports are presented as regular ethernet devices in U-Boot and
    they are expected to support the typical networking commands.
    DSA switches may be cascaded, DSA class code does not currently support
    this.

    Signed-off-by: Alex Marginean
    Signed-off-by: Vladimir Oltean
    Signed-off-by: Claudiu Manoil

    Alex Marginean
     

10 Mar, 2020

1 commit

  • This introduces support for the NC-SI protocol, modelled as a phy driver
    for other ethernet drivers to consume.

    NC-SI (Network Controller Sideband Interface) is a protocol to manage a
    sideband connection to a proper network interface, for example a BMC
    (Baseboard Management Controller) sharing the NIC of the host system.
    Probing and configuration occurs by communicating with the "remote" NIC
    via NC-SI control frames (Ethernet header 0x88f8).

    This implementation is roughly based on the upstream Linux
    implementation[0], with a reduced feature set and an emphasis on getting
    a link up as fast as possible rather than probing the full possible
    topology of the bus.
    The current phy model relies on the network being "up", sending NC-SI
    command frames via net_send_packet() and receiving them from the
    net_loop() loop (added in a following patch).

    The ncsi-pkt.h header[1] is copied from the Linux kernel for consistent
    field definitions.

    [0]: https://github.com/torvalds/linux/tree/master/net/ncsi
    [1]: https://github.com/torvalds/linux/blob/master/net/ncsi/ncsi-pkt.h

    Signed-off-by: Samuel Mendoza-Jonas
    Reviewed-by: Joel Stanley
    Acked-by: Joe Hershberger

    Samuel Mendoza-Jonas
     

18 Jan, 2020

2 commits


09 Dec, 2019

2 commits


03 Dec, 2019

2 commits


05 Sep, 2019

1 commit

  • The net_random_ethaddr() tries to get some entropy from different
    startup times of a board. The seed is initialized with get_timer() which
    has only a granularity of milliseconds. We can do better if we use
    get_ticks() which returns the raw timer ticks. Using this we have a
    higher chance of getting different values at startup.

    Signed-off-by: Michael Walle
    Reviewed-by: Bin Meng
    Acked-by: Joe Hershberger

    Michael Walle
     

12 Aug, 2019

2 commits


19 Jul, 2019

1 commit

  • The inline functions net_read_u32() and net_copy_u32() have been created to
    copy unaligned u32. But this is not obvious to the compiler. GCC 9.1
    introduces a check -Werror=address-of-packed-member which leads to a build
    error on Travis CI:

    net/bootp.c: In function ‘dhcp_send_request_packet’:
    net/bootp.c:1011:27: error: taking address of packed member of
    ‘struct bootp_hdr’ may result in an unaligned pointer value
    [-Werror=address-of-packed-member]
    1011 | net_copy_u32(&bp->bp_id, &bp_offer->bp_id);

    Change the type of the function parameters to void * to avoid the build
    error.

    Reported-by: Ramon Fried
    Signed-off-by: Heinrich Schuchardt
    Acked-by: Joe Hershberger

    Heinrich Schuchardt
     

12 Apr, 2019

1 commit


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