aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--Documentation/devicetree/bindings/arm/l2cc.txt23
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h1
-rw-r--r--arch/arm/mm/cache-l2x0.c48
-rw-r--r--arch/arm/mm/cache-tauros3.h41
4 files changed, 94 insertions, 19 deletions
diff --git a/Documentation/devicetree/bindings/arm/l2cc.txt b/Documentation/devicetree/bindings/arm/l2cc.txt
index c0c7626fd0ff..b513cb8196fe 100644
--- a/Documentation/devicetree/bindings/arm/l2cc.txt
+++ b/Documentation/devicetree/bindings/arm/l2cc.txt
@@ -7,20 +7,21 @@ The ARM L2 cache representation in the device tree should be done as follows:
7Required properties: 7Required properties:
8 8
9- compatible : should be one of: 9- compatible : should be one of:
10 "arm,pl310-cache" 10 "arm,pl310-cache"
11 "arm,l220-cache" 11 "arm,l220-cache"
12 "arm,l210-cache" 12 "arm,l210-cache"
13 "marvell,aurora-system-cache": Marvell Controller designed to be 13 "bcm,bcm11351-a2-pl310-cache": DEPRECATED by "brcm,bcm11351-a2-pl310-cache"
14 "brcm,bcm11351-a2-pl310-cache": For Broadcom bcm11351 chipset where an
15 offset needs to be added to the address before passing down to the L2
16 cache controller
17 "marvell,aurora-system-cache": Marvell Controller designed to be
14 compatible with the ARM one, with system cache mode (meaning 18 compatible with the ARM one, with system cache mode (meaning
15 maintenance operations on L1 are broadcasted to the L2 and L2 19 maintenance operations on L1 are broadcasted to the L2 and L2
16 performs the same operation). 20 performs the same operation).
17 "marvell,"aurora-outer-cache: Marvell Controller designed to be 21 "marvell,aurora-outer-cache": Marvell Controller designed to be
18 compatible with the ARM one with outer cache mode. 22 compatible with the ARM one with outer cache mode.
19 "brcm,bcm11351-a2-pl310-cache": For Broadcom bcm11351 chipset where an 23 "marvell,tauros3-cache": Marvell Tauros3 cache controller, compatible
20 offset needs to be added to the address before passing down to the L2 24 with arm,pl310-cache controller.
21 cache controller
22 "bcm,bcm11351-a2-pl310-cache": DEPRECATED by
23 "brcm,bcm11351-a2-pl310-cache"
24- cache-unified : Specifies the cache is a unified cache. 25- cache-unified : Specifies the cache is a unified cache.
25- cache-level : Should be set to 2 for a level 2 cache. 26- cache-level : Should be set to 2 for a level 2 cache.
26- reg : Physical base address and size of cache controller's memory mapped 27- reg : Physical base address and size of cache controller's memory mapped
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 3b2c40b5bfa2..6795ff743b3d 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -131,6 +131,7 @@ struct l2x0_regs {
131 unsigned long prefetch_ctrl; 131 unsigned long prefetch_ctrl;
132 unsigned long pwr_ctrl; 132 unsigned long pwr_ctrl;
133 unsigned long ctrl; 133 unsigned long ctrl;
134 unsigned long aux2_ctrl;
134}; 135};
135 136
136extern struct l2x0_regs l2x0_saved_regs; 137extern struct l2x0_regs l2x0_saved_regs;
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
diff --git a/arch/arm/mm/cache-tauros3.h b/arch/arm/mm/cache-tauros3.h
new file mode 100644
index 000000000000..02c0a97cbc02
--- /dev/null
+++ b/arch/arm/mm/cache-tauros3.h
@@ -0,0 +1,41 @@
1/*
2 * Marvell Tauros3 cache controller includes
3 *
4 * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
5 *
6 * based on GPL'ed 2.6 kernel sources
7 * (c) Marvell International Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __ASM_ARM_HARDWARE_TAUROS3_H
24#define __ASM_ARM_HARDWARE_TAUROS3_H
25
26/*
27 * Marvell Tauros3 L2CC is compatible with PL310 r0p0
28 * but with PREFETCH_CTRL (r2p0) and an additional event counter.
29 * Also, there is AUX2_CTRL for some Marvell specific control.
30 */
31
32#define TAUROS3_EVENT_CNT2_CFG 0x224
33#define TAUROS3_EVENT_CNT2_VAL 0x228
34#define TAUROS3_INV_ALL 0x780
35#define TAUROS3_CLEAN_ALL 0x784
36#define TAUROS3_AUX2_CTRL 0x820
37
38/* Registers shifts and masks */
39#define TAUROS3_AUX2_CTRL_LINEFILL_BURST8_EN (1 << 2)
40
41#endif