From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-leds@vger.kernel.org, linux-pm@vger.kernel.org,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>,
Will Deacon <will.deacon@arm.com>, Rob Herring <robh@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH v2] ARM: l2c: parse cache properties from ePAPR definitions
Date: Tue, 09 Sep 2014 10:23:01 +0200 [thread overview]
Message-ID: <3872359.cDihUR1d12@wuerfel> (raw)
In-Reply-To: <3750746.eYplbZAGky@wuerfel>
On Tuesday 09 September 2014 09:42:18 Arnd Bergmann wrote:
> > + switch (set_size >> 10) {
> > + case 512:
> > + set_size_bits = 6;
> > + break;
> > + case 256:
> > + set_size_bits = 5;
> > + break;
> > + case 128:
> > + set_size_bits = 4;
> > + break;
> > + case 64:
> > + set_size_bits = 3;
> > + break;
> > + case 32:
> > + set_size_bits = 2;
> > + break;
> > + case 16:
> > + set_size_bits = 1;
> > + break;
> > + default:
> > + pr_err("L2C OF: cache way size: %d KB is not mapped\n",
> > + way_size);
> > + break;
> > + }
> > +
> > + /*
> > + * The l2x0 TRMs call this size "way size" but that is incorrect:
> > + * the thing being configured in these register bits is actually
> > + * the cache set size, so the variable here has the right name
> > + * but the register bit definitions following the TRM are not
> > + * in archaic naming.
> > + */
>
> No, I think actually the comment and the variable name are wrong here,
> and the TRM is right. I'm surprised you get the right results out of
> this. The set_size should be a relatively small number, e.g. 256 bytes
> in case of an 8-way associative cache with 32 byte lines. What is the
> pr_debug output and the properties you pass in for your example system?
>
I just saw you had 'cache-sets = <8>' in your original DT file. That
is the wrong number, it needs to be 'cache-sets = <512>'. When you
fix that, you should get the right way_size as well.
Arnd
next prev parent reply other threads:[~2014-09-09 8:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 7:10 [PATCH v2] ARM: l2c: parse cache properties from ePAPR definitions Linus Walleij
2014-09-09 7:42 ` Arnd Bergmann
2014-09-09 8:23 ` Arnd Bergmann [this message]
2014-09-09 9:27 ` Linus Walleij
2014-09-09 9:45 ` Arnd Bergmann
2014-09-09 10:02 ` Russell King - ARM Linux
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=3872359.cDihUR1d12@wuerfel \
--to=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh@kernel.org \
--cc=will.deacon@arm.com \
/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).