aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Brandt <chris.brandt@renesas.com>2017-02-16 12:53:29 -0500
committerRussell King <rmk+kernel@armlinux.org.uk>2017-03-17 06:01:26 -0400
commit471b5e42cc7d76678314542d0ce079e5f3cfb706 (patch)
tree639fa6ad38840f2025b87661d565fc20f17a8021
parentc1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201 (diff)
ARM: 8659/1: l2c: allow CA9 optimizations to be disabled
If a PL310 is added to a system, but the sideband signals are not connected, some Cortex A9 optimizations cannot be used. In particular, enabling Full Line of Zeros in the CA9 without sidebands connected will crash the system since the CA9 will expect the L2C to perform operations, yet the L2C never gets the commands. Early BRESP also does not work without sideband signals. Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--Documentation/devicetree/bindings/arm/l2c2x0.txt3
-rw-r--r--arch/arm/mm/cache-l2x0.c13
2 files changed, 14 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index 917199f17965..d9650c1788f4 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -90,6 +90,9 @@ Optional properties:
90- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable), 90- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
91 <1> (forcibly enable), property absent (OS specific behavior, 91 <1> (forcibly enable), property absent (OS specific behavior,
92 preferably retain firmware settings) 92 preferably retain firmware settings)
93- arm,early-bresp-disable : Disable the CA9 optimization Early BRESP (PL310)
94- arm,full-line-zero-disable : Disable the CA9 optimization Full line of zero
95 write (PL310)
93 96
94Example: 97Example:
95 98
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 2290be390f87..808efbb89b88 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -57,6 +57,9 @@ static unsigned long sync_reg_offset = L2X0_CACHE_SYNC;
57 57
58struct l2x0_regs l2x0_saved_regs; 58struct l2x0_regs l2x0_saved_regs;
59 59
60static bool l2x0_bresp_disable;
61static bool l2x0_flz_disable;
62
60/* 63/*
61 * Common code for all cache controllers. 64 * Common code for all cache controllers.
62 */ 65 */
@@ -620,7 +623,7 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
620 u32 aux = l2x0_saved_regs.aux_ctrl; 623 u32 aux = l2x0_saved_regs.aux_ctrl;
621 624
622 if (rev >= L310_CACHE_ID_RTL_R2P0) { 625 if (rev >= L310_CACHE_ID_RTL_R2P0) {
623 if (cortex_a9) { 626 if (cortex_a9 && !l2x0_bresp_disable) {
624 aux |= L310_AUX_CTRL_EARLY_BRESP; 627 aux |= L310_AUX_CTRL_EARLY_BRESP;
625 pr_info("L2C-310 enabling early BRESP for Cortex-A9\n"); 628 pr_info("L2C-310 enabling early BRESP for Cortex-A9\n");
626 } else if (aux & L310_AUX_CTRL_EARLY_BRESP) { 629 } else if (aux & L310_AUX_CTRL_EARLY_BRESP) {
@@ -629,7 +632,7 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
629 } 632 }
630 } 633 }
631 634
632 if (cortex_a9) { 635 if (cortex_a9 && !l2x0_flz_disable) {
633 u32 aux_cur = readl_relaxed(base + L2X0_AUX_CTRL); 636 u32 aux_cur = readl_relaxed(base + L2X0_AUX_CTRL);
634 u32 acr = get_auxcr(); 637 u32 acr = get_auxcr();
635 638
@@ -1200,6 +1203,12 @@ static void __init l2c310_of_parse(const struct device_node *np,
1200 *aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE; 1203 *aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;
1201 } 1204 }
1202 1205
1206 if (of_property_read_bool(np, "arm,early-bresp-disable"))
1207 l2x0_bresp_disable = true;
1208
1209 if (of_property_read_bool(np, "arm,full-line-zero-disable"))
1210 l2x0_flz_disable = true;
1211
1203 prefetch = l2x0_saved_regs.prefetch_ctrl; 1212 prefetch = l2x0_saved_regs.prefetch_ctrl;
1204 1213
1205 ret = of_property_read_u32(np, "arm,double-linefill", &val); 1214 ret = of_property_read_u32(np, "arm,double-linefill", &val);