Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chris Brandt and committed by
Russell King
471b5e42 c1ae3cfa

+14 -2
+3
Documentation/devicetree/bindings/arm/l2c2x0.txt
··· 90 90 - arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable), 91 91 <1> (forcibly enable), property absent (OS specific behavior, 92 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 94 97 Example: 95 98
+11 -2
arch/arm/mm/cache-l2x0.c
··· 57 57 58 58 struct l2x0_regs l2x0_saved_regs; 59 59 60 + static bool l2x0_bresp_disable; 61 + static bool l2x0_flz_disable; 62 + 60 63 /* 61 64 * Common code for all cache controllers. 62 65 */ ··· 623 620 u32 aux = l2x0_saved_regs.aux_ctrl; 624 621 625 622 if (rev >= L310_CACHE_ID_RTL_R2P0) { 626 - if (cortex_a9) { 623 + if (cortex_a9 && !l2x0_bresp_disable) { 627 624 aux |= L310_AUX_CTRL_EARLY_BRESP; 628 625 pr_info("L2C-310 enabling early BRESP for Cortex-A9\n"); 629 626 } else if (aux & L310_AUX_CTRL_EARLY_BRESP) { ··· 632 629 } 633 630 } 634 631 635 - if (cortex_a9) { 632 + if (cortex_a9 && !l2x0_flz_disable) { 636 633 u32 aux_cur = readl_relaxed(base + L2X0_AUX_CTRL); 637 634 u32 acr = get_auxcr(); 638 635 ··· 1202 1199 *aux_val &= ~L2C_AUX_CTRL_PARITY_ENABLE; 1203 1200 *aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE; 1204 1201 } 1202 + 1203 + if (of_property_read_bool(np, "arm,early-bresp-disable")) 1204 + l2x0_bresp_disable = true; 1205 + 1206 + if (of_property_read_bool(np, "arm,full-line-zero-disable")) 1207 + l2x0_flz_disable = true; 1205 1208 1206 1209 prefetch = l2x0_saved_regs.prefetch_ctrl; 1207 1210