06 Sep, 2017

3 commits

  • The target is not currently mentioned anywhere. Add it to the help so
    people can find it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This was broken by the recent environment refactoring. Specifically:

    $ make environ
    scripts/Makefile.build:59: tools/environ/Makefile: No such file or directory
    make[1]: *** No rule to make target 'tools/environ/Makefile'. Stop.
    make: *** [Makefile:1469: environ] Error 2

    Fix this by updating the Makefile and adjusting the #include filesnames in
    two C files.

    Fixes: ec74f5f (Makefile: Rename 'env' target to 'environ')
    Reported-by: Måns Rullgård
    Signed-off-by: Simon Glass

    Simon Glass
     
  • With the move of environment code from common/ to env/ a number of
    changes needed to be made to various make targets. We missed updating
    some of the files required for out of tree builds of the tools. Correct
    the 'environ' target to know that we need to work under tools/env/ still
    (not tools/environ/) and then update the wrappers in env_attr.c and
    env_flags.c to point to the new correct file.

    Reported-by: Peter Robinson
    Tested-by: Peter Robinson
    Signed-off-by: Tom Rini

    Tom Rini
     

04 Sep, 2017

3 commits


23 Aug, 2017

1 commit


20 Aug, 2017

2 commits

  • s/notes/nodes

    Signed-off-by: Anatolij Gustschin

    Anatolij Gustschin
     
  • On some systems `python` is `python3` (for instance, Archlinux). The
    `PYTHON` variable can be used to point to `python2` to have a successful
    build.

    The use of `PYTHON` is currently limited in the Makefile and needs to be
    extended in other places:

    First, pylibfdt is required to be a Python 2 binding (binman imports
    pylibfdt and is only compatible Python 2), so its setup.py needs to be
    called accordingly. An alternative would be to change the libfdt
    setup.py shebang to python2, but the binding is actually portable. Also,
    it would break on system where there is no such thing as `python2`.

    Secondly, the libfdt import checks need to be done against Python 2 as
    well since the Python 2 compiled modules (in this case _libdft.so) can
    not be imported from Python 3.

    Note on the libfdt imports: "@if ! PYTHONPATH=tools $(PYTHON) -c 'import
    libfdt'; then..." is probably simpler than the currently sub-optimal
    pipe.
    Reviewed-by: Jonathan Gray

    Clément Bœsch
     

16 Aug, 2017

1 commit


15 Aug, 2017

1 commit


13 Aug, 2017

1 commit


26 Jul, 2017

2 commits

  • It seems that gcc 6.3 at least is smart enough to warn about the _val
    variable being unassigned in the default case in the set_hdr_field()
    macro, but not smart enough to figure out that the default case is never
    taken. This results in warnings such as the following:

    pfx##hdr32[idx].field = _val; \
    ^
    ../tools/mips-relocs.c:51:11: note: _val was declared here
    uint64_t _val; \
    ^
    ../tools/mips-relocs.c:88:2: note: in expansion of macro set_hdr_field
    set_hdr_field(p, idx, field, val)
    ^~~~~~~~~~~~~
    ../tools/mips-relocs.c:408:3: note: in expansion of macro set_phdr_field
    set_phdr_field(i, p_filesz, load_sz);
    ^~~~~~~~~~~~~~
    ../tools/mips-relocs.c: In function main:
    ../tools/mips-relocs.c:77:25: warning: _val may be used uninitialized
    in this function [-Wmaybe-uninitialized]

    Avoid this by assigning _val = 0 in the default case, and asserting that
    we didn't actually hit it for good measure.

    For reference gcc 7.1.1 seems to be smart enough to not hit the above
    warning without this patch.

    Signed-off-by: Paul Burton
    Fixes: 011dd93ca97a ("MIPS: Stop building position independent code")
    Cc: Daniel Schwierzeck
    Cc: Tom Rini
    Cc: u-boot@lists.denx.de

    Paul Burton
     
  • U-Boot has up until now built with -fpic for the MIPS architecture,
    producing position independent code which uses indirection through a
    global offset table, making relocation fairly straightforward as it
    simply involves patching up GOT entries.

    Using -fpic does however have some downsides. The biggest of these is
    that generated code is bloated in various ways. For example, function
    calls are indirected through the GOT & the t9 register:

    8f998064 lw t9,-32668(gp)
    0320f809 jalr t9

    Without -fpic the call is simply:

    0f803f01 jal be00fc04

    This is more compact & faster (due to the lack of the load & the
    dependency the jump has on its result). It is also easier to read &
    debug because the disassembly shows what function is being called,
    rather than just an offset from gp which would then have to be looked up
    in the ELF to discover the target function.

    Another disadvantage of -fpic is that each function begins with a
    sequence to calculate the value of the gp register, for example:

    3c1c0004 lui gp,0x4
    279c3384 addiu gp,gp,13188
    0399e021 addu gp,gp,t9

    Without using -fpic this sequence no longer appears at the start of each
    function, reducing code size considerably.

    This patch switches U-Boot from building with -fpic to building with
    -fno-pic, in order to gain the benefits described above. The cost of
    this is an extra step during the build process to extract relocation
    data from the ELF & write it into a new .rel section in a compact
    format, plus the added complexity of dealing with multiple types of
    relocation rather than the single type that applied to the GOT. The
    benefit is smaller, cleaner, more debuggable code. The relocate_code()
    function is reimplemented in C to handle the new relocation scheme,
    which also makes it easier to read & debug.

    Taking maltael_defconfig as an example the size of u-boot.bin built
    using the Codescape MIPS 2016.05-06 toolchain (gcc 4.9.2, binutils
    2.24.90) shrinks from 254KiB to 224KiB.

    Signed-off-by: Paul Burton
    Cc: Daniel Schwierzeck
    Cc: u-boot@lists.denx.de
    Reviewed-by: Daniel Schwierzeck
    Tested-by: Daniel Schwierzeck

    Paul Burton
     

