28 Sep, 2020

1 commit

  • Enable "optee_rpmb" command to write/read named persistent values
    created on RPMB by opening session with OPTEE AVB TA.
    This provides easy test for establishing a session with OPTEE
    TA and storage of persistent data in MMC RPMB.

    It includes following subcommands:

    optee_rpmb read_pvalue - read persistent values on rpmb via OPTEE AVB TA
    optee_rpmb write_pvalue - write persistent values on rpmb via OPTEE AVB TA

    Signed-off-by: Ruchika Gupta

    Ruchika Gupta
     

09 Apr, 2020

1 commit


31 Mar, 2020

2 commits


28 Mar, 2020

2 commits


17 Mar, 2020

3 commits

  • Currently, bootefi only parses memory reservation block to setup
    EFI reserved memory mappings. However, it doesn't parse the
    reserved-memory[1] device tree node that also can contain the
    reserved memory regions.

    Add capability to parse reserved-memory node and update the EFI memory
    mappings accordingly.

    1. /doc/device-tree-bindings/reserved-memory/reserved-memory.txt]

    Signed-off-by: Atish Patra

    Fix an endless loop.

    The /reserved-memory node may have children without reg property. Remove
    a superfluous debug statement.

    Signed-off-by: Heinrich Schuchardt

    Atish Patra
     
  • Addresses in the sandbox's device tree are in the sandbox's virtual address
    space. If we want to compare memory reservations in the device-tree with
    the output of 'efidebug memmap', we need to convert back to this address
    space.

    Adjust the output of the 'efidebug memmap' command.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • Some memory reservations are made in ft_board_setup(). Ensure that we
    create reserved memory map entries after ft_board_setup().

    The downside of this patch is that if bootefi is called multiple times with
    an devicetree argument superfluous reservations for the old copies of the
    device tree will exist. But that is still better than missing a reservation.

    Deleting the superfluous reservations is not possible because reservations
    in the memory map are rounded to page size and may be coallesced.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     

13 Mar, 2020

1 commit

  • 4dbc107f4683 ("cmd: gpio: Correct do_gpio() return value") correctly
    changed the behaviour of the gpio command to return CMD_RET_SUCCESS or
    CMD_RET_FAILURE, but any existing script which expects the return value
    to be the pin value is broken by this change.

    Reinstate the legacy behaviour for `gpio input` only.

    Fixes: 4dbc107f4683 ("cmd: gpio: Correct do_gpio() return value")
    Signed-off-by: Alex Kiernan
    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass

    Alex Kiernan
     

11 Mar, 2020

2 commits


29 Feb, 2020

1 commit

  • Following kernel's proposal for an arch-agnostic initrd loading
    mechanism [1] let's implement the U-boot counterpart.
    This new approach has a number of advantages compared to what we did up
    to now. The file is loaded into memory only when requested limiting the
    area of TOCTOU attacks. Users will be allowed to place the initramfs
    file on any u-boot accessible partition instead of just the ESP one.
    Finally this is an attempt of a generic interface across architectures
    in the linux kernel so it makes sense to support that.

    The file location is intentionally only supported as a config option
    argument(CONFIG_EFI_INITRD_FILESPEC), in an effort to enhance security.
    Although U-boot is not responsible for verifying the integrity of the
    initramfs, we can enhance the offered security by only accepting a
    built-in option, which will be naturally verified by UEFI Secure Boot.
    This can easily change in the future if needed and configure that via ENV
    or UEFI variable.

    [1] https://lore.kernel.org/linux-efi/20200207202637.GA3464906@rani.riverdale.lan/T/#m4a25eb33112fab7a22faa0fd65d4d663209af32f

    Signed-off-by: Ilias Apalodimas
    Signed-off-by: Heinrich Schuchardt

    Ilias Apalodimas
     

27 Feb, 2020

1 commit


19 Feb, 2020

1 commit


11 Feb, 2020

1 commit


09 Feb, 2020

1 commit

  • Both CMD_MX_CYCLIC and MX_CYCLIC are in use and defined in Kconfig,
    but only the non-CMD version currently does anything. This changes all
    usages to prefer the CMD_MX_CYCLIC option (since it's only affecting
    addition of the commands), and switches defconfigs using the non-CMD
    version to use the CMD version.

    Signed-off-by: Joel Johnson
    Reviewed-by: Tom Rini

    Joel Johnson
     

08 Feb, 2020

