03 Dec, 2018

5 commits

  • We should not call eth_rx() before the network interface is initialized.
    The services of the simple network protocol should check the state of
    the network adapter.

    Add and correct comments.

    Without this patch i.mx6 system Wandboard Quad rev B1 fails to execute
    bootefi selftest.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Calling net_send_packet() requires that the buffer is aligned to a multiple
    of PKTALIGN (= ARCH_DMA_MINALIGN). The UEFI spec does not require
    efi_net_transmit() to be called with a buffer with any special alignment.
    So we have to copy to an aligned buffer. The current coding copies to an
    aligned buffer only if CONFIG_EFI_LOADER_BOUNCE_BUFFER=y. Many boards
    like the Odroid C2 do not use a bounce buffer.

    With the patch we copy to a correctly aligned buffer in all cases.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Fix typos in EFI subsystem comments.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Rename the component parent of some EFI objects to header. This avoids
    misunderstandings.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • A pointer to a struct efi_object is a handle. We do not need any handle
    member in this structure. Let's eliminate it.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

16 Oct, 2018

1 commit


11 Sep, 2018

1 commit

  • In int-ll64.h, we always use the following typedefs:

    typedef unsigned int u32;
    typedef unsigned long uintptr_t;
    typedef unsigned long long u64;

    This does not need to match to the compiler's .
    Do not include it.

    The use of PRI* makes the code super-ugly. You can simply use
    "l" for printing uintptr_t, "ll" for u64, and no modifier for u32.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

27 Jul, 2018

1 commit

  • if_type is not correctly initialized

    Failure to initialize if_type means that grub2/efinet sends
    a bogus arp request. It therefore gets no response. On Raspberry Pi 3B+
    this leads to a pause at:

    lan78xx_eth Waiting for PHY auto negotiation to complete....... done
    lan78xx_eth Waiting for PHY auto negotiation to complete....... done

    Signed-off-by: Andrew Thomas
    Acked-by: Joe Hershberger

    Andrew Thomas
     

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
     

28 Apr, 2018

1 commit


06 Apr, 2018

1 commit

  • Add missing network initialization code.

    Before the patch the network was only usable if a network command like
    dhcp or tftp had beed executed.

    This was visible when interrupting the console countdown and executing
    bootefi selftest for vexpress_ca15_tc2_defconfig.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

04 Apr, 2018

3 commits

  • We use a timer to poll the network.

    iPXE is used for booting from iSCSI drives. It has been changed to run at
    TPL_CALLBACK most of the time (which is not what the UEFI spec
    recommends).

    By changing our timer to TPL_NOTIFY we can ensure that it is nevertheless
    executed.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • If an event of a group event is signaled all other events of the same
    group are signaled too.

    Function efi_signal_event is renamed to efi_queue_event.
    A new function efi_signal_event is introduced that checks if an event
    belongs to a group and than signals all events of the group.
    Event group notifciation is implemented for ExitBootServices,
    InstallConfigurationTable, and ResetSystem.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Consistently return status codes form efi_net_register().

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

01 Dec, 2017

4 commits


09 Oct, 2017

8 commits

  • In the receive function all return values should be filled.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The size fields in the Simple Network Protocol are all
    UINTN in the UEFI spec. So use size_t.

    Provide a function description of the receive function.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The returned interrupt status was wrong.

    As out transmit buffer is empty we need to always set
    EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT.

    When we have received a packet we need to set
    EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT.

    Furthermore we should call efi_timer_check() to handle events.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The WaitForPacket event informs that a network package has been
    received by the SimpleNetworkProtocol.

    Signed-off-by: Heinrich Schuchardt
    [agraf: Move is_signaled = true line into efi_net_push()]
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • A timer event is defined. The timer handler cares for receiving new
    packets.

    efi_timer_check is called both in efi_net_transmit and efi_net_receive
    to enable events during network communication.

    Calling efi_timer_check in efi_net_get_status is implemented in a
    separate patch.

    [agraf] This patch is needed to make efi_net_get_status() actually
    report incoming packets.

    Signed-off-by: Heinrich Schuchardt
    [agraf: fix spelling in comment]
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • U-Boot does not implement all functions of the simple network
    protocol. The unimplemented functions return either of
    EFI_SUCCESS and EFI_INVALID_PARAMETER.

    The UEFI spec foresees to return EFI_UNSUPPORTED in these cases.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The length of a MAC address is 6.
    We have to set this length in the EFI_SIMPLE_NETWORK_MODE
    structure of the EFI_SIMPLE_NETWORK_PROTOCOL.

    Without this patch iPXE fails to initialize the network with
    error message
    SNP MAC(001e0633bcbf,0x0) has invalid hardware address length 0

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • Provide the simple network protocol revision.
    This revision number could be used to identify backwards compatible
    enhancements of the protocol.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

20 Sep, 2017

2 commits

  • Get rid of the hacky fake boot-device and duplicate device-path
    constructing (which needs to match what efi_disk and efi_net do).
    Instead convert over to use efi_device_path helpers to construct
    device-paths, and use that to look up the actual boot device.

    Also, extract out a helper to plug things in properly to the
    loaded_image. In a following patch we'll want to re-use this in
    efi_load_image() to handle the case of loading an image from a
    file_path.

    Signed-off-by: Rob Clark
    Signed-off-by: Alexander Graf

    Rob Clark
     
  • Signed-off-by: Rob Clark
    Signed-off-by: Alexander Graf

    Rob Clark
     

19 Jul, 2017

1 commit

  • efi_open_protocol was implemented to call a protocol specific open
    function to retrieve the protocol interface.

    The UEFI specification does not know of such a function.

    It is not possible to implement InstallProtocolInterface with the
    current design.

    With the patch the protocol interface itself is stored in the list
    of installed protocols of an efi_object instead of an open function.

    Signed-off-by: Heinrich Schuchardt
    [agraf: fix efi gop support]
    Signed-off-by: Alexander Graf

    xypron.glpk@gmx.de
     

15 Nov, 2016

1 commit


19 Oct, 2016

2 commits

  • These are missing in some functions. Add them to keep things consistent.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Reviewed-by: Alexander Graf
    Signed-off-by: Alexander Graf

    Simon Glass
     
  • So far bounce buffers were only used for disk I/O, but network I/O
    may suffer from the same problem.

    On platforms that have problems doing DMA on high addresses, let's
    also bounce outgoing network packets. Incoming ones always already
    get bounced.

    This patch fixes EFI PXE boot on ZynqMP for me.

    Signed-off-by: Alexander Graf

    Alexander Graf
     

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