ARM: tegra: only run PL310 init on systems with one
Subsystems (3)
PATCH 1/1 ARM: tegra: only run PL310 init on systems with one
From: Stephen Warren <[email protected]>
(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.*)
--- arch/arm/mach-tegra/common.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm/mach-tegra/common.c +11 -0
@@ -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 ;
Signature · 1 line
1.8.1.5
PATCH 1/1 ARM: tegra: only run PL310 init on systems with one
Quoted 4 lines · Stephen Warren
From: Stephen Warren <[email protected]>
(This is commit
8859685785bfafadf9bc922dd3a2278e59886947upstream)
Quoted 8 lines
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
Quoted 46 lines
Cc <[email protected]> # v3.10..v3.12 inclusiveSigned-off-by Stephen Warren <[email protected]>--- arch/arm/mach-tegra/common.c | 11 +++++++++++ 1 file changed, 11 insertions(+)arch/arm/mach-tegra/common.c +11
-0@@ -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 ;Signature · 6 lines
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