27 Apr, 2020

1 commit

  • On 2019.04 SPL, we enabled DM gadget driver for QM/QXP to support
    dual USB ports. The CI_UDC DM gadget driver will call init function
    inside EHCI mx6 driver, so when building SPL on iMX8QM/QXP with CI UDC
    enabled, we have to enable usb host driver as well, and this introduces
    about more than 40KB size to SPL.

    Move the common codes to a independent file, so that both host driver
    and gadget driver can call it, then decouple the host and gadget driver.

    Note: the patch only applies to ci_udc gadget DM driver. For non-DM gadget
    driver, it still depends ehci host interfaces.

    Signed-off-by: Ye Li
    Acked-by: Peng Fan
    (cherry picked from commit 1afed171a77b4c95cd4ea76f29d5a0a6bb199820)

    Ye Li
     

23 Apr, 2020

2 commits


17 Nov, 2019

1 commit

  • Right now enabling SPL_FRAMEWORK will also enable it for the TPL in all
    cases, making the TPL bigger. There may be cases where the TPL is really
    size constrained due to its underlying ram size.

    Therefore introduce a new TPL_FRAMEWORK option and make the relevant
    conditionals check for both. The default is set to "y if SPL_FRAMEWORK"
    to mimic the previous behaviour where the TPL would always get the
    SPL framework if it was enabled in SPL.

    Signed-off-by: Heiko Stuebner
    Reviewed-by: Kever Yang

    Heiko Stuebner
     

07 Nov, 2019

1 commit

  • Add support for USB3 host and gadget driver. This is a direct sync of
    Linux kernel Cadence USB stack that from v5.4-rc1 release.
    Driver has been modified so that it compiles without errors against
    U-Boot code base.
    Features not required for U-Boot such as scatter-gather DMA and OTG
    interrupt handling has been dropped.

    Signed-off-by: Jean-Jacques Hiblot
    [jjhiblot@ti.com: Add PHY support]
    Signed-off-by: Vignesh Raghavendra

    Vignesh Raghavendra
     

15 Oct, 2019

1 commit

  • At present these two sections of code are linked together into a single
    2KB chunk in a single file. Some Intel SoCs like to have a FIT (Firmware
    Interface Table) in the ROM and the pointer for this needs to go at
    0xffffffc0 which is in the middle of these two sections.

    Make use of the new 'reset' entry and change the existing 16-bit entry to
    include just the 16-bit data.

    Signed-off-by: Simon Glass

    Simon Glass
     

08 May, 2019

2 commits

  • At present we support having 16-bit init be in SPL or U-Boot proper, but
    not TPL. Add support for this so that TPL can boot.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • At present only OF_SEPARATE is considered valid for building a device-tree
    file in SPL. However sandbox uses OF_HOSTFILE instead. Update the logic to
    handle this and make it easier to understand.

    Note that the new logic is not quite the same as the old logic. It was
    previously assumed that checking for:

    $(CONFIG_$(SPL_TPL_)OF_CONTROL)
    $(CONFIG_OF_SEPARATE)
    $(CONFIG_$(SPL_TPL_)OF_PLATDATA)

    producing 'yy' meant that the first two were 'y' and the last was empty.
    Strictly speaking it would be possible for any two of the three to be 'y'
    and still yield the same result. However, that was not the intention of
    the new logic, since OF_PLATDATA always ensures that no device-tree file
    is included. So in effect the new logic is the same, with the addition of
    OF_HOSTFILE as an option for OP_SEPARATE.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     

09 Apr, 2019

1 commit


21 Mar, 2019

1 commit


27 Jan, 2019

2 commits

  • Make use of "IMAGE_MAX_SIZE" and "IMAGE_TEXT_BASE" rather than
    CONFIG_SPL_MAX_SIZE and CONFIG_SPL_TEXT_BASE. This lets us re-use the
    same script for both SPL and TPL. Add logic to scripts/Makefile.spl to
    pass in the right value when preprocessing the script.

    Cc: Stefano Babic
    Cc: Fabio Estevam
    Cc: Jagan Teki
    Cc: Maxime Ripard
    Cc: Andreas Bießmann
    Cc: Philipp Tomsich
    Cc: Michal Simek
    Cc: Daniel Schwierzeck
    Cc: York Sun
    Cc: Bin Meng
    Cc: Heiko Schocher
    Cc: Adam Ford
    Signed-off-by: Tom Rini
    Reviewed-by: Daniel Schwierzeck
    Tested-by: Daniel Schwierzeck
    Tested-by: Adam Ford #da850evm & omap3_logic_somlv
    Reviewed-by: Simon Goldschmidt

    Tom Rini
     
  • Rather than checking for CONFIG_TPL_BUILD and then re-defining
    CONFIG_SPL_TEXT_BASE make use of CONFIG_TPL_TEXT_BASE directly.

    Cc: York Sun
    Cc: Po Liu
    Cc: Qiang Zhao
    Cc: Timur Tabi
    Signed-off-by: Tom Rini

    Tom Rini
     

