]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: bcm: config option for l2 cache support
authorAlex Elder <elder@linaro.org>
Mon, 21 Apr 2014 21:53:07 +0000 (16:53 -0500)
committerMatt Porter <mporter@linaro.org>
Fri, 25 Apr 2014 12:51:35 +0000 (08:51 -0400)
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>
arch/arm/mach-bcm/Kconfig
arch/arm/mach-bcm/Makefile
arch/arm/mach-bcm/kona.c
arch/arm/mach-bcm/kona.h

index 5f5740fc334f647a67acc66820fc40472cb636d3..28f90a01e3acbe585e8550ccc61773027a8dd643 100644 (file)
@@ -18,7 +18,6 @@ config ARCH_BCM_MOBILE
        select ARM_GIC
        select GPIO_BCM_KONA
        select TICK_ONESHOT
-       select CACHE_L2X0
        select HAVE_ARM_ARCH_TIMER
        select PINCTRL
        help
@@ -43,6 +42,17 @@ config ARCH_BCM_21664
          Enable support for the the BCM21664 family, which includes
          BCM21663 and BCM21664 variants.
 
+config ARCH_BCM_MOBILE_L2_CACHE
+       bool "Broadcom mobile SoC level 2 cache support"
+       depends on (ARCH_BCM_281XX || ARCH_BCM_21664)
+       default y
+       select CACHE_L2X0
+       select ARCH_BCM_MOBILE_SMC
+
+config ARCH_BCM_MOBILE_SMC
+       bool
+       depends on ARCH_BCM_281XX || ARCH_BCM_21664
+
 endmenu
 
 endif
index 7fb9b04022040b142c39edc90bed80f316d9a087..51549814f7cd66d6650d2c425a0ef1f5e7f135bc 100644 (file)
@@ -17,7 +17,10 @@ obj-$(CONFIG_ARCH_BCM_281XX) += board_bcm281xx.o
 obj-$(CONFIG_ARCH_BCM_21664)   += board_bcm21664.o
 
 # BCM281XX and BCM21664 L2 cache control
-obj-$(CONFIG_ARCH_BCM_MOBILE)  += bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
+obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona.o
+
+# Support for secure monitor traps
+obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o bcm_kona_smc_asm.o
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_bcm_kona_smc_asm.o      :=-Wa,-march=armv7-a$(plus_sec)
 
index ecdd71340a4686b1195743ac986b6e7e97a5b707..60b5dd5c866c9a6f94267aff3818c6eed3ea02bb 100644 (file)
@@ -22,9 +22,6 @@ void __init kona_l2_cache_init(void)
        unsigned int result;
        int ret;
 
-       if (!IS_ENABLED(CONFIG_CACHE_L2X0))
-               return;
-
        ret = bcm_kona_smc_init();
        if (ret) {
                pr_info("Secure API not available (%d). Skipping L2 init.\n",
index 3a7a017c29cd0414c8afd11a97509c18f66dade9..110185f7aad3195acabbc7ce69006ecd30bdf0c4 100644 (file)
@@ -11,4 +11,9 @@
  * GNU General Public License for more details.
  */
 
+#ifdef CONFIG_ARCH_BCM_MOBILE_L2_CACHE
+
 void __init kona_l2_cache_init(void);
+#else
+#define kona_l2_cache_init() ((void)0)
+#endif