2 commits

  • Based on reading the text of the license comment this appears to be
    the BSD-2-Clause license but with an imperfect word match as
    BSD-2-Clause was not (as far as I recall) a common license choice at the
    time the code was written.

    Cc: Wolfgang Denk
    Signed-off-by: Tom Rini

    Tom Rini
     
  • Use the correct return value in function do_gpio() and update
    commands documentation with the return values from command_ret_t enum.

    CMD_RET_SUCCESS is returned on command success and CMD_RET_FAILURE is
    returned on command failure.

    The command was returning the pin value, which caused confusion when
    debugging (#define DEBUG).

    Signed-off-by: Luka Kovacic
    Tested-by: Robert Marko

    Luka Kovacic
     

06 Feb, 2020

4 commits

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present devres.h is included in all files that include dm.h but few
    make use of it. Also this pulls in linux/compat which adds several more
    headers. Drop the automatic inclusion and require files to include devres
    themselves. This provides a good indication of which files use devres.

    Signed-off-by: Simon Glass
    Reviewed-by: Anatolij Gustschin

    Simon Glass
     
  • This adds a subcommand to dm to dump out what drivers are installed, and their
    compatible strings. I have found this useful in ensuring that I have the correct
    drivers compiled, and that I have put in the correct compatible strings.

    Signed-off-by Sean Anderson
    Reviewed-by: Simon Glass

    Sean Anderson
     
  • The command tpm (and tpm2) search the tpm and use it.
    On sandbox, there are two tpm (tpm 1.x and tpm 2.0).
    So the command tpm and tpm2 are always executed with
    the first tpm (tpm 1.x), and the command tpm2 always
    fails.

    This add a subcommand device to command tpm and
    command tpm2. Then the command tpm and tpm2 use
    the device selected with the subcommand device.

    To be compatible with previous behaviour, if the
    subcommand device is not used before a tpm (or tpm2)
    command, the device 0 is selected.

    Signed-off-by: Philippe Reynes
    Reviewed-by: Miquel Raynal

    Philippe Reynes
     

04 Feb, 2020

3 commits

  • Convert Android documentation from regular txt format to Sphinx (RST).
    Also add Android index.rst file and reference it in root index.rst, so
    that Android documentation is visible.

    Test:

    $ make htmldocs
    $ xdg-open doc/output/index.html

    Signed-off-by: Sam Protsenko
    Signed-off-by: Lokesh Vutla

    Sam Protsenko
     
  • Describe Android Boot Image format, how its support is implemented in
    U-Boot and associated commands usage.

    Signed-off-by: Sam Protsenko
    Signed-off-by: Lokesh Vutla

    Sam Protsenko
     
  • This command can be used to extract fields and image payloads from
    Android Boot Image. It can be used for example to implement boot flow
    where dtb is taken from boot.img (as v2 incorporated dtb inside of
    boot.img). Using this command, one can obtain needed dtb blob from
    boot.img in scripting manner, and then apply needed dtbo's (from "dtbo"
    partition) on top of that, providing then the resulting image to bootm
    command in order to boot the Android.

    Also right now this command has the sub-command to get an address and
    size of recovery dtbo from recovery image (for non-A/B devices only,
    see [1,2] for details).

    It can be tested like this:

    => mmc dev 1
    => part start mmc 1 boot_a boot_start
    => part size mmc 1 boot_a boot_size
    => mmc read $loadaddr $boot_start $boot_size
    => abootimg get ver
    => abootimg dump dtb

    [1] https://source.android.com/devices/bootloader/boot-image-header
    [2] https://source.android.com/devices/architecture/dto/partitions

    Signed-off-by: Sam Protsenko
    Signed-off-by: Lokesh Vutla

    Sam Protsenko
     

31 Jan, 2020

1 commit

  • New analysis by the tool has shown that we have some cases where we
    weren't handling the error exit condition correctly. When we ran into
    the ENOMEM case we wouldn't exit the function and thus incorrect things
    could happen. Rework the unwinding such that we don't need a helper
    function now and free what we may have allocated.

    Fixes: 18030d04d25d ("GPT: fix memory leaks identified by Coverity")
    Reported-by: Coverity (CID: 275475, 275476)
    Cc: Alison Chaiken
    Cc: Simon Goldschmidt
    Cc: Jordy
    Signed-off-by: Tom Rini
    Reviewed-by: Simon Goldschmidt

    Tom Rini
     

28 Jan, 2020

