From patchwork Fri Apr 4 10:10:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 27802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C38B20369 for ; Fri, 4 Apr 2014 10:11:21 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf9275841yho.6 for ; Fri, 04 Apr 2014 03:11:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=3jXjcIqRbuQbzroBDmoDWVALZmVfkhiAsJmgpWKlYj0=; b=cV30Bf3PAaxAzQVArqhz002km3fm6N6AD2GqnsiGalhNOHXAOxWmQS5JoZN6KJzSq4 aN3ywWMH01lkstt+0wjCX0EkdET03bzqYmcnYgeZqrbdsxlNXyuF35FNVrT2tq2zFiK8 8BCpm8xaaF73KrqCJp03nqJFpUfBupGXa3gMlSL+rzU4U6kbZVvO7Na4Blh557SrcFBD GNkqKLcSTznBMKIoyOGQ3figy1gotq2P3nIUaVk7ChzW7oQBAmD63gw2pAifmM04Cfrj 3es0aaibP46DFS1l+pKXzoXH3eYclzmaLOs6XNqQ+XNi2YZ+hLqSZBb1eiACaLrXRXDy bmAQ== X-Gm-Message-State: ALoCoQlXV1R6tlaFUC+xjatYrNAAcZszgzCUAYu2GgB5yJcOiGXB5N51jM+GxxSgfPoXp+YYcwDq X-Received: by 10.236.197.39 with SMTP id s27mr6600342yhn.36.1396606281213; Fri, 04 Apr 2014 03:11:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.76 with SMTP id b70ls980693qgd.97.gmail; Fri, 04 Apr 2014 03:11:21 -0700 (PDT) X-Received: by 10.58.1.97 with SMTP id 1mr766529vel.23.1396606281072; Fri, 04 Apr 2014 03:11:21 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id gs7si1704320vdc.164.2014.04.04.03.11.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 03:11:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so1295079veb.1 for ; Fri, 04 Apr 2014 03:11:21 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr7704094vcv.14.1396606280982; Fri, 04 Apr 2014 03:11:20 -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.12.8 with SMTP id v8csp101225vcv; Fri, 4 Apr 2014 03:11:19 -0700 (PDT) X-Received: by 10.66.129.133 with SMTP id nw5mr13944928pab.98.1396606279100; Fri, 04 Apr 2014 03:11:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yl4si4407034pbc.126.2014.04.04.03.11.18; Fri, 04 Apr 2014 03:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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 S1752597AbaDDKLR (ORCPT + 5 others); Fri, 4 Apr 2014 06:11:17 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:36561 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbaDDKLP (ORCPT ); Fri, 4 Apr 2014 06:11:15 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s34AAbNZ008420; Fri, 4 Apr 2014 05:10:37 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s34AAb0c022918; Fri, 4 Apr 2014 05:10:37 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 4 Apr 2014 05:10:37 -0500 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s34AAWpV031341; Fri, 4 Apr 2014 05:10:35 -0500 From: Sekhar Nori To: Tony Lindgren CC: Russell King , Linux OMAP Mailing List , Linux ARM Mailing List , Sekhar Nori Subject: [PATCH v2 1/3] ARM: OMAP2+: L2 cache: allow different aux ctrl settings Date: Fri, 4 Apr 2014 15:40:27 +0530 Message-ID: <26e5bedd5fa33981e2ef3a8e3e498405bf854765.1396605300.git.nsekhar@ti.com> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nsekhar@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 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: , Different SoCs likely need different L2 cache aux ctrl settings based on use cases and optimizations required. For example, if CMA is always used for coherent memory allocations, there is no need for sharable attribute override bit to be set. Pass aux control settings as argument to the L2 cache initialization function to allow for this. Signed-off-by: Sekhar Nori --- arch/arm/mach-omap2/omap4-common.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 06c6a18..0a2e4f0 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -196,10 +196,8 @@ static void omap4_l2c310_write_sec(unsigned long val, unsigned reg) omap_smc1(smc_op, val); } -static int __init omap_l2_cache_init(void) +static int __init omap_l2_cache_init(u32 aux_ctrl, u32 aux_flags) { - u32 aux_ctrl; - /* * To avoid code running on other OMAPs in * multi-omap builds @@ -212,23 +210,28 @@ static int __init omap_l2_cache_init(void) if (WARN_ON(!l2cache_base)) return -ENOMEM; - /* 16-way associativity, parity disabled, way size - 64KB (es2.0 +) */ - aux_ctrl = L310_AUX_CTRL_CACHE_REPLACE_RR | - L310_AUX_CTRL_NS_LOCKDOWN | - L310_AUX_CTRL_NS_INT_CTRL | - L2C_AUX_CTRL_SHARED_OVERRIDE | - L310_AUX_CTRL_DATA_PREFETCH | - L310_AUX_CTRL_INSTR_PREFETCH; - outer_cache.write_sec = omap4_l2c310_write_sec; if (of_have_populated_dt()) - l2x0_of_init(aux_ctrl, 0xc19fffff); + l2x0_of_init(aux_ctrl, aux_flags); else - l2x0_init(l2cache_base, aux_ctrl, 0xc19fffff); + l2x0_init(l2cache_base, aux_ctrl, aux_flags); return 0; } -omap_early_initcall(omap_l2_cache_init); + +static int __init omap4_l2_cache_init(void) +{ + /* 16-way associativity, parity disabled, way size - 64KB (es2.0 +) */ + u32 aux_ctrl = L310_AUX_CTRL_CACHE_REPLACE_RR | + L310_AUX_CTRL_NS_LOCKDOWN | + L310_AUX_CTRL_NS_INT_CTRL | + L2C_AUX_CTRL_SHARED_OVERRIDE | + L310_AUX_CTRL_DATA_PREFETCH | + L310_AUX_CTRL_INSTR_PREFETCH; + + return omap_l2_cache_init(aux_ctrl, 0xc19fffff); +} +omap_early_initcall(omap4_l2_cache_init); #endif void __iomem *omap4_get_sar_ram_base(void)