From patchwork Tue Apr 22 08:28:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 28769 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 227F320341 for ; Tue, 22 Apr 2014 08:29:00 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id jt11sf23071914pbb.11 for ; Tue, 22 Apr 2014 01:28:58 -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=7jWWRbD8bw2Bjs3khy2E5PHbzHhd+hhr8JavpW54CZ0=; b=fKuHTOn2fh8VOXaFI6uPTY/o1mfzAyQbQcyaqHq+JfEu+JqsRxMIH2lXXKI9uNRk4Y dlKtzDIMQLs12kDSBVBL3p/1zVgXHex1v+zr1CC7NyNCdVv6Hy9g3kOocIoyOPSjlM+W tNHo5wZ9loXuLEbQA0NIyqbJVBtXSFdShKYZyBYnA0SQN21KdCcB6g4Xm6OkRO3hqbgF p+DmFx66ISo78vR5r2i5cUBb+ufK9MOoBKuHFFNx8Vh/FX4LSGJBIIYn5pJhkIh+Z8S0 +nqY2gTF0V7kTBtwrys6dn648P1fLNZlsxSWvnuH+WAFyn/44lI4vaGAW60VLpgI27Q+ srUw== X-Gm-Message-State: ALoCoQndsOVhIzZh8y3Oy2/JquKt7zwNmaeCOWPosQvosQVBeTuEb6G17aUPuQfQIeW0UXIBuz24 X-Received: by 10.66.102.3 with SMTP id fk3mr21596011pab.17.1398155338628; Tue, 22 Apr 2014 01:28:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.72 with SMTP id s66ls2829660qgd.11.gmail; Tue, 22 Apr 2014 01:28:58 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr7604921vch.22.1398155338516; Tue, 22 Apr 2014 01:28:58 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id tv3si6741623vdc.36.2014.04.22.01.28.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 01:28:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if17so2142563vcb.8 for ; Tue, 22 Apr 2014 01:28:58 -0700 (PDT) X-Received: by 10.58.202.133 with SMTP id ki5mr33909873vec.19.1398155338383; Tue, 22 Apr 2014 01:28:58 -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 ib8csp6220vcb; Tue, 22 Apr 2014 01:28:57 -0700 (PDT) X-Received: by 10.67.15.42 with SMTP id fl10mr43210973pad.30.1398155336345; Tue, 22 Apr 2014 01:28:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zt8si22316925pbc.445.2014.04.22.01.28.55; Tue, 22 Apr 2014 01:28:55 -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 S1754480AbaDVI2w (ORCPT + 5 others); Tue, 22 Apr 2014 04:28:52 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:40324 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754434AbaDVI2k (ORCPT ); Tue, 22 Apr 2014 04:28:40 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3M8SBuD003388; Tue, 22 Apr 2014 03:28:11 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3M8SBYJ021450; Tue, 22 Apr 2014 03:28:11 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Tue, 22 Apr 2014 03:28:11 -0500 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3M8S6gd016954; Tue, 22 Apr 2014 03:28:09 -0500 From: Sekhar Nori To: Tony Lindgren , Russell King CC: Santosh Shilimkar , Linux OMAP Mailing List , Linux ARM Mailing List , Sekhar Nori Subject: [PATCH v3 1/3] ARM: OMAP2+: L2 cache: get rid of init call Date: Tue, 22 Apr 2014 13:58:01 +0530 Message-ID: <9e9e4a3cae0b383f35a04aa1c060d4f678471f4d.1398149526.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.177 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..ff02973 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 omap_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..b28299b 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(); + omap_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 df3f531..1230975 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -196,17 +196,10 @@ static void omap4_l2c310_write_sec(unsigned long val, unsigned reg) omap_smc1(smc_op, val); } -static int __init omap_l2_cache_init(void) +int __init omap_l2_cache_init(void) { u32 aux_ctrl; - /* - * 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)) @@ -226,7 +219,6 @@ static int __init omap_l2_cache_init(void) return 0; } -omap_early_initcall(omap_l2_cache_init); #endif void __iomem *omap4_get_sar_ram_base(void)