1. 27 5月, 2015 6 次提交
  2. 19 5月, 2015 1 次提交
    • L
      ARM64: kernel: make cpu_ops hooks DT agnostic · 819a8826
      Lorenzo Pieralisi 提交于
      ARM64 CPU operations such as cpu_init and cpu_init_idle take
      a struct device_node pointer as a parameter, which corresponds to
      the device tree node of the logical cpu on which the operation
      has to be applied.
      
      With the advent of ACPI on arm64, where MADT static table entries
      are used to initialize cpus, the device tree node parameter
      in cpu_ops hooks become useless when booting with ACPI, since
      in that case cpu device tree nodes are not present and can not be
      used for cpu initialization.
      
      The current cpu_init hook requires a struct device_node pointer
      parameter because it is called while parsing the device tree to
      initialize CPUs, when the cpu_logical_map (that is used to match
      a cpu node reg property to a device tree node) for a given logical
      cpu id is not set up yet. This means that the cpu_init hook cannot
      rely on the of_get_cpu_node function to retrieve the device tree
      node corresponding to the logical cpu id passed in as parameter,
      so the cpu device tree node must be passed in as a parameter to fix
      this catch-22 dependency cycle.
      
      This patch reshuffles the cpu_logical_map initialization code so
      that the cpu_init cpu_ops hook can safely use the of_get_cpu_node
      function to retrieve the cpu device tree node, removing the need for
      the device tree node pointer parameter.
      
      In the process, the patch removes device tree node parameters
      from all cpu_ops hooks, in preparation for SMP DT/ACPI cpus
      initialization consolidation.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Acked-by: NSudeep Holla <sudeep.holla@arm.com>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: Mark Rutland <mark.rutland@arm.com> [DT]
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      819a8826
  3. 26 3月, 2015 2 次提交
  4. 25 3月, 2015 1 次提交
  5. 27 2月, 2015 1 次提交
    • W
      arm64: psci: move psci firmware calls out of line · f5e0a12c
      Will Deacon 提交于
      An arm64 allmodconfig fails to build with GCC 5 due to __asmeq
      assertions in the PSCI firmware calling code firing due to mcount
      preambles breaking our assumptions about register allocation of function
      arguments:
      
        /tmp/ccDqJsJ6.s: Assembler messages:
        /tmp/ccDqJsJ6.s:60: Error: .err encountered
        /tmp/ccDqJsJ6.s:61: Error: .err encountered
        /tmp/ccDqJsJ6.s:62: Error: .err encountered
        /tmp/ccDqJsJ6.s:99: Error: .err encountered
        /tmp/ccDqJsJ6.s:100: Error: .err encountered
        /tmp/ccDqJsJ6.s:101: Error: .err encountered
      
      This patch fixes the issue by moving the PSCI calls out-of-line into
      their own assembly files, which are safe from the compiler's meddling
      fingers.
      Reported-by: NAndy Whitcroft <apw@canonical.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      f5e0a12c
  6. 27 1月, 2015 1 次提交
    • L
      arm64: kernel: remove ARM64_CPU_SUSPEND config option · af3cfdbf
      Lorenzo Pieralisi 提交于
      ARM64_CPU_SUSPEND config option was introduced to make code providing
      context save/restore selectable only on platforms requiring power
      management capabilities.
      
      Currently ARM64_CPU_SUSPEND depends on the PM_SLEEP config option which
      in turn is set by the SUSPEND config option.
      
      The introduction of CPU_IDLE for arm64 requires that code configured
      by ARM64_CPU_SUSPEND (context save/restore) should be compiled in
      in order to enable the CPU idle driver to rely on CPU operations
      carrying out context save/restore.
      
      The ARM64_CPUIDLE config option (ARM64 generic idle driver) is therefore
      forced to select ARM64_CPU_SUSPEND, even if there may be (ie PM_SLEEP)
      failed dependencies, which is not a clean way of handling the kernel
      configuration option.
      
      For these reasons, this patch removes the ARM64_CPU_SUSPEND config option
      and makes the context save/restore dependent on CPU_PM, which is selected
      whenever either SUSPEND or CPU_IDLE are configured, cleaning up dependencies
      in the process.
      
      This way, code previously configured through ARM64_CPU_SUSPEND is
      compiled in whenever a power management subsystem requires it to be
      present in the kernel (SUSPEND || CPU_IDLE), which is the behaviour
      expected on ARM64 kernels.
      
      The cpu_suspend and cpu_init_idle CPU operations are added only if
      CPU_IDLE is selected, since they are CPU_IDLE specific methods and
      should be grouped and defined accordingly.
      
      PSCI CPU operations are updated to reflect the introduced changes.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      af3cfdbf
  7. 11 12月, 2014 1 次提交
    • K
      arm64: psci: Fix build breakage without PM_SLEEP · e5e62d47
      Krzysztof Kozlowski 提交于
      Fix build failure of defconfig when PM_SLEEP is disabled (e.g. by
      disabling SUSPEND) and CPU_IDLE enabled:
      
      arch/arm64/kernel/psci.c:543:2: error: unknown field ‘cpu_suspend’ specified in initializer
        .cpu_suspend = cpu_psci_cpu_suspend,
        ^
      arch/arm64/kernel/psci.c:543:2: warning: initialization from incompatible pointer type [enabled by default]
      arch/arm64/kernel/psci.c:543:2: warning: (near initialization for ‘cpu_psci_ops.cpu_prepare’) [enabled by default]
      make[1]: *** [arch/arm64/kernel/psci.o] Error 1
      
      The cpu_operations.cpu_suspend field exists only if ARM64_CPU_SUSPEND is
      defined, not CPU_IDLE.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      e5e62d47
  8. 31 10月, 2014 1 次提交
  9. 29 10月, 2014 1 次提交
  10. 12 9月, 2014 1 次提交
    • L
      arm64: add PSCI CPU_SUSPEND based cpu_suspend support · 18910ab0
      Lorenzo Pieralisi 提交于
      This patch implements the cpu_suspend cpu operations method through
      the PSCI CPU SUSPEND API. The PSCI implementation translates the idle state
      index passed by the cpu_suspend core call into a valid PSCI state according to
      the PSCI states initialized at boot through the cpu_init_idle() CPU
      operations hook.
      
      The PSCI CPU suspend operation hook checks if the PSCI state is a
      standby state. If it is, it calls the PSCI suspend implementation
      straight away, without saving any context. If the state is a power
      down state the kernel calls the __cpu_suspend API (that saves the CPU
      context) and passed the PSCI suspend finisher as a parameter so that PSCI
      can be called by the __cpu_suspend implementation after saving and flushing
      the context as last function before power down.
      
      For power down states, entry point is set to cpu_resume physical address,
      that represents the default kernel execution address following a CPU reset.
      Reviewed-by: NAshwin Chaugule <ashwin.chaugule@linaro.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      18910ab0
  11. 18 7月, 2014 2 次提交
  12. 15 5月, 2014 2 次提交
  13. 28 2月, 2014 2 次提交
  14. 25 10月, 2013 4 次提交
    • M
      arm64: add PSCI CPU_OFF-based hotplug support · 831ccf79
      Mark Rutland 提交于
      This patch adds support for using PSCI CPU_OFF calls for CPU hotplug.
      With this code it is possible to hot unplug CPUs with "psci" as their
      boot-method, as long as there's an appropriate cpu_off function id
      specified in the psci node.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      831ccf79
    • M
      arm64: factor out spin-table boot method · 652af899
      Mark Rutland 提交于
      The arm64 kernel has an internal holding pen, which is necessary for
      some systems where we can't bring CPUs online individually and must hold
      multiple CPUs in a safe area until the kernel is able to handle them.
      The current SMP infrastructure for arm64 is closely coupled to this
      holding pen, and alternative boot methods must launch CPUs into the pen,
      where they sit before they are launched into the kernel proper.
      
      With PSCI (and possibly other future boot methods), we can bring CPUs
      online individually, and need not perform the secondary_holding_pen
      dance. Instead, this patch factors the holding pen management code out
      to the spin-table boot method code, as it is the only boot method
      requiring the pen.
      
      A new entry point for secondaries, secondary_entry is added for other
      boot methods to use, which bypasses the holding pen and its associated
      overhead when bringing CPUs online. The smp.pen.text section is also
      removed, as the pen can live in head.text without problem.
      
      The cpu_operations structure is extended with two new functions,
      cpu_boot and cpu_postboot, for bringing a cpu into the kernel and
      performing any post-boot cleanup required by a bootmethod (e.g.
      resetting the secondary_holding_pen_release to INVALID_HWID).
      Documentation is added for cpu_operations.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      652af899
    • M
      arm64: reorganise smp_enable_ops · cd1aebf5
      Mark Rutland 提交于
      For hotplug support, we're going to want a place to store operations
      that do more than bring CPUs online, and it makes sense to group these
      with our current smp_enable_ops. For cpuidle support, we'll want to
      group additional functions, and we may want them even for UP kernels.
      
      This patch renames smp_enable_ops to the more general cpu_operations,
      and pulls the definitions out of smp code such that they can be used in
      UP kernels. While we're at it, fix up instances of the cpu parameter to
      be an unsigned int, drop the init markings and rename the *_cpu
      functions to cpu_* to reduce future churn when cpu_operations is
      extended.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      cd1aebf5
    • M
      arm64: unify smp_psci.c and psci.c · 00ef54bb
      Mark Rutland 提交于
      The functions in psci.c are only used from smp_psci.c, and smp_psci
      cannot function without psci.c. Additionally psci.c is built when !SMP,
      where it's expected that cpu_suspend may be useful.
      
      This patch unifies the two files, removing pointless duplication and
      paving the way for PSCI support in UP systems.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      00ef54bb
  15. 30 1月, 2013 1 次提交