aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/cache-l2x0.c
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-12-13 10:42:19 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-12-29 07:32:47 -0500
commite68f31f4520ea5d1ddbcaddb320ef0b4201eef3c (patch)
treeab66c89f6347e23dea8ded7334ca2ef691c099fd /arch/arm/mm/cache-l2x0.c
parent017f161a55b48807a73fc9dff0b69f081bf43ee3 (diff)
ARM: 7922/1: l2x0: add Marvell Tauros3 support
This adds support for the Marvell Tauros3 cache controller which is compatible with pl310 cache controller but broadcasts L1 cache operations to L2 cache. While updating the binding documentation, clean up the list of possible compatibles. Also reorder driver compatibles to allow non-ARM derivated to be compatible to ARM cache controller compatibles. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Reviewed-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/cache-l2x0.c')
-rw-r--r--arch/arm/mm/cache-l2x0.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 447da6ffadd5..7abde2ce8973 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -25,6 +25,7 @@
25 25
26#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
27#include <asm/hardware/cache-l2x0.h> 27#include <asm/hardware/cache-l2x0.h>
28#include "cache-tauros3.h"
28#include "cache-aurora-l2.h" 29#include "cache-aurora-l2.h"
29 30
30#define CACHE_LINE_SIZE 32 31#define CACHE_LINE_SIZE 32
@@ -767,6 +768,14 @@ static void aurora_save(void)
767 l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); 768 l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
768} 769}
769 770
771static void __init tauros3_save(void)
772{
773 l2x0_saved_regs.aux2_ctrl =
774 readl_relaxed(l2x0_base + TAUROS3_AUX2_CTRL);
775 l2x0_saved_regs.prefetch_ctrl =
776 readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
777}
778
770static void l2x0_resume(void) 779static void l2x0_resume(void)
771{ 780{
772 if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { 781 if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
@@ -821,6 +830,18 @@ static void aurora_resume(void)
821 } 830 }
822} 831}
823 832
833static void tauros3_resume(void)
834{
835 if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
836 writel_relaxed(l2x0_saved_regs.aux2_ctrl,
837 l2x0_base + TAUROS3_AUX2_CTRL);
838 writel_relaxed(l2x0_saved_regs.prefetch_ctrl,
839 l2x0_base + L2X0_PREFETCH_CTRL);
840 }
841
842 l2x0_resume();
843}
844
824static void __init aurora_broadcast_l2_commands(void) 845static void __init aurora_broadcast_l2_commands(void)
825{ 846{
826 __u32 u; 847 __u32 u;
@@ -906,6 +927,15 @@ static const struct l2x0_of_data aurora_no_outer_data = {
906 }, 927 },
907}; 928};
908 929
930static const struct l2x0_of_data tauros3_data = {
931 .setup = NULL,
932 .save = tauros3_save,
933 /* Tauros3 broadcasts L1 cache operations to L2 */
934 .outer_cache = {
935 .resume = tauros3_resume,
936 },
937};
938
909static const struct l2x0_of_data bcm_l2x0_data = { 939static const struct l2x0_of_data bcm_l2x0_data = {
910 .setup = pl310_of_setup, 940 .setup = pl310_of_setup,
911 .save = pl310_save, 941 .save = pl310_save,
@@ -922,17 +952,19 @@ static const struct l2x0_of_data bcm_l2x0_data = {
922}; 952};
923 953
924static const struct of_device_id l2x0_ids[] __initconst = { 954static const struct of_device_id l2x0_ids[] __initconst = {
925 { .compatible = "arm,pl310-cache", .data = (void *)&pl310_data },
926 { .compatible = "arm,l220-cache", .data = (void *)&l2x0_data },
927 { .compatible = "arm,l210-cache", .data = (void *)&l2x0_data }, 955 { .compatible = "arm,l210-cache", .data = (void *)&l2x0_data },
928 { .compatible = "marvell,aurora-system-cache", 956 { .compatible = "arm,l220-cache", .data = (void *)&l2x0_data },
929 .data = (void *)&aurora_no_outer_data}, 957 { .compatible = "arm,pl310-cache", .data = (void *)&pl310_data },
930 { .compatible = "marvell,aurora-outer-cache",
931 .data = (void *)&aurora_with_outer_data},
932 { .compatible = "brcm,bcm11351-a2-pl310-cache",
933 .data = (void *)&bcm_l2x0_data},
934 { .compatible = "bcm,bcm11351-a2-pl310-cache", /* deprecated name */ 958 { .compatible = "bcm,bcm11351-a2-pl310-cache", /* deprecated name */
935 .data = (void *)&bcm_l2x0_data}, 959 .data = (void *)&bcm_l2x0_data},
960 { .compatible = "brcm,bcm11351-a2-pl310-cache",
961 .data = (void *)&bcm_l2x0_data},
962 { .compatible = "marvell,aurora-outer-cache",
963 .data = (void *)&aurora_with_outer_data},
964 { .compatible = "marvell,aurora-system-cache",
965 .data = (void *)&aurora_no_outer_data},
966 { .compatible = "marvell,tauros3-cache",
967 .data = (void *)&tauros3_data },
936 {} 968 {}
937}; 969};
938 970