1. 03 Oct, 2018 1 commit
  2. 03 Aug, 2018 2 commits
    • Roberto Vargas's avatar
      Add support for romlib in the build system · 5accce5b
      Roberto Vargas authored
      
      
      Romlib is a new image that is stored in ROM and contains the code of
      several libraries that can be shared between different images. All
      the functions within in the library are accessed using a jump table
      which allows to update the romlib image whithout changing the binary
      compatibility. This jump table can be also stored in RAM and it can
      allow to patch a romlib with potential bugs fixes..
      
      Change-Id: If980ccdaca24b7aaca900e32acc68baf6f94ab35
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      5accce5b
    • Roberto Vargas's avatar
      Add make macros to build library archives · 5fee0287
      Roberto Vargas authored
      
      
      This patch adds all the make macros needed to create a library archive
      and to use it in the link stage.
      
      Change-Id: I26597bfd6543649d0b68a9b1e06aec1ba353e6de
      Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
      5fee0287
  3. 18 Jul, 2018 1 commit
    • Konstantin Porotchkin's avatar
      make: support libraries in MAKE_BL macro · 23e0fe52
      Konstantin Porotchkin authored
      
      
      Add support for BLx stages to use libraries in MAKE_BL macro.
      This change does not affect BL stages that do not have
      BL_LIBS variable defined in their makefiles.
      However in case that BL wants to use external library
      (for instance vendor-specific DDR initialization code supplied
      as a library), this patch will allow to build BL image linked
      with such library.
      
      Change-Id: Ife29069a72dc4aff833db6ef8b828736d6689b78
      Signed-off-by: default avatarKonstantin Porotchkin <kostap@marvell.com>
      23e0fe52
  4. 18 Jun, 2018 1 commit
    • Yann Gautier's avatar
      Build: add cpp build processing for dtb · 01d237cb
      Yann Gautier authored
      
      
      This is an add-on feature that allows processing
      device tree with external includes.
      
      "-Iinclude" is also added to INCLUDES.
      It allows inclusion of dt-bindings files either in dts files or drivers,
      as those files will be in include/dt-bindings/.
      
      "-i fdts" is added to the DTC command line.
      As the pre-processed files are in build directory, the DT source directory
      has to be explicitely included, to manages /include/ directives.
      
      fixes arm-software/tf-issues#595
      Signed-off-by: default avatarLionel Debieve <lionel.debieve@st.com>
      Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
      01d237cb
  5. 01 Mar, 2018 1 commit
  6. 28 Feb, 2018 1 commit
  7. 26 Feb, 2018 1 commit
  8. 22 Feb, 2018 1 commit
  9. 01 Feb, 2018 12 commits
    • Masahiro Yamada's avatar
      Build: add GZIP compression filter · 14db8908
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      14db8908
    • Masahiro Yamada's avatar
      Build: support pre-tool image processing · 2da522bb
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      2da522bb
    • Masahiro Yamada's avatar
      Build: change the first parameter of TOOL_ADD_IMG to lowercase · 33950dd8
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      33950dd8
    • Masahiro Yamada's avatar
      Build: make tools depend on $(BIN) instead of PHONY target · 36af3455
      Masahiro Yamada authored
      
      
      The PHONY target "bl*" generate $(BIN) and $(DUMP), but host tools
      (fiptool, cert_create) only need $(BIN).
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      36af3455
    • Masahiro Yamada's avatar
      Build: remove third argument of CERT_ADD_CMD_OPT · 91704d9d
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      91704d9d
    • Masahiro Yamada's avatar
      Build: rename FIP_ADD_IMG to TOOL_ADD_IMG · c939d13a
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      c939d13a
    • Masahiro Yamada's avatar
      Build: rename FIP_ADD_PAYLOAD to TOOL_ADD_PAYLOAD · 10cea934
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      10cea934
    • Masahiro Yamada's avatar
      Build: move cert_create arguments and dependency to FIP_ADD_PAYLOAD · f30ee0b9
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      f30ee0b9
    • Masahiro Yamada's avatar
      Build: rip off unneeded $(eval ...) from buid macros · 945b316f
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      945b316f
    • Masahiro Yamada's avatar
      Build: merge build macros between FIP_ and FWU_FIP_ · 1dc0714f
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      1dc0714f
    • Masahiro Yamada's avatar
      Build: squash MAKE_TOOL_ARGS into MAKE_BL · 34ec8494
      Masahiro Yamada authored
      
      
      Now, MAKE_TOOL_ARGS is only called from MAKE_BL.  Squash it.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      34ec8494
    • Masahiro Yamada's avatar
      Build: check if specified external image exists · 802d2dd2
      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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      802d2dd2
  10. 24 Dec, 2017 1 commit
  11. 23 Dec, 2017 1 commit
  12. 06 Nov, 2017 1 commit
  13. 20 Sep, 2017 1 commit
    • Nishanth Menon's avatar
      Makefile: Add ability to build dtb · 03b397a8
      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: default avatarBenjamin Fair <b-fair@ti.com>
      Signed-off-by: default avatarNishanth Menon <nm@ti.com>
      03b397a8
  14. 28 Jun, 2017 2 commits
  15. 23 May, 2017 1 commit
  16. 03 May, 2017 1 commit
  17. 02 May, 2017 2 commits
    • Evan Lloyd's avatar
      Build: Correct Unix specific echo commands · 052ab529
      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: default avatarEvan Lloyd <evan.lloyd@arm.com>
      052ab529
    • Evan Lloyd's avatar
      Build: Fix parallel build · 6ba7d274
      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: default avatarEvan Lloyd <evan.lloyd@arm.com>
      6ba7d274
  18. 14 Feb, 2017 1 commit
    • Jeenu Viswambharan's avatar
      Introduce locking primitives using CAS instruction · c877b414
      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: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
      c877b414
  19. 19 Jan, 2017 2 commits
  20. 05 Jan, 2017 4 commits
  21. 29 Jul, 2016 1 commit
    • dp-arm's avatar
      Replace fip_create with fiptool · 819281ee
      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
      819281ee
  22. 13 Jun, 2016 1 commit