diff options
| -rw-r--r-- | Documentation/devicetree/bindings/arm/l2cc.txt | 10 | ||||
| -rw-r--r-- | arch/arm/mm/cache-l2x0.c | 54 |
2 files changed, 64 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/arm/l2cc.txt b/Documentation/devicetree/bindings/arm/l2cc.txt index 292ef7ca3058..0dbabe9a6b0a 100644 --- a/Documentation/devicetree/bindings/arm/l2cc.txt +++ b/Documentation/devicetree/bindings/arm/l2cc.txt | |||
| @@ -57,6 +57,16 @@ Optional properties: | |||
| 57 | - cache-id-part: cache id part number to be used if it is not present | 57 | - cache-id-part: cache id part number to be used if it is not present |
| 58 | on hardware | 58 | on hardware |
| 59 | - wt-override: If present then L2 is forced to Write through mode | 59 | - wt-override: If present then L2 is forced to Write through mode |
| 60 | - arm,double-linefill : Override double linefill enable setting. Enable if | ||
| 61 | non-zero, disable if zero. | ||
| 62 | - arm,double-linefill-incr : Override double linefill on INCR read. Enable | ||
| 63 | if non-zero, disable if zero. | ||
| 64 | - arm,double-linefill-wrap : Override double linefill on WRAP read. Enable | ||
| 65 | if non-zero, disable if zero. | ||
| 66 | - arm,prefetch-drop : Override prefetch drop enable setting. Enable if non-zero, | ||
| 67 | disable if zero. | ||
| 68 | - arm,prefetch-offset : Override prefetch offset value. Valid values are | ||
| 69 | 0-7, 15, 23, and 31. | ||
| 60 | 70 | ||
| 61 | Example: | 71 | Example: |
| 62 | 72 | ||
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 5288153f28b8..01de13809454 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
| @@ -1169,6 +1169,8 @@ static void __init l2c310_of_parse(const struct device_node *np, | |||
| 1169 | u32 tag[3] = { 0, 0, 0 }; | 1169 | u32 tag[3] = { 0, 0, 0 }; |
| 1170 | u32 filter[2] = { 0, 0 }; | 1170 | u32 filter[2] = { 0, 0 }; |
| 1171 | u32 assoc; | 1171 | u32 assoc; |
| 1172 | u32 prefetch; | ||
| 1173 | u32 val; | ||
| 1172 | int ret; | 1174 | int ret; |
| 1173 | 1175 | ||
| 1174 | of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag)); | 1176 | of_property_read_u32_array(np, "arm,tag-latency", tag, ARRAY_SIZE(tag)); |
| @@ -1214,6 +1216,58 @@ static void __init l2c310_of_parse(const struct device_node *np, | |||
| 1214 | assoc); | 1216 | assoc); |
| 1215 | break; | 1217 | break; |
| 1216 | } | 1218 | } |
| 1219 | |||
| 1220 | prefetch = l2x0_saved_regs.prefetch_ctrl; | ||
| 1221 | |||
| 1222 | ret = of_property_read_u32(np, "arm,double-linefill", &val); | ||
| 1223 | if (ret == 0) { | ||
| 1224 | if (val) | ||
| 1225 | prefetch |= L310_PREFETCH_CTRL_DBL_LINEFILL; | ||
| 1226 | else | ||
| 1227 | prefetch &= ~L310_PREFETCH_CTRL_DBL_LINEFILL; | ||
| 1228 | } else if (ret != -EINVAL) { | ||
| 1229 | pr_err("L2C-310 OF arm,double-linefill property value is missing\n"); | ||
| 1230 | } | ||
| 1231 | |||
| 1232 | ret = of_property_read_u32(np, "arm,double-linefill-incr", &val); | ||
| 1233 | if (ret == 0) { | ||
| 1234 | if (val) | ||
| 1235 | prefetch |= L310_PREFETCH_CTRL_DBL_LINEFILL_INCR; | ||
| 1236 | else | ||
| 1237 | prefetch &= ~L310_PREFETCH_CTRL_DBL_LINEFILL_INCR; | ||
| 1238 | } else if (ret != -EINVAL) { | ||
| 1239 | pr_err("L2C-310 OF arm,double-linefill-incr property value is missing\n"); | ||
| 1240 | } | ||
| 1241 | |||
| 1242 | ret = of_property_read_u32(np, "arm,double-linefill-wrap", &val); | ||
| 1243 | if (ret == 0) { | ||
| 1244 | if (!val) | ||
| 1245 | prefetch |= L310_PREFETCH_CTRL_DBL_LINEFILL_WRAP; | ||
| 1246 | else | ||
| 1247 | prefetch &= ~L310_PREFETCH_CTRL_DBL_LINEFILL_WRAP; | ||
| 1248 | } else if (ret != -EINVAL) { | ||
| 1249 | pr_err("L2C-310 OF arm,double-linefill-wrap property value is missing\n"); | ||
| 1250 | } | ||
| 1251 | |||
| 1252 | ret = of_property_read_u32(np, "arm,prefetch-drop", &val); | ||
| 1253 | if (ret == 0) { | ||
| 1254 | if (val) | ||
| 1255 | prefetch |= L310_PREFETCH_CTRL_PREFETCH_DROP; | ||
| 1256 | else | ||
| 1257 | prefetch &= ~L310_PREFETCH_CTRL_PREFETCH_DROP; | ||
| 1258 | } else if (ret != -EINVAL) { | ||
| 1259 | pr_err("L2C-310 OF arm,prefetch-drop property value is missing\n"); | ||
| 1260 | } | ||
| 1261 | |||
| 1262 | ret = of_property_read_u32(np, "arm,prefetch-offset", &val); | ||
| 1263 | if (ret == 0) { | ||
| 1264 | prefetch &= ~L310_PREFETCH_CTRL_OFFSET_MASK; | ||
| 1265 | prefetch |= val & L310_PREFETCH_CTRL_OFFSET_MASK; | ||
| 1266 | } else if (ret != -EINVAL) { | ||
| 1267 | pr_err("L2C-310 OF arm,prefetch-offset property value is missing\n"); | ||
| 1268 | } | ||
| 1269 | |||
| 1270 | l2x0_saved_regs.prefetch_ctrl = prefetch; | ||
| 1217 | } | 1271 | } |
| 1218 | 1272 | ||
| 1219 | static const struct l2c_init_data of_l2c310_data __initconst = { | 1273 | static const struct l2c_init_data of_l2c310_data __initconst = { |
