linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] ARM: zx: add initial L2CC initialization
Date: Mon, 16 Mar 2015 10:41:33 +0000	[thread overview]
Message-ID: <20150316104133.GG8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1426333785-3952-5-git-send-email-jun.nie@linaro.org>

On Sat, Mar 14, 2015 at 07:49:39PM +0800, Jun Nie wrote:
> +static void __init zx_l2x0_init(void)
> +{
> +	void __iomem *base;
> +	struct device_node *np;
> +	unsigned int val;
> +
> +	np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache");
> +	if (!np)
> +		goto out;
> +
> +	base = of_iomap(np, 0);
> +	if (!base) {
> +		of_node_put(np);
> +		goto out;
> +	}

NAK, really, NAK.  We're trying to get away from platforms doing crap
like this.

> +
> +	val = readl_relaxed(base + L310_PREFETCH_CTRL);
> +	val |= 0x70800000;
> +	writel_relaxed(val, base + L310_PREFETCH_CTRL);

So that's:

	L310_PREFETCH_CTRL_DBL_LINEFILL |
	L310_PREFETCH_CTRL_INSTR_PREFETCH |
	L310_PREFETCH_CTRL_DATA_PREFETCH |
	L310_PREFETCH_CTRL_DBL_LINEFILL_INCR

which you can enable by adding:

	arm,double-linefill
	arm,double-linefill-incr

The prefetch enables are also accessible via the auxillary control
register when the cache is not enabled (see below.)

> +
> +	writel_relaxed(L310_DYNAMIC_CLK_GATING_EN | L310_STNDBY_MODE_EN,
> +		       base + L310_POWER_CTRL);

These should be done by your boot loader - they're highly SoC specific.

> +out:
> +	l2x0_of_init(0x7c433C01, 0x8000c3fe);

Why these random values?

Firstly, the L2 code takes care of bits 0, 26, 27, 30 for you already.
I fail to see why you would want to hard-code the cache size here
either; the cache size is supposed to be configured by the hardware
designers at implementation stage and the aux control register is
supposed to take up that configuration at reset.

You see to be setting bits 10-13 inclusive, which include:

	L310_AUX_CTRL_HIGHPRIO_SO_DEV
	L310_AUX_CTRL_STORE_LIMITATION
	L310_AUX_CTRL_EXCLUSIVE_CACHE

Are you sure you're supposed to be setting these bits?

Bits 28 and 29 are the same as bits 28 and 29 in the prefetch register
(as in, you read or write those bits in either register and you're
accessing the exact same bits.)

The only possible bits you should be playing around with here which
we don't have a way to cater for are bits 22, 28, 29.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

  parent reply	other threads:[~2015-03-16 10:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-14 11:49 [PATCH 00/10] ZTE platform basic support Jun Nie
2015-03-14 11:49 ` [PATCH 01/10] ARM: zx: add basic support of ZTE ZX296702 Jun Nie
2015-03-14 21:21   ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 02/10] ARM: zx: add low level debug support Jun Nie
2015-03-15 22:44   ` Matthias Brugger
2015-03-15 22:48   ` Russell King - ARM Linux
2015-03-16  2:37     ` Shawn Guo
2015-03-16 10:08       ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 03/10] MAINTAINERS: add entry for ZTE ARM architecture Jun Nie
2015-03-14 11:49 ` [PATCH 04/10] ARM: zx: add initial L2CC initialization Jun Nie
2015-03-14 21:22   ` Arnd Bergmann
2015-03-16  2:48     ` Shawn Guo
2015-03-16  3:04       ` Jisheng Zhang
2015-03-16 10:41   ` Russell King - ARM Linux [this message]
2015-03-14 11:49 ` [PATCH 05/10] ARM: zx: bring up the secondary core Jun Nie
2015-03-14 21:25   ` Arnd Bergmann
2015-03-16  7:23     ` Shawn Guo
2015-03-14 11:49 ` [PATCH 06/10] ARM: zx: add cpu hotplug support Jun Nie
2015-03-14 21:26   ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 07/10] dt/binding: Document ZTE zx296702 devicetree Jun Nie
2015-03-14 11:49 ` [PATCH 08/10] ARM: dts: zx: add an initial dts for zx296702 Jun Nie
2015-03-14 21:30   ` Arnd Bergmann
2015-03-14 11:49 ` [PATCH 09/10] ARM: zx: Add basic defconfig support to ZX296702 Jun Nie
2015-03-15 13:15   ` Shawn Guo
2015-03-14 11:49 ` [PATCH 10/10] clk: zx: add zx296702 clock support Jun Nie
2015-03-14 21:33   ` Arnd Bergmann
2015-03-16 11:33   ` 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=20150316104133.GG8656@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).