aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-12-15 09:56:47 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-12-22 07:15:53 -0500
commit36f46d6d5cdef2308027261d633e96807d64d098 (patch)
tree26d739960f1b31e1055e88510ac36a49c61c2963
parente7273ff49acf58a5ca9c656f3f0a5dd713390853 (diff)
ARM: 8482/1: l2x0: make it possible to disable outer sync from DT
According to commit 2503a5ecd86c002506001eba432c524ea009fe7f "ARM: 6201/1: RealView: Do not use outer_sync() on ARM11MPCore boards with L220" Some PB11MPCore RealView core tiles have broken outer_sync. We got rid of the custom barriers from the machine by disabling outer sync, but that was just for the boardfile case. We have to be able to do the same in the device tree case. Since __l2c_init() is cloning and copying the L2C vtable, we pass an argument to this function to optionally numb the outer sync operation if desired, before initializing the cache. After this we can set up the cache correctly on the RealView PB11MPCore. This was tested on a PB11MPCore known to have the issue. Before this, spurious crashes would occur if we try to set up the cache properly, after this it boots rock solid. Cc: Arnd Bergmann <arnd@arndb.de> Cc: devicetree@vger.kernel.org Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--Documentation/devicetree/bindings/arm/l2cc.txt3
-rw-r--r--arch/arm/mm/cache-l2x0.c13
2 files changed, 13 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/arm/l2cc.txt b/Documentation/devicetree/bindings/arm/l2cc.txt
index d181b7c4c522..416864e9dc92 100644
--- a/Documentation/devicetree/bindings/arm/l2cc.txt
+++ b/Documentation/devicetree/bindings/arm/l2cc.txt
@@ -75,6 +75,9 @@ Optional properties:
75 specified to indicate that such transforms are precluded. 75 specified to indicate that such transforms are precluded.
76- arm,parity-enable : enable parity checking on the L2 cache (L220 or PL310). 76- arm,parity-enable : enable parity checking on the L2 cache (L220 or PL310).
77- arm,parity-disable : disable parity checking on the L2 cache (L220 or PL310). 77- arm,parity-disable : disable parity checking on the L2 cache (L220 or PL310).
78- arm,outer-sync-disable : disable the outer sync operation on the L2 cache.
79 Some core tiles, especially ARM PB11MPCore have a faulty L220 cache that
80 will randomly hang unless outer sync operations are disabled.
78- prefetch-data : Data prefetch. Value: <0> (forcibly disable), <1> 81- prefetch-data : Data prefetch. Value: <0> (forcibly disable), <1>
79 (forcibly enable), property absent (retain settings set by firmware) 82 (forcibly enable), property absent (retain settings set by firmware)
80- prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable), 83- prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 3f3008e5c662..9f9d54271aad 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -790,7 +790,7 @@ static const struct l2c_init_data l2c310_init_fns __initconst = {
790}; 790};
791 791
792static int __init __l2c_init(const struct l2c_init_data *data, 792static int __init __l2c_init(const struct l2c_init_data *data,
793 u32 aux_val, u32 aux_mask, u32 cache_id) 793 u32 aux_val, u32 aux_mask, u32 cache_id, bool nosync)
794{ 794{
795 struct outer_cache_fns fns; 795 struct outer_cache_fns fns;
796 unsigned way_size_bits, ways; 796 unsigned way_size_bits, ways;
@@ -866,6 +866,10 @@ static int __init __l2c_init(const struct l2c_init_data *data,
866 fns.configure = outer_cache.configure; 866 fns.configure = outer_cache.configure;
867 if (data->fixup) 867 if (data->fixup)
868 data->fixup(l2x0_base, cache_id, &fns); 868 data->fixup(l2x0_base, cache_id, &fns);
869 if (nosync) {
870 pr_info("L2C: disabling outer sync\n");
871 fns.sync = NULL;
872 }
869 873
870 /* 874 /*
871 * Check if l2x0 controller is already enabled. If we are booting 875 * Check if l2x0 controller is already enabled. If we are booting
@@ -925,7 +929,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
925 if (data->save) 929 if (data->save)
926 data->save(l2x0_base); 930 data->save(l2x0_base);
927 931
928 __l2c_init(data, aux_val, aux_mask, cache_id); 932 __l2c_init(data, aux_val, aux_mask, cache_id, false);
929} 933}
930 934
931#ifdef CONFIG_OF 935#ifdef CONFIG_OF
@@ -1724,6 +1728,7 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
1724 struct resource res; 1728 struct resource res;
1725 u32 cache_id, old_aux; 1729 u32 cache_id, old_aux;
1726 u32 cache_level = 2; 1730 u32 cache_level = 2;
1731 bool nosync = false;
1727 1732
1728 np = of_find_matching_node(NULL, l2x0_ids); 1733 np = of_find_matching_node(NULL, l2x0_ids);
1729 if (!np) 1734 if (!np)
@@ -1762,6 +1767,8 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
1762 if (cache_level != 2) 1767 if (cache_level != 2)
1763 pr_err("L2C: device tree specifies invalid cache level\n"); 1768 pr_err("L2C: device tree specifies invalid cache level\n");
1764 1769
1770 nosync = of_property_read_bool(np, "arm,outer-sync-disable");
1771
1765 /* Read back current (default) hardware configuration */ 1772 /* Read back current (default) hardware configuration */
1766 if (data->save) 1773 if (data->save)
1767 data->save(l2x0_base); 1774 data->save(l2x0_base);
@@ -1776,6 +1783,6 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
1776 else 1783 else
1777 cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID); 1784 cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID);
1778 1785
1779 return __l2c_init(data, aux_val, aux_mask, cache_id); 1786 return __l2c_init(data, aux_val, aux_mask, cache_id, nosync);
1780} 1787}
1781#endif 1788#endif