1. 25 Mar, 2021 1 commit
    • Andre Przywara's avatar
      allwinner: Move sunxi_cpu_power_off_self() into platforms · 9227719d
      Andre Przywara authored
      
      
      The code to power the current core off when SCPI is not available is now
      different for the two supported SoC families.
      To make adding new platforms easier, move sunxi_cpu_power_off_self()
      into the SoC directory, so we don't need to carry definitions for both
      methods for all SoCs.
      
      On the H6 we just need to trigger the CPUIDLE hardware, so can get rid
      of all the code to program the ARISC, which is now only needed for the
      A64 version.
      
      Change-Id: Id2a1ac7dcb375e2fd021b441575ce86b4d7edf2c
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      9227719d
  2. 23 Mar, 2021 1 commit
  3. 24 Jan, 2021 1 commit
    • Samuel Holland's avatar
      allwinner: Separate code to power off self and other CPUs · a1d349be
      Samuel Holland authored
      
      
      Currently, sunxi_cpu_off() has two separate code paths: one for the
      local CPU, and one for other CPUs. Let's split them in to two functions.
      This actually simplifies things, because all callers either operate on
      the local CPU only (sunxi_pwr_down_wfi()) or other CPUs only
      (sunxi_cpu_power_off_others()). This avoids needing a second MPIDR read
      to choose the appropriate code path.
      
      Change-Id: I55de85025235cc95466bfa106831fc4c2368f527
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      a1d349be
  4. 04 Dec, 2019 1 commit
  5. 18 Feb, 2019 1 commit
  6. 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
  7. 20 Oct, 2018 2 commits
    • Andre Przywara's avatar
      allwinner: Use the arisc to turn off ARM cores · 7db0c960
      Andre Przywara authored
      
      
      PSCI requires a core to turn itself off, which we can't do properly by
      just executing an algorithm on that very core. As a consequence we just
      put a core into WFI on CPU_OFF right now.
      To fix this let's task the "arisc" management processor (an OpenRISC
      core) with that task of asserting reset and turning off the core's power
      domain. We use a handcrafted sequence of OpenRISC instructions to
      achieve this, and hand this data over to the new sunxi_execute_arisc_code()
      routine.
      The commented source code for this routine is provided in a separate file,
      but the ATF code contains the already encoded instructions as data.
      The H6 uses the same algorithm, but differs in the MMIO addresses, so
      provide a SoC (family) specific copy of that code.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      7db0c960
    • Andre Przywara's avatar
      allwinner: Export sunxi_private.h · 4ec1a239
      Andre Przywara authored
      
      
      So far we have a sunxi_private.h header file in the common code directory.
      This holds the prototypes of various functions we share in *common*
      code. However we will need some of those in the platform specific code
      parts as well, and want to introduce new functions shared across the
      whole platform port.
      
      So move the sunxi_private.h file into the common/include directory, so
      that it becomes visible to all parts of the platform code.
      Fix up the existing #includes and add missing ones, also add the
      sunxi_read_soc_id() prototype here.
      
      This will be used in follow up patches.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      4ec1a239
  8. 28 Jun, 2018 1 commit
  9. 15 Jun, 2018 1 commit
    • Samuel Holland's avatar
      allwinner: Add functions to control CPU power/reset · 333d66cf
      Samuel Holland authored
      
      
      sun50i_cpu_on will be used by the PSCI implementation to initialize
      secondary cores for SMP. Unfortunately, sun50i_cpu_off is not usable by
      PSCI directly, because it is not possible for a CPU to use this function
      to power itself down. Power cannot be shut off until the outputs are
      clamped, and MMIO does not work once the outputs are clamped.
      
      But at least CPU0 can shutdown the other cores early in the BL31 boot
      process and before shutting down the system.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      333d66cf