23 Jul, 2017

4 commits

  • It is annoying to have to set up and maintain two sets of toolchains, one
    for buildman and one for moveconfig.

    Adjust moveconfig to make use to buildman's toolchains. This should make
    things easier.

    One missing feature is the ability to specify the toolchain on the command
    line with a special environment variable, e.g. CROSS_COMPILE_ARM. I'm not
    sure if that is useful, but if it is it could be implemented in buildman.

    Signed-off-by: Simon Glass
    Reviewed-by: Philipp Tomsich
    Tested-by: Philipp Tomsich

    Simon Glass
     
  • Add an option to specify 'all' to enable all flags. Also print an error
    if an unrecognised flag is used. At present it just prints usage
    information which is not very helpful.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • FreeBSD recently switch to it's BSDL dtc. While it support most of the
    features of the GPL one it still lacks the incbin directive.
    Add the possibility to specify which dtc we want to use for compiling dts
    and generating fit image.

    Signed-off-by: Emmanuel Vadot
    Acked-by: Simon Glass

    Emmanuel Vadot
     
  • Closing a file descriptor does not guarantee that the data has been
    successfully saved to disk, as the kernel might defer the write.

    Signed-off-by: Michael Heimpold

    Michael Heimpold
     

18 Jul, 2017

1 commit


12 Jul, 2017

