aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-15 16:51:47 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-05-29 19:48:21 -0400
commitf777332ba7ae42c396b7aabc20bdbeeebb3a63c0 (patch)
treedf0d9d4270fee0843b57596d66b3ed1f7c18d0b1 /arch/arm/mm
parentebd4219f10fbe3938cd36443e240eb6076b811ab (diff)
ARM: l2c: use L2C-210 handlers for L2C-310 errata-less implementations
Where no errata affect the L2C-310 handlers, they are functionally equivalent to L2C-210. Re-use the L2C-210 handlers for the L2C-310 part. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/cache-l2x0.c58
1 files changed, 36 insertions, 22 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 79ff08db204d..49ddff972cb3 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -493,6 +493,18 @@ static const struct l2c_init_data l2c210_data __initconst = {
493/* 493/*
494 * L2C-310 specific code. 494 * L2C-310 specific code.
495 * 495 *
496 * Very similar to L2C-210, the PA, set/way and sync operations are atomic,
497 * and the way operations are all background tasks. However, issuing an
498 * operation while a background operation is in progress results in a
499 * SLVERR response. We can reuse:
500 *
501 * __l2c210_cache_sync (using sync_reg_offset)
502 * l2c210_sync
503 * l2c210_inv_range (if 588369 is not applicable)
504 * l2c210_clean_range
505 * l2c210_flush_range (if 588369 is not applicable)
506 * l2c210_flush_all (if 727915 is not applicable)
507 *
496 * Errata: 508 * Errata:
497 * 588369: PL310 R0P0->R1P0, fixed R2P0. 509 * 588369: PL310 R0P0->R1P0, fixed R2P0.
498 * Affects: all clean+invalidate operations 510 * Affects: all clean+invalidate operations
@@ -666,7 +678,7 @@ static void __init l2c310_fixup(void __iomem *base, u32 cache_id,
666 if (IS_ENABLED(CONFIG_PL310_ERRATA_588369) && 678 if (IS_ENABLED(CONFIG_PL310_ERRATA_588369) &&
667 revision < L310_CACHE_ID_RTL_R2P0 && 679 revision < L310_CACHE_ID_RTL_R2P0 &&
668 /* For bcm compatibility */ 680 /* For bcm compatibility */
669 fns->inv_range == l2x0_inv_range) { 681 fns->inv_range == l2c210_inv_range) {
670 fns->inv_range = l2c310_inv_range_erratum; 682 fns->inv_range = l2c310_inv_range_erratum;
671 fns->flush_range = l2c310_flush_range_erratum; 683 fns->flush_range = l2c310_flush_range_erratum;
672 errata[n++] = "588369"; 684 errata[n++] = "588369";
@@ -704,12 +716,13 @@ static const struct l2c_init_data l2c310_init_fns __initconst = {
704 .fixup = l2c310_fixup, 716 .fixup = l2c310_fixup,
705 .save = l2c310_save, 717 .save = l2c310_save,
706 .outer_cache = { 718 .outer_cache = {
707 .inv_range = l2x0_inv_range, 719 .inv_range = l2c210_inv_range,
708 .clean_range = l2x0_clean_range, 720 .clean_range = l2c210_clean_range,
709 .flush_range = l2x0_flush_range, 721 .flush_range = l2c210_flush_range,
710 .flush_all = l2x0_flush_all, 722 .flush_all = l2c210_flush_all,
711 .disable = l2x0_disable, 723 .disable = l2c_disable,
712 .sync = l2x0_cache_sync, 724 .sync = l2c210_sync,
725 .set_debug = l2c310_set_debug,
713 .resume = l2c310_resume, 726 .resume = l2c310_resume,
714 }, 727 },
715}; 728};
@@ -896,8 +909,8 @@ static const struct l2c_init_data of_l2x0_data __initconst = {
896 }, 909 },
897}; 910};
898 911
899static void __init pl310_of_parse(const struct device_node *np, 912static void __init l2c310_of_parse(const struct device_node *np,
900 u32 *aux_val, u32 *aux_mask) 913 u32 *aux_val, u32 *aux_mask)
901{ 914{
902 u32 data[3] = { 0, 0, 0 }; 915 u32 data[3] = { 0, 0, 0 };
903 u32 tag[3] = { 0, 0, 0 }; 916 u32 tag[3] = { 0, 0, 0 };
@@ -930,19 +943,20 @@ static void __init pl310_of_parse(const struct device_node *np,
930 } 943 }
931} 944}
932 945
933static const struct l2c_init_data of_pl310_data __initconst = { 946static const struct l2c_init_data of_l2c310_data __initconst = {
934 .num_lock = 8, 947 .num_lock = 8,
935 .of_parse = pl310_of_parse, 948 .of_parse = l2c310_of_parse,
936 .enable = l2c_enable, 949 .enable = l2c_enable,
937 .fixup = l2c310_fixup, 950 .fixup = l2c310_fixup,
938 .save = l2c310_save, 951 .save = l2c310_save,
939 .outer_cache = { 952 .outer_cache = {
940 .inv_range = l2x0_inv_range, 953 .inv_range = l2c210_inv_range,
941 .clean_range = l2x0_clean_range, 954 .clean_range = l2c210_clean_range,
942 .flush_range = l2x0_flush_range, 955 .flush_range = l2c210_flush_range,
943 .flush_all = l2x0_flush_all, 956 .flush_all = l2c210_flush_all,
944 .disable = l2x0_disable, 957 .disable = l2c_disable,
945 .sync = l2x0_cache_sync, 958 .sync = l2c210_sync,
959 .set_debug = l2c310_set_debug,
946 .resume = l2c310_resume, 960 .resume = l2c310_resume,
947 }, 961 },
948}; 962};
@@ -1278,7 +1292,7 @@ static void bcm_flush_range(unsigned long start, unsigned long end)
1278 1292
1279static const struct l2c_init_data of_bcm_l2x0_data __initconst = { 1293static const struct l2c_init_data of_bcm_l2x0_data __initconst = {
1280 .num_lock = 8, 1294 .num_lock = 8,
1281 .of_parse = pl310_of_parse, 1295 .of_parse = l2c310_of_parse,
1282 .enable = l2c_enable, 1296 .enable = l2c_enable,
1283 .fixup = l2c310_fixup, 1297 .fixup = l2c310_fixup,
1284 .save = l2c310_save, 1298 .save = l2c310_save,
@@ -1286,9 +1300,9 @@ static const struct l2c_init_data of_bcm_l2x0_data __initconst = {
1286 .inv_range = bcm_inv_range, 1300 .inv_range = bcm_inv_range,
1287 .clean_range = bcm_clean_range, 1301 .clean_range = bcm_clean_range,
1288 .flush_range = bcm_flush_range, 1302 .flush_range = bcm_flush_range,
1289 .flush_all = l2x0_flush_all, 1303 .flush_all = l2c210_flush_all,
1290 .disable = l2x0_disable, 1304 .disable = l2c_disable,
1291 .sync = l2x0_cache_sync, 1305 .sync = l2c210_sync,
1292 .resume = l2c310_resume, 1306 .resume = l2c310_resume,
1293 }, 1307 },
1294}; 1308};
@@ -1329,7 +1343,7 @@ static const struct l2c_init_data of_tauros3_data __initconst = {
1329static const struct of_device_id l2x0_ids[] __initconst = { 1343static const struct of_device_id l2x0_ids[] __initconst = {
1330 L2C_ID("arm,l210-cache", of_l2c210_data), 1344 L2C_ID("arm,l210-cache", of_l2c210_data),
1331 L2C_ID("arm,l220-cache", of_l2x0_data), 1345 L2C_ID("arm,l220-cache", of_l2x0_data),
1332 L2C_ID("arm,pl310-cache", of_pl310_data), 1346 L2C_ID("arm,pl310-cache", of_l2c310_data),
1333 L2C_ID("brcm,bcm11351-a2-pl310-cache", of_bcm_l2x0_data), 1347 L2C_ID("brcm,bcm11351-a2-pl310-cache", of_bcm_l2x0_data),
1334 L2C_ID("marvell,aurora-outer-cache", of_aurora_with_outer_data), 1348 L2C_ID("marvell,aurora-outer-cache", of_aurora_with_outer_data),
1335 L2C_ID("marvell,aurora-system-cache", of_aurora_no_outer_data), 1349 L2C_ID("marvell,aurora-system-cache", of_aurora_no_outer_data),