linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [PATCH 00/13] QCOM: 8087 CPUIDLE driver
@ 2014-08-08  4:00 Lina Iyer
  2014-08-08  4:00 ` [RFC] [PATCH 01/13] msm: scm: Move scm-boot files to drivers/soc and include/soc Lina Iyer
                   ` (13 more replies)
  0 siblings, 14 replies; 18+ messages in thread
From: Lina Iyer @ 2014-08-08  4:00 UTC (permalink / raw)
  To: daniel.lezcano, khilman, amit.kucheria, sboyd, davidb, galak,
	linux-arm-msm, linux-arm-kernel
  Cc: msivasub, bryanh, Lina Iyer

Hello everybody,

Here are the set of patches for enabling cpuidle driver for 8074 based targets.

8074 like any ARM SoC can do architectural clock gating, that helps save on
power, but not enough of leakage power.  Leakage power of the SoC can be
further reduced by turning off power to the core. To aid this, every core (cpu
and L2) is accompanied by a Sub-system Power Manager (SPM), that can be
configured to indicate the low power mode, the core would be put into and the
SPM programs the peripheral h/w accordingly to enter low power and turn off the
power rail to the core.

The patchsets do the following

- Move scm-boot files from arm/mach-qcom to drivers/soc, following convention.
They are based on Stephen Boyd's series of patches
[http://www.spinics.net/lists/linux-arm-msm/msg10482.html]

- Add new Secure Monitor flags to support warmboot of a quad core system.

- Introduce the SPM driver to control power to the core. The SPM h/w IP works
in conjunction with the Krait CPU/L2. When the core executes WFI instruction,
the core is clockgated and the SPM state machine takes over and powers the core
down. An interrupt from GIC, resumes the SPM state machine which brings the cpu
out of the low power mode.

- Add the device tree configuration for each of the SPM nodes. There is one for
each cpu. There is one for each cpu and one for L2 and one for L2.

- Introduce the SoC driver interface layer to configure SPM per the core's idle
 state. To power down the cpu core, the SPM h/w needs to be set up correctly
to power down the core, when the core executes WFI. Linux is expected to call
into Secure Monitor to power down the core. At reset, the core will start in
Seure mode and will be returned back to Linux.  Also, when powering down the
core, let the SCM know the state of L2 as set up in Linux. This allows secure
monitor to flush the secure lines when Linux knows the cache may be powered
off. 

- Add ability to recognize the power down status of the core, to ensure that
the core is indeed powered down before powering down peripheral h/w.

- Add support for deeper idle states than just clock gating for hotplug and warmboot

- Add CPUIDLE driver for QCOM cpus. The cpuidle driver uses the SoC interface
layer to configure the SPM to allow Krait to be powered down. The driver
supports 4 low power modes, but not all SoCs, support all low power modes. The
modes supported are configured in device tree nodes.

- Provide device configuration for 8074 SoC. Current support is for WFI and
standalone power collapse, which powers only the core independent of the
other cores and caches.

- KConfig option to enable the driver

I have tested them on the Dragonboard 8074. The drivers should be fairly
extensible to 8084.

Thanks
Lina


Lina Iyer (13):
  msm: scm: Move scm-boot files to drivers/soc and include/soc
  msm: scm: Add SCM warmboot flags for quad core targets.
  qcom: spm: Add Subsystem Power Manager driver for QCOM chipsets
  arm: dts: qcom: Add SPM device bindings for 8974
  qcom: msm-pm: Add cpu low power mode functions
  qcom: msm-pm: Add support for hotplug and secondary startup
  qcom: sleep-status: Add ability to recognize cpu power down state
  arm: dts: qcom: Add device binding for sleep status
  soc: qcom: Add QCOM Power management config
  qcom: platsmp: Enable deeper idle states for hotplug
  qcom: cpuidle: Add cpuidle driver for QCOM cpus
  qcom: cpuidle: Add cpuidle device nodes for 8974 chipset
  qcom: cpuidle: Config option to enable QCOM cpuidle driver

 .../bindings/arm/msm/qcom,cpu-sleep-status.txt     |  41 ++
 .../devicetree/bindings/arm/msm/qcom,cpuidle.txt   |  73 +++
 .../devicetree/bindings/arm/msm/spm-v2.txt         | 104 +++
 arch/arm/boot/dts/qcom-msm8974-pm.dtsi             | 146 +++++
 arch/arm/boot/dts/qcom-msm8974.dtsi                |   2 +
 arch/arm/mach-qcom/Makefile                        |   1 -
 arch/arm/mach-qcom/platsmp.c                       |  22 +-
 drivers/cpuidle/Kconfig.arm                        |   6 +
 drivers/cpuidle/Makefile                           |   1 +
 drivers/cpuidle/cpuidle-qcom.c                     | 140 ++++
 drivers/soc/qcom/Kconfig                           |   8 +
 drivers/soc/qcom/Makefile                          |   4 +-
 drivers/soc/qcom/msm-pm.c                          | 254 ++++++++
 .../arm/mach-qcom => drivers/soc/qcom}/scm-boot.c  |   4 +-
 drivers/soc/qcom/sleep-status.c                    | 178 ++++++
 drivers/soc/qcom/spm.c                             | 559 ++++++++++++++++
 drivers/soc/qcom/spm_devices.c                     | 709 +++++++++++++++++++++
 drivers/soc/qcom/spm_driver.h                      | 118 ++++
 include/soc/qcom/pm.h                              |  45 ++
 .../arm/mach-qcom => include/soc/qcom}/scm-boot.h  |   3 +
 include/soc/qcom/spm.h                             | 106 +++
 21 files changed, 2519 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,cpu-sleep-status.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,cpuidle.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/spm-v2.txt
 create mode 100644 arch/arm/boot/dts/qcom-msm8974-pm.dtsi
 create mode 100644 drivers/cpuidle/cpuidle-qcom.c
 create mode 100644 drivers/soc/qcom/msm-pm.c
 rename {arch/arm/mach-qcom => drivers/soc/qcom}/scm-boot.c (97%)
 create mode 100644 drivers/soc/qcom/sleep-status.c
 create mode 100644 drivers/soc/qcom/spm.c
 create mode 100644 drivers/soc/qcom/spm_devices.c
 create mode 100644 drivers/soc/qcom/spm_driver.h
 create mode 100644 include/soc/qcom/pm.h
 rename {arch/arm/mach-qcom => include/soc/qcom}/scm-boot.h (91%)
 create mode 100644 include/soc/qcom/spm.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [RFC] [PATCH 00/13] QCOM: 8074 CPUIDLE driver
