09 Jan, 2019

1 commit


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
     

07 Apr, 2017

1 commit

  • Introduce a new sunxi-spl-with-ecc.bin image with already the right header,
    ECC, randomizer and padding for the BROM to be able to read it.

    It needs to be flashed using a raw access to the NAND so that the
    controller doesn't change a thing to it, since we already have all the
    right parameters.

    Signed-off-by: Maxime Ripard
    Acked-by: Boris Brezillon
    Reviewed-by: Heiko Schocher

    Maxime Ripard
     

06 Apr, 2017

1 commit

  • At present we have SPL_ which can be used in Makefiles to select between
    normal and SPL CONFIGs like this:

    obj-$(CONFIG_$(SPL_)DM) += core/

    When TPL is being built, SPL_ has the value 'SPL' which is generally a
    good idea since they tend to follow each other. But in extreme situations
    we may want to distinugish between SPL and TPL. For example we may not
    want to enable CONFIG_DM with TPL.

    Add a new SPL_TPL_ variable which is set to either empty (for U-Boot
    proper), 'SPL' or 'TPL'. This may prove useful with TPL-specific options.

    Signed-off-by: Simon Glass

    Simon Glass
     

17 Mar, 2017

1 commit

  • Right now the u-boot,dm-pre-reloc flag will make each marked node
    always appear in both spl and tpl. But systems needing an additional
    tpl might have special constraints for each, like the spl needing to
    be very tiny.

    So introduce two additional flags to mark nodes for only spl or tpl
    environments and introduce a function dm_fdt_pre_reloc to automate
    the necessary checks in code instances checking for pre-relocation
    flags.

    The behaviour of the original flag stays untouched and still marks
    a node for both spl and tpl.

    Signed-off-by: Heiko Stuebner
    Reviewed-by: Simon Glass
    Tested-by: Kever Yang

    Heiko Stübner
     

06 Feb, 2017

3 commits


03 Jan, 2017

1 commit

  • To being able to sign created binaries, we need to know the HAB Blocks
    for that image. Especially for the imximage type the HAB Blocks are
    only available during creation of the image. We want to preserve the
    information until we get to sign the files.
    In the verbose case we still get them printed out instead of writing
    to log files.

    Cc: sbabic@denx.de

    v2-Changes:
    - No usage of MKIMAGEOUTPUT_$(@F) macro.
    - Predefine default value /dev/null in every involved Makefile.

    Signed-off-by: Sven Ebenfeld
    Reviewed-by: George McCollister
    Tested-by: George McCollister

    Sven Ebenfeld
     

29 Nov, 2016

2 commits

  • Introduce USB Gadget config option. This allows to combine Makefile
    entries for SPL_USBETH_SUPPORT and SPL_DFU_SUPPORT.

    Signed-off-by: Stefan Agner
    Acked-by: Lukasz Majewski
    Tested-by: Ravi Babu

    Stefan Agner
     
  • The DFU Kconfig menu entries should be part of the SPL
    Kconfig file. Also avoid using the top level Makefile by
    moving the config dependent build artifacts to the driver/
    and driver/usb/gadget/ Makfiles.

    With that, DFU can be built again in SPL if
    CONFIG_SPL_DFU_SUPPORT is enabled.

    Fixes: 6ad6102246d8 ("usb:gadget: Disallow DFU in SPL for now")

    Signed-off-by: Stefan Agner
    Reviewed-by: Simon Glass
    Acked-by: Lukasz Majewski

    Stefan Agner
     

15 Nov, 2016

1 commit

  • The Zynq/ZynqMP boot.bin file contains a region for register initialization
    data. Filling in proper values in this table can reduce boot time
    (e.g. about 50ms faster on QSPI boot) and also reduce the size of
    the SPL binary.

    The table is a simple text file with register+data on each line. Other
    lines are simply skipped. The file can be passed to mkimage using the
    "-R" parameter.

    It is recommended to add reg init file to board folder.
    For example:
    CONFIG_BOOT_INIT_FILE="board/xilinx/zynqmp/xilinx_zynqmp_zcu102/reg.int

    Signed-off-by: Mike Looijmans
    Signed-off-by: Michal Simek

    Mike Looijmans
     

30 Oct, 2016

1 commit


07 Oct, 2016

