1. 11 Jan, 2021 1 commit
    • Marek Behún's avatar
      plat: marvell: armada: a3k: improve 4GB DRAM usage from 3.375 GB to 3.75 GB · b04921f7
      Marek Behún authored
      
      
      The current configuration of CPU windows on Armada 37x0 with 4 GB DRAM
      can only utilize 3.375 GB of memory. This is because there are only 5
      configuration windows, configured as such (in hexadecimal, also showing
      ranges not configurable by CPU windows):
      
               0 - 80000000 |   2 GB | DDR  | CPU window 0
        80000000 - C0000000 |   1 GB | DDR  | CPU window 1
        C0000000 - D0000000 | 256 MB | DDR  | CPU window 2
        D0000000 - D2000000 |  32 MB |      | Internal regs
            empty space     |        |      |
        D8000000 - D8010000 |  64 KB |      | CCI regs
            empty space     |        |      |
        E0000000 - E8000000 | 128 MB | DDR  | CPU window 3
        E8000000 - F0000000 | 128 MB | PCIe | CPU window 4
            empty space     |        |      |
        FFF00000 - end      |  64 KB |      | Boot ROM
      
      This can be improved by taking into account that:
      - CCI window can be moved (the base address is only hardcoded in TF-A;
        U-Boot and Linux will not break with changing of this address)
      - PCIe window can be moved (upstream U-Boot can change device-tree
        ranges of PCIe if PCIe window is moved)
      
      Change the layout after the Internal regs as such:
      
        D2000000 - F2000000 | 512 MB | DDR  | CPU window 3
        F2000000 - FA000000 | 128 MB | PCIe | CPU window 4
            empty space     |        |      |
        FE000000 - FE010000 |  64 KB |      | CCI regs
            empty space     |        |      |
        FFF00000 - end      |  64 KB |      | Boot ROM
      
      (Note that CCI regs base address is moved from D8000000 to FE000000 in
       all cases, not only for the configuration with 4 GB of DRAM. This is
       because TF-A is built with this address as a constant, so we cannot
       change this address at runtime only on some boards.)
      
      This yields 3.75 GB of usable RAM.
      
      Moreover U-Boot can theoretically reconfigure the PCIe window to DDR if
      it discovers that no PCIe card is connected. This can add another 128 MB
      of DRAM (resulting only in 128 MB of DRAM not being used).
      Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
      Change-Id: I4ca1999f852f90055fac8b2c4f7e80275a13ad7e
      b04921f7
  2. 05 Jan, 2021 1 commit
    • Marek Behún's avatar
      plat: marvell: armada: a3k: support doing system reset via CM3 secure coprocessor · d9243f26
      Marek Behún authored
      
      
      Introduce a new build option CM3_SYSTEM_RESET for A3700 platform, which,
      when enabled, adds code to the PSCI reset handler to try to do system
      reset by the WTMI firmware running on the Cortex-M3 secure coprocessor.
      (This function is exposed via the mailbox interface.)
      
      The reason is that the Turris MOX board has a HW bug which causes reset
      to hang unpredictably. This issue can be solved by putting the board in
      a specific state before reset.
      Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
      Change-Id: I3f60b9f244f334adcd33d6db6a361fbc8b8d209f
      d9243f26
  3. 07 Dec, 2020 8 commits
  4. 19 Nov, 2020 2 commits
    • Pali Rohár's avatar
      plat: marvell: armada: Add new target mrvl_bootimage · 91bc2da7
      Pali Rohár authored
      
      
      This new target builds boot-image.bin binary as described in documentation.
      This image does not contain WTMI image and therefore WTP repository is not
      required for building.
      
      Having ability to build just this boot-image.bin binary without full
      flash-image.bin is useful for A3720 Turris MOX board which does not use
      Marvell's WTP and a3700_utils.
      
      To reduce duplicity between a8k and a3k code, define this new target and
      also definitions for $(BUILD_PLAT)/$(BOOT_IMAGE) in common include file
      marvell_common.mk.
      
      For this purpose it is needed to include plat/marvell/marvell.mk file from
      a3700_common.mk unconditionally (and not only when WTP is defined). Now
      when common file plat/marvell/marvell.mk does not contain definition for
      building $(DOIMAGETOOL), it is possible to move its inclusion at the top of
      the a3700_common.mk file.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Ic58303b37a1601be9a06ff83b7a279cb7cfc8280
      91bc2da7
    • Pali Rohár's avatar
      plat: marvell: armada: a3k: Add support for building $(DOIMAGETOOL) · c6a7ab77
      Pali Rohár authored
      Current binary wtptp/linux/tbb_linux which is specified in $(DOIMAGETOOL)
      variable points to external pre-compiled Marvell x86_64 ELF linux binary
      from A3700-utils-marvell WTP repository.
      
      It means that currently it is not possible to compile TF-A for A3720 on
      other host platform then linux x86_64.
      
      Part of the A3700-utils-marvell WTP repository is also source code of
      $(DOIMAGETOOL) TBB_Linux tool.
      
      This change adds support for building $(DOIMAGETOOL) also for a3k platform.
      
      After running $(MAKE) at appropriate subdirectory of A3700-utils-marvell
      WTP repository, compiled TBB_linux tool will appear in WTP subdirectory
      wtptp/src/TBB_Linux/release/. So update also $(DOIMAGETOOL) variable to
      point to the correct location where TBB_linux was built.
      
      To build TBB_linux it is required to compile external Crypto++ library
      which is available at: https://github.com/weidai11/cryptopp.git
      
      
      
      User needs to set CRYPTOPP_PATH option to specify path to that library.
      
      After this change it is now possible to build whole firmware for A3720
      platform without requirement to use pre-compiled/proprietary x86_64
      executable binaries from Marvell.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I6f26bd4356778a2f8f730a223067a2e550e6c8e0
      c6a7ab77
  5. 21 Oct, 2020 1 commit
    • Pali Rohár's avatar
      plat: marvell: armada: Building ${DOIMAGETOOL} is only for a8k · b5e3d540
      Pali Rohár authored
      
      
      Currently a3k target is misusing ${DOIMAGETOOL} target for building flash
      and UART images. It is not used for building image tool.
      
      So move ${DOIMAGETOOL} target from common marvell include file into a8k
      include file and add correct invocation of ${MAKE} into a3k for building
      flash and UART images.
      
      Part of this change is also checks that MV_DDR_PATH for a3k was specified
      by user as this option is required for building a3k flash and UART images.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I5ae9d08b8505460933f17836c9b6435fd6e51bb6
      b5e3d540
  6. 19 Oct, 2020 1 commit
    • Pali Rohár's avatar
      plat: marvell: armada: Fix including plat/marvell/marvell.mk file · 0412b732
      Pali Rohár authored
      
      
      Include file plat/marvell/marvell.mk for platform A3700 was included two
      times. Once from file plat/marvell/armada/a3k/common/a3700_common.mk and
      second time from common file plat/marvell/armada/common/marvell_common.mk.
      
      It caused following warning every time was make called:
      
          plat/marvell/marvell.mk:51: warning: overriding recipe for target 'mrvl_clean'
          plat/marvell/marvell.mk:51: warning: ignoring old recipe for target 'mrvl_clean'
      
      Change in this commit removes inclusion of plat/marvell/marvell.mk file in
      common file plat/marvell/armada/common/marvell_common.mk. As a80x0 platform
      needs this include file, add it also into a80x0 platform specific include
      file lat/marvell/armada/a8k/common/a8k_common.mk.
      
      Also moves inclusion of plat/marvell/marvell.mk file in a3700 platform file
      plat/marvell/armada/a3k/common/a3700_common.mk at correct place. Global
      plat/marvell/marvell.mk expects that variables DOIMAGEPATH and DOIMAGETOOL
      are already defined, but it defines MARVELL_SECURE_BOOT variable which is
      needed by plat/marvell/armada/a3k/common/a3700_common.mk.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I5cbbd7eb8a3376924419f9850516b2a4924be5aa
      0412b732
  7. 15 Oct, 2020 1 commit
    • Pali Rohár's avatar
      plat: marvell: armada: a3k: When WTP is empty do not define variables and... · c5e1b061
      Pali Rohár authored
      
      plat: marvell: armada: a3k: When WTP is empty do not define variables and targets which depends on it
      
      Some of targets (e.g. mrvl_flash) depends on WTP build option. Other
      targets (e.g. fip) can be build also without WTP build option as they do
      not depend on it.
      
      This change put all A3720 variables and targets which depends on WTP into
      conditional if-endif section, so they are not defined when user has not
      supplied WTP build option.
      
      Target mrvl_flash is defined also when WTP was not specified and in this
      case it just print error message to help user.
      
      Variables which do not depend on WTP are moved to the top of
      a3700_common.mk file.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Idb3892233586a0afca3e0e6564279641d2e4b960
      c5e1b061
  8. 04 Oct, 2020 1 commit
  9. 18 Jun, 2020 1 commit
    • Marcin Wojtas's avatar
      plat: marvell: armada: modify PLAT_FAMILY name for 37xx SoCs · b5c850d4
      Marcin Wojtas authored
      
      
      The Marvell Armada 37xx SoCs-based platforms contain a bit
      awkward directory structure because the currently only one
      supported PLAT and PLAT_FAMILY are the same. Modify the latter
      to 'a3k' in order to improve it and keep plat/marvell/armada
      tree more consistent:
      
      plat/marvell/
      ├── armada
      │   ├── a3k
      │   │   ├── a3700
      
      [...]
      
      │   ├── a8k
      │   │   ├── a70x0
      
      [...]
      
      Change-Id: I693a6ef88e6ce49a326a3328875c90bbc186066a
      Signed-off-by: default avatarMarcin Wojtas <mw@semihalf.com>
      b5c850d4
  10. 06 Jun, 2020 1 commit
  11. 30 Mar, 2020 1 commit
    • Alexei Fedorov's avatar
      TF-A GICv3 driver: Introduce makefile · a6ea06f5
      Alexei Fedorov authored
      
      
      This patch moves all GICv3 driver files into new added
      'gicv3.mk' makefile for the benefit of the generic driver
      which can evolve in the future without affecting platforms.
      The patch adds GICv3 driver configuration flags
      'GICV3_IMPL', 'GICV3_IMPL_GIC600_MULTICHIP' and
      'GICV3_OVERRIDE_DISTIF_PWR_OPS' described in
      'GICv3 driver options' section of 'build-option.rst'
      document.
      
      NOTE: Platforms with GICv3 driver need to be modified to
      include 'drivers/arm/gic/v3/gicv3.mk' in their makefiles.
      
      Change-Id: If055f6770ff20f5dee5a3c99ae7ced7cdcac5c44
      Signed-off-by: default avatarAlexei Fedorov <Alexei.Fedorov@arm.com>
      a6ea06f5
  12. 10 Mar, 2020 1 commit
  13. 16 Jul, 2019 1 commit
  14. 01 Feb, 2019 1 commit
  15. 04 Jan, 2019 1 commit
    • Antonio Nino Diaz's avatar
      Sanitise includes across codebase · 09d40e0e
      Antonio Nino Diaz authored
      Enforce full include path for includes. Deprecate old paths.
      
      The following folders inside include/lib have been left unchanged:
      
      - include/lib/cpus/${ARCH}
      - include/lib/el3_runtime/${ARCH}
      
      The reason for this change is that having a global namespace for
      includes isn't a good idea. It defeats one of the advantages of having
      folders and it introduces problems that are sometimes subtle (because
      you may not know the header you are actually including if there are two
      of them).
      
      For example, this patch had to be created because two headers were
      called the same way: e0ea0928 ("Fix gpio includes of mt8173 platform
      to avoid collision."). More recently, this patch has had similar
      problems: 46f9b2c3 ("drivers: add tzc380 support").
      
      This problem was introduced in commit 4ecca339
      
       ("Move include and
      source files to logical locations"). At that time, there weren't too
      many headers so it wasn't a real issue. However, time has shown that
      this creates problems.
      
      Platforms that want to preserve the way they include headers may add the
      removed paths to PLAT_INCLUDES, but this is discouraged.
      
      Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      09d40e0e
  16. 07 Dec, 2018 1 commit
    • Julius Werner's avatar
      drivers/console: Link console framework code by default · 985ee0b7
      Julius Werner authored
      
      
      This patch makes the build system link the console framework code by
      default, like it already does with other common libraries (e.g. cache
      helpers). This should not make a difference in practice since TF is
      linked with --gc-sections, so the linker will garbage collect all
      functions and data that are not referenced by any other code. Thus, if a
      platform doesn't want to include console code for size reasons and
      doesn't make any references to console functions, the code will not be
      included in the final binary.
      
      To avoid compatibility issues with older platform ports, only make this
      change for the MULTI_CONSOLE_API.
      
      Change-Id: I153a9dbe680d57aadb860d1c829759ba701130d3
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      985ee0b7
  17. 15 Nov, 2018 2 commits
  18. 31 Oct, 2018 1 commit
    • Konstantin Porotchkin's avatar
      plat: marvell: Add support for Armada-37xx SoC platform · 1e66bacb
      Konstantin Porotchkin authored
      
      
      Add supprot for Marvell platforms based on Armada-37xx SoC.
      This includes support for the official Armada-3720 modular
      development board and EspressoBin community board.
      The Armada-37xx SoC contains dual Cortex-A53 Application CPU,
      single secure CPU (Cortex-M3) and the following interfaces:
      - SATA 3.0
      - USB 3.0 and USB 2.0
      - PCIe
      - SDIO (supports boot from eMMC)
      - SPI
      - UART
      - I2c
      - Gigabit Ethernet
      Signed-off-by: default avatarKonstantin Porotchkin <kostap@marvell.com>
      1e66bacb