Skip to content

Commit b522842

Browse files
linuswRussell King
authored andcommitted
ARM: 8448/1: add some L220 DT settings
The RealView ARM11MPCore enables parity, eventmon and shared override in the cache controller through its current boardfile, but the code and DT bindings for the ARM L220 is currently lacking the ability to set this up from DT. Add the required bool parameters for parity and shared override, but keep eventmon out of it: this should be enabled by the event monitor code. Cc: [email protected] Acked-by: Rob Herring <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 8005c49 commit b522842

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

Documentation/devicetree/bindings/arm/l2cc.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ Optional properties:
6767
disable if zero.
6868
- arm,prefetch-offset : Override prefetch offset value. Valid values are
6969
0-7, 15, 23, and 31.
70-
- arm,shared-override : The default behavior of the pl310 cache controller with
71-
respect to the shareable attribute is to transform "normal memory
72-
non-cacheable transactions" into "cacheable no allocate" (for reads) or
73-
"write through no write allocate" (for writes).
70+
- arm,shared-override : The default behavior of the L220 or PL310 cache
71+
controllers with respect to the shareable attribute is to transform "normal
72+
memory non-cacheable transactions" into "cacheable no allocate" (for reads)
73+
or "write through no write allocate" (for writes).
7474
On systems where this may cause DMA buffer corruption, this property must be
7575
specified to indicate that such transforms are precluded.
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).
7678
- prefetch-data : Data prefetch. Value: <0> (forcibly disable), <1>
7779
(forcibly enable), property absent (retain settings set by firmware)
7880
- prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),

arch/arm/mm/cache-l2x0.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,18 @@ static void __init l2x0_of_parse(const struct device_node *np,
10601060
val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT;
10611061
}
10621062

1063+
if (of_property_read_bool(np, "arm,parity-enable")) {
1064+
mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;
1065+
val |= L2C_AUX_CTRL_PARITY_ENABLE;
1066+
} else if (of_property_read_bool(np, "arm,parity-disable")) {
1067+
mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;
1068+
}
1069+
1070+
if (of_property_read_bool(np, "arm,shared-override")) {
1071+
mask &= ~L2C_AUX_CTRL_SHARED_OVERRIDE;
1072+
val |= L2C_AUX_CTRL_SHARED_OVERRIDE;
1073+
}
1074+
10631075
ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);
10641076
if (ret)
10651077
return;
@@ -1176,6 +1188,14 @@ static void __init l2c310_of_parse(const struct device_node *np,
11761188
*aux_mask &= ~L2C_AUX_CTRL_SHARED_OVERRIDE;
11771189
}
11781190

1191+
if (of_property_read_bool(np, "arm,parity-enable")) {
1192+
*aux_val |= L2C_AUX_CTRL_PARITY_ENABLE;
1193+
*aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;
1194+
} else if (of_property_read_bool(np, "arm,parity-disable")) {
1195+
*aux_val &= ~L2C_AUX_CTRL_PARITY_ENABLE;
1196+
*aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;
1197+
}
1198+
11791199
prefetch = l2x0_saved_regs.prefetch_ctrl;
11801200

11811201
ret = of_property_read_u32(np, "arm,double-linefill", &val);

0 commit comments

Comments
 (0)