24 Jan, 2019

1 commit


11 Jan, 2019

1 commit


13 Dec, 2018

1 commit

  • The function part_init() will only be built when we have both
    CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set. Protect the call to
    this function with both of these tests now.

    Cc: Simon Glass
    Cc: Philipp Tomsich
    Cc: Michal Simek
    Cc: York Sun
    Cc: Prabhakar Kushwaha
    Cc: Mingkai Hu
    Cc: Stefan Roese
    Cc: Marek Behún
    Cc: Vanessa Maegima
    Cc: Eugen Hristev
    Cc: Adam Ford
    Cc: Jagan Teki
    Cc: Tom Warren
    Cc: Stephen Warren
    Cc: Vitaly Andrianov
    Signed-off-by: Tom Rini
    Reviewed-by: Simon Glass

    Tom Rini
     

29 Nov, 2018

1 commit


09 Oct, 2018

2 commits


11 Sep, 2018

1 commit


15 Jun, 2018

1 commit

  • The value of PMUFW_INIT_FILE is prefixed with "$(srctree)/", thus
    forcing it to be a relative path inside the U-Boot source tree. Since
    the PMUFW is a binary file generated outside of U-Boot, the PMUFW
    binary must be copied inside the U-Boot source tree before the
    build.

    This generates a few problems:

    * if the source tree is shared among different out-of-tree builds,
    they will pollute (and potentially corrupt) each other
    * the source tree cannot be read-only
    * any buildsystem must add a command to copy the PMUFW binary
    * putting an externally-generated binary in the source tree is ugly
    as hell

    Avoid these problems by accepting an absolute path for
    PMUFW_INIT_FILE. This would be as simple as removing the "$(srctree)/"
    prefix, but in order to keep backward compatibility we rather use the
    shell and readlink to get the absolute path even when starting from a
    relative path.

    Since 'readlink -f' produces an empty string if the file does not
    exist, we also add a check to ensure the file configured in
    PMUFW_INIT_FILE exists. Otherwise the build would exit successfully,
    but produce a boot.bin without PMUFW as if PMUFW_INIT_FILE were empty.

    Tested in the 12 possible combinations of:
    - PMUFW_INIT_FILE empty, relative, absolute, non-existing
    - building in-tree, in subdir, in other directory

    Signed-off-by: Luca Ceresoli
    Cc: Michal Simek
    Cc: Simon Glass
    Cc: Emmanuel Vadot
    Signed-off-by: Michal Simek

    Luca Ceresoli
     

04 Jun, 2018

1 commit

  • When building compressed (lzop, gzip) multi-dtb fit images, the
    compression tool may embed the time or umask in the image.

    Work around this by manually setting the time of the source file using
    SOURCE_DATE_EPOCH and a hard-coded 0600 umask.

    With gzip, this could be accomplished by using -n/--no-name, but lzop
    has no current workaround:

    https://bugs.debian.org/896520

    Signed-off-by: Vagrant Cascadian

    Vagrant Cascadian
     

09 May, 2018

1 commit


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

15 Apr, 2018

