18 May, 2017

2 commits

  • This patch updates the mksunxiboot tool to optionally add
    the default device tree name string to the SPL header. This
    information can be used by the firmware upgrade tools to
    protect users from harming themselves by trying to upgrade
    to an incompatible bootloader.

    The primary use case here is a non-removable bootable media
    (such as NAND, eMMC or SPI flash), which already may have
    a properly working, but a little bit outdated bootloader
    installed. For example, the user may download or build a
    new U-Boot image for "Cubieboard", and then attemept to
    install it on a "Cubieboard2" hardware by mistake as a
    replacement for the already existing bootloader. If this
    happens, the flash programming tool can identify this
    problem and warn the user.

    The size of the SPL header is also increased from 64 bytes
    to 96 bytes to provide enough space for the device tree name
    string.
    [Andre: split patch to remove OF_LIST hash feature]

    Signed-off-by: Siarhei Siamashka
    Signed-off-by: Andre Przywara

    Siarhei Siamashka
     
  • mksunxiboot limits the size of the resulting SPL binaries to pretty
    conservative values to cover all SoCs and all boot media (NAND).
    It turns out that we have limit checks in place in the build process,
    so mksunxiboot can be relaxed and allow packaging binaries up to the
    actual 32KB the mask boot ROM actually imposes.
    This allows to have a bigger SPL, which is crucial for AArch64 builds.

    Signed-off-by: Andre Przywara
    Reviewed-by: Simon Glass
    Reviewed-by: Jagan Teki

    Andre Przywara
     

12 May, 2017

2 commits

  • As per MAINTAINERS[1] file description, 'Supported' is
    a valid status for a board. But buildman thinks 'Maintained'
    is the only valid state and complains about boards with 'Supported'
    status. Update buildman to accept 'Supported' as valid state.

    [1] http://git.denx.de/?p=u-boot.git;a=blob;f=MAINTAINERS;h=0962b47bf9057b22e93624e070c0204b893790dc;hb=HEAD#l10

    Reported-by: Sekhar Nori
    Signed-off-by: Lokesh Vutla
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass

    Lokesh Vutla
     
  • The rsa_st struct has been made opaque in 1.1.x, add forward compatible
    code to access the n, e, d members of rsa_struct.

    EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be
    called to reinitialise an already created structure.

    Signed-off-by: Jelle van der Waa

    Jelle van der Waa
     

11 May, 2017

10 commits

  • At present dtoc assumes that nodes which are phandles do not themselves
    reference other phandle nodes. Unfortunately this is not necessarilly
    true. As a result we can currently output C code which does not compile
    because a node declaration can be referenced before it is declared.

    Adjust the code to explicitly output all phandle nodes needed by node
    before the node itself is output.

    This fixes building with the latest rk3399-firefly.dts from Linux, which
    has reordered the nodes.

    Signed-off-by: Simon Glass
    Tested-by: Kever Yang

    Simon Glass
     
  • The code to generate the tables is quite long. Move the node-output code
    into its own function.

    Signed-off-by: Simon Glass
    Tested-by: Kever Yang

    Simon Glass
     
  • The imagetool framework checks whether function pointer for the verify,
    print and extract actions are available and will will handle their
    absence appropriately.

    This change removes the unnecessary functions and uses the driver
    structure to convey available functionality to imagetool. This is in
    fact better than having verify just return 0 (which previously broke
    dumpimage, as dumpimage assumed that we had handled the image and did
    not continue to probe further).

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • Dumpimage (it invoked with "-T rkspi" or "-T rksd") would not work due
    to check_params failing. These changes ensure that we can both be called
    with an empty imagename.

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • This change set adds documentation to the header0 initialisation and
    improves readability for the calculations of various offsets/lengths.

    As the U-Boot SPL stage doesn't use any payload beyond what is covered
    by init_size, we no longer add RK_MAX_BOOT_SIZE to init_boot_size.

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • The calculation of the variable header size in rkcommon_vrec_header
    had been update twice in the earlier series (introducing boot0-style
    images to deal with the alignment of the first instruction in 64bit
    binaries). Unfortunately, I didn't update the comment twice (so it
    remained out-of-date).

    This change brings the comment back in-sync with what the code is
    doing.

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • In (first) breaking and (then) fixing the rkspi tool, I realised that
    the calculation of the required padding (for the header-size and the
    2K-in-every-4K SPI layout) was not as self-explainatory as it could
    have been. This change rewrites the code (using new, common functions
    in rkcommon.c) and adds verbose in-line comments to ensure that we
    won't fall into the same pit in the future...

    Tested on the RK3399 (with has a boot0-style payload) with SD/MMC and SPI.

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • Our earlier change broke the generation of SPI images, by excluding the
    2K used for header0 from the size-calculation.

    This commit makes sure that these are included before calculating the
    required total size (including the padding from the 2K-from-every-4K
    conversion).

    Signed-off-by: Philipp Tomsich
    Acked-by: Simon Glass

    Philipp Tomsich
     
  • Add support for rk3328 package header in mkimage tool.

    Signed-off-by: Kever Yang
    Reviewed-by: Simon Glass

    Kever Yang
     

08 May, 2017

3 commits


06 May, 2017

2 commits


28 Apr, 2017

1 commit


18 Apr, 2017

3 commits


15 Apr, 2017

