linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric.y.miao@gmail.com (Eric Miao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm: disable L2 cache in the v7 finish function
Date: Wed, 24 Mar 2010 16:27:38 +0800	[thread overview]
Message-ID: <f17812d71003240127j6fe09f8du63e44c4b8b00ea8e@mail.gmail.com> (raw)
In-Reply-To: <20100322210045.GU11448@atomide.com>

On Tue, Mar 23, 2010 at 5:00 AM, Tony Lindgren <tony@atomide.com> wrote:
> * Woodruff, Richard <r-woodruff2@ti.com> [100319 12:51]:
>>
>> > From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-arm-kernel-
>> > bounces at lists.infradead.org] On Behalf Of Tony Lindgren
>> > Sent: Wednesday, March 10, 2010 3:53 PM
>>
>> > > +#ifdef CONFIG_OUTER_CACHE
>> > > + ? mrc ? ? p15, 0, r0, c1, c0, 1
>> > > + ? bic ? ? r0, r0, #0x2
>> > > + ? mcr ? ? p15, 0, r0, c1, c0, 1 ? ? ? ? ? @ disable L2 cache
>> > > +#endif
>> > > ? ? ldmfd ? sp!, {pc}
>> > > ?ENDPROC(cpu_v7_proc_fin)
>> >
>> > This one is a bit tricky. I know of three different ways
>> > to disable the L2 cache depending on the hardware. One of
>> > them is what you have above. The second is via SMI, and
>> > then the first one won't work. The third is via external
>> > secure monitor calls used on some omaps at least. And in
>> > the third case the first two methods won't work.
>>
>> On A8 cores with integrated L2 cache the L2EN bit is banked after r0px series (you won't find r0 systems anywhere). As such the above code is good on OMAP3 and many other A8's. ?Other bits in this same register have issues which you warn of. ?But not the L2EN.
>>
>> On A9 which uses outer cache the above won't work. ?The external PL310 (or variant) is memory mapped. ?To handle a different sequence is needed all together.
>
> Sounds like we need something like:
>
> ENTRY(cpu_v7_proc_fin)
> ...
> ? ? ? ?mcr ? ? p15, 0, r0, c1, c0, 0 ? @ disable caches
> ? ? ? ?b ? ? ? cpu_v7_arch_proc_fin ? ?@ disable L2 cache
> ? ? ? ?ldmfd ? sp!, {pc}
> ENDPROC(cpu_v7_proc_fin)
>
> And then cpu_v7_arch_proc_fin can be implemented for the platforms
> that need special handling.
>

Yeah, sort of I agree.

For outer cache, I also doubt that we might need to flush the L2 before
disabling, though this may depend on the exact behavior of the specific
cache controller. Introduce something like outer_cache_fns.finish() may
be something feasible.


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

      reply	other threads:[~2010-03-24  8:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 14:07 [PATCH 0/2] arm: fix kexec for ARMv7 Saeed Bishara
2010-03-09 14:07 ` [PATCH 1/2] arm: disable L2 cache in the v7 finish function Saeed Bishara
2010-03-09 14:07   ` [PATCH 2/2] arm: invalidate TLBs when enabling mmu Saeed Bishara
2010-03-09 16:45     ` Catalin Marinas
2010-04-14 17:49       ` Eric Miao
2010-04-14 17:56         ` Bryan Wu
2010-04-14 18:27     ` Russell King - ARM Linux
2010-04-15 12:24       ` Eric Miao
2010-04-15 12:24         ` Eric Miao
2010-04-15 22:36         ` Russell King - ARM Linux
2010-03-09 16:43   ` [PATCH 1/2] arm: disable L2 cache in the v7 finish function Catalin Marinas
2010-03-10 21:55     ` Tony Lindgren
2010-03-10 21:53   ` Tony Lindgren
2010-03-19 19:54     ` Woodruff, Richard
2010-03-22 21:00       ` Tony Lindgren
2010-03-24  8:27         ` Eric Miao [this message]

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=f17812d71003240127j6fe09f8du63e44c4b8b00ea8e@mail.gmail.com \
    --to=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).