aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-04-21 17:53:07 -0400
committerMatt Porter <mporter@linaro.org>2014-04-25 08:51:35 -0400
commit7b5fe9c9115c92b7e6297216c789268961a19f98 (patch)
treea4e2ad11e094d067e9cc80f67440a29023a20608
parent35138d52f18c3f757f12d54c0962a755bcf218f3 (diff)
ARM: bcm: config option for l2 cache support
Add a new config option ARCH_BCM_MOBILE_L2_CACHE that allows support for level-2 cache to be enabled or disabled at build time for BCM218XX and BCM21664 family SoCs. Build support for SMC only if it's required (currently it's only required for to support level 2 cache control). If arch/arm/mach-bcm/kona.c gets compiled, ARCH_BCM_MOBILE_L2_CACHE must have been selected, which implies CONFIG_CACHE_L2X0 is set. There is therefore no need to check CONFIG_CACHE_L2X0 at the top of kona_l2_cache_init(), so get rid of that check. Signed-off-by: Alex Elder <elder@linaro.org> Reviewed-by: Tim Kryger <tim.kryger@linaro.org> Reviewed-by: Markus Mayer <markus.mayer@linaro.org> Reviewed-by: Matt Porter <mporter@linaro.org> Signed-off-by: Matt Porter <mporter@linaro.org>
-rw-r--r--arch/arm/mach-bcm/Kconfig12
-rw-r--r--arch/arm/mach-bcm/Makefile5
-rw-r--r--arch/arm/mach-bcm/kona.c3
-rw-r--r--arch/arm/mach-bcm/kona.h5
4 files changed, 20 insertions, 5 deletions
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 5f5740fc334f..28f90a01e3ac 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -18,7 +18,6 @@ config ARCH_BCM_MOBILE
18 select ARM_GIC 18 select ARM_GIC
19 select GPIO_BCM_KONA 19 select GPIO_BCM_KONA
20 select TICK_ONESHOT 20 select TICK_ONESHOT
21 select CACHE_L2X0
22 select HAVE_ARM_ARCH_TIMER 21 select HAVE_ARM_ARCH_TIMER
23 select PINCTRL 22 select PINCTRL
24 help 23 help
@@ -43,6 +42,17 @@ config ARCH_BCM_21664
43 Enable support for the the BCM21664 family, which includes 42 Enable support for the the BCM21664 family, which includes
44 BCM21663 and BCM21664 variants. 43 BCM21663 and BCM21664 variants.
45 44
45config ARCH_BCM_MOBILE_L2_CACHE
46 bool "Broadcom mobile SoC level 2 cache support"
47 depends on (ARCH_BCM_281XX || ARCH_BCM_21664)
48 default y
49 select CACHE_L2X0
50 select ARCH_BCM_MOBILE_SMC
51
52config ARCH_BCM_MOBILE_SMC
53 bool
54 depends on ARCH_BCM_281XX || ARCH_BCM_21664
55
46endmenu 56endmenu
47 57
48endif 58endif
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index 7fb9b0402204..51549814f7cd 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -17,7 +17,10 @@ obj-$(CONFIG_ARCH_BCM_281XX) += board_bcm281xx.o
17obj-$(CONFIG_ARCH_BCM_21664) += board_bcm21664.o 17obj-$(CONFIG_ARCH_BCM_21664) += board_bcm21664.o
18 18
19# BCM281XX and BCM21664 L2 cache control 19# BCM281XX and BCM21664 L2 cache control
20obj-$(CONFIG_ARCH_BCM_MOBILE) += bcm_kona_smc.o bcm_kona_smc_asm.o kona.o 20obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona.o
21
22# Support for secure monitor traps
23obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o bcm_kona_smc_asm.o
21plus_sec := $(call as-instr,.arch_extension sec,+sec) 24plus_sec := $(call as-instr,.arch_extension sec,+sec)
22AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) 25AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec)
23 26
diff --git a/arch/arm/mach-bcm/kona.c b/arch/arm/mach-bcm/kona.c
index ecdd71340a46..60b5dd5c866c 100644
--- a/arch/arm/mach-bcm/kona.c
+++ b/arch/arm/mach-bcm/kona.c
@@ -22,9 +22,6 @@ void __init kona_l2_cache_init(void)
22 unsigned int result; 22 unsigned int result;
23 int ret; 23 int ret;
24 24
25 if (!IS_ENABLED(CONFIG_CACHE_L2X0))
26 return;
27
28 ret = bcm_kona_smc_init(); 25 ret = bcm_kona_smc_init();
29 if (ret) { 26 if (ret) {
30 pr_info("Secure API not available (%d). Skipping L2 init.\n", 27 pr_info("Secure API not available (%d). Skipping L2 init.\n",
diff --git a/arch/arm/mach-bcm/kona.h b/arch/arm/mach-bcm/kona.h
index 3a7a017c29cd..110185f7aad3 100644
--- a/arch/arm/mach-bcm/kona.h
+++ b/arch/arm/mach-bcm/kona.h
@@ -11,4 +11,9 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 */ 12 */
13 13
14#ifdef CONFIG_ARCH_BCM_MOBILE_L2_CACHE
15
14void __init kona_l2_cache_init(void); 16void __init kona_l2_cache_init(void);
17#else
18#define kona_l2_cache_init() ((void)0)
19#endif