@ 2014-08-08  4:05 Lina Iyer
  2014-08-08  4:05 ` [RFC] [PATCH 02/13] msm: scm: Add SCM warmboot flags for quad core targets Lina Iyer
  0 siblings, 1 reply; 18+ messages in thread
From: Lina Iyer @ 2014-08-08  4:05 UTC (permalink / raw)
  To: daniel.lezcano, khilman, amit.kucheria, sboyd, davidb, galak,
	linux-arm-msm
  Cc: msivasub, bryanh, Lina Iyer

Hello everybody,

Here are the set of patches for enabling cpuidle driver for 8074 based targets.

8074 like any ARM SoC can do architectural clock gating, that helps save on
power, but not enough of leakage power.  Leakage power of the SoC can be
further reduced by turning off power to the core. To aid this, every core (cpu
and L2) is accompanied by a Sub-system Power Manager (SPM), that can be
configured to indicate the low power mode, the core would be put into and the
SPM programs the peripheral h/w accordingly to enter low power and turn off the
power rail to the core.

The patchsets do the following

- Move scm-boot files from arm/mach-qcom to drivers/soc, following convention.
They are based on Stephen Boyd's series of patches
[http://www.spinics.net/lists/linux-arm-msm/msg10482.html]

- Add new Secure Monitor flags to support warmboot of a quad core system.

- Introduce the SPM driver to control power to the core. The SPM h/w IP works
in conjunction with the Krait CPU/L2. When the core executes WFI instruction,
the core is clockgated and the SPM state machine takes over and powers the core
down. An interrupt from GIC, resumes the SPM state machine which brings the cpu
out of the low power mode.

- Add the device tree configuration for each of the SPM nodes. There is one for
each cpu. There is one for each cpu and one for L2 and one for L2.

- Introduce the SoC driver interface layer to configure SPM per the core's idle
 state. To power down the cpu core, the SPM h/w needs to be set up correctly
to power down the core, when the core executes WFI. Linux is expected to call
into Secure Monitor to power down the core. At reset, the core will start in
Seure mode and will be returned back to Linux.  Also, when powering down the
core, let the SCM know the state of L2 as set up in Linux. This allows secure
monitor to flush the secure lines when Linux knows the cache may be powered
off. 

- Add ability to recognize the power down status of the core, to ensure that
the core is indeed powered down before powering down peripheral h/w.

- Add support for deeper idle states than just clock gating for hotplug and warmboot

- Add CPUIDLE driver for QCOM cpus. The cpuidle driver uses the SoC interface
layer to configure the SPM to allow Krait to be powered down. The driver
supports 4 low power modes, but not all SoCs, support all low power modes. The
modes supported are configured in device tree nodes.

- Provide device configuration for 8074 SoC. Current support is for WFI and
standalone power collapse, which powers only the core independent of the
other cores and caches.

- KConfig option to enable the driver

I have tested them on the Dragonboard 8074. The drivers should be fairly
extensible to 8084.

Thanks
Lina


Lina Iyer (13):
  msm: scm: Move scm-boot files to drivers/soc and include/soc
  msm: scm: Add SCM warmboot flags for quad core targets.
  qcom: spm: Add Subsystem Power Manager driver for QCOM chipsets
  arm: dts: qcom: Add SPM device bindings for 8974
  qcom: msm-pm: Add cpu low power mode functions
  qcom: msm-pm: Add support for hotplug and secondary startup
  qcom: sleep-status: Add ability to recognize cpu power down state
  arm: dts: qcom: Add device binding for sleep status
  soc: qcom: Add QCOM Power management config
  qcom: platsmp: Enable deeper idle states for hotplug
  qcom: cpuidle: Add cpuidle driver for QCOM cpus
  qcom: cpuidle: Add cpuidle device nodes for 8974 chipset
  qcom: cpuidle: Config option to enable QCOM cpuidle driver

 .../bindings/arm/msm/qcom,cpu-sleep-status.txt     |  41 ++
 .../devicetree/bindings/arm/msm/qcom,cpuidle.txt   |  73 +++
 .../devicetree/bindings/arm/msm/spm-v2.txt         | 104 +++
 arch/arm/boot/dts/qcom-msm8974-pm.dtsi             | 146 +++++
 arch/arm/boot/dts/qcom-msm8974.dtsi                |   2 +
 arch/arm/mach-qcom/Makefile                        |   1 -
 arch/arm/mach-qcom/platsmp.c                       |  22 +-
 drivers/cpuidle/Kconfig.arm                        |   6 +
 drivers/cpuidle/Makefile                           |   1 +
 drivers/cpuidle/cpuidle-qcom.c                     | 140 ++++
 drivers/soc/qcom/Kconfig                           |   8 +
 drivers/soc/qcom/Makefile                          |   4 +-
 drivers/soc/qcom/msm-pm.c                          | 254 ++++++++
 .../arm/mach-qcom => drivers/soc/qcom}/scm-boot.c  |   4 +-
 drivers/soc/qcom/sleep-status.c                    | 178 ++++++
 drivers/soc/qcom/spm.c                             | 559 ++++++++++++++++
 drivers/soc/qcom/spm_devices.c                     | 709 +++++++++++++++++++++
 drivers/soc/qcom/spm_driver.h                      | 118 ++++
 include/soc/qcom/pm.h                              |  45 ++
 .../arm/mach-qcom => include/soc/qcom}/scm-boot.h  |   3 +
 include/soc/qcom/spm.h                             | 106 +++
 21 files changed, 2519 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,cpu-sleep-status.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,cpuidle.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/spm-v2.txt
 create mode 100644 arch/arm/boot/dts/qcom-msm8974-pm.dtsi
 create mode 100644 drivers/cpuidle/cpuidle-qcom.c
 create mode 100644 drivers/soc/qcom/msm-pm.c
 rename {arch/arm/mach-qcom => drivers/soc/qcom}/scm-boot.c (97%)
 create mode 100644 drivers/soc/qcom/sleep-status.c
 create mode 100644 drivers/soc/qcom/spm.c
 create mode 100644 drivers/soc/qcom/spm_devices.c
 create mode 100644 drivers/soc/qcom/spm_driver.h
 create mode 100644 include/soc/qcom/pm.h
 rename {arch/arm/mach-qcom => include/soc/qcom}/scm-boot.h (91%)
 create mode 100644 include/soc/qcom/spm.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-08-08 22:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08  4:00 [RFC] [PATCH 00/13] QCOM: 8087 CPUIDLE driver Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 01/13] msm: scm: Move scm-boot files to drivers/soc and include/soc Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 02/13] msm: scm: Add SCM warmboot flags for quad core targets Lina Iyer
2014-08-08 16:19   ` Kumar Gala
2014-08-08 22:06     ` Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 03/13] qcom: spm: Add Subsystem Power Manager driver for QCOM chipsets Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 04/13] arm: dts: qcom: Add SPM device bindings for 8974 Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 05/13] qcom: msm-pm: Add cpu low power mode functions Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 06/13] qcom: msm-pm: Add support for hotplug and secondary startup Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 07/13] qcom: sleep-status: Add ability to recognize cpu power down state Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 08/13] arm: dts: qcom: Add device binding for sleep status Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 09/13] soc: qcom: Add QCOM Power management config Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 10/13] qcom: platsmp: Enable deeper idle states for hotplug Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 11/13] qcom: cpuidle: Add cpuidle driver for QCOM cpus Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 12/13] qcom: cpuidle: Add cpuidle device nodes for 8974 chipset Lina Iyer
2014-08-08  4:00 ` [RFC] [PATCH 13/13] qcom: cpuidle: Config option to enable QCOM cpuidle driver Lina Iyer
2014-08-08 14:33 ` [RFC] [PATCH 00/13] QCOM: 8087 CPUIDLE driver Lina Iyer
  -- strict thread matches above, loose matches on Subject: below --
2014-08-08  4:05 [RFC] [PATCH 00/13] QCOM: 8074 " Lina Iyer
2014-08-08  4:05 ` [RFC] [PATCH 02/13] msm: scm: Add SCM warmboot flags for quad core targets Lina Iyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).