From: luis.henriques@canonical.com (Luís Henriques)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: tegra: only run PL310 init on systems with one
Date: Thu, 27 Feb 2014 12:55:26 +0000 [thread overview]
Message-ID: <20140227125526.GB3607@hercules> (raw)
In-Reply-To: <1393437746-11287-1-git-send-email-swarren@wwwdotorg.org>
On Wed, Feb 26, 2014 at 11:02:26AM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> (This is commit 8859685785bfafadf9bc922dd3a2278e59886947 upstream)
>
> Fix tegra_init_cache() to check whether the system has a PL310 cache
> before touching the PL310 registers. This prevents access to non-existent
> registers on Tegra114 and later.
>
> (When applying this to 3.10, there will be a trivial conflict, just due to
> context differences, at the added include of (linux/of.h>)
>
> (I applied and tested this backport on each of v3.10.*, v3.11.*, v3.12.*)
Thanks a lot for backporting and testing this patch. I will queue it for
the 3.11 kernel.
Cheers,
--
Lu?s
> Cc: <stable@vger.kernel.org> # v3.10..v3.12 inclusive
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> arch/arm/mach-tegra/common.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
> index 94a119a35af8..3c405f43ca39 100644
> --- a/arch/arm/mach-tegra/common.c
> +++ b/arch/arm/mach-tegra/common.c
> @@ -22,6 +22,7 @@
> #include <linux/io.h>
> #include <linux/clk.h>
> #include <linux/delay.h>
> +#include <linux/of.h>
> #include <linux/reboot.h>
> #include <linux/irqchip.h>
> #include <linux/clk-provider.h>
> @@ -82,10 +83,20 @@ void tegra_assert_system_reset(enum reboot_mode mode, const char *cmd)
> static void __init tegra_init_cache(void)
> {
> #ifdef CONFIG_CACHE_L2X0
> + static const struct of_device_id pl310_ids[] __initconst = {
> + { .compatible = "arm,pl310-cache", },
> + {}
> + };
> +
> + struct device_node *np;
> int ret;
> void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
> u32 aux_ctrl, cache_type;
>
> + np = of_find_matching_node(NULL, pl310_ids);
> + if (!np)
> + return;
> +
> cache_type = readl(p + L2X0_CACHE_TYPE);
> aux_ctrl = (cache_type & 0x700) << (17-8);
> aux_ctrl |= 0x7C400001;
> --
> 1.8.1.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-02-27 12:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 18:02 [PATCH] ARM: tegra: only run PL310 init on systems with one Stephen Warren
2014-02-27 12:55 ` Luís Henriques [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-02-18 23:51 Stephen Warren
2014-02-19 4:31 ` Olof Johansson
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=20140227125526.GB3607@hercules \
--to=luis.henriques@canonical.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