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. 07 Jan, 2021 1 commit
    • Pali Rohár's avatar
      Makefile: Do not mark file targets as .PHONY target · a9812206
      Pali Rohár authored
      
      
      Only non-file targets should be set a .PHONY. Otherwise if file target is
      set as .PHONY then targets which depends on those file .PHONY targets would
      be always rebuilt even when their prerequisites are not changed.
      
      File target which needs to be always rebuilt can be specified in Make
      system via having a prerequisite on some .PHONY target, instead of marking
      whole target as .PHONY. In Makefile projects it is common to create empty
      .PHONY target named FORCE for this purpose.
      
      This patch changes all file targets which are set as .PHONY to depends on
      new .PHONY target FORCE, to ensure that these file targets are always
      rebuilt (as before). Basically they are those targets which calls external
      make subprocess.
      
      After FORCE target is specified in main Makefile, remove it from other
      Makefile files to prevent duplicate definitions.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Iee3b4e0de93879b95eb29a1745a041538412e69e
      a9812206
  3. 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
  4. 07 Dec, 2020 9 commits
  5. 19 Nov, 2020 3 commits
    • Pali Rohár's avatar
      plat: marvell: Update SUBVERSION to match Marvell's forked version · d22db1b0
      Pali Rohár authored
      
      
      Marvell's TF-A fork has SUBVERSION set to devel-18.12.2.
      
      The only differences between Marvell's devel-18.12.0 and devel-18.12.2
      versions are documentation updates and cherry-picked patches from TF-A
      upstream repository.
      
      So upstream TF-A has already all changes from Marvell's TF-A devel-18.12.2
      fork and therefore update SUBVERSION to reflect this state.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I5ce946a5176a5cbf124acd8037392463d586b072
      d22db1b0
    • 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
  6. 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
  7. 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
  8. 16 Oct, 2020 1 commit
    • Pali Rohár's avatar
      plat: marvell: armada: Fix dependences for target fip · fb28d525
      Pali Rohár authored
      
      
      For building fip image it is not needed to build target mrvl_flash. This
      fip image contains only bl2, bl31 and bl33 (u-boot.bin) images and
      therefore it does not depend on Marvell wtmi and wtp A3700-utils.
      
      So remove mrvl_flash dependency for fip target to allow building fip image
      without need to build mrvl_flash and therefore specify and provide Marvell
      wmi and wtp A3700-utils.
      
      This changes fixes compilation of fip image for A3700 platform by command:
      
          make CROSS_COMPILE=aarch64-linux-gnu- BL33=/path/u-boot/u-boot.bin \
               DEBUG=0 LOG_LEVEL=0 USE_COHERENT_MEM=0 PLAT=a3700 fip
      
      Marvell boot image can be still build by 'mrvl_flash' target.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Iba9a9da5be6fd1da23407fc2d490aedcb1a292c9
      fb28d525
  9. 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
  10. 09 Oct, 2020 1 commit
    • Jimmy Brisson's avatar
      Don't return error information from console_flush · 831b0e98
      Jimmy Brisson authored
      
      
      And from crash_console_flush.
      
      We ignore the error information return by console_flush in _every_
      place where we call it, and casting the return type to void does not
      work around the MISRA violation that this causes. Instead, we collect
      the error information from the driver (to avoid changing that API), and
      don't return it to the caller.
      
      Change-Id: I1e35afe01764d5c8f0efd04f8949d333ffb688c1
      Signed-off-by: default avatarJimmy Brisson <jimmy.brisson@arm.com>
      831b0e98
  11. 04 Oct, 2020 5 commits
  12. 04 Aug, 2020 1 commit
    • Grant Likely's avatar
      Use abspath to dereference $BUILD_BASE · 29214e95
      Grant Likely authored
      
      
      If the user tries to change BUILD_BASE to put the build products outside
      the build tree the compile will fail due to hard coded assumptions that
      $BUILD_BASE is a relative path. Fix by using $(abspath $(BUILD_BASE))
      to rationalize to an absolute path every time and remove the relative
      path assumptions.
      
      This patch also adds documentation that BUILD_BASE can be specified by
      the user.
      Signed-off-by: default avatarGrant Likely <grant.likely@arm.com>
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      Change-Id: Ib1af874de658484aaffc672f30029b852d2489c8
      29214e95
  13. 30 Jul, 2020 6 commits
    • Grzegorz Jaszczyk's avatar
      plat: marvell: octeontx: add support for t9130 · 2c9d2636
      Grzegorz Jaszczyk authored
      
      
      CN-9130 has single CP0 inside the package and 2 additional one from MoChi
      interface. In case of db-9130-modular board the MCI interface is routed to:
      - on-board CP115 (MCI0)
      - extension board CP115 (MCI1)
      
      The board is based on DIMM DDR.
      
      The 9130 has up to 3CP, and decoding windows looks like below:
      
        (free for further use)
       .----------. 0xf800 0000
       | CP2 CFG  |
       '----------' 0xf600 0000
       | CP1 CFG  |
       '----------' 0xf400 0000
       | CP0 CFG  |
       '----------' 0xf200 0000
       | AP CFG   |
       '----------' 0xf000 0000
        (free for further use)
       .----------. 0xec00 0000
       | SPI      |
       | MEM_MAP  | (Currently not opened)
       '----------' 0xe800 0000
       | PEX2_CP2 |
       '----------' 0xe700 0000
       | PEX1_CP2 |
       '----------' 0xe600 0000
       | PEX0-CP2 |
       '----------'
       .----------. 0xe500 0000
       | PEX2_CP1 |
       '----------' 0xe400 0000
       | PEX1_CP1 |
       '----------' 0xe300 0000
       | PEX0-CP1 |
       '----------'
       .----------. 0xe200 0000
       | PEX2-CP0 |
       '----------' 0xe100 0000
       | PEX1-CP0 |
       '----------' 0xe000 0000
       | PEX0-CP0 |
       | 512MB    |
       '----------' 0xc000 0000
      
      Change-Id: Ia8eee4f96c1043753f74f9da437b9f72ce2d6eb0
      Signed-off-by: default avatarGrzegorz Jaszczyk <jaz@semihalf.com>
      2c9d2636
    • Alex Evraev's avatar
      plat: marvell: t9130: add SVC support · 12c66c6b
      Alex Evraev authored
      
      
      As the preparation for adding the CN913x SoC family support
      introduce code that enable SVC and the frequency handling
      specific for the AP807 North Bridge.
      
      Change-Id: Ibe34a511b49cd9671a2e53b77bdcfc644bb915e3
      Signed-off-by: default avatarAlex Evraev <alexev@marvell.com>
      12c66c6b
    • Grzegorz Jaszczyk's avatar
      plat: marvell: t9130: update AVS settings · 885cd821
      Grzegorz Jaszczyk authored
      
      
      Update AVS settings and remove unused macros.
      This is a preparation patch for adding CN913x SoC
      family support.
      
      Change-Id: Ib1dd70885a316ed5763d0f4730d0e4734da117b7
      Signed-off-by: default avatarGrzegorz Jaszczyk <jaz@semihalf.com>
      885cd821
    • Ben Peled's avatar
      plat: marvell: t9130: pass actual CP count for load_image · 5bc3643e
      Ben Peled authored
      
      
      Add CN913x case to bl2_plat_get_cp_count.
      Fix loading of cp1/2 image. This is a preparation
      patch for adding CN913x SoC family support.
      
      Change-Id: Id84a30203d20572fc0dfd3f91ea395c199a85fe9
      Signed-off-by: default avatarBen Peled <bpeled@marvell.com>
      5bc3643e
    • Alex Evraev's avatar
      plat: marvell: armada: a7k: add support to SVC validation mode · ebf307bf
      Alex Evraev authored
      
      
      Add support for “AVS reduction” feature at this mode for
      7040 Dual Cluster operation mode at CPU=1600MHz
      
      Change-Id: Ia72b10e0ccfad07568bf4c089ea3990173ae24b2
      Signed-off-by: default avatarAlex Evraev <alexev@marvell.com>
      ebf307bf
    • Moti Buskila's avatar
      plat: marvell: armada: add support for twin-die combined memory device · 48270689
      Moti Buskila authored
      
      
      the twin-die combined memory device should be treated as
      X8 device and not as X16 one. This patch is required to
      re-enable compilation after BLE (mv-ddr-marvell) firmware upgrade.
      
      Change-Id: I41257ff2825164ebca85a84bbb8462d7b3447b97
      Signed-off-by: default avatarMoti Buskila <motib@marvell.com>
      Signed-off-by: default avatarMarcin Wojtas <mw@semihalf.com>
      48270689
  14. 10 Jul, 2020 6 commits
  15. 03 Jul, 2020 2 commits