From patchwork Fri Apr 4 10:10:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 27800 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4AE8D20369 for ; Fri, 4 Apr 2014 10:11:13 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf3646338qgd.9 for ; Fri, 04 Apr 2014 03:11:13 -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=bVNYF54Keq73u91R2pfcyte7ZPQmjmhHsPPt7nw/ghA=; b=nN0t6b1TnU/04rDNtmJIDtqdRGtis3/o0cbHltBNs/ox3Bb1VxvZCL/VvgwH04s6US /LIkC8qszmtYcDSZZTBRztlZCJM1I6elQ1T6V/q1pa9wXuupVKkcZS0GoiBaU0G44Jd+ og7lf58edXMJBVl+jhplZP/I6lBWgbcIF9B5lI8664hvOM2mew7jwa3+PKhtKC0q+LNN 9b1BAfivlypmACSbfod7VNbwyrVpaR4E7DvZkrRyb0OiQl7pzg8fJ/fd1vv8NYh7Lfvk /7Q1yLXVOpGcvUmYjPL2WGeZMElKDJuMcSE/FwYy/xTx0dePbxGwgegZD4MnaGXt2jNr C+Qw== X-Gm-Message-State: ALoCoQnLyo/aelZcaG1a6GUrWJJFt36qVMB8eh/lytBSQAbRDHNuIMcaAKlSqCvOb5PvnB5RzAxl X-Received: by 10.58.11.137 with SMTP id q9mr3156635veb.13.1396606273068; Fri, 04 Apr 2014 03:11:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.76 with SMTP id b70ls980650qgd.97.gmail; Fri, 04 Apr 2014 03:11:13 -0700 (PDT) X-Received: by 10.58.107.65 with SMTP id ha1mr4454596veb.1.1396606272993; Fri, 04 Apr 2014 03:11:12 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id dq1si1721370vcb.41.2014.04.04.03.11.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 03:11:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so3004331vcb.35 for ; Fri, 04 Apr 2014 03:11:12 -0700 (PDT) X-Received: by 10.59.9.38 with SMTP id dp6mr395102ved.24.1396606272902; Fri, 04 Apr 2014 03:11:12 -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 v8csp101219vcv; Fri, 4 Apr 2014 03:11:12 -0700 (PDT) X-Received: by 10.68.135.99 with SMTP id pr3mr11132567pbb.99.1396606271748; Fri, 04 Apr 2014 03:11:11 -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.10; Fri, 04 Apr 2014 03:11:10 -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 S1752574AbaDDKLK (ORCPT + 5 others); Fri, 4 Apr 2014 06:11:10 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:49543 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752336AbaDDKLE (ORCPT ); Fri, 4 Apr 2014 06:11:04 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s34AAdTj000667; Fri, 4 Apr 2014 05:10:39 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s34AAdYU022927; Fri, 4 Apr 2014 05:10:39 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 4 Apr 2014 05:10:39 -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 s34AAWpW031341; Fri, 4 Apr 2014 05:10:37 -0500 From: Sekhar Nori To: Tony Lindgren CC: Russell King , Linux OMAP Mailing List , Linux ARM Mailing List , Sekhar Nori Subject: [PATCH v2 2/3] ARM: OMAP2+: L2 cache: get rid of init call Date: Fri, 4 Apr 2014 15:40:28 +0530 Message-ID: <65332aad267b6dd81330215b0f4e2a7be12431d5.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.220.176 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: , Get rid of init call to initialize L2 cache. Instead use the init_early machine hook. This helps in using the initialization routine across SoCs without the need of ugly cpu_is_*() checks. Signed-off-by: Sekhar Nori --- arch/arm/mach-omap2/common.h | 1 + arch/arm/mach-omap2/io.c | 1 + arch/arm/mach-omap2/omap4-common.c | 10 +--------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index d88aff7..c64d5f5 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -91,6 +91,7 @@ extern void omap3_sync32k_timer_init(void); extern void omap3_secure_sync32k_timer_init(void); extern void omap3_gptimer_timer_init(void); extern void omap4_local_timer_init(void); +int omap4_l2_cache_init(void); extern void omap5_realtime_timer_init(void); void omap2420_init_early(void); diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index f14f9ac..81bc89c 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -640,6 +640,7 @@ void __init omap4430_init_early(void) omap44xx_clockdomains_init(); omap44xx_hwmod_init(); omap_hwmod_init_postsetup(); + omap4_l2_cache_init(); omap_clk_soc_init = omap4xxx_dt_clk_init; } diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 0a2e4f0..f8b8dac 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -198,13 +198,6 @@ static void omap4_l2c310_write_sec(unsigned long val, unsigned reg) static int __init omap_l2_cache_init(u32 aux_ctrl, u32 aux_flags) { - /* - * To avoid code running on other OMAPs in - * multi-omap builds - */ - if (!cpu_is_omap44xx()) - return -ENODEV; - /* Static mapping, never released */ l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); if (WARN_ON(!l2cache_base)) @@ -219,7 +212,7 @@ static int __init omap_l2_cache_init(u32 aux_ctrl, u32 aux_flags) return 0; } -static int __init omap4_l2_cache_init(void) +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 | @@ -231,7 +224,6 @@ static int __init omap4_l2_cache_init(void) return omap_l2_cache_init(aux_ctrl, 0xc19fffff); } -omap_early_initcall(omap4_l2_cache_init); #endif void __iomem *omap4_get_sar_ram_base(void)