linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: srinidhi.kasagar@stericsson.com (srinidhi kasagar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM l2x0: check whether l2x0 already enabled
Date: Tue, 24 Nov 2009 06:05:08 +0530	[thread overview]
Message-ID: <1259022908.2742.9.camel@vinay-desktop> (raw)
In-Reply-To: <f2235a630911240411x67ad7e05k218b32e8d732dd0c@mail.gmail.com>

On Tue, 2009-11-24 at 13:11 +0100, Surinder P Singh wrote:
> On Tue, Nov 24, 2009 at 3:47 AM, srinidhi kasagar
> <srinidhi.kasagar@stericsson.com> wrote:
> > From: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
> > Date: Tue, 24 Nov 2009 13:59:20 +0530
> >
> > If running in non-secure mode, accessing
> > control and auxiliary registers of l2x0
> > will fault.
> >
> > Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
> > ---
> >  arch/arm/mm/cache-l2x0.c |   24 +++++++++++++++---------
> >  1 files changed, 15 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
> > index b480f1d..7c0d056 100644
> > --- a/arch/arm/mm/cache-l2x0.c
> > +++ b/arch/arm/mm/cache-l2x0.c
> > @@ -99,18 +99,24 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
> >
> >        l2x0_base = base;
> >
> > -       /* disable L2X0 */
> > -       writel(0, l2x0_base + L2X0_CTRL);
> > +       /* check if l2x0 controller is already enabled.
> > +        * if you are booting from non-secure mode
> > +        * accessing the below registers will fault.
> > +        */
> > +       if (!(readl(l2x0_base + L2X0_CTRL) & 1)) {
> 
> 2 points:
> 
> 1. Since this code is also valid for devices based on pre-ARMv6, maybe
> making this code conditional for >=ARMv6 would be cleaner ?
rather it depends on l2 controller being used. L210 controllers
do not have such restrictions whereas l220/pl310 have such kind
of secure/non-secure restrictions. So would it be better to keep
condition based on l2 controller being used?

Srinidhi

  reply	other threads:[~2009-11-24  0:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 22:17 [PATCH] ARM l2x0: check whether l2x0 already enabled srinidhi kasagar
2009-11-24 12:11 ` Surinder P Singh
2009-11-24  0:35   ` srinidhi kasagar [this message]
2009-11-24 13:35     ` Surinder P Singh
2009-11-24 13:55       ` Catalin Marinas
2009-11-25 19:10         ` srinidhi kasagar
2009-11-26  7:34           ` Surinder P Singh
2009-12-01 18:35           ` Catalin Marinas

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=1259022908.2742.9.camel@vinay-desktop \
    --to=srinidhi.kasagar@stericsson.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).