26 Feb, 2014

1 commit

  • Generate include/generated/generic-asm-offsets.h and
    include/generated/asm-offsets.h in ./Kbuild.

    This commit also changes the include guard.

    Before this commit, __ASM_OFFSETS_H__ was used for both of them.
    So we could not include generic-asm-offsets.h and asm-offsets.h
    at the same time.

    This commit renames the include guard of the former to
    __GENERIC_ASM_OFFSETS_H__.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

20 Feb, 2014

8 commits

  • tools/kernel-doc/docproc.c and tools/kernel-doc/kernel-doc are
    files imported from Linux Kernel.

    They originally resided under scripts/ directory in Linux Kernel.

    This commit moves them to the original location.

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

    Masahiro Yamada
     
  • fw_printenv is a program which mostly runs on the target Linux.

    Before switching to Kbuild, we needed to set HOSTCC at the
    command line like this:
    make HOSTCC= env

    Going forward we can cross compile it by specifying CROSS_COMPILE:
    make CROSS_COMPILE= env
    This looks more natural.

    Signed-off-by: Masahiro Yamada
    Tested-by: Gerhard Sittig

    Masahiro Yamada
     
  • - Move "easylogo", "gdb" tagets to tools/Makefile
    - Delete "gdbtools" target (same as "gdb")

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Now we are ready to switch over to real Kbuild.

    This commit disables temporary scripts:
    scripts/{Makefile.build.tmp, Makefile.host.tmp}
    and enables real Kbuild scripts:
    scripts/{Makefile.build,Makefile.host,Makefile.lib}.

    This switch is triggered by the line in scripts/Kbuild.include
    -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
    +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj

    We need to adjust some build scripts for U-Boot.
    But smaller amount of modification is preferable.

    Additionally, we need to fix compiler flags which are
    locally added or removed.

    In Kbuild, it is not allowed to change CFLAGS locally.
    Instead, ccflags-y, asflags-y, cppflags-y,
    CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
    are prepared for that purpose.

    Signed-off-by: Masahiro Yamada
    Tested-by: Gerhard Sittig

    Masahiro Yamada
     
  • This commit changes the working directory
    where the build process occurs.

    Before this commit, build process occurred under the source
    tree for both in-tree and out-of-tree build.

    That's why we needed to add $(obj) prefix to all generated
    files in makefiles like follows:
    $(obj)u-boot.bin: $(obj)u-boot

    Here, $(obj) is empty for in-tree build, whereas it points
    to the output directory for out-of-tree build.

    And our old build system changes the current working directory
    with "make -C " syntax when descending into the
    sub-directories.

    On the other hand, Kbuild uses a different idea
    to handle out-of-tree build and directory descending.

    The build process of Kbuild always occurs under the output tree.
    When "O=dir/to/store/output/files" is given, the build system
    changes the current working directory to that directory and
    restarts the make.

    Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj="
    syntax for descending into sub-directories.
    (We can write it like "make $(obj)=" with a shorthand.)
    This means the current working directory is always the top
    of the output directory.

    Signed-off-by: Masahiro Yamada
    Tested-by: Gerhard Sittig

    Masahiro Yamada
     
  • This commit merges commonly-used header include paths
    to UBOOTINCLUDE and NOSTDINC_FLAGS variables, which are placed
    at the top Makefile.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • BFD_ROOT_DIR is used only in tools/gdb/Makefile

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Before this commit, makefiles under tools/ directory
    were implemented with their own way.

    This commit refactors them by using "hostprogs-y" variable.

    Several C sources have been added to wrap other C sources
    to simplify Makefile.
    For example, tools/crc32.c includes lib/crc32.c

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

19 Feb, 2014

1 commit


13 Feb, 2014

1 commit


25 Jan, 2014

2 commits


20 Jan, 2014

1 commit


10 Jan, 2014

1 commit


09 Jan, 2014

