diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-03-19 15:14:13 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-05-29 19:48:26 -0400 |
commit | 9081114837742cf7f152c9bccbeeb2a9273183f4 (patch) | |
tree | 58042e58ec8a4d03c7dc3ddc592cc1ef377f012b /arch/arm/mm | |
parent | 733c6bbafdfac62a307ed5ca925889343c5635ac (diff) |
ARM: l2c: convert Broadcom L2C-310 to new code
The Broadcom L2C-310 devices use ARMs L2C-310 R2P3 or later. These
require no errata workarounds, and so we can directly call the l2c210
functions from their methods.
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.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 751c3d7a22b3..57680e03da84 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -1360,16 +1360,16 @@ static void bcm_inv_range(unsigned long start, unsigned long end) | |||
1360 | 1360 | ||
1361 | /* normal case, no cross section between start and end */ | 1361 | /* normal case, no cross section between start and end */ |
1362 | if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) { | 1362 | if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) { |
1363 | l2x0_inv_range(new_start, new_end); | 1363 | l2c210_inv_range(new_start, new_end); |
1364 | return; | 1364 | return; |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | /* They cross sections, so it can only be a cross from section | 1367 | /* They cross sections, so it can only be a cross from section |
1368 | * 2 to section 3 | 1368 | * 2 to section 3 |
1369 | */ | 1369 | */ |
1370 | l2x0_inv_range(new_start, | 1370 | l2c210_inv_range(new_start, |
1371 | bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1)); | 1371 | bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1)); |
1372 | l2x0_inv_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR), | 1372 | l2c210_inv_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR), |
1373 | new_end); | 1373 | new_end); |
1374 | } | 1374 | } |
1375 | 1375 | ||
@@ -1382,26 +1382,21 @@ static void bcm_clean_range(unsigned long start, unsigned long end) | |||
1382 | if (unlikely(end <= start)) | 1382 | if (unlikely(end <= start)) |
1383 | return; | 1383 | return; |
1384 | 1384 | ||
1385 | if ((end - start) >= l2x0_size) { | ||
1386 | l2x0_clean_all(); | ||
1387 | return; | ||
1388 | } | ||
1389 | |||
1390 | new_start = bcm_l2_phys_addr(start); | 1385 | new_start = bcm_l2_phys_addr(start); |
1391 | new_end = bcm_l2_phys_addr(end); | 1386 | new_end = bcm_l2_phys_addr(end); |
1392 | 1387 | ||
1393 | /* normal case, no cross section between start and end */ | 1388 | /* normal case, no cross section between start and end */ |
1394 | if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) { | 1389 | if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) { |
1395 | l2x0_clean_range(new_start, new_end); | 1390 | l2c210_clean_range(new_start, new_end); |
1396 | return; | 1391 | return; |
1397 | } | 1392 | } |
1398 | 1393 | ||
1399 | /* They cross sections, so it can only be a cross from section | 1394 | /* They cross sections, so it can only be a cross from section |
1400 | * 2 to section 3 | 1395 | * 2 to section 3 |
1401 | */ | 1396 | */ |
1402 | l2x0_clean_range(new_start, | 1397 | l2c210_clean_range(new_start, |
1403 | bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1)); | 1398 | bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1)); |
1404 | l2x0_clean_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR), | 1399 | l2c210_clean_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR), |
1405 | new_end); | 1400 | new_end); |
1406 | } | 1401 | } |
1407 | 1402 | ||
@@ -1415,7 +1410,7 @@ static void bcm_flush_range(unsigned long start, unsigned long end) | |||
1415 | return; | 1410 | return; |
1416 | 1411 | ||
1417 | if ((end - start) >= l2x0_size) { | 1412 | if ((end - start) >= l2x0_size) { |
1418 | l2x0_flush_all(); | 1413 | outer_cache.flush_all(); |
1419 | return; | 1414 | return; |
1420 | } | 1415 | } |
1421 | 1416 | ||
@@ -1424,24 +1419,24 @@ static void bcm_flush_range(unsigned long start, unsigned long end) | |||
1424 | 1419 | ||
1425 | /* normal case, no cross section between start and end */ | 1420 | /* normal case, no cross section between start and end */ |
1426 | if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) { | 1421 | if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) { |
1427 | l2x0_flush_range(new_start, new_end); | 1422 | l2c210_flush_range(new_start, new_end); |
1428 | return; | 1423 | return; |
1429 | } | 1424 | } |
1430 | 1425 | ||
1431 | /* They cross sections, so it can only be a cross from section | 1426 | /* They cross sections, so it can only be a cross from section |
1432 | * 2 to section 3 | 1427 | * 2 to section 3 |
1433 | */ | 1428 | */ |
1434 | l2x0_flush_range(new_start, | 1429 | l2c210_flush_range(new_start, |
1435 | bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1)); | 1430 | bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1)); |
1436 | l2x0_flush_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR), | 1431 | l2c210_flush_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR), |
1437 | new_end); | 1432 | new_end); |
1438 | } | 1433 | } |
1439 | 1434 | ||
1435 | /* Broadcom L2C-310 start from ARMs R3P2 or later, and require no fixups */ | ||
1440 | static const struct l2c_init_data of_bcm_l2x0_data __initconst = { | 1436 | static const struct l2c_init_data of_bcm_l2x0_data __initconst = { |
1441 | .num_lock = 8, | 1437 | .num_lock = 8, |
1442 | .of_parse = l2c310_of_parse, | 1438 | .of_parse = l2c310_of_parse, |
1443 | .enable = l2c_enable, | 1439 | .enable = l2c_enable, |
1444 | .fixup = l2c310_fixup, | ||
1445 | .save = l2c310_save, | 1440 | .save = l2c310_save, |
1446 | .outer_cache = { | 1441 | .outer_cache = { |
1447 | .inv_range = bcm_inv_range, | 1442 | .inv_range = bcm_inv_range, |