Skip to content
  1. May 30, 2014
  2. May 29, 2014
  3. May 28, 2014
    • Paul Burton's avatar
      MIPS: Malta: CPS SMP by default · 32201453
      Paul Burton authored
      
      
      The CONFIG_MIPS_CPS SMP implementation should be able to handle all
      cases the CONFIG_MIPS_CMP implementation does, but without requiring
      bootloader assistance. It is also required in order to make use of
      features such as hotplug & cpuidle core power gating. Enable it by
      default for Malta configs that previously enabled the now deprecated
      CONFIG_MIPS_CMP, and disable the latter. The local version suffix "cmp"
      is removed rather than replaced with "cps" since there are other ways to
      tell that the CPS SMP implementation is in use (the "VPE topology" line
      in the boot log being one).
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      32201453
    • Paul Burton's avatar
      cpuidle: cpuidle-cps: add MIPS CPS cpuidle driver · d0508944
      Paul Burton authored
      
      
      This patch adds a cpuidle driver for systems based around the MIPS
      Coherent Processing System (CPS) architecture. It supports four idle
      states:
      
        - The standard MIPS wait instruction.
      
        - The non-coherent wait, clock gated & power gated states exposed by
          the recently added pm-cps layer.
      
      The pm-cps layer is used to enter all the deep idle states. Since cores
      in the clock or power gated states cannot service interrupts, the
      gic_send_ipi_single function is modified to send a power up command for
      the appropriate core to the CPC in cases where the target CPU has marked
      itself potentially incoherent.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      d0508944
    • Paul Burton's avatar
      cpuidle: declare cpuidle_dev in cpuidle.h · f08dbf8a
      Paul Burton authored
      
      
      Declaring this allows drivers which need to initialise each struct
      cpuidle_device at initialisation time to make use of the structures
      already defined in cpuidle.c, rather than having to wastefully define
      their own.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      f08dbf8a
    • Paul Burton's avatar
      MIPS: include cpuidle Kconfig menu · c095ebaf
      Paul Burton authored
      
      
      This patch simply includes the cpuidle Kconfig entries in preparation
      for cpuidle drivers used on MIPS systems.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      c095ebaf
    • Paul Burton's avatar
      MIPS: cpuidle wait instruction state · da9f970f
      Paul Burton authored
      
      
      Defines a macro intended to allow trivial use of the regular MIPS wait
      instruction from cpuidle drivers, which may simply invoke the macro
      within their array of states.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      da9f970f
    • Paul Burton's avatar
      MIPS: smp-cps: duplicate core0 CCA on secondary cores · 0155a065
      Paul Burton authored
      
      
      Rather than hardcoding CCA=0x5 for secondary cores, re-use the CCA from
      the boot CPU. This allows overrides of the CCA using the cca= kernel
      parameter to take effect on all CPUs for consistency.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      0155a065
    • Paul Burton's avatar
      MIPS: smp-cps: set a coherent default CCA · 33b68665
      Paul Burton authored
      
      
      This patch sets a default CCA suited for use with multi-core SMP on all
      current MIPS CPS based systems. It may still be overriden by the cca=
      argument on the kernel command line.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      33b68665
    • Paul Burton's avatar
      MIPS: smp-cps: prevent multi-core SMP with unsuitable CCA · 5c399f6e
      Paul Burton authored
      
      
      If the user or bootloader sets the CCA to a value which is not suited
      for multi-core SMP (ie. anything non-coherent) then limit the system to
      using only a single core and warn the user.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      5c399f6e
    • Paul Burton's avatar
      MIPS: smp-cps: hotplug support · 1d8f1f5a
      Paul Burton authored
      
      
      This patch adds support for offlining CPUs via hotplug when using the
      CONFIG_MIPS_CPS SMP implementation. When a CPU is offlined one of 2
      things will happen:
      
        - If the CPU is part of a core which implements the MT ASE and there
          is at least one other VPE online within that core then the VPE will
          be halted by settings its TCHalt bit.
      
        - Otherwise if supported the core will be powered down via the CPC.
      
        - Otherwise the CPU will hang by executing an infinite loop.
      
      Bringing CPUs back online is then a process of either clearing the
      appropriate VPEs TCHalt bit or powering up the appropriate core via the
      CPC. Throughout the process the struct core_boot_config vpe_mask field
      must be maintained such that mips_cps_boot_vpes will start & stop the
      correct VPEs.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      1d8f1f5a
    • Paul Burton's avatar
      MIPS: pm-cps: add PM state entry code for CPS systems · 3179d37e
      Paul Burton authored
      
      
      This patch adds code to generate entry & exit code for various low power
      states available on systems based around the MIPS Coherent Processing
      System architecture (ie. those with a Coherence Manager, Global
      Interrupt Controller & for >=CM2 a Cluster Power Controller). States
      supported are:
      
        - Non-coherent wait. This state first leaves the coherent domain and
          then executes a regular MIPS wait instruction. Power savings are
          found from the elimination of coherency interventions between the
          core and any other coherent requestors in the system.
      
        - Clock gated. This state leaves the coherent domain and then gates
          the clock input to the core. This removes all dynamic power from the
          core but leaves the core at the mercy of another to restart its
          clock. Register state is preserved, but the core can not service
          interrupts whilst its clock is gated.
      
        - Power gated. This deepest state removes all power input to the core.
          All register state is lost and the core will restart execution from
          its BEV when another core powers it back up. Because register state
          is lost this state requires cooperation with the CONFIG_MIPS_CPS SMP
          implementation in order for the core to exit the state successfully.
      
      The code will detect which states are available on the current system
      during boot & generate the entry/exit code for those states. This will
      be used by cpuidle & hotplug implementations.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      3179d37e
    • Paul Burton's avatar
      MIPS: smp-cps: use CPC core-other locking · dd9233d0
      Paul Burton authored
      
      
      The core which the CPC core-other region relates to is based upon the
      core-local core-other addressing register. As its name suggests this
      register is shared between all VPEs within a core, and if there is a
      possibility that multiple VPEs within a core will attempt to access
      another core simultaneously then locking is required. This wasn't
      previously a problem with the only user being cpu0 during boot, but will
      be an issue once hotplug is implemented & may race with other users such
      as cpuidle.
      
      Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
      dd9233d0