From patchwork Fri Apr 18 02:30:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 28609 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 194732013D for ; Fri, 18 Apr 2014 02:32:41 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id bj1sf4438977pad.11 for ; Thu, 17 Apr 2014 19:32:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=bN2NEAtqHEQiczAMfDHDlU5G78HfTI2m8bv5w75Q5RY=; b=m41xydF5zx1FINoALkEAWZwgCkaUByXe/37sYePknD7oZv8YXmEZBjmwj9QONE5fOS eLOrrQe6mlboB6TX/gaQfUv4Y1PrIFpKVbhfVXs12DFd4fWCU0Ufmcu0ELr4rDfhjWt3 vZ3h6hqqlp9VoucoYSHfAyMLXEB7rvJEe4gosI6rf+Sb8uOLpkazGhowxNrSwRit1Beh Gaxev8wLIbZSk7WMhBRXEzy129AIt4KP10AN5bLVe8ZTejui8zJlPiLJB3Avji495IA6 /Dt3ILGZfPAcWDfKjqfuN+TxpE8ZGhwL1fVn8VayPk2/6OJXBtXhDfKGiGbMOH2rrgji NJYA== X-Gm-Message-State: ALoCoQnxjnjtySuHkqoZpL+FkTRDhzjsPykBv4snhok3skkIup0PHd5lglnrs0Adf6J7pBT6N89X X-Received: by 10.66.66.163 with SMTP id g3mr8997017pat.3.1397788361217; Thu, 17 Apr 2014 19:32:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.200 with SMTP id x66ls1347518qgx.46.gmail; Thu, 17 Apr 2014 19:32:41 -0700 (PDT) X-Received: by 10.58.181.170 with SMTP id dx10mr785444vec.25.1397788361106; Thu, 17 Apr 2014 19:32:41 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id sj10si4757679vcb.123.2014.04.17.19.32.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 19:32:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so1786987veb.6 for ; Thu, 17 Apr 2014 19:32:41 -0700 (PDT) X-Received: by 10.58.201.5 with SMTP id jw5mr14315971vec.6.1397788361019; Thu, 17 Apr 2014 19:32:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp80092vcb; Thu, 17 Apr 2014 19:32:40 -0700 (PDT) X-Received: by 10.66.121.164 with SMTP id ll4mr19174602pab.129.1397788359989; Thu, 17 Apr 2014 19:32:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id py5si9486521pbc.400.2014.04.17.19.32.37; Thu, 17 Apr 2014 19:32:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080AbaDRCbU (ORCPT + 26 others); Thu, 17 Apr 2014 22:31:20 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:48395 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbaDRCaY (ORCPT ); Thu, 17 Apr 2014 22:30:24 -0400 Received: by mail-ie0-f170.google.com with SMTP id rd18so1180663iec.29 for ; Thu, 17 Apr 2014 19:30:24 -0700 (PDT) X-Received: by 10.50.82.73 with SMTP id g9mr1276255igy.0.1397788223903; Thu, 17 Apr 2014 19:30:23 -0700 (PDT) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id m8sm673967igx.9.2014.04.17.19.30.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 19:30:23 -0700 (PDT) From: Alex Elder To: bcm@fixthebug.org, mporter@linaro.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/10] ARM: bcm: config option for l2 cache support Date: Thu, 17 Apr 2014 21:30:11 -0500 Message-Id: <1397788215-20279-7-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397788215-20279-1-git-send-email-elder@linaro.org> References: <1397788215-20279-1-git-send-email-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer Reviewed-by: Matt Porter --- arch/arm/mach-bcm/Kconfig | 12 +++++++++++- arch/arm/mach-bcm/Makefile | 5 ++++- arch/arm/mach-bcm/kona.c | 3 --- arch/arm/mach-bcm/kona.h | 5 +++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 5f5740f..28f90a0 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -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 diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile index 7fb9b04..5154981 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 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) diff --git a/arch/arm/mach-bcm/kona.c b/arch/arm/mach-bcm/kona.c index ecdd713..60b5dd5 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) 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", diff --git a/arch/arm/mach-bcm/kona.h b/arch/arm/mach-bcm/kona.h index 3a7a017..110185f 100644 --- a/arch/arm/mach-bcm/kona.h +++ b/arch/arm/mach-bcm/kona.h @@ -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