13 Feb, 2019

22 commits

  • Stating the function module is sufficient. We don't need file and line
    number. Anyway the format code for the line number was incorrect (should
    be %d).

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

    Heinrich Schuchardt
     
  • For some API calls checks for the return values are missing.

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

    Heinrich Schuchardt
     
  • For some API calls checks for the return values are missing.

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

    Heinrich Schuchardt
     
  • Running the simple network protocol test on the sandbox requires setting
    the environment variable ethact to a network interface connected to a DHCP
    server and ethrotate to 'no'. So let's make it an on-request test on the
    sandbox (selectable by setting environment variable efi_selftest).

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

    Heinrich Schuchardt
     
  • The SetVariable() runtime service does not change the data passed to it.
    So mark the parameter as constant.

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

    Heinrich Schuchardt
     
  • The runtime variable services never change GUIDs. So we should declare
    the GUID parameters as constant.

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

    Heinrich Schuchardt
     
  • The function, efi_init_obj_list(), can be shared in different pseudo efi
    applications, like bootefi/bootmgr as well as my efishell. Moreover, it
    will be utilized to extend efi initialization, for example, my "removable
    disk support" patch and "capsule-on-disk support" patch in the future.

    So with this patch, it will be moved to a new file, efi_setup.c, under
    lib/efi_loader and exported, making no changes in functionality.

    Signed-off-by: AKASHI Takahiro
    Remove lines deactivated by #if 1 #else
    Reviewed-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    AKASHI Takahiro
     
  • %s/specfication/specification/
    %s/selftest/self-test/
    %s/little endian/little-endian/

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

    Heinrich Schuchardt
     
  • ARMv7-M only supports the Thumb instruction set. Our current crt0 code does
    not support it. With the patch we can build all unit tests of the EFI
    subsystem that do not require crt0.

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

    Heinrich Schuchardt
     
  • We use u16* for Unicode strings and efi_uintn_t for UINTN. Correct the
    signature of efi_exit() and efi_start_image().

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

    Heinrich Schuchardt
     
  • debug() support supports %p to print pointers.

    The debug message is unique. So there is not need to write a possibly
    distracting line number.

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

    Heinrich Schuchardt
     
  • Commit 7b78d6438a2b ("efi_loader: Reserve unaccessible memory") introduced
    a comparison between RAM top and RAM start that was not known at the time
    when the patch of commit 49759743bf09 ("efi_loader: eliminate sandbox
    addresses") was written.

    The sandbox uses an address space that is only relevant in the sandbox
    context. We have to map ram_top from the sandbox address space to the
    physical address space before using it in the EFI subsystem.

    Fixes: 49759743bf09 ("efi_loader: eliminate sandbox addresses")
    Fixes: 7b78d6438a2b ("efi_loader: Reserve unaccessible memory")
    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • It should not be necessary to adjust CMD_BOOTEFI_HELLO_COMPILE in config
    files.

    arch/arm/lib/crt0_arm_efi.S cannot be compiled in thumbs mode. We can
    disable CMD_BOOTEFI_HELLO_COMPILE for CONFIG_CPU_V7M. So there is no longer
    a need to disable it in stm32 configs.

    helloworld.efi can be built without problems on x86_64. So there is no need
    to disable it in chromebook_link64_defconfig and qemu-x86_64_defconfig.

    Same is true for ARM V7A. So do not disable CMD_BOOTEFI_HELLO_COMPILE in
    kp_imx6q_tpc_defconfig.

    Some architecture checks are already make for EFI_LOADER. There is no need
    to repeat them for CMD_BOOTEFI_HELLO_COMPILE

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Reviewed-by: Patrice.Chotard@st.com
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • When calling efi_dp_from_mem() use a named constant for the memory type.

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

    Heinrich Schuchardt
     
  • The aim of this patch is not to have temporary variables used in
    distro_bootcmd left as environment variables after run something.
    See the discussion[1].
    Without this patch, saveenv command also saves those variables, too.
    While they are apparently safe, scsi_need_init can be harmful.

    Please note that, in most cases, a variable should be converted to
    hush's local variable, while "devplist" cannot because it is created
    by "part" command as an environment variable.

    [1] https://lists.denx.de/pipermail/u-boot/2018-December/350209.html

    Signed-off-by: AKASHI Takahiro
    Signed-off-by: Alexander Graf

    AKASHI Takahiro
     
  • EFI_ENTRY in efi_connect_controller() should use %pD to print the remaining
    device path.

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

    Heinrich Schuchardt
     
  • The first parameter of efi_add_runtime_mmio() is a pointer to a
    pointer. This should be reflected in the documentation.

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

    Heinrich Schuchardt
     
  • Some boards support NVME drives. We should be able to use them as boot
    devices.

    NVME access requires running 'nvme scan'.

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

    Heinrich Schuchardt
     
  • Provide unit tests for u16_strdup() and u16_strcpy().

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

    Heinrich Schuchardt
     
  • Add u16_strcpy() and u16_strdup(). The latter function will be
    used later in implementing efi HII database protocol.

    Signed-off-by: Akashi Takahiro
    Reviewed-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Akashi, Takahiro
     
  • Commit 393fccdf6c73 ("efi_loader: efi_guid_t must be 64-bit aligned")
    has changed the alignment of efi_guid_t. This changed the size of
    struct efi_configuration_table on 32-bit systems form 20 to 24 bytes. As
    an array of this type is pointed to by the system table this breaks
    compatibility with existing versions of GRUB and Linux. Let's get back the
    original size by using the attribute __packed.

    Fixes: 393fccdf6c73 ("efi_loader: efi_guid_t must be 64-bit aligned")
    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     
  • The UEFI Specification Version 2.7 Errata A defines:

    "EFI_GUID
    128-bit buffer containing a unique identifier value.
    Unless otherwise specified, aligned on a 64-bit boundary."

    Before this patch efi_guid_t was 8-bit aligned.

    Signed-off-by: Heinrich Schuchardt
    Acked-by: Ard Biesheuvel
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

12 Feb, 2019

10 commits


11 Feb, 2019

8 commits

  • - Fix BUILD_TARGET for ARCH_MVEBU from Baruch
    - Fix MVEBU PCIe reset issues from Baruch
    - Increase DDR stability on x530 from Chris

    Tom Rini
     
  • MV_DDR_FREQ_SAR lets the DDR frequency be determined by hardware
    strapping. This also has the side effect of running the DDR clock in
    synchronous mode with the CPU core clock rather than from an independent
    PLL. We've seen this improve reliability in operation across a number of
    boards and temperature ranges.

    Signed-off-by: Chris Packham
    Reviewed-by: Stefan Roese
    Signed-off-by: Stefan Roese

    Chris Packham
     
  • Commit dc146ca11187 ("Kconfig: Migrate CONFIG_BUILD_TARGET") made the
    mvebu default build target depend on CONFIG_SPL_BUILD. Unfortunately,
    there is no such Kconfig symbol. Use the CONFIG_SPL symbol instead to
    fix that.

    Cc: Jagan Teki
    Signed-off-by: Baruch Siach
    Reviewed-by: Stefan Roese
    Reviewed-by: Jagan Teki
    Signed-off-by: Stefan Roese

    Baruch Siach
     
  • Describe the mini-PCIe slot gpio reset signal. This enables PCIe devices
    on Clearfog GT-8K.

    Signed-off-by: Baruch Siach
    Reviewed-by: Stefan Roese
    Signed-off-by: Stefan Roese

    Baruch Siach
     
  • The dm_gpio_set_value() routine sets signal logical level, with
    GPIO_ACTIVE_LOW/HIGH value taken into account. Reset active value is 1
    (asserted), while reset inactive value is 0 (de-asserted). Fix the reset
    toggle code to set the correct reset logic value.

    Reported-by: Sven Auhagen
    Signed-off-by: Baruch Siach
    Reviewed-by: Stefan Roese
    Signed-off-by: Stefan Roese

    Baruch Siach
     
  • The PCIe slot PERST signal is active low. Fix the gpio signal
    description in the dts.

    This happened to work because the pcie_dw_mvebu driver sets the reset
    gpio level to 1 (high) to release the reset. The following commit will
    fix that.

    Signed-off-by: Baruch Siach
    Reviewed-by: Stefan Roese
    Signed-off-by: Stefan Roese

    Baruch Siach
     
  • For !DM case busses are listed as
    ZynqMP> i2c bus
    Bus 0: zynq_0
    Bus 1: zynq_0->PCA9544A@0x75:0
    Bus 2: zynq_0->PCA9544A@0x75:1
    Bus 3: zynq_0->PCA9544A@0x75:2
    Bus 4: zynq_1
    Bus 5: zynq_1->PCA9548@0x74:0
    Bus 6: zynq_1->PCA9548@0x74:1
    Bus 7: zynq_1->PCA9548@0x74:2
    Bus 8: zynq_1->PCA9548@0x74:3
    Bus 9: zynq_1->PCA9548@0x74:4
    Bus 10: zynq_1->PCA9548@0x75:0
    Bus 11: zynq_1->PCA9548@0x75:1
    Bus 12: zynq_1->PCA9548@0x75:2
    Bus 13: zynq_1->PCA9548@0x75:3
    Bus 14: zynq_1->PCA9548@0x75:4
    Bus 15: zynq_1->PCA9548@0x75:5
    Bus 16: zynq_1->PCA9548@0x75:6
    Bus 17: zynq_1->PCA9548@0x75:7

    where is exactly describing i2c bus topology.
    By moving to DM case i2c mux buses are using names from DT and because
    i2c-muxes describing sub busses with the same names like i2c@0, etc it
    is hard to identify which bus is where.
    Linux is adding topology information to i2c-mux busses to identify them
    better.
    This patch is doing the same and composing bus name with topology
    information.

    When patch is applied with topology information on zcu102-revA.
    ZynqMP> i2c bus
    Bus 0: i2c@ff020000
    20: gpio@20, offset len 1, flags 0
    21: gpio@21, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus 2: i2c@ff020000->i2c-mux@75->i2c@0
    Bus 3: i2c@ff020000->i2c-mux@75->i2c@1
    Bus 4: i2c@ff020000->i2c-mux@75->i2c@2
    Bus 1: i2c@ff030000 (active 1)
    74: i2c-mux@74, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus 5: i2c@ff030000->i2c-mux@74->i2c@0 (active 5)
    54: eeprom@54, offset len 1, flags 0
    Bus 6: i2c@ff030000->i2c-mux@74->i2c@1
    Bus 7: i2c@ff030000->i2c-mux@74->i2c@2
    Bus 8: i2c@ff030000->i2c-mux@74->i2c@3
    Bus 9: i2c@ff030000->i2c-mux@74->i2c@4
    Bus 10: i2c@ff030000->i2c-mux@75->i2c@0
    Bus 11: i2c@ff030000->i2c-mux@75->i2c@1
    Bus 12: i2c@ff030000->i2c-mux@75->i2c@2
    Bus 13: i2c@ff030000->i2c-mux@75->i2c@3
    Bus 14: i2c@ff030000->i2c-mux@75->i2c@4
    Bus 15: i2c@ff030000->i2c-mux@75->i2c@5
    Bus 16: i2c@ff030000->i2c-mux@75->i2c@6
    Bus 17: i2c@ff030000->i2c-mux@75->i2c@7

    Behavior before the patch is applied.
    ZynqMP> i2c bus
    Bus 0: i2c@ff020000
    20: gpio@20, offset len 1, flags 0
    21: gpio@21, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus 2: i2c@0
    Bus 3: i2c@1
    Bus 4: i2c@2
    Bus 1: i2c@ff030000 (active 1)
    74: i2c-mux@74, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus 5: i2c@0 (active 5)
    54: eeprom@54, offset len 1, flags 0
    Bus 6: i2c@1
    Bus 7: i2c@2
    Bus 8: i2c@3
    Bus 9: i2c@4
    Bus 10: i2c@0
    Bus 11: i2c@1
    Bus 12: i2c@2
    Bus 13: i2c@3
    Bus 14: i2c@4
    Bus 15: i2c@5
    Bus 16: i2c@6
    Bus 17: i2c@7

    Signed-off-by: Michal Simek
    Reviewed-by: Simon Glass
    Reviewed-by: Heiko Schocher

    Michal Simek
     
  • For i2c controllers which are missing alias in DT there is no req_seq
    setup. This function is setting up proper ID based on highest found
    alias ID.

    On zcu102 this is the behavior when patch is applied.
    ZynqMP> i2c bus
    Bus 0: i2c@ff020000
    20: gpio@20, offset len 1, flags 0
    21: gpio@21, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus 2: i2c@0
    Bus 3: i2c@1
    Bus 4: i2c@2
    Bus 1: i2c@ff030000 (active 1)
    74: i2c-mux@74, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus 5: i2c@0 (active 5)
    54: eeprom@54, offset len 1, flags 0
    Bus 6: i2c@1
    Bus 7: i2c@2
    Bus 8: i2c@3
    Bus 9: i2c@4
    Bus 10: i2c@0
    Bus 11: i2c@1
    Bus 12: i2c@2
    Bus 13: i2c@3
    Bus 14: i2c@4
    Bus 15: i2c@5
    Bus 16: i2c@6
    Bus 17: i2c@7

    Before this patch applied (controllers have -1 ID)
    ZynqMP> i2c bus
    Bus 0: i2c@ff020000
    20: gpio@20, offset len 1, flags 0
    21: gpio@21, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus -1: i2c@0
    Bus -1: i2c@1
    Bus -1: i2c@2
    Bus 1: i2c@ff030000 (active 1)
    74: i2c-mux@74, offset len 1, flags 0
    75: i2c-mux@75, offset len 1, flags 0
    Bus -1: i2c@0 (active 0)
    54: eeprom@54, offset len 1, flags 0
    Bus -1: i2c@1
    Bus -1: i2c@2
    Bus -1: i2c@3
    Bus -1: i2c@4
    Bus -1: i2c@0
    Bus -1: i2c@1
    Bus -1: i2c@2
    Bus -1: i2c@3
    Bus -1: i2c@4
    Bus -1: i2c@5
    Bus -1: i2c@6
    Bus -1: i2c@7

    Signed-off-by: Michal Simek
    Reviewed-by: Heiko Schocher

    Michal Simek