1 commit

  • Our build system still parses ad-hoc CONFIG options in header files
    and generates include/autoconf.mk so that Makefiles can reference
    them. This gimmick was introduced in the pre-Kconfig days and will
    be kept until Kconfig migration is completed.

    The include/autoconf.mk is generated like follows:

    [1] Preprocess include/common.h with -DDO_DEPS_ONLY and
    retrieve macros into include/autoconf.mk.tmp
    [2] Reformat include/autoconf.mk.dep into include/autoconf.mk
    with tools/scripts/define2mk.sed script
    [3] Remove include/autoconf.mk.tmp

    Here, include/autoconf.mk.tmp is similar to u-boot.cfg, which is
    also generated by preprocessing include/config.h with -DDO_DEPS_ONLY.
    In other words, there is much overlap among include/autoconf.mk and
    u-boot.cfg build rules.

    So, the idea is to split the build rule of include/autoconf.mk
    into two stages. The first preprocesses headers into u-boot.cfg.
    The second parses the u-boot.cfg into include/autoconf.mk. The
    build rules of u-boot.cfg in Makefile and spl/Makefile will be gone.

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

    Masahiro Yamada
     

28 Sep, 2016

1 commit

  • Traditionally the DFU support is available only
    as part 2nd stage boot loader(u-boot) and DFU
    is not supported in SPL.

    The SPL-DFU feature is useful for boards which
    does not have MMC/SD, ethernet boot mechanism
    to boot the board and only has USB inteface.

    This patch add DFU support in SPL with RAM
    memory device support to load and execute u-boot.
    And then leverage full functionality DFU in
    u-boot to flash boot inital binary images to
    factory or bare-metal boards to memory devices
    like SPI, eMMC, MMC/SD card using USB interface.

    This SPL-DFU support can be enabled through
    Menuconfig->Boot Images->Enable SPL-DFU support

    Signed-off-by: Ravi Babu
    Reviewed-by: Tom Rini

    B, Ravi
     

22 Sep, 2016

2 commits

  • Prior to the previous patch, a freshly created .u-boot.cfg.cmd may not
    correctly represent all dependencies for u-boot.cfg. The previous change
    only solved this issue for fresh builds; when performing an incremental
    build, the deficient .u-boot.cfg.cmd is already present, so u-boot.cfg
    is not rebuilt, and hence .u-boot.cfg.cmd is not rebuilt with the correct
    content.

    Solve this by explicitly detecting when the dependency file .u-boot.cfg.d
    has not been integrated into .u-boot.cfg.cmd, and force u-boot.cfg to be
    rebuilt in this case by deleting it first. This is possible since
    if_changed_dep will always delete .u-boot.cfg.d when it executes
    successfully, so its presence means either that the previous build was
    made by a source tree that contained a Makefile that didn't include the
    previous patch, or that the build failed part way through executing
    if_changed_dep for u-boot.cfg. Forcing a rebuild of u-boot.cfg is required
    in the former case, and will cause no additional work in the latter case,
    since the file would be rebuilt anyway for the same reason it was being
    rebuilt by the previous build.

    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • cmd_cpp_cfg generates a dependency output, but because it's invoked using
    if_changed rather than if_changed_dep, that dependency file is ignored.
    This results in Kbuild not knowing about which files u-boot.cfg depends
    on, so it may not be rebuilt when required.

    A practical result of this is that u-boot.cfg may continue to reference
    CONFIG_ options that no longer exist in the source tree, and this can
    cause the adhoc config options check to fail.

    This change modifies Makefile to use if_changed_dep, which in turn causes
    all dependencies to be known to the next make invocation.

    Signed-off-by: Stephen Warren

    Stephen Warren
     

17 Sep, 2016

1 commit

  • At present TPL uses the same options as SPL support. In a few cases the board
    config enables or disables the SPL options depending on whether
    CONFIG_TPL_BUILD is defined.

    With the move to Kconfig, options are determined for the whole build and
    (without a hack like an #undef in a header file) cannot be controlled in this
    way.

    Create new TPL options for these and update users. This will allow Kconfig
    conversion to proceed for these boards.

    Signed-off-by: Simon Glass

    Simon Glass
     

15 Jul, 2016

3 commits


06 Jun, 2016

1 commit


24 May, 2016

1 commit


03 May, 2016

1 commit

  • dtb is already included in binary that's why there is no need to replace
    u-boot-spl.bin with u-boot-spl-dtb.bin. This is only needed for
    OF_SEPARATE is enabled. Only copy -nodtb.bin version which is straight
    output from objcopy -O binary.

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

    Michal Simek
     

08 Feb, 2016

1 commit

  • The build command of u-boot-spl.dtb is not constant, but dependent
    on CONFIG_OF_SPL_REMOVE_PROPS. Use $(call if_changed,...) so that
    the change of CONFIG_OF_SPL_REMOVE_PROPS is detected.

    Also, add tools/fdtgrep to the dependency to make sure u-boot-spl.dtb
    is generated by the up-to-date fdtgrep in case the tool is modified.

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

    Masahiro Yamada