All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	Dave Martin <Dave.Martin@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com
Subject: [RFC 0/7] ARM: sun9i: SMP support with Multi-Cluster Power Management
Date: Thu, 14 May 2015 14:10:04 +0800	[thread overview]
Message-ID: <1431583811-25780-1-git-send-email-wens@csie.org> (raw)

Hi everyone,

This is my attempt to support SMP and CPU hot plugging on the Allwinner
A80 SoC. The A80 is a big.Little processor with 2 clusters of 4x Cortex-A7
and 4x Cortex-A15 cores.

Much of the sunxi-specific MCPM code is derived from Allwinner code and
documentation, with some references to the other MCPM implementations,
as well as the Cortex's Technical Reference Manuals for the power
sequencing info.

One major difference compared to other platforms is we currently do not
have a standalone PMU or other embedded firmware to do the actually power
sequencing. All power/reset control is done by the kernel. As such, I
couldn't figure out where to put the code to power off the outbound
processor. I'm putting it in the .wait_for_powerdown() callback for now.
This does not get called by the big.Little switcher. But since we lack
cpufreq support at the moment, big.Little switcher is probably not going
to work anyway.

The code has been tested on my A80 Optimus, and reliably brings up all
cores. CPU hotplugging works as well. One issue I have is the processors
in cluster 0 do not stay in WFI after they are signaled to go offline.
I haven't tested the CCI-400 PMU bits yet.

I've done the best I could to fit the code into the new MCPM callbacks,
unlike the Allwinner code which uses the old .power_up()/.power_down()
ones. However my knowledge of ARM internals is limited, so it is quite
possible I got something wrong. Reviews are highly appreciated.

The actual work is split into 3 phases:

Patch 1 adds basic SMP bringup code using the common MCPM code.
No hotplugging is supported.

Patch 2 ~ 4 add the required DT device nodes.

Patch 5 adds support for hotplugging processor cores 1~7.

Patch 6 adds support for cpu0 hotplugging. The BROM checks a region
of secure SRAM for special flags. If they are set, execution is
diverted to the configured secondary startup address, just like it
would be for all the other processor cores.

Patch 7 adds the DT nodes for the secure SRAM.


Regards
ChenYu


Chen-Yu Tsai (7):
  ARM: sun9i: Support SMP on A80 with Multi-Cluster Power Management
    (MCPM)
  ARM: dts: sun9i: Add CCI-400 device nodes for A80
  ARM: dts: sun9i: Add CPUCFG device node for A80 dtsi
  ARM: dts: sun9i: Add PRCM device node for the A80 dtsi
  ARM: sunxi: mcpm: Support CPU/cluster power down and hotplugging for
    cpu1~7
  ARM: sunxi: mcpm: Support cpu0 hotplug
  ARM: dts: sun9i: Add secure SRAM node used for MCPM SMP hotplug

 arch/arm/boot/dts/sun9i-a80.dtsi |  76 ++++++
 arch/arm/mach-sunxi/Kconfig      |   8 +
 arch/arm/mach-sunxi/Makefile     |   1 +
 arch/arm/mach-sunxi/mcpm.c       | 497 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 582 insertions(+)
 create mode 100644 arch/arm/mach-sunxi/mcpm.c

-- 
2.1.4


WARNING: multiple messages have this Message-ID (diff)
From: wens@csie.org (Chen-Yu Tsai)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 0/7] ARM: sun9i: SMP support with Multi-Cluster Power Management
Date: Thu, 14 May 2015 14:10:04 +0800	[thread overview]
Message-ID: <1431583811-25780-1-git-send-email-wens@csie.org> (raw)

Hi everyone,

This is my attempt to support SMP and CPU hot plugging on the Allwinner
A80 SoC. The A80 is a big.Little processor with 2 clusters of 4x Cortex-A7
and 4x Cortex-A15 cores.

Much of the sunxi-specific MCPM code is derived from Allwinner code and
documentation, with some references to the other MCPM implementations,
as well as the Cortex's Technical Reference Manuals for the power
sequencing info.

One major difference compared to other platforms is we currently do not
have a standalone PMU or other embedded firmware to do the actually power
sequencing. All power/reset control is done by the kernel. As such, I
couldn't figure out where to put the code to power off the outbound
processor. I'm putting it in the .wait_for_powerdown() callback for now.
This does not get called by the big.Little switcher. But since we lack
cpufreq support at the moment, big.Little switcher is probably not going
to work anyway.

The code has been tested on my A80 Optimus, and reliably brings up all
cores. CPU hotplugging works as well. One issue I have is the processors
in cluster 0 do not stay in WFI after they are signaled to go offline.
I haven't tested the CCI-400 PMU bits yet.

I've done the best I could to fit the code into the new MCPM callbacks,
unlike the Allwinner code which uses the old .power_up()/.power_down()
ones. However my knowledge of ARM internals is limited, so it is quite
possible I got something wrong. Reviews are highly appreciated.

The actual work is split into 3 phases:

Patch 1 adds basic SMP bringup code using the common MCPM code.
No hotplugging is supported.

Patch 2 ~ 4 add the required DT device nodes.

Patch 5 adds support for hotplugging processor cores 1~7.

Patch 6 adds support for cpu0 hotplugging. The BROM checks a region
of secure SRAM for special flags. If they are set, execution is
diverted to the configured secondary startup address, just like it
would be for all the other processor cores.

Patch 7 adds the DT nodes for the secure SRAM.


Regards
ChenYu


Chen-Yu Tsai (7):
  ARM: sun9i: Support SMP on A80 with Multi-Cluster Power Management
    (MCPM)
  ARM: dts: sun9i: Add CCI-400 device nodes for A80
  ARM: dts: sun9i: Add CPUCFG device node for A80 dtsi
  ARM: dts: sun9i: Add PRCM device node for the A80 dtsi
  ARM: sunxi: mcpm: Support CPU/cluster power down and hotplugging for
    cpu1~7
  ARM: sunxi: mcpm: Support cpu0 hotplug
  ARM: dts: sun9i: Add secure SRAM node used for MCPM SMP hotplug

 arch/arm/boot/dts/sun9i-a80.dtsi |  76 ++++++
 arch/arm/mach-sunxi/Kconfig      |   8 +
 arch/arm/mach-sunxi/Makefile     |   1 +
 arch/arm/mach-sunxi/mcpm.c       | 497 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 582 insertions(+)
 create mode 100644 arch/arm/mach-sunxi/mcpm.c

-- 
2.1.4

             reply	other threads:[~2015-05-14  6:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  6:10 Chen-Yu Tsai [this message]
2015-05-14  6:10 ` [RFC 0/7] ARM: sun9i: SMP support with Multi-Cluster Power Management Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 1/7] ARM: sun9i: Support SMP on A80 with Multi-Cluster Power Management (MCPM) Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 2/7] ARM: dts: sun9i: Add CCI-400 device nodes for A80 Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-17 14:51   ` Maxime Ripard
2015-05-17 14:51     ` Maxime Ripard
2015-05-19  7:12     ` Chen-Yu Tsai
2015-05-19  7:12       ` Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 3/7] ARM: dts: sun9i: Add CPUCFG device node for A80 dtsi Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 4/7] ARM: dts: sun9i: Add PRCM device node for the " Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-17 14:54   ` Maxime Ripard
2015-05-17 14:54     ` Maxime Ripard
2015-05-19  3:08     ` Chen-Yu Tsai
2015-05-19  3:08       ` Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 5/7] ARM: sunxi: mcpm: Support CPU/cluster power down and hotplugging for cpu1~7 Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 6/7] ARM: sunxi: mcpm: Support cpu0 hotplug Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-14  6:10 ` [RFC 7/7] ARM: dts: sun9i: Add secure SRAM node used for MCPM SMP hotplug Chen-Yu Tsai
2015-05-14  6:10   ` Chen-Yu Tsai
2015-05-20 10:08   ` Maxime Ripard
2015-05-20 10:08     ` Maxime Ripard
2015-05-24 15:55     ` [linux-sunxi] " Chen-Yu Tsai
2015-05-24 15:55       ` Chen-Yu Tsai
2015-05-25 21:24       ` Maxime Ripard
2015-05-25 21:24         ` Maxime Ripard
2015-05-26 16:47         ` Chen-Yu Tsai
2015-05-26 16:47           ` Chen-Yu Tsai
2015-06-11 16:33           ` Maxime Ripard
2015-06-11 16:33             ` Maxime Ripard
2015-05-16 10:08 ` [linux-sunxi] [RFC 0/7] ARM: sun9i: SMP support with Multi-Cluster Power Management Ian Campbell
2015-05-16 10:08   ` Ian Campbell
2015-05-17 14:38   ` Maxime Ripard
2015-05-17 14:38     ` Maxime Ripard
2015-05-18  5:19     ` Nicolas Pitre
2015-05-18  5:19       ` Nicolas Pitre
2015-05-18  9:04       ` Maxime Ripard
2015-05-18  9:04         ` Maxime Ripard
2015-05-19  2:51   ` Chen-Yu Tsai
2015-05-19  2:51     ` Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431583811-25780-1-git-send-email-wens@csie.org \
    --to=wens@csie.org \
    --cc=Dave.Martin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nicolas.pitre@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.