1 commit

  • ARM64 uses the newer RELA-style relocations rather than the older REL.
    RELA relocations have an addend in the relocation struct, rather than
    expecting the loader to read a value from the location to be updated.

    While this is beneficial for ordinary program loading, it's problematic
    for U-Boot because the location to be updated starts out with zero,
    rather than a pre-relocation value. Since we need to be able to run C
    code before relocation, we need a tool to apply the relocations at
    build time.

    In theory this tool is applicable to other newer architectures (mainly
    64-bit), but currently the only relocations it supports are for arm64,
    and it assumes a 64-bit little-endian target. If the latter limitation
    is ever to be changed, we'll need a way to tell the tool what format
    the image is in. Eventually this may be replaced by a tool that uses
    libelf or similar and operates directly on the ELF file. I've written
    some code for such an approach but libelf does not make it easy to poke
    addresses by memory address (rather than by section), and I was
    hesitant to write code to manually parse the program headers and do the
    update outside of libelf (or to iterate over sections) -- especially
    since it wouldn't get test coverage on things like binaries with
    multiple PT_LOAD segments. This should be good enough for now to let
    the manual relocation stuff be removed from the arm64 patches.

    Signed-off-by: Scott Wood
    Signed-off-by: David Feng

    Scott Wood
     

06 Jan, 2014

2 commits


30 Dec, 2013

2 commits

  • When variable size SPL is used, the BL1 expects the SPL to be
    encapsulated differently: instead of putting the checksum at a fixed
    offset in the SPL blob, prepend the blob with a header including the
    size and the checksum.

    The enhancements include
    - adding a command line option, '--vs' to indicate the need for the
    variable size encapsulation
    - padding the fixed size encapsulated blob with 0xff instead of random
    memory contents
    - do not silently truncate the input file, report error instead
    - no need to explicitly closing files/freeing memory, this all happens
    on exit; removing cleanups it makes code clearer
    - profuse commenting
    - modify Makefile to allow enabling the new feature per board

    Signed-off-by: Vadim Bendebury
    Signed-off-by: Rajeshwari S Shinde
    Acked-by: Simon Glass
    Signed-off-by: Minkyu Kang

    Rajeshwari Birje
     
  • Adding the base patch for Exynos based SMDK5420.
    This shall enable compilation and basic boot support for
    SMDK5420.

    Signed-off-by: Rajeshwari S Shinde
    Signed-off-by: Akshay Saraswat
    Acked-by: Simon Glass
    Signed-off-by: Minkyu Kang

    Rajeshwari Birje
     

18 Dec, 2013

1 commit

  • According to NOTE in strtoul(3), the errno must be zeroed before strtoul()
    is called. Zero the errno. The NOTE reads as such:

    Since strtoul() can legitimately return 0 or ULONG_MAX (ULLONG_MAX for
    strtoull()) on both success and failure, the calling program should set
    errno to 0 before the call, and then determine if an error occurred
    by checking whether errno has a nonzero value after the call.

    This issue was detected on Fedora 19 with glibc 2.17 .

    Signed-off-by: Marek Vasut
    Cc: Stefano Babic
    Cc: Tom Rini

    Marek Vasut
     

16 Dec, 2013

1 commit


13 Dec, 2013

4 commits

  • We have some scripts imported from Linux Kernel:
    setlocalversion, checkstack.pl, checkpatch.pl, cleanpatch

    They are located under tools/ directory in U-Boot now.
    But they were originally located under scripts/ directory
    in Linux Kernel.

    This commit moves them to the original location.

    It is true that binutils-version.sh and dtc-version.sh
    do not originate in Linux Kernel, but they should
    be moved by analogy to gcc-version.sh.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Given a multi-file image created through the mkimage's -d option:

    $ mkimage -A x86 -O linux -T multi -n x86 -d vmlinuz:initrd.img:System.map \
    multi.img

    Image Name: x86
    Created: Thu Jul 25 10:29:13 2013
    Image Type: Intel x86 Linux Multi-File Image (gzip compressed)
    Data Size: 13722956 Bytes = 13401.32 kB = 13.09 MB
    Load Address: 00000000
    Entry Point: 00000000
    Contents:
    Image 0: 4040128 Bytes = 3945.44 kB = 3.85 MB
    Image 1: 7991719 Bytes = 7804.41 kB = 7.62 MB
    Image 2: 1691092 Bytes = 1651.46 kB = 1.61 MB

    It is possible to perform the innverse operation -- extracting any file from
    the image -- by using the dumpimage's -i option:

    $ dumpimage -i multi.img -p 2 System.map

    Although it's feasible to retrieve "data files" from image through scripting,
    the requirement to embed tools such 'dd', 'awk' and 'sed' for this sole purpose
    is cumbersome and unreliable -- once you must keep track of file sizes inside
    the image. Furthermore, extracting data files using "dumpimage" tool is faster
    than through scripting.

    Signed-off-by: Guilherme Maciel Ferreira
    Signed-off-by: Simon Glass

    Guilherme Maciel Ferreira
     
  • In order to avoid duplicating code and keep only one point of modification,
    the functions, structs and defines useful for "dumpimage" were moved from
    "mkimage" to a common module called "imagetool".

    This modification also weakens the coupling between image types (FIT, IMX, MXS,
    and so on) and image tools (mkimage and dumpimage). Any tool may initialize the
    "imagetool" through register_image_tool() function, while the image types
    register themselves within an image tool using the register_image_type()
    function:

    +---------------+
    +------| fit_image |
    +--------------+ +-----------+ | +---------------+
    | mkimage |--------> | | | |
    Signed-off-by: Simon Glass

    Guilherme Maciel Ferreira
     
  • This function should be declared static.

    Signed-off-by: Guilherme Maciel Ferreira
    Signed-off-by: Simon Glass

    Guilherme Maciel Ferreira
     

