From patchwork Mon Apr 21 21:53:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 28746 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA5D3203F3 for ; Mon, 21 Apr 2014 21:54:52 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf30936006iec.7 for ; Mon, 21 Apr 2014 14:54:52 -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=K6Zz9u55vPgn7y+9X59SUfrKC2gQKbPofgYtiddJ0nk=; b=SQ0gKZJikFOeCNYoWMd/gI1kV4x84RLT6aTLm0fGKUbkNS7/lSsPorNi9MbhmKMqGE hS/iCCe2ANUtJDrLv4QYOpca1cPXGovJ0DLe1A9YI2NDZHIq99IS8TS6I6WXaxeP/Zb1 MUfuuWkHzA0+iTWxU5/PTEwHGg46pUVSr2V3RRbx7nqIO3AfjkpbpU7hJj6nUQcu3ky2 wHKvwoqVDPYKBLAwYw3Wrjhv7NTroOd6GarwWHIRn5w14RPZez8rk3/B3eO3nVMhF4/z f7V2yRaUBqz/4gizsHiuXzf1yoBM/DxFYLjeV0RCuV+MmFqY4BmN1gZriWc+I75RruD9 o1aA== X-Gm-Message-State: ALoCoQnX5x2nYWee9nwANTpGlBMbHJ0+L8m3PInM5odpzdsdO/p0w8lvIVhEl/3KprP6vVimY2AR X-Received: by 10.182.19.164 with SMTP id g4mr20395658obe.21.1398117292213; Mon, 21 Apr 2014 14:54:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.164 with SMTP id r33ls2077158qgr.2.gmail; Mon, 21 Apr 2014 14:54:52 -0700 (PDT) X-Received: by 10.58.49.10 with SMTP id q10mr35718406ven.5.1398117292077; Mon, 21 Apr 2014 14:54:52 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id 7si6478669vcm.206.2014.04.21.14.54.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 14:54:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so8456487veb.41 for ; Mon, 21 Apr 2014 14:54:52 -0700 (PDT) X-Received: by 10.58.202.133 with SMTP id ki5mr31437773vec.19.1398117291988; Mon, 21 Apr 2014 14:54:51 -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 ib8csp321055vcb; Mon, 21 Apr 2014 14:54:51 -0700 (PDT) X-Received: by 10.68.248.7 with SMTP id yi7mr40935805pbc.31.1398117291156; Mon, 21 Apr 2014 14:54:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td10si21518495pac.263.2014.04.21.14.54.50; Mon, 21 Apr 2014 14:54:50 -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 S1755284AbaDUVxk (ORCPT + 26 others); Mon, 21 Apr 2014 17:53:40 -0400 Received: from mail-yk0-f180.google.com ([209.85.160.180]:57554 "EHLO mail-yk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755258AbaDUVxe (ORCPT ); Mon, 21 Apr 2014 17:53:34 -0400 Received: by mail-yk0-f180.google.com with SMTP id 19so3833965ykq.25 for ; Mon, 21 Apr 2014 14:53:33 -0700 (PDT) X-Received: by 10.236.135.104 with SMTP id t68mr55758504yhi.35.1398117213831; Mon, 21 Apr 2014 14:53:33 -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 t63sm74182258yhm.32.2014.04.21.14.53.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Apr 2014 14:53:33 -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 v2 06/10] ARM: bcm: config option for l2 cache support Date: Mon, 21 Apr 2014 16:53:07 -0500 Message-Id: <1398117191-2433-7-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1398117191-2433-1-git-send-email-elder@linaro.org> References: <1398117191-2433-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.182 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