summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.spl
Commit message (Collapse)AuthorAgeFilesLines
* sunxi: Use mkimage for SPL boot image generationAndre Przywara2021-01-111-4/+4
| | | | | | | | | | | | | Switch the SPL boot image generation from using mksunxiboot to the new sunxi_egon format of mkimage. Verified to create identical results for all 152 Allwinner boards. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Samuel Holland <samuel@sholland.org>
* dtoc: Rename dt-platdata.c to dt-plat.cSimon Glass2021-01-051-1/+1
| | | | | | | Use this new name to be consistent with the rest of U-Boot, which talks about 'plat' for the platform data, which is what this file holds. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Invoke dtoc only onceSimon Glass2021-01-051-12/+9
| | | | | | | | | | | | | | | Update the Makefile to run dtoc only once, generating all required files. This saves time since there is a lot of processing in each invocation of dtoc. We already have a variable for the object files to build, so use that instead of repeating the same filenames. Add a C version of this also, for the same reason. This makes it easier to add new C files (generated by dtoc) to the build later, as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Use common args for dtocSimon Glass2021-01-051-2/+5
| | | | | | | At present the dtoc commmand line is repeated twice in the Makefile. Use a variable to avoid this, so it is easier to add more conditional arguments. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Tidy up SPL dtb productionSimon Glass2021-01-051-3/+4
| | | | | | | | | | | | | | Use the SPL_NAME variable to simplify the rules. Drop the SPL targets clean-files since the SPL and TPL dts/ directories are removed by existing rules. Move the SPL rules into a new spl_dtbs to avoid the complicated $(if) construct. Also drop unused pieces from the 'targets' variable. With this, SPL and TPL have separate dtbs which respect the various u-boot,dm-spl / u-boot,dm-tpl tags. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Build SPL dtbs in the spl/ directorySimon Glass2021-01-051-1/+1
| | | | | | | | | Rather than putting these in the top-level dts/ directory (which is intended for U-Boot proper), put them in the correct subdirectory for SPL (either spl/ or tpl/). This is where other SPL targets are kept, so this is more consistent. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Build a separate .dtb for TPLSimon Glass2021-01-051-1/+3
| | | | | | | | | | | | | | | | | At present both SPL and TPL use the same devicetree binary. While there is logic to run fdtgrep separately on each one, it does not actually happen. Add a new TPL rule and use that instead. Make this rule conditional on there actually being a TPL. Do the same for SPL for consistency. Note that the SPL and TPL dtbs are build by a Makefule rule used for U-Boot proper. This is the 'dtbs' target in dts/Makefile. So the check for CONFIG_TPL_BUILD in cmd_fdtgrep never actually works at present. We don't support CONFIG_OF_EMBED for TPL at present. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Generate a symbol file for u-boot-splSimon Glass2020-10-291-1/+6
| | | | | | | Add a rule to generate u-boot-spl.sym so that pytest can discover the available unit tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: Build tests for SPLSimon Glass2020-10-291-0/+1
| | | | | | | We want to run unit tests in SPL. Add a new Kconfig to control this and enable it for sandbox_spl Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Rename ALL-y to INPUTS-ySimon Glass2020-07-281-12/+12
| | | | | | | | | | | When binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs. Rename the variable to indicate this, and add a new 'inputs' target. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* kbuild: spl: Add shrunk arch-dtbs to targets listJan Kiszka2020-05-141-1/+4
| | | | | | | | This avoids needless rebuilding. Fixes: 2f57c95100f2 ("spl: dm: Make it possible for the SPL to pick its own DTB from a FIT") CC: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* kbuild: spl: Fix parallel buildJan Kiszka2020-05-141-1/+1
| | | | | | | | | | The dts dir must exists when running this rule. That missing dependency broke e.g. "make -j" for the am65x targets. Fixes: 2f57c95100f2 ("spl: dm: Make it possible for the SPL to pick its own DTB from a FIT") CC: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* kbuild: SPL/TPL: generate separate asm-offsets.h for SPL and TPLMasahiro Yamada2020-04-281-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently generic-asm-offsets.h and asm-offsets.h are generated based on U-Boot proper config options. The same asm-offsets headers are used for building U-Boot SPL/TPL, which causes potential offset mismatch if U-Boot proper has different config options from U-Boot SPL/TPL. This commit adds: spl/include/generated/(generic-)asm-offsets.h tpl/include/generated/(generic-)asm-offsets.h spl/include/generated/(generic-)asm-offsets.h is generated if CONFIG_SPL=y, and included when building SPL. tpl/include/generated/(generic-)asm-offsets.h is generated if CONFIG_TPL=y, and included when building TPL. They are created before Kbuild descends into SPL/TPL object directories and builds $(obj)/dts/dt-platdata.o because $(obj)/dts/dt-platdata.c includes a bunch of headers. Prepend -I$(obj)/include to $(UBOOTINCLUDE) so (generic-)asm-offsets.h is searched in {spl,tpl}/include/generated/. Requested-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* kbuild: add FORCE to dependency of $(obj)/dts/dt-platdata.oMasahiro Yamada2020-04-241-2/+3
| | | | | | | | | if_changed must have FORCE as a prerequisite. Add $(obj)/dts/dt-platdata.o to 'targets' so that the corresponding .cmd file is included. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
* kconfig / kbuild: Re-sync with Linux 4.19Tom Rini2020-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Align Kconfig and Kbuild logic to Linux 4.19 release with minimal impact on files outside of this scope. Our previous Kconfig sync was done by commit 5972ff077e0f ("kconfig / kbuild: re-sync with Linux 4.18"). In this particular re-sync in order to keep clang support working a number of related changes needed to be pulled in that had been missed previously. Not all of these changes we easily traceable and so have been omitted from the list below. The imported Linux commits are: [From prior to v4.18] 9f3f1fd29976 kbuild: Add __cc-option macro d7f14c66c273 kbuild: Enable Large File Support for hostprogs 6d79a7b424a5 kbuild: suppress warnings from 'getconf LFS_*' 24403874316a Shared library support 86a9df597cdd kbuild: fix linker feature test macros when cross compiling with Clang 0294e6f4a000 kbuild: simplify ld-option implementation [From v4.18 to v4.19] 96f14fe738b6 kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS 10844aebf448 kbuild: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS b90a368000ab kbuild: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS 8377bd2b9ee1 kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS f92d19e0ef9b kbuild: Use HOST*FLAGS options from the command line 4ab3b80159d4 kconfig: check for pkg-config on make {menu,n,g,x}config 693359f7ac90 kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE f60b992e30ff kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags) 2fb9279f2c3e kbuild: change ld_flags to contain LDFLAGS_$(@F) c931d34ea085 arm64: build with baremetal linker target instead of Linux when available 5accd7f3360e kconfig: handle format string before calling conf_message_callback() a2ff4040151a kconfig: rename file_write_dep and move it to confdata.c 0608182ad542 kconfig: split out useful helpers in confdata.c adc18acf42a1 kconfig: remove unneeded directory generation from local*config 79123b1389cc kconfig: create directories needed for syncconfig by itself 16952b77d8b5 kconfig: make syncconfig update .config regardless of sym_change_count d6c6ab93e17f kbuild: remove deprecated host-progs variable 56869d45e364 kconfig: fix the rule of mainmenu_stmt symbol c151272d1687 kconfig: remove unused sym_get_env_prop() function 1880861226c1 kconfig: remove P_ENV property type e3fd9b5384f3 scripts/dtc: consolidate include path options in Makefile 4bf6a9af0e91 kconfig: add build-only configurator targets f1575595d156 kconfig: error out when seeing recursive dependency 5e8c5299d315 kconfig: report recursive dependency involving 'imply' f498926c47aa kconfig: improve the recursive dependency report 98a4afbfafd2 kconfig: fix "Can't open ..." in parallel build 9a9ddcf47831 kconfig: suppress "configuration written to .config" for syncconfig 87a32e624037 kbuild: pass LDFLAGS to recordmcount.pl d503ac531a52 kbuild: rename LDFLAGS to KBUILD_LDFLAGS 217c3e019675 disable stringop truncation warnings for now bc8d2e20a3eb kconfig: remove a spurious self-assignment fd65465b7016 kconfig: do not require pkg-config on make {menu,n}config 5a4630aadb9a ftrace: Build with CPPFLAGS to get -Qunused-arguments Note that this adds new cleanup work to do in that we should adapt the shared library support we have to what is now upstream. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
* spl: separate SPL_FRAMEWORK config for spl and tplHeiko Stuebner2019-11-171-0/+4
| | | | | | | | | | | | | | 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 <heiko.stuebner@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* usb: Add Cadence USB3 host and gadget driverVignesh Raghavendra2019-11-071-0/+1
| | | | | | | | | | | | | 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> [jjhiblot@ti.com: Add PHY support] Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
* binman: x86: Separate out 16-bit reset and init codeSimon Glass2019-10-151-6/+16
| | | | | | | | | | | | 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 <sjg@chromium.org>
* x86: Allow 16-bit init to be in TPLSimon Glass2019-05-081-1/+9
| | | | | | | | 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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* spl: Allow sandbox to build a device-tree fileSimon Glass2019-05-081-1/+13
| | | | | | | | | | | | | | | | | | | | | | | 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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Makefile.spl: Move generated AT91SAM NAND image boot.bin to spl directoryStefan Roese2019-04-091-3/+3
| | | | | | | | | | | | | | This patch moves the AT91SAM NAND booting SPL image "boot.bin" which includes the ECC values from the root directory into the spl directory, where all SPL related images are located. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Andreas Bießmann <andreas@biessmann.org> Cc: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Heiko Schocher <hs@denx.de> Tested on the taurus board: Tested-by: Heiko Schocher <hs@denx.de>
* ARM: socfpga: Build sfp image only for Gen5 and Arria10 devicesDalon Westergreen2019-03-211-1/+1
| | | | | | | The sfp file is only valid for Gen5 (Cyclone5 & Arria5) and Arria10 devices. The file should only be built for these devices. Signed-off-by: Dalon Westergreen <dalon.westergreen@intel.com>
* linker: Modify linker scripts to be more genericTom Rini2019-01-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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 <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Jagan Teki <jagan@openedev.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Andreas Bießmann <andreas@biessmann.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: York Sun <york.sun@nxp.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Adam Ford <aford173@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Adam Ford <aford173@gmail.com> #da850evm & omap3_logic_somlv Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* PowerPC: Stop re-using CONFIG_SPL_TEXT_BASE for TPLTom Rini2019-01-261-6/+1
| | | | | | | | | | | 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 <york.sun@nxp.com> Cc: Po Liu <po.liu@nxp.com> Cc: Qiang Zhao <qiang.zhao@nxp.com> Cc: Timur Tabi <timur@tabi.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* arm64: zynqmp: Align u-boot-spl.bin for boot.bin creationMichal Simek2019-01-241-1/+4
| | | | | | | | | | Bootrom is not capable to work with non align bootloader partition that's why it is necessary to align it before boot.bin creation. The patch is creating new spl/u-boot-spl-align.bin which is used only for boot.bin. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as CONFIG_SPL_USB_GADGETJean-Jacques Hiblot2019-01-101-1/+1
| | | | | | | The SPL option for USB gadget should be named after the option for u-boot (CONFIG_USB_GADGET) Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
* blk: Rework guard around part_init callTom Rini2018-12-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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 <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: York Sun <york.sun@nxp.com> Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Cc: Mingkai Hu <mingkai.hu@nxp.com> Cc: Stefan Roese <sr@denx.de> Cc: Marek Behún <marek.behun@nic.cz> Cc: Vanessa Maegima <vanessa.maegima@nxp.com> Cc: Eugen Hristev <eugen.hristev@microchip.com> Cc: Adam Ford <aford173@gmail.com> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: MediaTek: add MTK boot header generation to mkimageRyder Lee2018-11-281-0/+11
| | | | | | | | This patch adds support for MTK boot image generation. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* fdt: Allow C++ comments in link scripts and DT filesSimon Glass2018-10-091-1/+1
| | | | | | | | At present // in a device-tree file or link script causes a warning. But this is used in the standard license header. Update the compiler flags to use C99, which permits this. Signed-off-by: Simon Glass <sjg@chromium.org>
* Makefile: Add a warning if SPL/TPL cannot be builtSimon Glass2018-10-091-0/+7
| | | | | | | | At present the build fails in strange ways if CONFIG_SPL is defined by CONFIG_SUPPORT_SPL is not. Add a warning for this case as it can be very confusing to debug. Signed-off-by: Simon Glass <sjg@chromium.org>
* armv8: K3: am654: Add support for generating build targetsLokesh Vutla2018-09-111-0/+9
| | | | | | | | | Update Makefile to generate - tispl.bin: First stage bootloader on ARMv8 core - u-boot.img: Second stage bootloader on ARMv8 core. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* arm64: zynqmp: accept an absolute path for PMUFW_INIT_FILELuca Ceresoli2018-06-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <luca@lucaceresoli.net> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Simon Glass <sjg@chromium.org> Cc: Emmanuel Vadot <manu@bidouilliste.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* Set time and umask on multi-dtb fit images to ensure reproducibile builds.Vagrant Cascadian2018-06-041-0/+4
| | | | | | | | | | | | | | | 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@debian.org>
* spl: socfpga: Generate Arria10 SFP header V1Marek Vasut2018-05-081-0/+4
| | | | | | | | Generate SoCFPGA boot header version 1 instead of version 0 for Arria10. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Chin Liang See <chin.liang.see@intel.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-3/+1
| | | | | | | | | | | | | | | | | | | | 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 <trini@konsulko.com>
* Makefile: always preserve output for images that can contain HAB BlocksRasmus Villemoes2018-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <rasmus.villemoes@prevas.dk> Tested-by: Breno Lima <breno.lima@nxp.com>
* spl: unbreak CONFIG_SPL_MULTI_DTB_FIT after fixing CONFIG_OF_EMBEDSimon Goldschmidt2018-02-141-0/+2
| | | | | | | | | | | | | | | 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 <lokeshvutla@ti.com> Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
* spl: make CONFIG_OF_EMBED pass dts through fdtgrepGoldschmidt Simon2017-11-291-18/+2
| | | | | | | | | | | | | | | | 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 <sgoldschmidt@de.pepperl-fuchs.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: mkimage: Extend mkimage to also include pmufwMichal Simek2017-11-281-1/+2
| | | | | | | | | | | | | | | | 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 <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* pylibfdt: compile pylibfdt only when dtoc/binman is necessaryMasahiro Yamada2017-11-171-13/+2
| | | | | | | | | | | | | | | | | | 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 <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefileMasahiro Yamada2017-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | 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 <yamada.masahiro@socionext.com>
* spl: dm: Make it possible for the SPL to pick its own DTB from a FITJean-Jacques Hiblot2017-10-061-1/+34
| | | | | | | | | | | | | | 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 <jjhiblot@ti.com> [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 <trini@konsulko.com>
* dtoc: Rename the auto-generated dt-structs.h fileSimon Glass2017-09-151-2/+3
| | | | | | | | | | | | 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 <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
* Makefile: honor PYTHON configuration properlyClément Bœsch2017-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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 <jsg@jsg.id.au>
* Move environment files from common/ to env/Simon Glass2017-08-151-2/+2
| | | | | | | | | About a quarter of the files in common/ relate to the environment. It seems better to put these into their own subdirectory and remove the prefix. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: Kconfig: migrate $(SPL_TPL_)LDSCRIPT to KconfigPhilipp Tomsich2017-08-131-1/+8
| | | | | | | | | | 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 <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: allow a separate TEXT_BASE, LDSCRIPT and MAX_SIZE for TPLPhilipp Tomsich2017-08-131-2/+8
| | | | | | | | | | | | | | | | | | | | | 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 <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: dm: Kconfig: split OF_CONTROL and OF_PLATDATA between SPL and TPLPhilipp Tomsich2017-08-131-2/+2
| | | | | | | | | | | | | | | 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 <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* fdt: Makefile: Build python libfdt library if neededSimon Glass2017-06-021-4/+13
| | | | | | | | | | | | | | | 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 <sjg@chromium.org>
* sunxi: Store the device tree name in the SPL headerSiarhei Siamashka2017-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 <siarhei.siamashka@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>