1. 10 Jul, 2021 2 commits
    • Pali Rohár's avatar
      fix(plat/marvell/a8k): Correctly set include directories for individual targets · 559ab2df
      Pali Rohár authored
      
      
      Do not set all include directories, including those for external targets
      in one PLAT_INCLUDES variable.
      
      Instead split them into variables:
      * $(PLAT_INCLUDES) for all TF-A BL images
      * BLE target specific $(PLAT_INCLUDES) only for Marvell BLE image
      * $(MV_DDR_INCLUDES) for targets in external Marvell mv-ddr-marvell tree
      
      Include directory $(CURDIR)/drivers/marvell is required by TF-A BL
      images, so move it from ble.mk to a8k_common.mk.
      
      Include directory $(MV_DDR_PATH) is needed only by Marvell BLE image, so
      move it into BLE target specific $(PLAT_INCLUDES) variable.
      
      And remaining include directories specified in ble.mk are needed only
      for building external dependences from Marvell mv-ddr tree, so move them
      into $(MV_DDR_INCLUDES) variable and correctly use it in $(MV_DDR_LIB)
      target.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I331f7de675dca2bc70733d56b768f00d56ae4a67
      559ab2df
    • Pali Rohár's avatar
      fix(plat/marvell/a8k): Require that MV_DDR_PATH is correctly set · 528dafc3
      Pali Rohár authored
      
      
      Target mrvl_flash depends on external mv_ddr source code which is not
      part of TF-A project. Do not expect that it is pre-downloaded at some
      specific location and require user to specify correct path to mv_ddr
      source code via MV_DDR_PATH build option.
      
      TF-A code for Armada 37x0 platform also depends on mv_ddr source code
      and already requires passing correct MV_DDR_PATH build option.
      
      So for A8K implement same checks for validity of MV_DDR_PATH option as
      are already used by TF-A code for Armada 37x0 platform.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I792f2bfeab0cec89b1b64e88d7b2c456e22de43a
      528dafc3
  2. 02 Jun, 2021 1 commit
    • Pali Rohár's avatar
      fix(plat/marvell/a3720/uart): fix UART parent clock rate determination · 5a91c439
      Pali Rohár authored
      
      
      The UART code for the A3K platform assumes that UART parent clock rate
      is always 25 MHz. This is incorrect, because the xtal clock can also run
      at 40 MHz (this is board specific).
      
      The frequency of the xtal clock is determined by a value on a strapping
      pin during SOC reset. The code to determine this frequency is already in
      A3K's comphy driver.
      
      Move the get_ref_clk() function from the comphy driver to a separate
      file and use it for UART parent clock rate determination.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I8bb18a2d020ef18fe65aa06ffa4ab205c71be92e
      5a91c439
  3. 01 Jun, 2021 2 commits
  4. 28 May, 2021 1 commit
    • Pali Rohár's avatar
      fix(plat/marvell/a3720/uart): fix UART clock rate value and divisor calculation · 66a77528
      Pali Rohár authored
      
      
      UART parent clock is by default the platform's xtal clock, which is
      25 MHz.
      
      The value defined in the driver, though, is 25.8048 MHz. This is a hack
      for the suboptimal divisor calculation
        Divisor = UART clock / (16 * baudrate)
      which does not use rounding division, resulting in a suboptimal value
      for divisor if the correct parent clock rate was used.
      
      Change the code for divisor calculation to
        Divisor = Round(UART clock / (16 * baudrate))
      and change the parent clock rate value to 25 MHz.
      
      The final UART divisor for default baudrate 115200 is not affected by
      this change.
      
      (Note that the parent clock rate should not be defined via a macro,
      since the xtal clock can also be 40 MHz. This is outside of the scope of
      this fix, though.)
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: Iaa401173df87aec94f2dd1b38a90fb6ed0bf0ec6
      66a77528
  5. 27 Apr, 2021 1 commit
    • Pali Rohár's avatar
      plat: marvell: armada: a3k: Add new compile option A3720_DB_PM_WAKEUP_SRC · f2800a47
      Pali Rohár authored
      
      
      This new compile option is only for Armada 3720 Development Board. When
      it is set to 1 then TF-A will setup PM wake up src configuration.
      
      By default this new option is disabled as it is board specific and no
      other A37xx board has PM wake up src configuration.
      
      Currently neither upstream U-Boot nor upstream Linux kernel has wakeup
      support for A37xx platforms, so having it disabled does not cause any
      issue.
      
      Prior this commit PM wake up src configuration specific for Armada 3720
      Development Board was enabled for every A37xx board. After this change it
      is enabled only when compiling with build flag A3720_DB_PM_WAKEUP_SRC=1
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Change-Id: I09fea1172c532df639acb3bb009cfde32d3c5766
      f2800a47
  6. 20 Apr, 2021 12 commits
  7. 25 Feb, 2021 2 commits
  8. 24 Feb, 2021 1 commit
  9. 11 Feb, 2021 2 commits
  10. 29 Jan, 2021 10 commits
  11. 28 Jan, 2021 1 commit
  12. 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
  13. 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
  14. 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
  15. 07 Dec, 2020 2 commits