linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* CPUv6K (ARM1176) and wfi()
@ 2011-03-28 12:25 Jamie Iles
  2011-03-28 14:32 ` Dave Martin
  0 siblings, 1 reply; 6+ messages in thread
From: Jamie Iles @ 2011-03-28 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Catalin, Will,

I'm respinning some PM patches for my platform (ARM1176JZ-S) and looking 
at arch/arm/include/asm/system.h, for CPU_32v6K wfi() uses the "wfi" 
instruction, but when I use this on my system the instruction returns 
immediately.  Replacing this with:

	asm volatile("mcr   p15, 0, %0, c7, c0, 4\n" :: "r"(0));

makes everything work properly.  The ARM1176 TRM doesn't mention the wfi 
instruction afaict but does say to use the cp15 instruction in section 
10.2.2 (Standby mode).  It doesn't look to me that the SEV or WFE 
instructions are implemented on ARM1176 so I'm guessing that these are 
only in mpcore?

Jamie

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

* CPUv6K (ARM1176) and wfi()
  2011-03-28 12:25 CPUv6K (ARM1176) and wfi() Jamie Iles
@ 2011-03-28 14:32 ` Dave Martin
  2011-03-29  9:07   ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Martin @ 2011-03-28 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 28, 2011 at 1:25 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> Hi Catalin, Will,
>
> I'm respinning some PM patches for my platform (ARM1176JZ-S) and looking
> at arch/arm/include/asm/system.h, for CPU_32v6K wfi() uses the "wfi"
> instruction, but when I use this on my system the instruction returns
> immediately. ?Replacing this with:
>
> ? ? ? ?asm volatile("mcr ? p15, 0, %0, c7, c0, 4\n" :: "r"(0));
>
> makes everything work properly. ?The ARM1176 TRM doesn't mention the wfi
> instruction afaict but does say to use the cp15 instruction in section
> 10.2.2 (Standby mode). ?It doesn't look to me that the SEV or WFE
> instructions are implemented on ARM1176 so I'm guessing that these are
> only in mpcore?

I think WFI/SEV/WFE are encoded as NOP-synonyms, so they may do
nothing on non-multicore platforms; so I think the MCR is the correct
mechanism to use for 1176... unless Will or Catalin have better ideas.

Cheers
---Dave

>
> Jamie
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

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

* CPUv6K (ARM1176) and wfi()
  2011-03-28 14:32 ` Dave Martin
@ 2011-03-29  9:07   ` Will Deacon
  2011-03-29 10:58     ` Jamie Iles
  0 siblings, 1 reply; 6+ messages in thread
From: Will Deacon @ 2011-03-29  9:07 UTC (permalink / raw)
  To: linux-arm-kernel

> On Mon, Mar 28, 2011 at 1:25 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> > Hi Catalin, Will,
> >
> > I'm respinning some PM patches for my platform (ARM1176JZ-S) and looking
> > at arch/arm/include/asm/system.h, for CPU_32v6K wfi() uses the "wfi"
> > instruction, but when I use this on my system the instruction returns
> > immediately. ?Replacing this with:
> >
> > ? ? ? ?asm volatile("mcr ? p15, 0, %0, c7, c0, 4\n" :: "r"(0));
> >
> > makes everything work properly. ?The ARM1176 TRM doesn't mention the wfi
> > instruction afaict but does say to use the cp15 instruction in section
> > 10.2.2 (Standby mode). ?It doesn't look to me that the SEV or WFE
> > instructions are implemented on ARM1176 so I'm guessing that these are
> > only in mpcore?
> 
> I think WFI/SEV/WFE are encoded as NOP-synonyms, so they may do
> nothing on non-multicore platforms; so I think the MCR is the correct
> mechanism to use for 1176... unless Will or Catalin have better ideas.

Would using the mcr get in the way of a combined v6/v7 kernel image?
I notice that the behaviour on A9 is the exact opposite (wfi works, mcr
is a NOP).

Will

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

* CPUv6K (ARM1176) and wfi()
  2011-03-29  9:07   ` Will Deacon
@ 2011-03-29 10:58     ` Jamie Iles
  2011-03-29 11:26       ` Will Deacon
  0 siblings, 1 reply; 6+ messages in thread
From: Jamie Iles @ 2011-03-29 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 29, 2011 at 10:07:47AM +0100, Will Deacon wrote:
> > On Mon, Mar 28, 2011 at 1:25 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> > > Hi Catalin, Will,
> > >
> > > I'm respinning some PM patches for my platform (ARM1176JZ-S) and looking
> > > at arch/arm/include/asm/system.h, for CPU_32v6K wfi() uses the "wfi"
> > > instruction, but when I use this on my system the instruction returns
> > > immediately. ?Replacing this with:
> > >
> > > ? ? ? ?asm volatile("mcr ? p15, 0, %0, c7, c0, 4\n" :: "r"(0));
> > >
> > > makes everything work properly. ?The ARM1176 TRM doesn't mention the wfi
> > > instruction afaict but does say to use the cp15 instruction in section
> > > 10.2.2 (Standby mode). ?It doesn't look to me that the SEV or WFE
> > > instructions are implemented on ARM1176 so I'm guessing that these are
> > > only in mpcore?
> > 
> > I think WFI/SEV/WFE are encoded as NOP-synonyms, so they may do
> > nothing on non-multicore platforms; so I think the MCR is the correct
> > mechanism to use for 1176... unless Will or Catalin have better ideas.
> 
> Would using the mcr get in the way of a combined v6/v7 kernel image?
> I notice that the behaviour on A9 is the exact opposite (wfi works, mcr
> is a NOP).

