- 22 Feb, 2018 1 commit
-
-
Stephen Warren authored
This makes incremental builds work when the only change is to a definition in a makefile. Fixes arm-software/tf-issues#551 Signed-off-by: Stephen Warren <swarren@nvidia.com>
-
- 01 Feb, 2018 12 commits
-
-
Masahiro Yamada authored
One typical usage of the pre-tool image filter is data compression, and GZIP is one of the most commonly used compression methods. I guess this is generic enough to be put in the common script instead of platform.mk. If you want to use this, you can add something like follows to your platform.mk: BL32_PRE_TOOL_FILTER := GZIP BL33_PRE_TOOL_FILTER := GZIP Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
There are cases where we want to process images before they are passed to cert_create / fiptool. My main motivation is data compression. By compressing images, we can save data storage, and possibly speed up loading images. The image verification will also get faster because certificates are generated based on compressed images. Other image transformation filters (for ex. encryption), and their combinations would be possible. So, our build system should support transformation filters in a generic manner. The choice of applied filters is up to platforms (so specified in platform.mk) To define a new filter, <FILTER_NAME>_RULE and <FILTER_NAME>_SUFFIX are needed. For example, the GZIP compression filter can be implemented as follows: ------------------------>8------------------------ define GZIP_RULE $(1): $(2) @echo " GZIP $$@" $(Q)gzip -n -f -9 $$< --stdout > $$@ endef GZIP_SUFFIX := .gz ------------------------>8------------------------ The _RULE defines how to create the target $(1) from the source $(2). The _SUFFIX defines the extension appended to the processed image path. The suffix is not so important because the file name information is not propagated to FIP, but adding a sensible suffix will be good to classify the data file. Platforms can specify which filter is applied to which BL image, like this: ------------------------>8------------------------ BL32_PRE_TOOL_FILTER := GZIP BL33_PRE_TOOL_FILTER := GZIP ------------------------>8------------------------ <IMAGE_NAME>_PRE_TOOL_FILTER specifies per-image filter. With this, different images can be transformed differently. For the case above, only BL32 and BL33 are GZIP-compressed. Nothing is done for other images. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
In the next commit, I need the image name in lowercase because output files are generally named in lowercase. Unfortunately, TOOL_ADD_IMG takes the first argument in uppercase since we generally use uppercase Make variables. make_helpers/build_macros.mk provides 'uppercase' macro to convert a string into uppercase, but 'lowercase' does not exist. We can implement it if we like, but it would be more straightforward to change the argument of TOOL_ADD_IMG. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The PHONY target "bl*" generate $(BIN) and $(DUMP), but host tools (fiptool, cert_create) only need $(BIN). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The third argument was given "true" by images, but it was moved to TOOL_ADD_PAYLOAD. No more caller of CERT_ADD_CMD_OPT uses this. So, the third argument is always empty. Remove it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Now FIP_ADD_IMG takes care of both fiptool and cert_create symmetrically. Rename it so that it matches the behavior. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Now FIP_ADD_PAYLOAD takes care of both fiptool and cert_create symmetrically. Rename it so that it matches the behavior. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The fiptool and cert_create use the same command options for images. It is pretty easy to handle both in the same, symmetrical way. Move CRT_ARGS and CRT_DEPS to FIP_ADD_PAYLOAD. This refactoring makes sense because FIP_ADD_PAYLOAD is called from MAKE_BL (when building images from source), and from FIP_ADD_IMG (when including external images). (FIP_ADD_PAYLOAD will be renamed later on since it now caters to both fiptool and cert_create). We can delete CERT_ADD_CMD_OPT for images in tbbr.mk. It still needs to call CERT_ADD_CMD_OPT directly for certificates. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The callers of these macros are supposed to use $(eval $(call, ...)). The $(eval ...) on the callee side is unneeded. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The build system supports generating two FIP images, fip and fwu_fip. Accordingly, we have similar build macros. FIP_ADD_PAYLOAD <--> FWU_FIP_ADD_PAYLOAD CERT_ADD_CMD_OPT <--> FWU_CERT_ADD_CMD_OPT FIP_ADD_IMG <--> FWU_FIP_ADD_IMG The duplicated code increases the maintenance burden. Also, the build rule of BL2U looks clumsy - we want to call MAKE_BL to compile it from source files, but we want to put it in fwu_fip. We can not do it in a single macro call since the current MAKE_BL does not support fwu_fip. To refactor those in a clean way is to support one more argument to specify the FIP prefix. If it is empty, the images are targeted to fip, whereas if the argument is "FWU_", targeted to fwu_fip. The build macros prefixed with FWU_ go away. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Now, MAKE_TOOL_ARGS is only called from MAKE_BL. Squash it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
check_* targets check if the required option are given, but do not check the validity of the argument. If the specified file does not exist, let the build fail immediately instead of passing the invalid file path to tools. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 24 Dec, 2017 1 commit
-
-
Masahiro Yamada authored
check_* targets just check necessary command line argument, not build any images. They should be specified as .PHONY. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 23 Dec, 2017 1 commit
-
-
Masahiro Yamada authored
Commit 8f0617ef ("Apply TBBR naming convention to the fip_create options") changed fiptool command options. We often forget to update documentation. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 06 Nov, 2017 1 commit
-
-
Masahiro Yamada authored
Some platforms (for ex. UniPhier) want to create files in the very top of the build directory. Add ${BUILD_PLAT} so such files can depend on it. Make existing directory targets depend on ${BUILD_PLAT} because they are sub-directories of ${BUILD_PLAT}. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 20 Sep, 2017 1 commit
-
-
Nishanth Menon authored
This is a revamp of the original approach in: https://github.com/ARM-software/arm-trusted-firmware/pull/747 Current build system has no means to automatically generate dtbs from dts, instead, stores the dtbs in the fdts/ folder. While this makes perfect sense for many reference platforms, this becomes a minor breakage in development flow for newer platforms. However, this can be solved by providing a rule for the dtbs while building the ATF binaries by purely describing which dts sources we need. For example, with this change, we will now be able to describe the dtbs we need for the platform in the corresponding platform.mk file: FDT_SOURCES += fdts/abc.dts This should be able to generate the abc.dtb appropriately. Since device trees are specification of hardware, we don't tie the rule to any specific BL, instead a generic rule is introduced. Further, this approach allows us to generate appropriate dtbs which may be need to be regenerated when a common dtsi gets updated, by just restricting changes to the dtsi alone, instead of synchronizing all the dtbs as well. If dtc is not available in default paths, but is available in an alternate location, it can be chosen by overriding the DTC variable such as 'make DTC=~/dtc/dtc ....` NOTE: dtbs are built only with the explicit make dtbs command. The rule is only available if the platform defines a FDT_SOURCES variable. Signed-off-by: Benjamin Fair <b-fair@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com>
-
- 28 Jun, 2017 2 commits
-
-
Soby Mathew authored
This patch defines the variable `LDLIBS` which allows external libraries to be specified to 'ld' to enable it to link the libraries. Change-Id: I02a490eca1074063d00153ccb0ee974ef8859a0e Signed-off-by: Soby Mathew <soby.mathew@arm.com>
-
Douglas Raillard authored
Use TF_LDFLAGS from the Makefiles, and still append LDFLAGS as well to the compiler's invocation. This allows passing extra options from the make command line using LDFLAGS. Document new LDFLAGS Makefile option. Change-Id: I88c5ac26ca12ac2b2d60a6f150ae027639991f27 Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
-
- 23 May, 2017 1 commit
-
-
Masahiro Yamada authored
The current assert_boolean does not work with variables assigned with '=' flavor instead of ':='. For example, FOO = $(BAR) BAR := 1 Here, $(value FOO) is evaluated to $(BAR), not 1. This is not what we expect. While I am here, I simplified the implementation. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 03 May, 2017 1 commit
-
-
dp-arm authored
To make software license auditing simpler, use SPDX[0] license identifiers instead of duplicating the license text in every file. NOTE: Files that have been imported by FreeBSD have not been modified. [0]: https://spdx.org/ Change-Id: I80a00e1f641b8cc075ca5a95b10607ed9ed8761a Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
-
- 02 May, 2017 2 commits
-
-
Evan Lloyd authored
Some recent changes have added direct use of the echo command without parameters. This fails on a Windows shell, because echo without parameters reports the mode ("ECHO is on"). This is corrected using the ECHO_BLANK_LINE macro already provided for that purpose. Change-Id: I5fd7192861b4496f6f46b4f096e80a752cd135d6 Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
-
Evan Lloyd authored
2 problems were found, but are in one change to avoid submitting a patch that might fail to build. The problems were: 1. The macro MAKE_PREREQ_DIR has a minor bug, in that it is capable of generating recursive dependencies. 2. The inclusion of BUILD_DIR in TEMP_OBJ_DIRS left no explicit dependency, BUILD_DIR might not exist when subdirectories are created by a thread on another CPU. This fix corrects these with the following changes: 1. MAKE_PREREQ_DIR does nothing for a direct self dependency. 2. BUILD_DIR is built using MAKE_PREREQ_DIR. 3. BUILD_DIR is an explicit prerequisite of all OBJ_DIRS. Change-Id: I938cddea4a006df225c02a47b9cf759212f27fb7 Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
-
- 14 Feb, 2017 1 commit
-
-
Jeenu Viswambharan authored
The ARMv8v.1 architecture extension has introduced support for far atomics, which includes compare-and-swap. Compare and Swap instruction is only available for AArch64. Introduce build options to choose the architecture versions to target ARM Trusted Firmware: - ARM_ARCH_MAJOR: selects the major version of target ARM Architecture. Default value is 8. - ARM_ARCH_MINOR: selects the minor version of target ARM Architecture. Default value is 0. When: (ARM_ARCH_MAJOR > 8) || ((ARM_ARCH_MAJOR == 8) && (ARM_ARCH_MINOR >= 1)), for AArch64, Compare and Swap instruction is used to implement spin locks. Otherwise, the implementation falls back to using load-/store-exclusive instructions. Update user guide, and introduce a section in Firmware Design guide to summarize support for features introduced in ARMv8 Architecture Extensions. Change-Id: I73096a0039502f7aef9ec6ab3ae36680da033f16 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
-
- 19 Jan, 2017 2 commits
-
-
Masahiro Yamada authored
Append . then strip /. seems clumsy. Just use $(patsubst %/,%, ). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Soren reports build fails if -j option is given: $ make -j16 CROSS_COMPILE=aarch64-linux-gnu- Building fvp make: *** No rule to make target 'build/fvp/release/bl1/', needed by 'build/fvp/release/bl1/bl1.ld'. Stop. make: *** Waiting for unfinished jobs.... The cause of the failure is that $(dir ) leaves a trailing / on the directory names. It must be ripped off to let Make create the directory. There are some ways to fix the issue. Here, I chose to make MAKE_LD look like MAKE_C and MAKE_S because bl*_dirs seems the central place of making directories. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
-
- 05 Jan, 2017 4 commits
-
-
Masahiro Yamada authored
This adds a phony target for each dependency other than the main file, causing each to depend on nothing. Without this, the incremental build will fail when a header file is removed. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Currently, .d files are generated before any objects are built. So, IS_ANYTHING_TO_BUILD flag is needed to avoid such processing for non-build targets. There is a cleverer way; just create a .d file simultaneously when the corresponding object is created. No need to have separate rules for .d files. This commit will also fix a bug; -D$(IMAGE) is defined for $(OBJ), but not for $(PREREQUISITES). So, .d files are generated with different macro sets from those for .o files, then wrong .d files are generated. For example, in lib/cpus/aarch64/cpu_helpers.S #if IMAGE_BL31 #include <cpu_data.h> #endif <cpu_data.h> is parsed for the object when built for BL31, but the .d file does not pick up that dependency. With this commit, the compiler will generate .o and .d at the same time, guaranteeing they are generated under the same circumstances. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
Using AS for pre-processing looks a bit weird, and some assembly specific options are given for nothing. Rather, use CPP. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
Masahiro Yamada authored
The -c flag should not be included in the global variable TF_CFLAGS; it should be specified in the build rule only when its target is a *.o file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-
- 29 Jul, 2016 1 commit
-
-
dp-arm authored
fiptool provides a more consistent and intuitive interface compared to the fip_create program. It serves as a better base to build on more features in the future. fiptool supports various subcommands. Below are the currently supported subcommands: 1) info - List the images contained in a FIP file. 2) create - Create a new FIP file with the given images. 3) update - Update an existing FIP with the given images. 4) unpack - Extract a selected set or all the images from a FIP file. 5) remove - Remove images from a FIP file. This is a new command that was not present in fip_create. To create a new FIP file, replace "fip_create" with "fiptool create". To update a FIP file, replace "fip_create" with "fiptool update". To dump the contents of a FIP file, replace "fip_create --dump" with "fiptool info". A compatibility script that emulates the basic functionality of fip_create is provided. Existing scripts might or might not work with the compatibility script. Users are strongly encouraged to migrate to fiptool. Fixes ARM-Software/tf-issues#87 Fixes ARM-Software/tf-issues#108 Fixes ARM-Software/tf-issues#361 Change-Id: I7ee4da7ac60179cc83cf46af890fd8bc61a53330
-
- 13 Jun, 2016 1 commit
-
-
Soren Brinkmann authored
Add a convenience macro to add a build definition with a value. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
-
- 14 Apr, 2016 1 commit
-
-
Sandrine Bailleux authored
The user can provide additional CFLAGS to use when building TF. However, these custom CFLAGS are currently prepended to the standard CFLAGS that are hardcoded in the TF build system. This is an issue because when providing conflicting compiler flags (e.g. different optimisations levels like -O1 and -O0), the last one on the command line usually takes precedence. This means that the user flags get overriden. To address this problem, this patch separates the TF CFLAGS from the user CFLAGS. The former are now stored in the TF_CFLAGS make variable, whereas the CFLAGS make variable is untouched and reserved for the user. The order of the 2 sets of flags is enforced when invoking the compiler. Fixes ARM-Software/tf-issues#350 Change-Id: Ib189f44555b885f1dffbec6015092f381600e560
-
- 01 Apr, 2016 5 commits
-
-
Evan Lloyd authored
To get round problems encountered when building in a DOS build environment the generation of the .o file containing build identifier strings is modified. The problems encounterred were: 1. DOS echo doesn't strip ' characters from the output text. 2. git is not available from CMD.EXE so the BUILD_STRING value needs some other origin. A BUILD_STRING value of "development build" is used for now. MAKE_BUILD_STRINGS is used to customise build string generation in a DOS environment. This variable is not defined in the UNIX build environment make file helper, and so the existing build string generation behaviour is retained in these build environments. NOTE: This commit completes a cumulative series aimed at improving build portability across development environments. This enables the build to run on several new build environments, if the relevant tools are available. At this point the build is tested on Windows 7 Enterprise SP1, using CMD.EXE, Cygwin and Msys (MinGW),as well as a native Linux envionment". The Windows platform builds used aarch64-none-elf-gcc.exe 4.9.1. CMD.EXE and Msys used Gnu Make 3.81, cygwin used Gnu Make 4.1. CAVEAT: The cert_create tool build is not tested on the Windows platforms (openssl-for-windows has a GPL license). Change-Id: Iaa4fc89dbe2a9ebae87e2600c9eef10a6af30251
-
Evan Lloyd authored
Because of command differences in some build environments the "inline" method of generating the build directory structure is not portable. (e.g. in DOS environments the mkdir shell command fails if a directory already exists, whereas in UNIX environments it succeeds.) To improve portability we generate the directories needed using make, but use the "order-only prerequisites" feature of make to prevent writes of files into the directories generating re-builds, as suggested in the GNU make Manual (Version 4.1 September 2014). Change-Id: Ic9af475831063c7fe6f8bccffef184d79e799419
-
Evan Lloyd authored
Add make helper files to select the appropriate settings for the build environment. Selection is made in make_helpers/build_env.mk, which selects other files to include using generic build environment settings. The Trusted Firmware Makefile and supporting tool Makefiles are updated to include build_env.mk instead of unix.mk. NOTE: This change does not fully enable builds in other build environments. It facilitates this without compromising the existing build environments. Change-Id: Ic4064ffe6ce158bbd16d7cc9f27dd4655a3580f6
-
Evan Lloyd authored
To help diagnose make problems, we report an error if the make program used does not provide the $(eval ) make functionality. This will detect early versions of GNU make and other make programs. Change-Id: I0ebb0f63694cf0b04eaeb7ea1e9e172fb9770ce0
-
Evan Lloyd authored
As an initial stage of making Trusted Firmware build environment more portable, we remove most uses of the $(shell ) function and replace them with more portable make function based solutions. Note that the setting of BUILD_STRING still uses $(shell ) since it's not possible to reimplement this as a make function. Avoiding invocation of this on incompatible host platforms will be implemented separately. Change-Id: I768e2f9a265c78814a4adf2edee4cc46cda0f5b8
-
- 06 Feb, 2016 1 commit
-
-
Patrick Georgi authored
This allows reproducible builds (same source and same compiler produce bit-identical results) and also allows coordinating the timestamp across multiple projects, eg. with another firmware. Signed-off-by: Patrick Georgi <pgeorgi@google.com>
-
- 05 Jan, 2016 1 commit
-
-
Juan Castillo authored
The fip_create tool specifies images in the command line using the ARM TF naming convention (--bl2, --bl31, etc), while the cert_create tool uses the TBBR convention (--tb-fw, --soc-fw, etc). This double convention is confusing and should be aligned. This patch updates the fip_create command line options to follow the TBBR naming convention. Usage examples in the User Guide have been also updated. NOTE: users that build the FIP by calling the fip_create tool directly from the command line must update the command line options in their scripts. Users that build the FIP by invoking the main ARM TF Makefile should not notice any difference. Change-Id: I84d602630a2585e558d927b50dfde4dd2112496f
-