21 commits

  • Change is consistent with other SOCs and it is in preparation
    for adding SOMs. SOC's related files are moved from cpu/ to
    mach-imx/.

    This change is also coherent with the structure in kernel.

    Signed-off-by: Stefano Babic

    CC: Fabio Estevam
    CC: Akshay Bhat
    CC: Ken Lin
    CC: Marek Vasut
    CC: Heiko Schocher
    CC: "Sébastien Szymanski"
    CC: Christian Gmeiner
    CC: Stefan Roese
    CC: Patrick Bruenn
    CC: Troy Kisky
    CC: Nikita Kiryanov
    CC: Otavio Salvador
    CC: "Eric Bénard"
    CC: Jagan Teki
    CC: Ye Li
    CC: Peng Fan
    CC: Adrian Alonso
    CC: Alison Wang
    CC: Tim Harvey
    CC: Martin Donnelly
    CC: Marcin Niestroj
    CC: Lukasz Majewski
    CC: Adam Ford
    CC: "Albert ARIBAUD (3ADEV)"
    CC: Boris Brezillon
    CC: Soeren Moch
    CC: Richard Hu
    CC: Wig Cheng
    CC: Vanessa Maegima
    CC: Max Krummenacher
    CC: Stefan Agner
    CC: Markus Niebel
    CC: Breno Lima
    CC: Francesco Montefoschi
    CC: Jaehoon Chung
    CC: Scott Wood
    CC: Joe Hershberger
    CC: Anatolij Gustschin
    CC: Simon Glass
    CC: "Andrew F. Davis"
    CC: "Łukasz Majewski"
    CC: Patrice Chotard
    CC: Nobuhiro Iwamatsu
    CC: Hans de Goede
    CC: Masahiro Yamada
    CC: Stephen Warren
    CC: Andre Przywara
    CC: "Álvaro Fernández Rojas"
    CC: York Sun
    CC: Xiaoliang Yang
    CC: Chen-Yu Tsai
    CC: George McCollister
    CC: Sven Ebenfeld
    CC: Filip Brozovic
    CC: Petr Kulhavy
    CC: Eric Nelson
    CC: Bai Ping
    CC: Anson Huang
    CC: Sanchayan Maity
    CC: Lokesh Vutla
    CC: Patrick Delaunay
    CC: Gary Bisson
    CC: Alexander Graf
    CC: u-boot@lists.denx.de
    Reviewed-by: Fabio Estevam
    Reviewed-by: Christian Gmeiner

    Stefano Babic
     
  • The verify_header callback in kwbimage.c only verifies v0 headers checksum.
    Running 'mkimage -l' on a v1 image gives the following misleading output:

    GP Header: Size ae000000 LoadAddr 34160600

    Implement support for v1 headers. For that, factor out the header checksum code
    to a separate main_hdr_checksum_ok() routine. This routine relies on the fact
    that the checksum field offset is the same in both v0 and v1 headers. With this
    patch applied 'mkimage -l' correctly identifies the image:

    Image Type: MVEBU Boot from sdio Image
    Image version:1
    Data Size: 398904 Bytes = 389.55 KiB = 0.38 MiB
    Load Address: 007fffc0
    Entry Point: 00800000

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

    Baruch Siach
     
  • The offset marking in kwbimage.h is inconsistent. main_hdr_v0 uses decimals,
    main_hdr_v1 uses hex without '0x' prefix, secure_hdr_v1 uses hex with '0x'
    prefix. Make all offset marks hex with '0x' prefix.

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

    Baruch Siach
     
  • Armada 38x also uses image header v1.

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

    Baruch Siach
     
  • Tom Rini
     
  • If a system module is named the same as one of those used by binman we
    currently pick the system module. Adjust the ordering so that our modules
    are chosen instead.

    The module conflict reported was 'tools' from jira-python. I cannot access
    that package to test it.

    Signed-off-by: Simon Glass
    Reported-by: Kevin Hilman
    Acked-by: Kevin Hilman

    Simon Glass
     
  • Add some tests of dtoc's functionality to make it easier to expand and
    enhance the tool.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This function uses several separate string replaces where a regular
    expression might seem more reasonable. Add a comment justifying the way it
    is currently done.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Collect the main logic of dtoc into a function and put it into
    dtb_platdata. This will allow tests to use this function instead of
    duplicating the code themselves.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Rather than using static functions within the class, move them out of the
    class. This will make it slightly easier for tests to call them.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This option is the only one actually used by the dtb_platdata class. Pass
    it explicitly to avoid needing to pass the whole option object to the
    constructor.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This conversion appears to not be needed as it does not occur in practice.
    Drop it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Unfortunately I neglected to run pylint on this tool with its initial
    submission. Fix the warnings.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • To simplify running tests we should move this class into its own file.
    This allows the tests to import it without having to import dtoc.py, which
    runs the tests.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add a description of the dtoc tool at the top of the file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This class should use the options object passed to it rather than finding
    the global one. Fix it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • By using a Kconfig parser we can find the location of each option in the
    Kconfig tree. Using the information from the database we can then
    automatically add an 'imply' option into the right place if requested by
    the user.

    Add a -a option to support adding 'imply' options. Display the location of
    any existing 'imply' option so that progress can be examined. Add a -A
    option to hide any existing 'imply' options so that already-completed
    additions need not be considered further.

    Also add documentation for this feature.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Sometimes it is useful to display CONFIG_TARGET or CONFIG_CMD configs. Add
    an option to control this.

    Also we generally ignore implying configs which affect fewer than 5
    boards. But sometimes it is useful to show those those, so add an option
    that reduces the minimum to two.

    ERRATUM configs are never useful for implying things, so ignore those.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • It is useful to be able to process only a subset of boards to save time.
    Often that subset is defined by the defconfig files in a git commit. This
    change allows things like:

    # Build the database
    ./tools.moveconfig.py -b

    # Find some implying configs
    ./tools/moveconfig.py -i CONFIG_X

    # Add some 'imply' statements to Kconfig files
    ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B

    # Reprocess the defconfig files to see if we can drop some changes
    git show --stat | ./tools/moveconfig.py -s -d -

    # Update the commit, with fewer defconfig changes
    gii commit -au

    Where the commit contains defconfig files, this will reprocess them to
    take account of the imply statements that you added.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Sometimes a node will have multiple compatible strings. Drivers may use
    one or the other so the best approach seems to be to #define them to be
    equivalent.

    Update dtoc to support this.

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

    Simon Glass
     
  • Some CONFIG options can be implied by others and this can help to reduce
    the size of the defconfig files. For example, CONFIG_X86 implies
    CONFIG_CMD_IRQ, so we can put 'imply CMD_IRQ' under 'config X86' and
    all x86 boards will have that option, avoiding adding CONFIG_CMD_IRQ to
    each of the x86 defconfig files.

    Add a -i option which searches for such options.

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

    Simon Glass