1. 11 Nov, 2019 1 commit
    • Manish Pandey's avatar
      n1sdp: setup multichip gic routing table · 6799a370
      Manish Pandey authored
      
      
      N1SDP supports multichip configuration wherein n1sdp boards are
      connected over high speed coherent CCIX link, for now only dual-chip
      is supported.
      
      Whether or not multiple chips are present is dynamically probed by
      SCP firmware and passed on to TF-A, routing table will be set up
      only if multiple chips are present.
      
      Initialize GIC-600 multichip operation by overriding the default GICR
      frames with array of GICR frames and setting the chip 0 as routing
      table owner.
      
      Change-Id: Ida35672be4bbf4c517469a5b330548d75e593ff2
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      6799a370
  2. 07 Nov, 2019 1 commit
  3. 05 Nov, 2019 1 commit
  4. 31 Oct, 2019 1 commit
    • Manish Pandey's avatar
      n1sdp: update platform macros for dual-chip setup · f91a8e4c
      Manish Pandey authored
      
      
      N1SDP supports multichip configuration wherein n1sdp boards are
      connected over high speed coherent CCIX link  for now only dual-chip is
      supported.
      
      A single instance of TF-A runs on master chip which should be aware of
      slave chip's CPU and memory topology.
      
      This patch updates platform macros to include remote chip's information
      and also ensures that a single version of firmware works for both single
      and dual-chip setup.
      
      Change-Id: I75799fd46dc10527aa99585226099d836c21da70
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      f91a8e4c
  5. 30 Oct, 2019 1 commit
    • Manish Pandey's avatar
      n1sdp: introduce platform information SDS region · 34c7af41
      Manish Pandey authored
      
      
      Platform information structure holds information about platform's DDR
      size(local/remote) which will be used to zero out the memory before
      enabling the ECC capability as well as information about multichip
      setup. Multichip and remote DDR information can only be probed in SCP,
      SDS region will be used by TF-A to get this information at boot up.
      
      This patch introduces a new SDS to store platform information, which is
      populated dynamically by SCP Firmware.previously used mem_info SDS is
      also made part of this structure itself.
      
      The platform information is also passed to BL33 by copying it to Non-
      Secure SRAM.
      
      Change-Id: I4781dc6a7232c3c0a3219b164d943ce9e3e469ee
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      34c7af41
  6. 29 Oct, 2019 1 commit
    • Andrew F. Davis's avatar
      ti: k3: common: Add PIE support · ff835a9a
      Andrew F. Davis authored
      
      
      Running TF-A from non-standard location such as DRAM is useful for some
      SRAM heavy use-cases. Allow the TF-A binary to be executed from an
      arbitrary memory location.
      Signed-off-by: default avatarAndrew F. Davis <afd@ti.com>
      Change-Id: Icd97926e4d97f37d7cde4a92758a52f57d569111
      ff835a9a
  7. 24 Oct, 2019 13 commits
  8. 21 Oct, 2019 1 commit
    • Manish Pandey's avatar
      plat/arm: use Aff3 bits also to validate mpidr · b30646a8
      Manish Pandey authored
      
      
      There are some platforms which uses MPIDR Affinity level 3 for storing
      extra affinity information e.g. N1SDP uses it for keeping chip id in a
      multichip setup, for such platforms MPIDR validation should not fail.
      
      This patch adds Aff3 bits also as part of mpidr validation mask, for
      platforms which does not uses Aff3 will not have any impact as these
      bits will be all zeros.
      
      Change-Id: Ia8273972fa7948fdb11708308d0239d2dc4dfa85
      Signed-off-by: default avatarManish Pandey <manish.pandey2@arm.com>
      b30646a8
  9. 03 Oct, 2019 5 commits
  10. 02 Oct, 2019 1 commit
  11. 01 Oct, 2019 2 commits
    • Radoslaw Biernacki's avatar
      qemu/qemu_sbsa: Adding memory mapping for both FLASH0/FLASH1 · fa405e3b
      Radoslaw Biernacki authored
      This patch adds mapping for secure FLASH0 for qemu/virt and
      qemu/qemu_sbsa platforms. This change is targeted for sbsa but since both
      platforms share common code, changes in common defines was necessary.
      
      For qemu_sbsa, this patch adds necessary mapping in order to boot without
      semi-hosting from secure FLASH0. EFI need to stay in FLASH1 (share it with
      variables) since it need to "run in place" in non secure domain. Changes
      for this are under RFC at edk2-platforms mailing list:
      https://patches.linaro.org/patch/171327/
      
      
      (edk2-platforms/Platform/Qemu/SbsaQemu/SbsaQemu.dsc).
      
      In docs qemu/virt is described as using semi-hosting, therefore this change
      should be orthogonal to existing assumptions while giving possibility to
      store both bl1 and fip in FLASH0 at some point (additional changes required
      for that).
      Signed-off-by: default avatarRadoslaw Biernacki <radoslaw.biernacki@linaro.org>
      Change-Id: I782bc3637c91c01eaee680b3c5c408e24b4b6e28
      fa405e3b
    • Radoslaw Biernacki's avatar
      qemu/qemu_sbsa: Adding Qemu SBSA platform · 558a6f44
      Radoslaw Biernacki authored
      
      
      This patch introduces Qemu SBSA platform.
      Both platform specific files where copied from qemu/qemu with changes for
      DRAM base above 32bit and removal of ARMv7 conditional defines/code.
      Documentation is aligned to rest of SBSA patches along the series and
      planed changes in edk2-platform repo.
      
      Fixes ARM-software/tf-issues#602
      Signed-off-by: default avatarRadoslaw Biernacki <radoslaw.biernacki@linaro.org>
      Change-Id: I8ebc34eedb2268365e479ef05654b2df1b99128c
      558a6f44
  12. 30 Sep, 2019 1 commit
  13. 26 Sep, 2019 2 commits
  14. 25 Sep, 2019 9 commits
    • Andre Przywara's avatar
      rpi4: Add stdout-path to device tree · 1a7422eb
      Andre Przywara authored
      
      
      Some device tree users like to find a pointer to the standard serial
      console in the device tree, in the "stdout-path" property of the /chosen
      node.
      
      Add the location of the Mini UART in that property, so that DT users are
      happy, for instance Linux' earlycon detection.
      
      Change-Id: I178e55016e5640de5ab0bc6e061944bd3583ea96
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      1a7422eb
    • Andre Przywara's avatar
      rpi4: Add GIC maintenance interrupt to GIC DT node · 3903a8cd
      Andre Przywara authored
      
      
      For being able to use the virtualisation support the GIC offers, we need
      to know the interrupt number of the maintenance interrupt. This
      information is missing from the official RPi4 device tree.
      
      Use libfdt to add the "interrupts" property to the GIC node, which
      allows hypervisors like KVM or Xen to be able to use the GIC's help on
      virtualising interrupts.
      
      Change-Id: Iab84f0885a5bf29fb84ca8f385e8a39d27700c75
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      3903a8cd
    • Andre Przywara's avatar
      rpi4: Cleanup memory regions, move pens to first page · 882c0ff6
      Andre Przywara authored
      
      
      Now that we have the SMP pens in the first page of DRAM, we can get rid
      of all the fancy RPi3 memory regions that our RPi4 port does not really
      need. This avoids using up memory all over the place, restricting ATF
      to just run in the first 512KB of DRAM.
      
      Remove the now unused regions. This also moves the SMP pens into our
      first memory page (holding the firmware magic), where the original
      firmware put them, but where there is also enough space for them.
      
      Since the pens will require code execution privileges, we amend the
      memory attributes used for that page to include write and execution
      rights.
      
      Change-Id: I131633abeb4a4d7b9057e737b9b0d163b73e47c6
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      882c0ff6
    • Andre Przywara's avatar
      rpi4: Reserve resident BL31 region from non-secure world · 2b19e2f3
      Andre Przywara authored
      
      
      The GPU firmware loads the armstub8.bin (BL31) image at address 0, the
      beginning of DRAM. As this holds the resident PSCI code and the SMP
      pens, the non-secure world should better know about this, to avoid
      accessing memory owned by TF-A. This is particularly criticial as the
      Raspberry Pi 4 does not feature a secure memory controller, so
      overwriting code is a very real danger.
      
      Use the newly introduced function to add a node into reserved-memory
      node, where non-secure world can check for regions to be excluded from
      its mappings.
      
      Reserve the first 512KB of memory for now. We can refine this later if
      need be.
      
      Change-Id: I00e55e70c5c02615320d79ff35bc32b805d30770
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      2b19e2f3
    • Andre Przywara's avatar
      rpi4: Amend DTB to advertise PSCI · f67fa69c
      Andre Przywara authored
      
      
      The device tree provided by the official Raspberry Pi firmware uses
      spin tables for SMP bringup.
      
      One of the benefit of having TF-A is that it provides PSCI services, so
      let's rewrite the DTB to advertise PSCI instead of spin tables.
      This uses the (newly exported) routine from the QEMU platform port.
      
      Change-Id: Ifddcb14041ca253a333f8c2d5e97a42db152470c
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      f67fa69c
    • Andre Przywara's avatar
      rpi4: Determine BL33 entry point at runtime · 448fb352
      Andre Przywara authored
      
      
      Now that we have the armstub magic value in place, the GPU firmware will
      write the kernel load address (and DTB address) into our special page,
      so we can always easily access the actual location without hardcoding
      any addresses into the BL31 image.
      
      Make the compile-time defined PRELOADED_BL33_BASE macro optional, and
      read the BL33 entry point from the magic location, if the macro was not
      defined. We do the same for the DTB address.
      
      This also splits the currently "common" definition of
      plat_get_ns_image_entrypoint() to be separate between RPi3 and RPi4.
      
      Change-Id: I6f26c0adc6fce2df47786b271c490928b4529abb
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      448fb352
    • Andre Przywara's avatar
      rpi4: Accommodate "armstub8.bin" header at the beginning of BL31 image · c4597e13
      Andre Przywara authored
      
      
      The Raspberry Pi GPU firmware checks for a magic value at offset 240
      (0xf0) of the armstub8.bin image it loads. If that value matches,
      it writes the kernel load address and the DTB address into subsequent
      memory locations.
      We can use these addresses to avoid hardcoding these values into the BL31
      image, to make it more flexible and a drop-in replacement for the
      official armstub8.bin.
      
      Reserving just 16 bytes at offset 240 of the final image file is not easily
      possible, though, as this location is in the middle of the generic BL31
      entry point code.
      However we can prepend an extra section before the actual BL31 image, to
      contain the magic and addresses. This needs to be 4KB, because the
      actual BL31 entry point needs to be page aligned.
      
      Use the platform linker script hook that the generic code provides, to
      add an almost empty 4KB code block before the entry point code. The very
      first word contains a branch instruction to jump over this page, into
      the actual entry code.
      This also gives us plenty of room for the SMP pens later.
      
      Change-Id: I38caa5e7195fa39cbef8600933a03d86f09263d6
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      c4597e13
    • Andre Przywara's avatar
      Add basic support for Raspberry Pi 4 · f5cb15b0
      Andre Przywara authored
      
      
      The Raspberry Pi 4 is a single board computer with four Cortex-A72
      cores. From a TF-A perspective it is quite similar to the Raspberry Pi
      3, although it comes with more memory (up to 4GB) and has a GIC.
      
      This initial port though differs quite a lot from the existing rpi3
      platform port, mainly due to taking a much simpler and more robust
      approach to loading the non-secure payload:
      The GPU firmware of the SoC, which is responsible for initial platform
      setup (including DRAM initialisation), already loads the kernel, device
      tree and the "armstub" into DRAM. We take advantage of this, by placing
      just a BL31 component into the armstub8.bin component, which will be
      executed first, in AArch64 EL3.
      The non-secure payload can be a kernel or a boot loader (U-Boot or
      EDK-2), disguised as the "kernel" image and loaded by the GPU firmware.
      
      So this is just a BL31-only port, which directly drops into EL2
      and executes whatever has been loaded as the "kernel" image, handing
      over the DTB address in x0.
      
      Change-Id: I636f4d1f661821566ad9e341d69ba36f6bbfb546
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      f5cb15b0
    • Andre Przywara's avatar
      rpi3: Allow runtime determination of UART base clock rate · 7c0a1877
      Andre Przywara authored
      
      
      At the moment the UART input clock rate is hard coded at compile time.
      This works as long as the GPU firmware always sets up the same rate,
      which does not seem to be true for the Raspberry Pi 4.
      
      In preparation for being able to change this at runtime, add a base
      clock parameter to the console setup function. This is still hardcoded
      for the Raspberry Pi 3.
      
      Change-Id: I398bc2f1e9b46f7af9a84cb0b33cbe8e78f2d900
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      7c0a1877