1 commit

  • The current makefile logic disables creation of the
    SPL.log/u-boot-ivt.img.log etc. files when V=1 is given on the command
    line, the rationale presumably being that the user wants and gets the
    information on the console.

    However, from general principles, I don't think a higher V= level
    should affect which build artifacts get generated (and certainly
    shouldn't produce fewer). Concretely, it's also a problem that when
    doing a V=1 build in a terminal, the relevant HAB blocks lines easily
    drown in all the other V=1 output.

    Moreover, build systems such as Yocto by default pass V=1, so in that
    case the information gets hidden away in the do_compile log file, making
    it nigh impossible to create a recipe for creating signed U-boot images
    - I don't want to disable V=1, because having verbose output in the log
    file is valuable when things go wrong, but OTOH trying to go digging in
    the do_compile log file (and getting exactly the right lines) is not
    pleasant to even think about.

    So change the logic so that for V=0, the mkimage output is redirected
    to MKIMAGEOUTPUT (which is also the current behaviour), while for any
    other value of V, we _additionally_ write the information to make's
    stdout, whatever that might be.

    Signed-off-by: Rasmus Villemoes
    Tested-by: Breno Lima

    Rasmus Villemoes
     

15 Feb, 2018

1 commit

  • With commit 9bd76b807636 ("spl: make CONFIG_OF_EMBED pass dts through
    fdtgrep"), CONFIG_SPL_MULTI_DTB_FIT has been broken because
    cmd_fdtgrep was now unknown in scripts/Makefile.spl after moving
    it to dts/Makefile. This bug has been introduced with v2018.01.

    This patch moves cmd_fdtgrep from dts/Makefile to scripts/Makefile.lib
    and includes scripts/Makefile.lib in scripts/Makefile.spl.

    Fixes: 9bd76b807636 ("spl: make CONFIG_OF_EMBED pass dts through fdtgrep")
    Reported-by: Lokesh Vutla
    Signed-off-by: Simon Goldschmidt
    Reviewed-by: Lokesh Vutla

    Simon Goldschmidt
     

30 Nov, 2017

1 commit

  • Building spl with CONFIG_OF_EMBED enabled results in an error message
    on my board: "SPL image too big". This is because the fdtgrep build
    step is only executed for CONFIG_OF_SEPARATE.

    Fix this by moving the fdtgrep build step ('cmd_fdtgreo') from
    scripts/Makefile.spl to dts/Makefile so that the reduced dtb is
    available for all kinds of spl builds.

    The resulting variable name for the embedded device tree blob changes,
    too, which is why common.h and fdtdec.c have tiny changes.

    Signed-off-by: Simon Goldschmidt
    Reviewed-by: Simon Glass

    Goldschmidt Simon
     

28 Nov, 2017

1 commit

  • The patch is adding external pmufw "Platform Management Unit firmware"
    to boot.bin image. Boot.bin is a Xilinx format which bootrom is capable
    to read and boot the system. pmufw is copied to the header data section
    follows by u-boot-spl.bin. pmufw is consumed by PMU unit (Microblaze)
    and SPL runs on a53-0.

    This is generated command line when PMUFW_INIT_FILE is setup.

    ./tools/mkimage -T zynqmpimage -R ./"" -n
    ./"board/xilinx/zynqmp/pmufw.bin" -d spl/u-boot-spl.bin spl/boot.bin

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

    Michal Simek
     

17 Nov, 2017

2 commits

  • Currently, pylibfdt is always compiled if swig is installed on your
    machine. It is really annoying because most of targets (excepts
    x86, sunxi, rockchip) do not use dtoc or binman.

    "checkbinman" and "checkdtoc" are wrong. It is odd that the final
    build stage checks if we have built necessary tools. If your platform
    depends on dtoc/binman, you must be able to build pylibfdt. If swig
    is not installed, it should fail immediately.

    I added PYLIBFDT, DTOC, BINMAN entries to Kconfig. They should be
    property select:ed by platforms that need them. Kbuild will descend
    into scripts/dtc/pylibfdt/ only when CONFIG_PYLIBFDT is enabled.

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

    Masahiro Yamada
     
  • The pylibfdt is used by dtoc (and, indirectly by binman), but there
    is no reason why it must be generated in the tools/ directory.

    Recently, U-Boot switched over to the bundled DTC, and the directory
    structure under scripts/dtc/ now mirrors the upstream DTC project.
    So, scripts/dtc/pylibfdt is the best location.

    I also rewrote the Makefile in a cleaner Kbuild style.

    The scripts from the upstream have been moved as follows:

    lib/libfdt/pylibfdt/setup.py -> scripts/dtc/pylibfdt/setup.py
    lib/libfdt/pylibfdt/libfdt.i -> scripts/dtc/pylibfdt/libfdt.i_shipped

    The .i_shipped is coped to .i during building because the .i must be
    located in the objtree when we build it out of tree.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

06 Oct, 2017

1 commit

  • u-boot can be embedded within a FIT image with multiple DTBs. It then
    selects at run-time which one is best suited for the platform.
    Use the same principle here for the SPL: put the DTBs in a FIT image,
    compress it (LZO, GZIP, or no compression) and append it at the end of the
    SPL.

    Signed-off-by: Jean-Jacques Hiblot
    [trini: Move default y of SPL_MULTI_DTB_FIT_DYN_ALLOC to it being the
    default choice if SYS_MALLOC_F, drop spl.h include from lib/fdtdec.c
    it's unused.]
    Signed-off-by Tom Rini

    Jean-Jacques Hiblot
     

15 Sep, 2017

1 commit

  • The filename of the auto-generated file is the same as the file that
    includes it. Even though the form is in the generated/ subdirectory, this
    could be confused.

    Rename the generated file to something that makes it clear it is
    auto-generated.

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

    Simon Glass
     

20 Aug, 2017

1 commit

  • 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
     

15 Aug, 2017

1 commit


13 Aug, 2017

3 commits

  • Now that we have split up SPL_LDSCRIPT into a SPL and TPL variant and
    have started to use the TPL-variant for the RK3368, it's time to clean
    up behind ourselves: move both variants into Kconfig and remove them
    from the whitelist.

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

    Philipp Tomsich
     
  • For the bringup of the RK3368, we need to support TPL and SPL running
    from different addresses... which requires both stages to use a
    distinct TEXT_BASE.

    This commit adds support for having a separate LDSCRIPT for TPL (which
    is expected to make use of the TPL_MAX_SIZE define) and for having a
    the option of defining TPL_TEXT_BASE and having the TPL stage linked
    against this address.

    Note that the handling of the TEXT_BASE is designed to not interfere
    with the previous assumption that SPL_TEXT_BASE should be used for TPL
    as well, unless TPL_TEXT_BASE is defined. For this reason, the test
    in Makefile.spl uses the following (seemingly redundant checks):
    1. looks for $(SPL_TPL_)TEXT_BASE
    2. looks for SPL_TEXT_BASE (even when building in TPL)

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

    Philipp Tomsich
     
  • For the RK3368, we want to use OF_PLATDATA in TPL, but full OF_CONTROL
    in SPL: this requires the introduction of a new family of
    configuration options to decouple SPL_OF_CONTROL and SPL_OF_PLATDATA
    from TPL.

    Consequently, Makefile.spl needs to be adjusted to test for these
    configuration items through the $(SPL_TPL_) macro instead of
    hard-coding the SPL variant.

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

    Philipp Tomsich
     

03 Jun, 2017

1 commit

  • This is needed by binman and dtoc, so if those are being used, check that
    the library is present and complain if not. Make sure that any error
    appears on stderr so that buildman notices it.

    This means that the fallback library (which uses fdtget) will not be used
    anymore and swig will need to be installed to use binman / dtoc.

    This affects any board which uses binman (currently sunxi and x86) or dtoc
    (anything that uses CONFIG_SPL_OF_PLATDATA, currently some rockchip
    boards).

    Signed-off-by: Simon Glass

    Simon Glass
     

18 May, 2017

1 commit

  • 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
     

12 May, 2017

1 commit

  • When OF control is enabled for the SPL stage, nodes are removed from
    the DTB to reduce its size. While /chosen is kept, /config is removed.

    There's no reason why /chosen should be kept over /config (and as we
    would like to put properties into /config that control the SPL stage),
    we add '/config' to the list of nodes to be retained for the SPL stage.

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

    Philipp Tomsich
     

10 Apr, 2017

1 commit

  • Since Binutils 1a9ccd70f9a7[1] u-boot will not link targets that set
    CONFIG_SYS_TEXT_BASE=0 with the following error:

    LD u-boot
    arm-linux-gnueabi-ld.bfd: u-boot: Not enough room for program headers, try
    linking with -N
    arm-linux-gnueabi-ld.bfd: final link failed: Bad value

    The issue can be reproduced with the bad binutils and the rock2_defconfig
    target.

    This issue was also encountered by the powerpc kernel[2], with the fix
    being to pass --no-dynamic-linker for linkers newer than 2.26 when this
    flag was introduced. The option tells ld that the PIE or shared lib does
    not need loaded program headers.

    Ubuntu Zesty's Binutils 2.27.51.20161202 hits this error.

    [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=1a9ccd70f9a7
    [2] https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/commit/?h=next&id=ff45000fcb56b5b0f1a14a865d3541746d838a0a

    Signed-off-by: Joel Stanley
    [AF: Apply to LDFLAGS_$(SPL_BIN) as well, suggested by Tom Rini]
    Signed-off-by: Andreas Färber

    Joel Stanley