Wouldnet it also be a problem for smp-on-up for a v6K only kernel?  It 
doesn't look like arm11 mpcore supports the cp15 access...

Jamie

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

* CPUv6K (ARM1176) and wfi()
  2011-03-29 10:58     ` Jamie Iles
@ 2011-03-29 11:26       ` Will Deacon
  2011-03-29 11:30         ` Jamie Iles
  0 siblings, 1 reply; 6+ messages in thread
From: Will Deacon @ 2011-03-29 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

> On Tue, Mar 29, 2011 at 10:07:47AM +0100, Will Deacon wrote:
> > > On Mon, Mar 28, 2011 at 1:25 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> > > > Hi Catalin, Will,
> > > >
> > > > I'm respinning some PM patches for my platform (ARM1176JZ-S) and looking
> > > > at arch/arm/include/asm/system.h, for CPU_32v6K wfi() uses the "wfi"
> > > > instruction, but when I use this on my system the instruction returns
> > > > immediately. ?Replacing this with:
> > > >
> > > > ? ? ? ?asm volatile("mcr ? p15, 0, %0, c7, c0, 4\n" :: "r"(0));
> > > >
> > > > makes everything work properly. ?The ARM1176 TRM doesn't mention the wfi
> > > > instruction afaict but does say to use the cp15 instruction in section
> > > > 10.2.2 (Standby mode). ?It doesn't look to me that the SEV or WFE
> > > > instructions are implemented on ARM1176 so I'm guessing that these are
> > > > only in mpcore?
> > >
> > > I think WFI/SEV/WFE are encoded as NOP-synonyms, so they may do
> > > nothing on non-multicore platforms; so I think the MCR is the correct
> > > mechanism to use for 1176... unless Will or Catalin have better ideas.
> >
> > Would using the mcr get in the way of a combined v6/v7 kernel image?
> > I notice that the behaviour on A9 is the exact opposite (wfi works, mcr
> > is a NOP).
> 
> Wouldnet it also be a problem for smp-on-up for a v6K only kernel?  It
> doesn't look like arm11 mpcore supports the cp15 access...

Section 3.4.18 (table 3.29) in the 11MPCore TRM mentions WFI using the mcr
instruction so it should be all present and correct. Are you seeing issues
in hardware?

Will

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

* CPUv6K (ARM1176) and wfi()
  2011-03-29 11:26       ` Will Deacon
@ 2011-03-29 11:30         ` Jamie Iles
  0 siblings, 0 replies; 6+ messages in thread
From: Jamie Iles @ 2011-03-29 11:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 29, 2011 at 12:26:09PM +0100, Will Deacon wrote:
> > On Tue, Mar 29, 2011 at 10:07:47AM +0100, Will Deacon wrote:
> > > > On Mon, Mar 28, 2011 at 1:25 PM, Jamie Iles <jamie@jamieiles.com> wrote:
> > > > > Hi Catalin, Will,
> > > > >
> > > > > I'm respinning some PM patches for my platform (ARM1176JZ-S) and looking
> > > > > at arch/arm/include/asm/system.h, for CPU_32v6K wfi() uses the "wfi"
> > > > > instruction, but when I use this on my system the instruction returns
> > > > > immediately. ?Replacing this with:
> > > > >
> > > > > ? ? ? ?asm volatile("mcr ? p15, 0, %0, c7, c0, 4\n" :: "r"(0));
> > > > >
> > > > > makes everything work properly. ?The ARM1176 TRM doesn't mention the wfi
> > > > > instruction afaict but does say to use the cp15 instruction in section
> > > > > 10.2.2 (Standby mode). ?It doesn't look to me that the SEV or WFE
> > > > > instructions are implemented on ARM1176 so I'm guessing that these are
> > > > > only in mpcore?
> > > >
> > > > I think WFI/SEV/WFE are encoded as NOP-synonyms, so they may do
> > > > nothing on non-multicore platforms; so I think the MCR is the correct
> > > > mechanism to use for 1176... unless Will or Catalin have better ideas.
> > >
> > > Would using the mcr get in the way of a combined v6/v7 kernel image?
> > > I notice that the behaviour on A9 is the exact opposite (wfi works, mcr
> > > is a NOP).
> > 
> > Wouldnet it also be a problem for smp-on-up for a v6K only kernel?  It
> > doesn't look like arm11 mpcore supports the cp15 access...
> 
> Section 3.4.18 (table 3.29) in the 11MPCore TRM mentions WFI using the mcr
> instruction so it should be all present and correct. Are you seeing issues
> in hardware?

OK, I missed that!  I don't have access to an mpcore system so I haven't 
tried this on hardware, just the problem with wfi on 1176.

Jamie

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

end of thread, other threads:[~2011-03-29 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 12:25 CPUv6K (ARM1176) and wfi() Jamie Iles
2011-03-28 14:32 ` Dave Martin
2011-03-29  9:07   ` Will Deacon
2011-03-29 10:58     ` Jamie Iles
2011-03-29 11:26       ` Will Deacon
2011-03-29 11:30         ` Jamie Iles

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).