4 commits

  • - spi cs accessing slaves (Bin Meng)
    - spi prevent overriding established bus (Marcin Wojtas)
    - support speed in spi command (Marek Vasut)
    - add W25N01GV spinand (Robert Marko)
    - move cadence_qspi to use spi-mem (Vignesh Raghavendra)
    - add octal mode (Vignesh Raghavendra)

    Tom Rini
     
  • Some PMICs (such as the DA9063) have non-contiguous register maps.
    Attempting to read the non implemented registers returns an error
    rather than a dummy value which causes 'pmic dump' to terminate
    prematurely.

    Fix this by allowing the PMIC driver to return -ENODATA for such
    registers, which will then be displayed as '--' by pmic dump.

    Use a single error code rather than any error code so that
    we can distinguish between a hardware failure reading the PMIC
    and a non implemented register known to the driver.

    Signed-off-by: Martin Fuzzey

    Martin Fuzzey
     
  • If we didn't unbind the sata from block device, the same devices would
    be added after sata remove,
    This patch is to resolve this issue as below:

    => sata info
    SATA#0:
    (3.0 Gbps)
    SATA#1:
    (3.0 Gbps)
    Device 0: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY30
    Type: Hard Disk
    Supports 48-bit addressing
    Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
    Device 1: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX30
    Type: Hard Disk
    Supports 48-bit addressing
    Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
    => sata stop
    => sata info
    SATA#0:
    (3.0 Gbps)
    SATA#1:
    (3.0 Gbps)
    Device 0: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY300
    Type: Hard Disk
    Supports 48-bit addressing
    Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
    Device 1: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX300
    Type: Hard Disk
    Supports 48-bit addressing
    Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
    Device 2: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY300
    Type: Hard Disk
    Supports 48-bit addressing
    Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
    Device 3: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX300
    Type: Hard Disk
    Supports 48-bit addressing
    Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)

    Signed-off-by: Peng Ma
    Reviewed-by: Simon Glass

    Peng Ma
     
  • The 'sspi' command hard-coded 1 MHz bus frequency for all transmissions.
    Allow changing that at runtime by specifying '@freq' bus frequency in Hz.

    Signed-off-by: Marek Vasut
    Cc: Tom Rini
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Jagan Teki

    Marek Vasut
     

25 Jan, 2020

1 commit

  • This patch modify the loop in mtd erase command to erase one by one
    the blocks in the requested area.

    It solves issue on "mtd erase" command on nand with existing bad block,
    the command is interrupted on the first bad block with the trace:
    "Skipping bad block at 0xffffffffffffffff"

    In MTD driver (nand/raw), when a bad block is present on the MTD
    device, the erase_op.fail_addr is not updated and we have the initial
    value MTD_FAIL_ADDR_UNKNOWN = (ULL)-1.

    This case seems normal in nand_base.c:nand_erase_nand(),
    we have the 2 exit cases during the loop:

    1/ we have a bad block (nand_block_checkbad)
    instr->state = MTD_ERASE_FAILED
    loop interrupted (goto erase_exit)

    2/ if block erase failed (status & NAND_STATUS_FAIL)
    instr->state = MTD_ERASE_FAILED;
    instr->fail_addr =
    ((loff_t)page << chip->page_shift);
    loop interrupted (goto erase_exit)

    So erase_op.fail_addr can't be used if bad blocks were present
    in the erased area; we need to use mtd_erase only one block to detect
    and skip these existing bad blocks (as it is done in nand_util.c).

    Signed-off-by: Patrick Delaunay
    Reviewed-by: Miquel Raynal

    Patrick Delaunay
     

23 Jan, 2020

2 commits


21 Jan, 2020

1 commit

  • Add support for read/write of ONIE "Tlvinfo" EEPROM data format. TLV
    stands for Type-Length-Value. The data format is described here:

    https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html#board-eeprom-information-format

    Based on U-Boot patch from the Open Compute project:

    https://github.com/opencomputeproject/onie/blob/ec87e872d46b9805565d2c6124b2f701ef1c07b1/patches/u-boot/common/feature-sys-eeprom-tlv-common.patch

    Keep only I2C EEPROM support. Use the generic eeprom driver. Fix
    checkpatch issues.

    Add support for multiple EEPROM TLV stores on the same system. This is
    useful in case of SOM and carrier that both provide ID and hardware
    configuration information.

    Add option to enable for SPL. This allows selection of RAM configuration
    based on EEPROM stored board identification.

    Signed-off-by: Baruch Siach

    Baruch Siach
     

18 Jan, 2020

5 commits