25 Nov, 2013

3 commits


22 Nov, 2013

3 commits

  • A common use-case is to build all boards for a particular SoC. This can
    be achieved by:

    ./tools/buildman/buildman -b mainline_dev tegra20

    However, when the SoC is a member of a family of SoCs, and each SoC has
    a different name, it would be even more useful to build all boards for
    every SoC in that family. This currently isn't possible since buildman's
    board selection command-line arguments are compared to board definitions
    using pure string equality.

    To enable this, compare using a regex match instead. This matches
    MAKEALL's handling of command-line arguments. This enables:

    (all Tegra)
    ./tools/buildman/buildman -b mainline_dev tegra

    (all Tegra)
    ./tools/buildman/buildman -b mainline_dev '^tegra.*$'

    (all Tegra20, Tegra30 boards, but not Tegra114)
    ./tools/buildman/buildman -b mainline_dev 'tegra[23]'

    Signed-off-by: Stephen Warren
    Acked-by: Simon Glass

    Stephen Warren
     
  • This is a trivial fix for c'n'p error.

    Signed-off-by: Andreas Bießmann
    Acked-by: Simon Glass

    Andreas Bießmann
     
  • Sometimes a commit should have notes enclosed with it rather
    than withing the cover letter -- possibly even because there
    is no cover letter. Add a 'Commit-notes' tag, similar to the
    'Series-notes' one; lines between this tag and the next END
    line are inserted in the patch right after the '---' commit
    delimiter.

    Change-Id: I01e99ae125607dc6dec08f3be8a5a0b37f0a483d
    Signed-off-by: Albert ARIBAUD
    Signed-off-by: Simon Glass
    (Updated README)

    Albert ARIBAUD
     

18 Nov, 2013

1 commit


08 Nov, 2013

1 commit

  • In-tree build:
    - Do not create a symbolic link
    from include/asm to arch/${ARCH}/include/asm
    - Add ${SRCTREE}/arch/arm/include into the header search path

    Out-of-tree build:
    - Do not create a directory ${OBJTREE}/include2
    - Do not create a symbolic link
    from ${OBJTREE}/include2/asm to ${SRCTREE}/arch/${ARCH}/include/asm
    - Add ${SRCTREE}/arch/arm/include into the header search path

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 Oct, 2013

5 commits


11 Oct, 2013

1 commit

  • When a toolchain invocation fails, an exception is thrown but not caught
    which then aborts the entire toolchain detection process. To solve this,
    request that exceptions not be thrown, since the toolchain init code
    already error-checks the command result. This solves e.g.:

    - found '/usr/bin/winegcc'
    Traceback (most recent call last):
    ...
    Exception: Error running '/usr/bin/winegcc --version'

    Change-Id: I579c72ab3b021e38b14132893c3375ea257c74f0
    Signed-off-by: Stephen Warren
    Acked-by: Simon Glass
    Signed-off-by: Simon Glass
    (formatted to 80cols)

    Stephen Warren