1 commit

  • When writing out some of our results we may now have UTF-8 characters
    in there as well. Translate these to latin-1 and ignore any errors (as
    this is for diagnostic and given the githash anything else can be
    reconstructed by the user.

    Reviewed-by: Simon Glass
    Signed-off-by: Tom Rini

    Tom Rini
     

14 Apr, 2017

6 commits

  • Here with some DM changes as well as the long-standing AT91 DM/DT
    conversion patches which I have picked up via dm.

    Tom Rini
     
  • One of these has crept in in this commit:

    40a808f1 ARCv2: SLC: Make sure busy bit is set properly on SLC flushing

    Adjust buildman to handle it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Not force to use python from PATH. Issue was noted when building with
    Yocto, because python from the distro is always taken instead of
    python-native built during Yocto process.

    Signed-off-by: Stefano Babic
    CC: Simon Glass
    Reviewed-by: Simon Glass

    Stefano Babic
     
  • With skeleton.dtsi being dropped it is more likely that the /aliases node
    will be last in the device tree. Update fdtgrep to handle this.

    Signed-off-by: Simon Glass
    Tested-by: Masahiro Yamada

    Simon Glass
     
  • With Python 3.5.2 encode will throw an exception if val is a byte array.
    Decode it to a string first. This assumes it's utf-8, if it's not valid
    utf-8 it will throw an exception.

    Signed-off-by: George McCollister
    Acked-by: Simon Glass

    George McCollister
     
  • os.read() returns a byte array in Python 3.5.2 and needs to be converted
    into a string. Check if the returned value is an instance of bytes and
    if it is decode it as a utf-8 string. If it is not a utf-8 encoded string
    the decoding may fail with an exception.

    Prior to this fix the comparisions check data == "" would fail when data
    was b'' and would cause an infinite memory leaking loop. joins would
    also fail with an exception below but due to the infinite loop it never
    made it that far.

    Signed-off-by: George McCollister
    Acked-by: Simon Glass

    George McCollister
     

13 Apr, 2017

4 commits

  • fw_env_open allocates buffers to store the environment, but these
    buffers are never freed. This becomes quite nasty using the fw_ tools as
    library, because each access to the environment (even just reading a
    variable) generates a memory leak equal to the size of the environment.

    Fix this renaming fw_env_close() as fw_env_flush(), because the function
    really flushes the environment from RAM to storage, and add a
    fw_env_close function to free the allocated resources.

    Signed-off-by: Stefano Babic

    Stefano Babic
     
  • Changes in the environment library are difficult to tracked by programs
    using the library. Add simply an API version number that must be
    increased each time when the API is changed.

    This can be detected and a program can work with different versions of
    the library.

    Signed-off-by: Stefano Babic

    Stefano Babic
     
  • Move U-Boot private data into a separate file. This
    lets export fw_env.h to be used by external programs
    that want to change the environment using the library
    built in tools/env.

    Signed-off-by: Stefano Babic

    Stefano Babic
     
  • aes.h is a too generic name if this file can
    be exported and used by a program.
    Rename it to avoid any conflicts with
    other files (for example, from openSSL).

    Signed-off-by: Stefano Babic

    Stefano Babic
     

10 Apr, 2017

2 commits


07 Apr, 2017

1 commit

  • This program generates raw SPL images that can be flashed on the NAND with
    the ECC and randomizer properly set up.

    This has been copied (and tweaked to find the right headers) from the
    sunxi-tools (https://github.com/linux-sunxi/sunxi-tools) upstream
    repository, commit 1c3a6ca5.

    Signed-off-by: Maxime Ripard
    Acked-by: Boris Brezillon
    Reviewed-by: Hans de Goede
    Reviewed-by: Jagan Teki

    Maxime Ripard
     

05 Apr, 2017

3 commits

  • To simplify the creation of AArch64 SPL images for the RK3399, we
    use the ENABLE_ARM_SOC_BOOT0_HOOK option and prepend 4 bytes of
    padding at the start of the text section. This makes it easy for
    mkimage to rewrite this word with the 'RK33' boot magic.

    This change brings logic to calculate the header size and allocate
    the header back in sync. For the RK3399 we now limit the header to
    before the payload (i.e. the 'header0' and the padding up to the
    actual image) and overwrite the first word (inserted by the
    boot0-hook for this purpose) with the 'RK33' magic in-place.

    X-AffectedPlatforms: RK3399-Q7
    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich
     
  • The RK3399 boot code (running as AArch64) poses a bit of a challenge
    for SPL image generation:
    * The BootROM will start execution right after the 4-byte header (at
    the odd instruction word loaded into SRAM at 0xff8c2004, with the
    'RK33' boot magic residing at 0xff8c2000).
    * The default padding (during ELF generation) for AArch64 is 0x0,
    which is an illegal instruction and the .text section needs to be
    naturally aligned (someone might locate a 64bit constant relative
    to the section start and unaligned loads trigger a fault for all
    privileged modes of an ARMv8)... so we can't simply define the
    CONFIG_SPL_TEXT_BASE option to the odd address (0xff8c2004).
    * Finally, we don't want to change the values used for padding of
    the SPL .text section for all ARMv8 targets to the instruction
    word encoding 'nop', as this would affect all padding in this
    section and might hide errors that would otherwise quickly trigger
    an illegal insn exception.

    To deal with this situation, we modify the rkimage generation to
    - understand the fact that the RK3399 needs to pad the header to an
    8 byte boundary using an AArch64 'nop'
    - the necessary logic to adjust the header_size (which controls the
    location where the payload is copied into the image) and to insert
    this padding (AArch64 insn words are always little-endian) into
    the image following the 4-byte header magic.

    X-AffectedPlatforms: RK3399-Q7
    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich
     
  • The RC4 encoding works on full blocks, but the calculation of the
    starting offset and size are needlessly complicated by using a
    reference value known to be offset into a block by the size of the
    header and then correcting for the (hard-coded) size of the header
    (i.e. 4 bytes).

    We change this over to use the RK_SPL_HDR_START directly (which is
    known to be on a block boundary).

    X-AffectedPlatforms: RK3399-Q7
    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich