diff mbox

[v3,1/2] ARM: Add API to detect SCU base address from CP15

Message ID 1358833924-24535-1-git-send-email-hdoyu@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hiroshi DOYU Jan. 22, 2013, 5:52 a.m. UTC
Add API to detect SCU base address from CP15.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
Update: Use Russell's suggestion,
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/143321.html
---
 arch/arm/include/asm/smp_scu.h |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Santosh Shilimkar Jan. 22, 2013, 6:07 a.m. UTC | #1
On Tuesday 22 January 2013 11:22 AM, Hiroshi Doyu wrote:
> Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.
>
> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
> ---
Looks fine. I will also update OMAP code with the new
interface. Thanks.

For the patch,
Acked-by: Santosh Shilimkar<santosh.shilimkar@ti.com>
Stephen Warren Jan. 22, 2013, 4:57 p.m. UTC | #2
On 01/21/2013 11:07 PM, Santosh Shilimkar wrote:
> On Tuesday 22 January 2013 11:22 AM, Hiroshi Doyu wrote:
>> Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.
>>
>> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
>> ---
> Looks fine. I will also update OMAP code with the new
> interface. Thanks.

OK, so patch 1/2 at least needs to get into a stable arm-soc branch
then. Unless there are violent objections, I'll forward patch 1/2 to
arm-soc and request it be added into a branch so that Tegra and OMAP can
both merge it into their branches as a dependency. I guess patch 2/2
could also be included; I don't think it has any complex dependencies
that'd prevent that, and would help to show how patch 1/2 gets used.

Hiroshi, is this series the only dependency you need for your Tegra114
series? So, I could merge your Tegra114 series once this series is applied?

> For the patch,
> Acked-by: Santosh Shilimkar<santosh.shilimkar@ti.com>

Thanks.
Olof Johansson Jan. 22, 2013, 5:04 p.m. UTC | #3
On Tue, Jan 22, 2013 at 8:57 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 01/21/2013 11:07 PM, Santosh Shilimkar wrote:
>> On Tuesday 22 January 2013 11:22 AM, Hiroshi Doyu wrote:
>>> Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.
>>>
>>> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
>>> ---
>> Looks fine. I will also update OMAP code with the new
>> interface. Thanks.
>
> OK, so patch 1/2 at least needs to get into a stable arm-soc branch
> then. Unless there are violent objections, I'll forward patch 1/2 to
> arm-soc and request it be added into a branch so that Tegra and OMAP can
> both merge it into their branches as a dependency. I guess patch 2/2
> could also be included; I don't think it has any complex dependencies
> that'd prevent that, and would help to show how patch 1/2 gets used.
>
> Hiroshi, is this series the only dependency you need for your Tegra114
> series? So, I could merge your Tegra114 series once this series is applied?

For something like this, it might make more sense for us to just apply
the patches for OMAP on top, i.e. we'll pull the short branch from
you, and then we can just apply patches (with maintainer acks) on top,
instead of doing a bunch of single-patch pulls.

Since Russell had comments on it earlier, I'd like him to give a nod
that he's happy with it too.


-Olof
Stephen Warren Jan. 22, 2013, 6:35 p.m. UTC | #4
On 01/21/2013 10:52 PM, Hiroshi Doyu wrote:
> Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.

Will, is your for-next/perf branch stable; can I pull it into a branch
destined for arm-soc? Background below:

Uggh.

This patch (2/2) depends on "ARM: tegra: Use DT /cpu node to detect
number of CPU core" from your Tegra114 series, since that patch removes
the other use of scu_base, thus allowing this patch to remove that variable.

Then, that patch depends on "ARM: Define CPU part numbers and
implementors" from Will Deacon's ARM perf tree at:

git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf

That means that in order to put this series into arm-soc, we would have
to pull in Will's perf branch first, then the following Tegra patches,
the latter two of which are already in Tegra's for-next, so I'd have to
pull them out:

0bb7bd9 ARM: tegra: Use DT /cpu node to detect number of CPU core
a8f5f25 ARM: tegra: Add CPU nodes to Tegra30 device tree
9975516 ARM: tegra: Add CPU nodes to Tegra20 device tree

Hiroshi, it would be extremely useful if you could explicitly specify
the dependencies of your series when posting them; it took me a long
time and a lot of searching to track all the dependencies down. :-(
Will Deacon Jan. 22, 2013, 6:46 p.m. UTC | #5
Hi Stephan,

On Tue, Jan 22, 2013 at 06:35:55PM +0000, Stephen Warren wrote:
> On 01/21/2013 10:52 PM, Hiroshi Doyu wrote:
> > Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.
> 
> Will, is your for-next/perf branch stable; can I pull it into a branch
> destined for arm-soc? Background below:

I'm going to send a pull request to Russell tomorrow using my for-rmk/perf
branch, so *that* is stable. You might, however, want to wait for Russell to
push that out because it's also needed for kvm and, as such, will need to
be published anyway.

Sound ok?

Will
Stephen Warren Jan. 22, 2013, 6:49 p.m. UTC | #6
On 01/22/2013 11:46 AM, Will Deacon wrote:
> Hi Stephan,
> 
> On Tue, Jan 22, 2013 at 06:35:55PM +0000, Stephen Warren wrote:
>> On 01/21/2013 10:52 PM, Hiroshi Doyu wrote:
>>> Skip scu_enable(scu_base) if CPU is not Cortex A9 with SCU.
>>
>> Will, is your for-next/perf branch stable; can I pull it into a branch
>> destined for arm-soc? Background below:
> 
> I'm going to send a pull request to Russell tomorrow using my for-rmk/perf
> branch, so *that* is stable. You might, however, want to wait for Russell to
> push that out because it's also needed for kvm and, as such, will need to
> be published anyway.
> 
> Sound ok?

I'm assuming rmk's branch will be a stable base, so that sounds great,
thanks.
Hiroshi DOYU Jan. 23, 2013, 6:04 a.m. UTC | #7
Stephen Warren <swarren@wwwdotorg.org> wrote @ Tue, 22 Jan 2013 17:57:39 +0100:

> Hiroshi, is this series the only dependency you need for your
> Tegra114

Basically yes.

> series? So, I could merge your Tegra114 series once this series is applied?

But now "CCF" seems to be in. Then, the HACK(*1) needs to be replaced
with "Tegra114 CCF". But "Tegra114 CCF" doesn't seem ready yet. I'll check
if this Tegra114 series would work without "Tegra114 CCF".

*1: http://patchwork.ozlabs.org/patch/212010/
Hiroshi DOYU Jan. 23, 2013, 9:27 a.m. UTC | #8
Hiroshi Doyu <hdoyu@nvidia.com> wrote @ Wed, 23 Jan 2013 08:04:57 +0200 (EET):

> Stephen Warren <swarren@wwwdotorg.org> wrote @ Tue, 22 Jan 2013 17:57:39 +0100:
> 
> > Hiroshi, is this series the only dependency you need for your
> > Tegra114
> 
> Basically yes.
> 
> > series? So, I could merge your Tegra114 series once this series is applied?
> 
> But now "CCF" seems to be in. Then, the HACK(*1) needs to be replaced
> with "Tegra114 CCF". But "Tegra114 CCF" doesn't seem ready yet. I'll check
> if this Tegra114 series would work without "Tegra114 CCF".
> 
> *1: http://patchwork.ozlabs.org/patch/212010/

Stephen,

Verified "Tegra114 series" worked with "for-3.9/soc" branch(inc CCF)
with a little tweak.

I can post Tegra114 series again. If you want them rebased onto
another branch, let me know.
Stephen Warren Jan. 23, 2013, 4:37 p.m. UTC | #9
On 01/23/2013 02:27 AM, Hiroshi Doyu wrote:
> Hiroshi Doyu <hdoyu@nvidia.com> wrote @ Wed, 23 Jan 2013 08:04:57 +0200 (EET):
> 
>> Stephen Warren <swarren@wwwdotorg.org> wrote @ Tue, 22 Jan 2013 17:57:39 +0100:
>>
>>> Hiroshi, is this series the only dependency you need for your
>>> Tegra114
>>
>> Basically yes.
>>
>>> series? So, I could merge your Tegra114 series once this series is applied?
>>
>> But now "CCF" seems to be in. Then, the HACK(*1) needs to be replaced
>> with "Tegra114 CCF". But "Tegra114 CCF" doesn't seem ready yet. I'll check
>> if this Tegra114 series would work without "Tegra114 CCF".
>>
>> *1: http://patchwork.ozlabs.org/patch/212010/
> 
> Stephen,
> 
> Verified "Tegra114 series" worked with "for-3.9/soc" branch(inc CCF)
> with a little tweak.

Good news.

> I can post Tegra114 series again. If you want them rebased onto
> another branch, let me know.

Yes please. I will apply them to for-3.9/soc. Please assume that
for-3.9/soc will already contain "ARM: Define CPU part numbers and
implementors", and your two SCU-related patches. Include your "ARM:
tegra: Use DT /cpu node to detect number of CPU core" as the first patch
in the series. I assume that is all of the dependencies; if I've
forgotten anything, please point it out. Thanks.
Hiroshi DOYU Jan. 28, 2013, 7:18 a.m. UTC | #10
Hi Russell,

On Tue, 22 Jan 2013 18:04:46 +0100
Olof Johansson <olof@lixom.net> wrote:

> Since Russell had comments on it earlier, I'd like him to give a nod
> that he's happy with it too.

Is this ok for you?

The original patch is:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/143552.html
Russell King - ARM Linux Jan. 28, 2013, 2:47 p.m. UTC | #11
On Mon, Jan 28, 2013 at 09:18:55AM +0200, Hiroshi Doyu wrote:
> Hi Russell,
> 
> On Tue, 22 Jan 2013 18:04:46 +0100
> Olof Johansson <olof@lixom.net> wrote:
> 
> > Since Russell had comments on it earlier, I'd like him to give a nod
> > that he's happy with it too.
> 
> Is this ok for you?
> 
> The original patch is:
> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/143552.html

Yes, this version is much better, thanks.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Stephen Warren Jan. 28, 2013, 6:03 p.m. UTC | #12
On 01/21/2013 10:52 PM, Hiroshi Doyu wrote:
> Add API to detect SCU base address from CP15.

I've applied these 2 patches and Santosh's OMAP followup to Tegra's
for-3.9/scu-base-rework branch.
diff mbox

Patch

diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 4eb6d00..006f026 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -6,6 +6,23 @@ 
 #define SCU_PM_POWEROFF	3
 
 #ifndef __ASSEMBLER__
+
+#include <asm/cputype.h>
+
+static inline bool scu_a9_has_base(void)
+{
+	return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9;
+}
+
+static inline unsigned long scu_a9_get_base(void)
+{
+	unsigned long pa;
+
+	asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa));
+
+	return pa;
+}
+
 unsigned int scu_get_core_count(void __iomem *);
 void scu_enable(void __iomem *);
 int scu_power_mode(void __iomem *, unsigned int);